Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision be6f6cfd

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID be6f6cfd8dc7def5356edd0c5aacb814b4baded1
  • Vorgänger 2b339152
  • Nachfolger d29b0238

Globale Variablen für Systemeinstellungen und Features nach %::lx_office_conf verschoben

Betroffen sind:
$webdav
$vertreter
$lizenzen
$show_best_before
$parts_show_image
$parts_image_css
$parts_listing_images
$eur
$dbcharset
$language

Unterschiede anzeigen:

SL/Auth.pm
257 257

  
258 258
  $main::lxdebug->message(LXDebug->DEBUG1(), "Auth::create_database DSN: $dsn");
259 259

  
260
  my $charset    = $main::dbcharset;
260
  my $charset    = $::lx_office_conf{system}->{dbcharset};
261 261
  $charset     ||= Common::DEFAULT_CHARSET;
262 262
  my $encoding   = $Common::charset_to_db_encoding{$charset};
263 263
  $encoding    ||= 'UNICODE';
......
300 300
  my $self = shift;
301 301
  my $dbh  = $self->dbconnect();
302 302

  
303
  my $charset    = $main::dbcharset;
303
  my $charset    = $::lx_office_conf{system}->{dbcharset};
304 304
  $charset     ||= Common::DEFAULT_CHARSET;
305 305

  
306 306
  $dbh->rollback();
SL/Common.pm
336 336
  my ($form) = @_;
337 337

  
338 338
  return $main::lxdebug->leave_sub()
339
    unless ($main::webdav && $form->{id});
339
    unless ($::lx_office_conf{system}->{webdav} && $form->{id});
340 340

  
341 341
  my ($path, $number);
342 342

  
SL/Controller/Base.pm
55 55
      my $content_type  = $options->{type} eq 'js' ? 'text/javascript' : 'text/html';
56 56

  
57 57
      print $::form->create_http_response(content_type => $content_type,
58
                                          charset      => $::dbcharset || Common::DEFAULT_CHARSET());
58
                                          charset      => $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET());
59 59

  
60 60
    } else {
61 61
      $::form->{title} = $locals{title} if $locals{title};
......
67 67
                 AUTH     => $::auth,
68 68
                 FORM     => $::form,
69 69
                 LOCALE   => $::locale,
70
                 LXCONFIG => { dbcharset              => $::dbcharset,
71
                               webdav                 => $::webdav,
72
                               lizenzen               => $::lizenzen,
70
                 LXCONFIG => { dbcharset              => $::lx_office_conf{system}->{dbcharset},
71
                               webdav                 => $::lx_office_conf{system}->{webdav},
72
                               lizenzen               => $::lx_office_conf{system}->{lizenzen},
73 73
                               latex_templates        => $::lx_office_conf{print_templates}->{latex},
74 74
                               opendocument_templates => $::lx_office_conf{print_templates}->{opendocument},
75
                               vertreter              => $::vertreter,
76
                               show_best_before       => $::show_best_before,
75
                               vertreter              => $::lx_office_conf{system}->{vertreter},
76
                               show_best_before       => $::lx_office_conf{system}->{show_best_before},
77 77
                             },
78 78
                 LXDEBUG  => $::lxdebug,
79 79
                 MYCONFIG => \%::myconfig,
SL/DB/Helper/PriceTaxCalculator.pm
163 163
sub _calculate_assembly_item {
164 164
  my ($self, $data, $part, $total_qty, $base_factor) = @_;
165 165

  
166
  return 0 if $::eur || !$data->{is_invoice};
166
  return 0 if $::lx_office_conf{system}->{eur} || !$data->{is_invoice};
167 167

  
168 168
  foreach my $assembly_entry (@{ $part->assemblies }) {
169 169
    push @{ $data->{assembly_items}->[-1] }, { part      => $assembly_entry->part,
......
184 184

  
185 185
  _dbg("cpsi tq " . $total_qty);
186 186

  
187
  return 0 if $::eur || !$data->{is_invoice} || !$total_qty;
187
  return 0 if $::lx_office_conf{system}->{eur} || !$data->{is_invoice} || !$total_qty;
188 188

  
189 189
  my ($entry);
190 190
  $base_factor           ||= 1;
SL/DB/Invoice.pm
302 302
=item 6. Items in C<invoice> are updated according to their allocation
303 303
status (regarding for costs of goold sold). Will only be done if
304 304
Lx-Office is not configured to use Einnahmenüberschussrechnungen
305
(C<$::eur>).
305
(see config/lx_office.conf, section "system", variable "eur").
306 306

  
307 307
=item 7. The invoice and its items are saved.
308 308

  
SL/DBUpgrade2.pm
353 353

  
354 354
  return 0 if !@unapplied_scripts;
355 355

  
356
  my $db_charset           = $main::dbcharset || Common::DEFAULT_CHARSET;
356
  my $db_charset           = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
357 357
  $self->{form}->{login} ||= 'admin';
358 358

  
359 359
  map { $_->{description} = SL::Iconv::convert($_->{charset}, $db_charset, $_->{description}) } values %{ $self->{all_controls} };
SL/DO.pm
383 383

  
384 384
  $form->{saved_donumber} = $form->{donumber};
385 385

  
386
  Common::webdav_folder($form) if ($main::webdav);
386
  Common::webdav_folder($form);
387 387

  
388 388
  $main::lxdebug->leave_sub();
389 389

  
......
712 712
    $sth->finish();
713 713
  }
714 714

  
715
  Common::webdav_folder($form) if ($main::webdav);
715
  Common::webdav_folder($form);
716 716

  
717 717
  $main::lxdebug->leave_sub();
718 718

  
SL/Dispatcher.pm
52 52
  my $template             = shift;
53 53
  my $error_type           = shift || '';
54 54

  
55
  $::locale                = Locale->new($::language);
55
  $::locale                = Locale->new($::lx_office_conf{system}->{language});
56 56
  $::form->{error}         = $::locale->text('The session is invalid or has expired.') if ($error_type eq 'session');
57 57
  $::form->{error}         = $::locale->text('Incorrect password!.')                   if ($error_type eq 'password');
58
  $::myconfig{countrycode} = $::language;
58
  $::myconfig{countrycode} = $::lx_office_conf{system}->{language};
59 59
  $::form->{stylesheet}    = 'css/lx-office-erp.css';
60 60

  
61 61
  $::form->header;
......
164 164
  $self->unrequire_bin_mozilla;
165 165

  
166 166
  $::cgi         = CGI->new('');
167
  $::locale      = Locale->new($::language);
167
  $::locale      = Locale->new($::lx_office_conf{system}->{language});
168 168
  $::form        = Form->new;
169 169
  %::called_subs = ();
170 170

  
SL/FCGIFixes.pm
25 25

  
26 26
sub fix_print_and_internal_encoding_after_0_68 {
27 27
  return if version->new("$FCGI::VERSION")->numify <= version->new("0.68")->numify;
28
  return if lc($::dbcharset) !~ m/^(?:utf-?8|unicode)$/;
28
  return if lc($::lx_office_conf{system}->{dbcharset}) !~ m/^(?:utf-?8|unicode)$/;
29 29

  
30 30
  my $encoder             = Encode::find_encoding('UTF-8');
31 31
  my $original_fcgi_print = \&FCGI::Stream::PRINT;
SL/Form.pm
262 262
    $self->_request_to_hash($content);
263 263
  }
264 264

  
265
  my $db_charset   = $main::dbcharset;
265
  my $db_charset   = $::lx_office_conf{system}->{dbcharset};
266 266
  $db_charset    ||= Common::DEFAULT_CHARSET;
267 267

  
268 268
  my $encoding     = $self->{INPUT_ENCODING} || $db_charset;
......
636 636
  # extra code is currently only used by menuv3 and menuv4 to set their css.
637 637
  # it is strongly deprecated, and will be changed in a future version.
638 638
  my ($self, $extra_code) = @_;
639
  my $db_charset = $::dbcharset || Common::DEFAULT_CHARSET;
639
  my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
640 640
  my @header;
641 641

  
642 642
  $::lxdebug->leave_sub and return if !$ENV{HTTP_USER_AGENT} || $self->{header}++;
......
720 720

  
721 721
  my ($self) = @_;
722 722

  
723
  my $db_charset = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
723
  my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
724 724
  my $cgi        = $main::cgi || CGI->new('');
725 725
  my $output     = $cgi->header('-charset' => $db_charset);
726 726

  
......
761 761
  my $language;
762 762

  
763 763
  if (!%::myconfig || !$::myconfig{"countrycode"}) {
764
    $language = $main::language;
764
    $language = $::lx_office_conf{system}->{language};
765 765
  } else {
766 766
    $language = $main::myconfig{"countrycode"};
767 767
  }
......
802 802
    map { $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys %::myconfig;
803 803
  }
804 804

  
805
  $additional_params->{"conf_dbcharset"}              = $::dbcharset;
806
  $additional_params->{"conf_webdav"}                 = $::webdav;
807
  $additional_params->{"conf_lizenzen"}               = $::lizenzen;
805
  $additional_params->{"conf_dbcharset"}              = $::lx_office_conf{system}->{dbcharset};
806
  $additional_params->{"conf_webdav"}                 = $::lx_office_conf{system}->{webdav};
807
  $additional_params->{"conf_lizenzen"}               = $::lx_office_conf{system}->{lizenzen};
808 808
  $additional_params->{"conf_latex_templates"}        = $::lx_office_conf{print_templates}->{latex};
809 809
  $additional_params->{"conf_opendocument_templates"} = $::lx_office_conf{print_templates}->{opendocument};
810
  $additional_params->{"conf_vertreter"}              = $::vertreter;
811
  $additional_params->{"conf_show_best_before"}       = $::show_best_before;
812
  $additional_params->{"conf_parts_image_css"}        = $::parts_image_css;
813
  $additional_params->{"conf_parts_listing_images"}   = $::parts_listing_images;
814
  $additional_params->{"conf_parts_show_image"}       = $::parts_show_image;
810
  $additional_params->{"conf_vertreter"}              = $::lx_office_conf{system}->{vertreter};
811
  $additional_params->{"conf_show_best_before"}       = $::lx_office_conf{system}->{show_best_before};
812
  $additional_params->{"conf_parts_image_css"}        = $::lx_office_conf{features}->{parts_image_css};
813
  $additional_params->{"conf_parts_listing_images"}   = $::lx_office_conf{features}->{parts_listing_images};
814
  $additional_params->{"conf_parts_show_image"}       = $::lx_office_conf{features}->{parts_show_image};
815 815

  
816 816
  if (%main::debug_options) {
817 817
    map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
......
1311 1311

  
1312 1312
      map { $mail->{$_} = $self->{$_} }
1313 1313
        qw(cc bcc subject message version format);
1314
      $mail->{charset} = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
1314
      $mail->{charset} = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
1315 1315
      $mail->{to} = $self->{EMAIL_RECIPIENT} ? $self->{EMAIL_RECIPIENT} : $self->{email};
1316 1316
      $mail->{from}   = qq|"$myconfig->{name}" <$myconfig->{email}>|;
1317 1317
      $mail->{fileid} = "$fileid.";
SL/IR.pm
103 103
    $form->{"qty_$i"}  = $form->parse_amount($myconfig, $form->{"qty_$i"});
104 104
    $form->{"qty_$i"} *= -1 if $form->{storno};
105 105

  
106
    $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $main::eur;
106
    $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $::lx_office_conf{system}->{eur};
107 107

  
108 108
    # get item baseunit
109 109
    if (!$item_units{$form->{"id_$i"}}) {
......
577 577
  # delete zero entries
578 578
  do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE amount = 0|);
579 579

  
580
  Common::webdav_folder($form) if ($main::webdav);
580
  Common::webdav_folder($form);
581 581

  
582 582
  # Link this record to the records it was created from.
583 583
  RecordLinks->create_links('dbh'        => $dbh,
......
875 875
  }
876 876
  $sth->finish();
877 877

  
878
  Common::webdav_folder($form) if ($main::webdav);
878
  Common::webdav_folder($form);
879 879

  
880 880
  $dbh->disconnect();
881 881

  
SL/IS.pm
1045 1045
  # save printed, emailed and queued
1046 1046
  $form->save_status($dbh);
1047 1047

  
1048
  Common::webdav_folder($form) if ($main::webdav);
1048
  Common::webdav_folder($form);
1049 1049

  
1050 1050
  # Link this record to the records it was created from.
1051 1051
  RecordLinks->create_links('dbh'        => $dbh,
......
1277 1277
    # sellprice is the cost of the item
1278 1278
    my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ( ($ref->{price_factor} || 1) * ( $basefactor || 1 )), 2);
1279 1279

  
1280
    if (!$main::eur) {
1280
    if (!$::lx_office_conf{system}->{eur}) {
1281 1281
      $ref->{expense_accno} = ($form->{"expense_accno_$row"}) ? $form->{"expense_accno_$row"} : $ref->{expense_accno};
1282 1282
      # add to expense
1283 1283
      $form->{amount_cogs}{ $form->{id} }{ $ref->{expense_accno} } += -$linetotal;
......
1584 1584
    }
1585 1585
    $sth->finish;
1586 1586

  
1587
    Common::webdav_folder($form) if ($main::webdav);
1587
    Common::webdav_folder($form);
1588 1588
  }
1589 1589

  
1590 1590
  my $rc = $dbh->commit;
SL/Locale.pm
55 55

  
56 56
  my ($type, $country) = @_;
57 57

  
58
  $country ||= $::language;
58
  $country ||= $::lx_office_conf{system}->{language};
59 59
  $country   =~ s|.*/||;
60 60
  $country   =~ s|\.||g;
61 61

  
......
96 96
    }
97 97
  }
98 98

  
99
  my $db_charset            = $main::dbcharset || Common::DEFAULT_CHARSET;
100
  $self->{is_utf8}          = (any { lc($::dbcharset || '') eq $_ } qw(utf8 utf-8 unicode)) ? 1 : 0;
99
  my $db_charset            = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
100
  $self->{is_utf8}          = (any { lc($::lx_office_conf{system}->{dbcharset} || '') eq $_ } qw(utf8 utf-8 unicode)) ? 1 : 0;
101 101

  
102 102
  if ($self->{is_utf8}) {
103 103
    binmode STDOUT, ":utf8";
SL/OE.pm
567 567
  $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
568 568
                                       "quonumber" : "ordnumber"};
569 569

  
570
  Common::webdav_folder($form) if ($main::webdav);
570
  Common::webdav_folder($form);
571 571

  
572 572
  my $rc = $dbh->commit;
573 573

  
......
993 993

  
994 994
  $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? "buy" : "sell");
995 995

  
996
  Common::webdav_folder($form) if ($main::webdav);
996
  Common::webdav_folder($form);
997 997

  
998 998
  $self->load_periodic_invoice_config($form);
999 999

  
SL/ReportGenerator.pm
428 428
  my $num_columns     = scalar @visible_columns;
429 429
  my $num_header_rows = 1;
430 430

  
431
  my $font_encoding   = $main::dbcharset || 'ISO-8859-15';
431
  my $font_encoding   = $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15';
432 432

  
433 433
  foreach my $name (@visible_columns) {
434 434
    push @column_props, { 'justify' => $self->{columns}->{$name}->{align} eq 'right' ? 'right' : 'left' };
SL/Template/OpenDocument.pm
22 22
  my $self = $type->SUPER::new(@_);
23 23

  
24 24
  $self->{"rnd"}   = int(rand(1000000));
25
  $self->{"iconv"} = SL::Iconv->new($main::dbcharset, "UTF-8");
25
  $self->{"iconv"} = SL::Iconv->new($::lx_office_conf{system}->{dbcharset}, "UTF-8");
26 26

  
27 27
  $self->set_tag_style('&lt;%', '%&gt;');
28 28
  $self->{quot_re} = '&quot;';
SL/User.pm
581 581
    closedir(SQLDIR);
582 582
  }
583 583

  
584
  my $db_charset = $main::dbcharset;
584
  my $db_charset = $::lx_office_conf{system}->{dbcharset};
585 585
  $db_charset ||= Common::DEFAULT_CHARSET;
586 586

  
587 587
  my $dbupdater = SL::DBUpgrade2->new(form => $form, dbdriver => $form->{dbdriver});
......
648 648
  $form->{sid} = $form->{dbdefault};
649 649

  
650 650
  my $rc         = -2;
651
  my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET;
651
  my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
652 652

  
653 653
  map { $_->{description} = SL::Iconv::convert($_->{charset}, $db_charset, $_->{description}) } values %{ $dbupdater->{all_controls} };
654 654

  
bin/mozilla/admin.pl
767 767
  }
768 768
  closedir SQLDIR;
769 769

  
770
  my $default_charset = $main::dbcharset;
770
  my $default_charset = $::lx_office_conf{system}->{dbcharset};
771 771
  $default_charset ||= Common::DEFAULT_CHARSET;
772 772

  
773 773
  my $cluster_encoding = User->dbclusterencoding($form);
774 774
  if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i)) {
775
    if ($main::dbcharset !~ m/^UTF-?8$/i) {
775
    if ($::lx_office_conf{system}->{dbcharset} !~ m/^UTF-?8$/i) {
776 776
      $form->show_generic_error($locale->text('The selected  PostgreSQL installation uses UTF-8 as its encoding. ' .
777 777
                                              'Therefore you have to configure Lx-Office to use UTF-8 as well.'),
778 778
                                'back_button' => 1);
......
934 934

  
935 935
    map { $mail->{$_} = $form->{$_} } qw(from to cc subject message);
936 936

  
937
    $mail->{charset}     = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
937
    $mail->{charset}     = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
938 938
    $mail->{attachments} = [ { "filename" => $tmp, "name" => $name } ];
939 939
    $mail->send();
940 940

  
......
958 958
    $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
959 959
  }
960 960

  
961
  my $default_charset   = $main::dbcharset;
961
  my $default_charset   = $::lx_office_conf{system}->{dbcharset};
962 962
  $default_charset    ||= Common::DEFAULT_CHARSET;
963 963

  
964 964
  $form->{DBENCODINGS}  = [];
bin/mozilla/am.pl
1111 1111
  $form->{title} = $locale->text('Type of Business');
1112 1112

  
1113 1113
  my @column_index = qw(description discount customernumberinit);
1114
  push @column_index, 'salesman' if $::vertreter;
1114
  push @column_index, 'salesman' if $::lx_office_conf{system}->{vertreter};
1115 1115
  my %column_header;
1116 1116
  $column_header{description} =
1117 1117
      qq|<th class=listheading width=60%>|
......
1224 1224
    $form->format_amount(\%myconfig, $form->{discount} * 100);
1225 1225

  
1226 1226
  my $salesman_code;
1227
  if ($::vertreter) {
1227
  if ($::lx_office_conf{system}->{vertreter}) {
1228 1228
    $salesman_code = qq|
1229 1229
  <tr>
1230 1230
    <th align="right">| . $locale->text('Representative') . qq|</th>
......
1873 1873
  }
1874 1874

  
1875 1875
  my $linkaccounts;
1876
  if (!$main::eur) {
1876
  if (!$::lx_office_conf{system}->{eur}) {
1877 1877
    $linkaccounts = qq|
1878 1878
               <tr>
1879 1879
                <th align=right>| . $locale->text('Inventory') . qq|</th>
bin/mozilla/ca.pl
84 84

  
85 85
  $form->{title} = $locale->text('Chart of Accounts');
86 86

  
87
  if ($main::eur) {
87
  if ($::lx_office_conf{system}->{eur}) {
88 88
    $form->{method} = "cash";
89 89
  }
90 90

  
......
177 177
          <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
178 178
        </tr>
179 179
| if $form->{selectdepartment};
180
  my $accrual = ($main::eur) ? ""        : "checked";
181
  my $cash    = ($main::eur) ? "checked" : "";
180
  my $accrual = $::lx_office_conf{system}->{eur} ? ""        : "checked";
181
  my $cash    = $::lx_office_conf{system}->{eur} ? "checked" : "";
182 182

  
183 183
  my $name_1    = "fromdate";
184 184
  my $id_1      = "fromdate";
......
246 246

  
247 247
  $form->{description} =~ s/\"/&quot;/g;
248 248

  
249
  my $eur = $::lx_office_conf{system}->{eur};
250

  
249 251
  print qq|
250 252
<body onLoad="$onload">
251 253

  
......
254 256
<input type=hidden name=accno value=$form->{accno}>
255 257
<input type=hidden name=description value="$form->{description}">
256 258
<input type=hidden name=sort value=transdate>
257
<input type=hidden name=eur value=$main::eur>
259
<input type=hidden name=eur value=$eur>
258 260
<input type=hidden name=accounttype value=$form->{accounttype}>
259 261

  
260 262
<table border=0 width=100%>
bin/mozilla/ct.pl
300 300
                   taxzones  => "ALL_TAXZONES");
301 301
  $form->get_pricegroup(\%myconfig, { all => 1 });
302 302

  
303
  $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter;
303
  $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{system}->{vertreter};
304 304

  
305 305
  $form->{ALL_SALESMEN}   = $form->{ALL_EMPLOYEES};
306 306
  $form->{taxincluded}    = ($form->{taxincluded}) ? "checked" : "";
......
354 354

  
355 355
  $::form->isblank("name", $::locale->text("Name missing!"));
356 356

  
357
  if ($::form->{new_salesman_id} && $::vertreter) {
357
  if ($::form->{new_salesman_id} && $::lx_office_conf{system}->{vertreter}) {
358 358
    $::form->{salesman_id} = $::form->{new_salesman_id};
359 359
    delete $::form->{new_salesman_id};
360 360
  }
bin/mozilla/do.pl
165 165
  $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
166 166

  
167 167
  # retrieve order/quotation
168
  $form->{webdav}   = $main::webdav;
168
  $form->{webdav}   = $::lx_office_conf{system}->{webdav};
169 169
  $form->{jsscript} = 1;
170 170

  
171 171
  my $editing = $form->{id};
......
865 865
    map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{ $ref };
866 866
    map { $form->{"${_}_$form->{rowcount}"} = $form->format_amount(\%myconfig, $ref->{$_}) } qw(qty sellprice lastcost);
867 867

  
868
    if ($vc_discount){ # falls wir einen Lieferanten/Kundenrabatt haben 
868
    if ($vc_discount){ # falls wir einen Lieferanten/Kundenrabatt haben
869 869
      # und keinen anderen discount wert an $i ...
870 870
      $form->{"discount_$form->{rowcount}"} ||= $vc_discount; # ... nehmen wir diesen Rabatt
871 871
    }
......
1310 1310
      foreach my $request (@{ DO->unpack_stock_information('packed' => $form->{"stock_out_$i"}) }) {
1311 1311
        $request->{parts_id} = $form->{"id_$i"};
1312 1312
        $request->{base_qty} = $request->{qty} * $units->{$request->{unit}}->{factor} / $base_unit_factor;
1313
        $request->{project_id} = $form->{"project_id_$i"} ? $form->{"project_id_$i"} : $form->{globalproject_id}; 
1313
        $request->{project_id} = $form->{"project_id_$i"} ? $form->{"project_id_$i"} : $form->{globalproject_id};
1314 1314

  
1315 1315
        my $map_key          = join '--', ($form->{"id_$i"}, @{$request}{qw(warehouse_id bin_id chargenumber bestbefore)});
1316 1316

  
......
1352 1352
        my $pinfo = $part_info_map{$request->{parts_id}};
1353 1353
        my $binfo = $bin_info_map{$request->{bin_id}};
1354 1354

  
1355
        if ($main::show_best_before) {
1355
        if ($::lx_office_conf{system}->{show_best_before}) {
1356 1356
            push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, #5, for the transfer of #6.",
1357 1357
                                                     $pinfo->{description},
1358 1358
                                                     $binfo->{warehouse_description},
bin/mozilla/ic.pl
1526 1526

  
1527 1527
  $auth->assert('part_service_assembly_edit');
1528 1528

  
1529
  $form->{eur}              = $main::eur; # config dumps into namespace - yuck
1529
  $form->{eur}              = $::lx_office_conf{system}->{eur}; # config dumps into namespace - yuck
1530 1530
  $form->{pg_keys}          = sub { "$_[0]->{partsgroup}--$_[0]->{id}" };
1531 1531
  $form->{description_area} = ($form->{rows} = $form->numtextrows($form->{description}, 40)) > 1;
1532 1532
  $form->{notes_rows}       =  max 4, $form->numtextrows($form->{notes}, 40), $form->numtextrows($form->{formel}, 40);
bin/mozilla/installationcheck.pl
16 16
  return if (scalar(@missing_modules) == 0);
17 17

  
18 18
  use SL::Locale;
19
  my $locale = new Locale($main::language, "installationcheck");
19

  
20
  my $locale = new Locale($::lx_office_conf{system}->{language}, "installationcheck");
20 21

  
21 22
  print(qq|content-type: text/html
22 23

  
bin/mozilla/invoice_io.pl
163 163
    ::end_of_request();
164 164
  }
165 165

  
166
  Common::webdav_folder($form) if ($main::webdav);
166
  Common::webdav_folder($form);
167 167

  
168 168
  #   if (   $form->{print_and_post}
169 169
  #       && $form->{second_run}
bin/mozilla/io.pl
489 489
    qw(bin listprice inventory_accno income_accno expense_accno unit weight
490 490
       assembly taxaccounts partsgroup formel longdescription not_discountable
491 491
       part_payment_id partnotes id lastcost price_factor_id price_factor);
492
  push @new_fields, "lizenzen" if ($main::lizenzen);
492
  push @new_fields, "lizenzen" if $::lx_office_conf{system}->{lizenzen};
493 493
  push @new_fields, grep { m/^ic_cvar_/ } keys %{ $form->{item_list}->[0] };
494 494

  
495 495
  my $i = 0;
......
497 497
  foreach my $ref (@{ $form->{item_list} }) {
498 498
    my $checked = ($i++) ? "" : "checked";
499 499

  
500
    if ($main::lizenzen) {
500
    if ($::lx_office_conf{system}->{lizenzen}) {
501 501
      if ($ref->{inventory_accno} > 0) {
502 502
        $ref->{"lizenzen"} = qq|<option></option>|;
503 503
        foreach my $item (@{ $form->{LIZENZEN}{ $ref->{"id"} } }) {
......
622 622
    $form->{payment_id} = $form->{"part_payment_id_$i"};
623 623
  }
624 624

  
625
  if ($main::lizenzen) {
625
  if ($::lx_office_conf{system}->{lizenzen}) {
626 626
    map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} } qw(lizenzen);
627 627
  }
628 628

  
......
937 937
  my $script = $form->{"script"};
938 938
  $script =~ s|.*/||;
939 939
  $script =~ s|.pl$||;
940
  $locale = new Locale($main::language, $script);
940
  $locale = new Locale($::lx_office_conf{system}->{language}, $script);
941 941

  
942 942
  map { $form->{"select$_"} = "" } ($form->{vc}, "currency");
943 943

  
bin/mozilla/ir.pl
100 100
  $form->{vc} = 'vendor';
101 101

  
102 102
  # create links
103
  $form->{webdav}   = $main::webdav;
103
  $form->{webdav}   = $::lx_office_conf{system}->{webdav};
104 104
  $form->{jsscript} = 1;
105 105

  
106 106
  $form->create_links("AP", \%myconfig, "vendor");
bin/mozilla/is.pl
132 132
  $form->{vc} = 'customer';
133 133

  
134 134
  # create links
135
  $form->{webdav}   = $main::webdav;
136
  $form->{lizenzen} = $main::lizenzen;
135
  $form->{webdav}   = $::lx_office_conf{system}->{webdav};
136
  $form->{lizenzen} = $::lx_office_conf{system}->{lizenzen};
137 137

  
138 138
  $form->create_links("AR", \%myconfig, "customer");
139 139

  
......
561 561

  
562 562
        $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
563 563

  
564
        if ($main::lizenzen) {
564
        if ($::lx_office_conf{system}->{lizenzen}) {
565 565
          if ($form->{"inventory_accno_$i"} ne "") {
566 566
            $form->{"lizenzen_$i"} = qq|<option></option>|;
567 567
            foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) {
bin/mozilla/licenses.pl
325 325

  
326 326
  $form->{title} = $locale->text('Add License');
327 327

  
328
  if (!$main::lizenzen) {
328
  if (!$::lx_office_conf{system}->{lizenzen}) {
329 329
    $form->error(
330 330
                 $locale->text(
331 331
                   'The licensing module has been deactivated in lx-erp.conf.')
......
518 518

  
519 519
  $form->{title} = $locale->text('Licenses');
520 520

  
521
  if (!$main::lizenzen) {
521
  if (!$::lx_office_conf{system}->{lizenzen}) {
522 522
    $form->error(
523 523
                 $locale->text(
524 524
                   'The licensing module has been deactivated in lx-erp.conf.')
bin/mozilla/login.pl
175 175
sub show_error {
176 176
  my $template           = shift;
177 177
  my %myconfig           = %main::myconfig;
178
  $myconfig{countrycode} = $main::language;
178
  $myconfig{countrycode} = $::lx_office_conf{system}->{language};
179 179
  $form->{stylesheet}    = 'css/lx-office-erp.css';
180 180

  
181 181
  $form->header();
bin/mozilla/menuXML.pl
54 54
  my $form     = $main::form;
55 55
  my %myconfig = %main::myconfig;
56 56

  
57
  my $charset = $main::dbcharset || 'ISO-8859-1';
57
  my $charset = $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-1';
58 58
  my $callback            = $form->unescape($form->{callback});
59 59
  $callback               = URI->new($callback)->rel($callback) if $callback;
60 60
  $callback               = "login.pl?action=company_logo"      if $callback =~ /^(\.\/)?$/;
bin/mozilla/oe.pl
222 222
  $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
223 223

  
224 224
  # retrieve order/quotation
225
  $form->{webdav}   = $main::webdav;
225
  $form->{webdav}   = $::lx_office_conf{system}->{webdav};
226 226
  $form->{jsscript} = 1;
227 227

  
228 228
  my $editing = $form->{id};
......
498 498

  
499 499
  print $form->parse_html_template("oe/form_footer", {
500 500
     %TMPL_VAR,
501
     webdav          => $main::webdav,
501
     webdav          => $::lx_office_conf{system}->{webdav},
502 502
     print_options   => print_options(inline => 1),
503 503
     label_edit      => $locale->text("Edit the $form->{type}"),
504 504
     label_workflow  => $locale->text("Workflow $form->{type}"),
......
1924 1924

  
1925 1925
  $form->language_payment(\%myconfig);
1926 1926

  
1927
  Common::webdav_folder($form) if ($main::webdav);
1927
  Common::webdav_folder($form);
1928 1928

  
1929 1929
  &form_header;
1930 1930

  
bin/mozilla/rp.pl
146 146

  
147 147
  $form->{title} = $locale->text($title{ $form->{report} });
148 148

  
149
  my $accrual = ($main::eur) ? ""        : "checked";
150
  my $cash    = ($main::eur) ? "checked" : "";
149
  my $accrual = $::lx_office_conf{system}->{eur} ? ""        : "checked";
150
  my $cash    = $::lx_office_conf{system}->{eur} ? "checked" : "";
151 151

  
152 152
  my $year = (localtime)[5] + 1900;
153 153

  
bin/mozilla/sepa.pl
481 481

  
482 482
  my $sepa_xml   = SL::SEPA::XML->new('company'     => $myconfig->{company},
483 483
                                      'creditor_id' => $myconfig->{sepa_creditor_id},
484
                                      'src_charset' => $main::dbcharset || 'ISO-8859-15',
484
                                      'src_charset' => $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15',
485 485
                                      'message_id'  => $message_id,
486 486
                                      'grouped'     => 1,
487 487
                                      'collection'  => $vc eq 'customer',
bin/mozilla/wh.pl
436 436
    $form->error($locale->text('The warehouse or the bin is missing.'));
437 437
  }
438 438

  
439
  if (!$main::show_best_before) {
439
  if (!$::lx_office_conf{system}->{show_best_before}) {
440 440
      $form->{bestbefore} = '';
441 441
  }
442 442

  
config/lx-erp.conf
1
use Cwd;
2

  
3
our (
4
  $dbcharset, $eur, $language,
5
  $lizenzen,
6
  $parts_image_css, $parts_listing_images, $parts_show_image,
7
  $show_best_before, $vertreter, $webdav
8
);
9

  
10
# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
11
# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
12
$eur = 1;
13

  
14
# set language for login and admin
15
# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
16
$language = "de";
17

  
18
# Aktivierung der verschiedenen Spezialmodule
19
$webdav = 0;
20
$lizenzen = 1;
21
$vertreter = 0;
22

  
23
# Zeige Felder für Mindesthaltbarkeitsdatum
24
$show_best_before = 0;
25

  
26
## Artikelbilder anzeigen
27
# Artikelbild in der Detailansicht anzeigen
28
$parts_show_image = 1; # [0|1]
29
$parts_image_css = 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;'; # [belibige valide css definiton]
30
# Artikelbilder per default in den Suchergebnissen anzeigen
31
$parts_listing_images = 0; # [0|1]
32

  
33
# Das charset, in dem die Daten in der Datenbank abgelegt sind.
34
$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
35
# $dbcharset = "ISO-8859-15";
36

  
37 1
1;
config/lx-erp.conf.default
1
use Cwd;
2

  
3
our (
4
  $dbcharset, $eur, $language,
5
  $lizenzen,
6
  $parts_image_css, $parts_listing_images, $parts_show_image,
7
  $show_best_before, $vertreter, $webdav
8
);
9

  
10
# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
11
# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
12
$eur = 1;
13

  
14
# set language for login and admin
15
# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
16
$language = "de";
17

  
18
# Aktivierung der verschiedenen Spezialmodule
19
$webdav = 0;
20
$lizenzen = 1;
21
$vertreter = 0;
22

  
23
# Zeige Felder für Mindesthaltbarkeitsdatum
24
$show_best_before = 0;
25

  
26
## Artikelbilder anzeigen
27
# Artikelbild in der Detailansicht anzeigen
28
$parts_show_image = 1; # [0|1]
29
$parts_image_css = 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;'; # [belibige valide css definiton]
30
# Artikelbilder per default in den Suchergebnissen anzeigen
31
$parts_listing_images = 0; # [0|1]
32

  
33
# Das charset, in dem die Daten in der Datenbank abgelegt sind.
34
$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
35
# $dbcharset = "ISO-8859-15";
36

  
37 1
1;
config/lx_office.conf.default
1
[system]
2
# EUR: Einnahmen-Überschussrechnung (net income method). Set this to 1
3
# if your company uses the net income method and to 0 for balacing.
4
eur = 1
5

  
6
# Set language for login and admin forms. Currently "de" (German),
7
# "de_DE" (new German) and "en" (English, not perfect) are available.
8
language = de
9

  
10
# The database charset. Must match the database cluster you want to
11
# connect to.
12
dbcharset = UTF-8
13

  
14
[features]
15
# Activate certain optional features and modules.
16
webdav = 0
17
lizenzen = 1
18
vertreter = 0
19

  
20
# Show fields used for the best before date
21
show_best_before = 0
22

  
23
## Pictures for parts
24
# Show the picture in the part form
25
parts_show_image = 1
26
# Style the picture with the following CSS code:
27
parts_image_css = border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;
28
# Show the picture in the results when you search for parts
29
parts_listing_images = 0
30

  
1 31
[paths]
2 32
# path to temporary files (must be writeable by the web server)
3 33
userspath = users
scripts/console
66 66
  SL::Dispatcher::_decode_recursively(\%::lx_office_conf);
67 67

  
68 68
  $::lxdebug = LXDebug->new;
69
  $::locale = Locale->new($::language);
69
  $::locale = Locale->new($::lx_office_conf{system}->{language});
70 70
  $::cgi    = CGI->new qw();
71 71
  $::form   = Form->new;
72 72
  $::auth   = SL::Auth->new;
scripts/task_server.pl
46 46
  eval { require "config/lx-erp-local.conf"; 1; } or die $EVAL_ERROR if -f "config/lx-erp-local.conf";
47 47

  
48 48
  $::lxdebug = LXDebug->new;
49
  $::locale  = Locale->new($::language);
49
  $::locale  = Locale->new($::lx_office_conf{system}->{language});
50 50
  $::cgi     = CGI->new qw();
51 51
  $::form    = Form->new;
52 52
  $::auth    = SL::Auth->new;
......
115 115
      foreach my $job (@{ $jobs }) {
116 116
        # Provide fresh global variables in case legacy code modifies
117 117
        # them somehow.
118
        $::locale = Locale->new($::language);
118
        $::locale = Locale->new($::lx_office_conf{system}->{language});
119 119
        $::form   = Form->new;
120 120

  
121 121
        $job->run;
sql/Pg-upgrade/Pg-upgrade-2.2.0.33-2.2.0.34.pl
162 162
  $sth->execute() || mydberror($query);
163 163

  
164 164
  my $query_update = "UPDATE parts SET buchungsgruppen_id = ?";
165
  $query_update .= ", inventory_accno_id = ?" if ($main::eur);
165
  $query_update .= ", inventory_accno_id = ?" if $::lx_office_conf{system}->{eur};
166 166
  $query_update .= " WHERE id = ?";
167 167
  my $sth_update = $dbh->prepare($query_update);
168 168

  
169 169
  while (my $ref = $sth->fetchrow_hashref()) {
170 170
    foreach my $bg (@{$buchungsgruppen}) {
171
      if (($main::eur ||
171
      if (($::lx_office_conf{system}->{eur} ||
172 172
           ($ref->{"inventory_accno_id"} == $bg->{"inventory_accno_id"})) &&
173 173
          ($ref->{"income_accno_id"} == $bg->{"income_accno_id_0"}) &&
174 174
          ($ref->{"expense_accno_id"} == $bg->{"expense_accno_id_0"})) {
175 175
        my @values = ($bg->{"id"}, $ref->{"id"});
176
        splice(@values, 1, 0, $bg->{"inventory_accno_id"}) if ($main::eur);
176
        splice(@values, 1, 0, $bg->{"inventory_accno_id"}) if $::lx_office_conf{system}->{eur};
177 177
        $sth_update->execute(@values) ||
178 178
          mydberror($query_update . " (" . join(", ", @values) . ")");
179 179
        last;
......
195 195
      if (($ref->{"income_accno_id"} == $bg->{"income_accno_id_0"}) &&
196 196
          ($ref->{"expense_accno_id"} == $bg->{"expense_accno_id_0"})) {
197 197
        my @values = ($bg->{"id"}, $ref->{"id"});
198
        splice(@values, 1, 0, undef) if ($main::eur);
198
        splice(@values, 1, 0, undef) if $::lx_office_conf{system}->{eur};
199 199
        $sth_update->execute(@values) ||
200 200
          mydberror($query_update . " (" . join(", ", @values) . ")");
201 201
        last;
......
299 299
    $entry->{"ACC_INVENTORY"} = $acc_inventory;
300 300
    $entry->{"ACC_INCOME"} = $acc_income;
301 301
    $entry->{"ACC_EXPENSE"} = $acc_expense;
302
    $entry->{"eur"} = $main::eur;
302
    $entry->{"eur"} = $::lx_office_conf{system}->{eur};
303 303
  }
304 304

  
305 305
  # $form->parse_html_template("dbupgrade/buchungsgruppen_parts")
......
439 439

  
440 440
  # If balancing is off then force parts.inventory_accno_id to
441 441
  # a single value for parts.
442
  force_inventory_accno_id_for_parts() if ($main::eur);
442
  force_inventory_accno_id_for_parts() if $::lx_office_conf{system}->{eur};
443 443

  
444 444
  # Force "IC" to be present in chart.link for all accounts
445 445
  # which have been used as inventory accounts in parts.

Auch abrufbar als: Unified diff