Merge branch 'after-262'
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 9 Feb 2011 12:58:23 +0000 (13:58 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 9 Feb 2011 12:58:23 +0000 (13:58 +0100)
Conflicts:
scripts/dbupgrade2_tool.pl

1  2 
DEBIAN/DEBIAN/postinst
DEBIAN/mk_erp_deb.sh
SL/DO.pm
SL/Form.pm
bin/mozilla/admin.pl
bin/mozilla/oe.pl
doc/INSTALL.texi
doc/INSTALL.txt
locale/de_DE/all
scripts/dbupgrade2_tool.pl
templates/webpages/oe/form_header.html

@@@ -176,22 -170,14 +170,22 @@@ mk_links() 
              ln -s /etc/lx-office-erp/lx-office-erp.cherokee /etc/cherokee/sites-available/lx-office-erp.cherokee
          fi;
      fi;
 +    if [ -e /etc/lighttpd ] ; then 
 +        if ! [ -f /etc/lighttpd/conf-enabled/lx-office-erp.lighttpd ] ; then
 +            ln -s /etc/lx-office-erp/lx-office-erp.lighttpd /etc/lighttpf/conf-enabled/10-lx-office-erp
 +        fi;
 +    fi;
  }
  reload_web_server() {
-     if [ -f /etc/init.d/apache* ] ; then 
+     if [ -f /etc/init.d/apache* ] ; then
              /etc/init.d/apache* reload
      fi
-     if [ -f /etc/init.d/cherokee ] ; then 
+     if [ -f /etc/init.d/cherokee ] ; then
              /etc/init.d/cherokee reload
      fi
 +    if [ -f /etc/init.d/lighttpd ] ; then 
 +            /etc/init.d/lighttpd reload
 +    fi
  }
  case "$1" in
  
Simple merge
diff --cc SL/DO.pm
Simple merge
diff --cc SL/Form.pm
Simple merge
Simple merge
@@@ -1940,11 -1956,76 +1956,74 @@@ sub report_for_todo_list 
    return $content;
  }
  
+ sub edit_periodic_invoices_config {
+   $::lxdebug->enter_sub();
+   $::form->{type} = 'sales_order';
+   check_oe_access();
+   my $config;
+   $config = YAML::Load($::form->{periodic_invoices_config}) if $::form->{periodic_invoices_config};
+   if ('HASH' ne ref $config) {
+     $config =  { periodicity             => 'y',
+                  start_date_as_date      => $::form->{transdate},
+                  extend_automatically_by => 12,
+                  active                  => 1,
+                };
+   }
+   $config->{periodicity} = 'm' if none { $_ eq $config->{periodicity} } qw(m q y);
+   $::form->get_lists(printers => "ALL_PRINTERS",
+                      charts   => { key       => 'ALL_CHARTS',
+                                    transdate => 'current_date' });
+   $::form->{AR}    = [ grep { $_->{link} =~ m/(?:^|:)AR(?::|$)/ } @{ $::form->{ALL_CHARTS} } ];
+   $::form->{title} = $::locale->text('Edit the configuration for periodic invoices');
+   $::form->header();
+   print $::form->parse_html_template('oe/edit_periodic_invoices_config', $config);
+   $::lxdebug->leave_sub();
+ }
+ sub save_periodic_invoices_config {
+   $::lxdebug->enter_sub();
+   $::form->{type} = 'sales_order';
+   check_oe_access();
+   $::form->isblank('start_date_as_date', $::locale->text('The start date is missing.'));
+   my $config = { active                  => $::form->{active}     ? 1 : 0,
+                  terminated              => $::form->{terminated} ? 1 : 0,
+                  periodicity             => (any { $_ eq $::form->{periodicity} } qw(m q y)) ? $::form->{periodicity} : 'm',
+                  start_date_as_date      => $::form->{start_date_as_date},
+                  end_date_as_date        => $::form->{end_date_as_date},
+                  print                   => $::form->{print} ? 1 : 0,
+                  printer_id              => $::form->{print} ? $::form->{printer_id} * 1 : undef,
+                  copies                  => $::form->{copies} * 1 ? $::form->{copies} : 1,
+                  extend_automatically_by => $::form->{extend_automatically_by} * 1 || undef,
+                  ar_chart_id             => $::form->{ar_chart_id} * 1,
+                };
+   $::form->{periodic_invoices_config} = YAML::Dump($config);
+   $::form->{title} = $::locale->text('Edit the configuration for periodic invoices');
+   $::form->header;
+   print $::form->parse_html_template('oe/save_periodic_invoices_config', $config);
+   $::lxdebug->leave_sub();
+ }
  sub dispatcher {
 -  my $form     = $main::form;
 -  my $locale   = $main::locale;
 -
    foreach my $action (qw(delete delivery_order e_mail invoice print purchase_order purchase_order quotation
                           request_for_quotation sales_order sales_order save save_and_close save_as_new ship_to update)) {
 -    if ($form->{"action_${action}"}) {
 +    if ($::form->{"action_${action}"}) {
 +      $::form->{dispatched_action} = $action;
        call_sub($action);
        return;
      }
Simple merge
diff --cc doc/INSTALL.txt
Simple merge
@@@ -1682,9 -1702,11 +1703,11 @@@ $self->{texts} = 
    'The selected bin does not exist.' => 'Der ausgew&auml;hlte Lagerplatz existiert nicht.',
    'The selected exports have been closed.' => 'Die ausgewählten Exporte wurden abgeschlossen.',
    'The selected warehouse does not exist.' => 'Das ausgew&auml;hlte Lager existiert nicht.',
 -  'The selected warehouse is empty.' => 'Das ausgew&auml;hlte Lager ist leer.',
 +  'The selected warehouse is empty, or no stocked items where found that match the filter settings.' => 'Das ausgewählte Lager ist leer, oder die Suche ergab keine Übereinstimmungen.',
    'The session is invalid or has expired.' => 'Sie sind von Lx-Office abgemeldet.',
+   'The settings were saved, but the password was not changed.' => '',
    'The source warehouse does not contain any bins.' => 'Das Quelllager enth&auml;lt keine Lagerpl&auml;tze.',
+   'The start date is missing.'  => '',
    'The subject is missing.'     => 'Der Betreff fehlt.',
    'The tables for user management and authentication do not exist. They will be created in the next step in the following database:' => 'Die Tabellen zum Speichern der Benutzerdaten und zur Benutzerauthentifizierung wurden nicht gefunden. Sie werden in der folgenden Datenbank angelegt:',
    'The tabulator character'     => 'Das Tabulator-Symbol',
@@@ -358,11 -359,8 +361,8 @@@ sub build_upgrade_order 
  #######
  #######
  
- eval { require "config/lx-erp.conf"; };
- eval { require "config/lx-erp-local.conf"; } if (-f "config/lx-erp-local.conf");
- $locale = Locale->new($::language);
--$form = Form->new();
 -$locale = Locale->new("de");
++$locale = Locale->new;
++$form   = Form->new;
  
  #######
  #######