Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp
authorC. Braun <information@lx-office-hosting.de>
Fri, 13 May 2011 13:46:47 +0000 (15:46 +0200)
committerC. Braun <information@lx-office-hosting.de>
Fri, 13 May 2011 13:46:47 +0000 (15:46 +0200)
20 files changed:
SL/Auth.pm
SL/Controller/DebugMenu.pm
SL/Controller/FrameHeader.pm [new file with mode: 0644]
SL/Dispatcher.pm
SL/Form.pm
bin/mozilla/am.pl
bin/mozilla/do.pl
bin/mozilla/io.pl
bin/mozilla/kopf.pl [deleted file]
bin/mozilla/menu.pl
bin/mozilla/oe.pl
config/lx_office.conf.default
css/frame_header/header.css [new file with mode: 0644]
doc/changelog
doc/konfigurationsdatei.txt
js/switchmenuframe.js
locale/de/all
scripts/mklinks.sh
templates/webpages/login/old_configuration_files.html
templates/webpages/menu/header.html

index fca3b8b..8b8d859 100644 (file)
@@ -256,7 +256,7 @@ sub create_database {
   my $encoding   = $Common::charset_to_db_encoding{$charset};
   $encoding    ||= 'UNICODE';
 
-  my $dbh        = SL::DBConnect->connect($dsn, $params{superuser}, $params{superuser_password}, { pg_enable_utf8 => $charset =~ m/^utf-?8$/i });
+  my $dbh        = SL::DBConnect->connect($dsn, $params{superuser}, $params{superuser_password}, { pg_enable_utf8 => scalar($charset =~ m/^utf-?8$/i) });
 
   if (!$dbh) {
     $main::form->error($main::locale->text('The connection to the template database failed:') . "\n" . $DBI::errstr);
index d612d37..0e53676 100644 (file)
@@ -9,7 +9,7 @@ __PACKAGE__->run_before(sub { die 'not allowed in config' unless $::lx_office_co
 sub action_reload {
   my ($self, %params) = @_;
 
-  print $::cgi->redirect('kopf.pl');
+  print $::cgi->redirect('controller.pl?action=FrameHeader/header');
   exit;
 }
 
@@ -17,7 +17,7 @@ sub action_toggle {
   my ($self, %params) = @_;
 
   $::lxdebug->level_by_name($::form->{level}, !$::lxdebug->level_by_name($::form->{level}));
-  print $::cgi->redirect('kopf.pl');
+  print $::cgi->redirect('controller.pl?action=FrameHeader/header');
   return;
 }
 
diff --git a/SL/Controller/FrameHeader.pm b/SL/Controller/FrameHeader.pm
new file mode 100644 (file)
index 0000000..855350c
--- /dev/null
@@ -0,0 +1,17 @@
+package SL::Controller::FrameHeader;
+
+use strict;
+use parent qw(SL::Controller::Base);
+
+sub action_header {
+  my ($self) = @_;
+
+  delete $::form->{stylesheet};
+  $::form->use_stylesheet('frame_header/header.css');
+  $self->render('menu/header',
+                now        => DateTime->now_local,
+                is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i),
+                is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i));
+}
+
+1;
index e728976..47c2e2a 100644 (file)
@@ -188,7 +188,7 @@ sub handle_request {
 
     $::form->error($::locale->text('System currently down for maintenance!')) if -e ($::lx_office_conf{paths}->{userspath} . "/nologin") && $script ne 'admin';
 
-    if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') {
+    if ($script eq 'login' or $script eq 'admin') {
       $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}";
       ::run($session_result);
 
index dfff9b4..cef5995 100644 (file)
@@ -640,6 +640,18 @@ sub create_http_response {
   return $output;
 }
 
+sub use_stylesheet {
+  my $self = shift;
+
+  $self->{stylesheet} = [ $self->{stylesheet} ] unless ref $self->{stylesheet} eq 'ARRAY';
+  $self->{stylesheet} = [ grep { -f                       }
+                          map  { m:^css/: ? $_ : "css/$_" }
+                          grep { $_                       }
+                               (@{ $self->{stylesheet} }, @_)
+                        ];
+
+  return @{ $self->{stylesheet} };
+}
 
 sub header {
   $::lxdebug->enter_sub;
@@ -662,8 +674,7 @@ sub header {
     push @header, "<meta http-equiv='refresh' content='$refresh_time;$refresh_url'>";
   }
 
-  push @header, "<link rel='stylesheet' href='css/$_' type='text/css' title='Lx-Office stylesheet'>"
-    for grep { -f "css/$_" } apply { s|.*/|| } $self->{stylesheet}, $self->{stylesheets};
+  push @header, map { qq|<link rel="stylesheet" href="$_" type="text/css" title="Lx-Office stylesheet">| } $self->use_stylesheet;
 
   push @header, "<style type='text/css'>\@page { size:landscape; }</style>" if $self->{landscape};
   push @header, "<link rel='shortcut icon' href='$self->{favicon}' type='image/x-icon'>" if -f $self->{favicon};
@@ -1638,7 +1649,7 @@ sub date_closed {
   #   Leere Datumseingabe i.O.
   #     SELECT 1 FROM defaults WHERE '' < closedto
   #   normale Zahlungsbuchung über Rechnungsmaske i.O.
-  #     SELECT 1 FROM defaults WHERE '10.05.2011' < closedto 
+  #     SELECT 1 FROM defaults WHERE '10.05.2011' < closedto
   # Testfälle mit definiertem closedto (30.04.2011):
   #  Leere Datumseingabe i.O.
   #   SELECT 1 FROM defaults WHERE '' < closedto
@@ -3812,7 +3823,7 @@ Examples:
 =head2 C<header>
 
 Generates a general purpose http/html header and includes most of the scripts
-ans stylesheets needed.
+and stylesheets needed. Stylesheets can be added with L<use_stylesheet>.
 
 Only one header will be generated. If the method was already called in this
 request it will not output anything and return undef. Also if no
@@ -3832,9 +3843,8 @@ default to 3 seconds and the refering url.
 
 =item stylesheet
 
-=item stylesheets
-
-If these are arrayrefs the contents will be inlined into the header.
+Either a scalar or an array ref. Will be inlined into the header. Add
+stylesheets with the L<use_stylesheet> function.
 
 =item landscape
 
index 5dfb72f..c6bb8e4 100644 (file)
@@ -504,7 +504,7 @@ sub list_account {
 
   push(@ { $form->{AJAX} }, $pjx);
 
-  $form->{stylesheets} = "list_accounts.css";
+  $form->use_stylesheet("list_accounts.css");
   $form->{title}       = $locale->text('Chart of Accounts');
 
   $form->header;
index 1b7a109..99a2cc7 100644 (file)
@@ -401,6 +401,7 @@ sub update_delivery_order {
           && ($form->{"description_$i"} eq "")) {
         $form->{rowcount}--;
         $form->{"discount_$i"} = "";
+        $form->{"not_discountable_$i"} = "";
         display_form();
 
       } else {
@@ -745,9 +746,13 @@ sub invoice {
 
   for my $i (1 .. $form->{rowcount}) {
     # für bug 1284
-    if ($form->{discount}){ # Falls wir einen Lieferanten-/Kundenrabatt haben
-      # und keinen anderen discount wert an $i ...
-      $form->{"discount_$i"} ||= $form->{discount}*100; # ... nehmen wir diesen Rabatt
+    unless ($form->{"ordnumber"}) {
+      if ($form->{discount}) { # Falls wir einen Lieferanten-/Kundenrabatt haben
+        # und rabattfähig sind, dann
+        unless ($form->{"not_discountable_$i"}) {
+          $form->{"discount_$i"} = $form->{discount}*100; # ... nehmen wir diesen Rabatt
+        }
+      }
     }
     map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor);
   }
index b26bce4..866e5ec 100644 (file)
@@ -370,7 +370,7 @@ sub display_row {
 
     if ($is_delivery_order) {
       map { $form->{"${_}_${i}"} = $form->format_amount(\%myconfig, $form->{"${_}_${i}"}) } qw(sellprice discount lastcost);
-      push @hidden_vars, qw(sellprice discount price_factor_id lastcost);
+      push @hidden_vars, qw(sellprice discount not_discountable price_factor_id lastcost);
       push @hidden_vars, "stock_${stock_in_out}_sum_qty", "stock_${stock_in_out}";
     }
 
diff --git a/bin/mozilla/kopf.pl b/bin/mozilla/kopf.pl
deleted file mode 100644 (file)
index 0228566..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use DateTime;
-
-sub run {
-  my $session_result = shift;
-
-  %::myconfig = $::auth->read_user($::form->{login})  if $::form->{login};
-  $::locale   = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
-
-  $::form->header;
-  print $::form->parse_html_template('menu/header', {
-    now        => DateTime->now,
-    show_debug => $::lx_office_conf{debug}{show_debug_menu},
-    lxdebug    => $::lxdebug,
-    is_links   => ($ENV{HTTP_USER_AGENT} =~ /links/i),
-  });
-}
-
-1;
-
-#
index cd0ca0d..15c43ef 100644 (file)
@@ -63,7 +63,7 @@ sub display {
 
   print qq|
 <frameset rows="28px,*" cols="*" framespacing="0" frameborder="0">
-  <frame  src="kopf.pl" name="kopf"  scrolling="NO">
+  <frame  src="controller.pl?action=FrameHeader/header" scrolling="NO">
   <frameset cols="$framesize,*" framespacing="0" frameborder="0" border="0" id="menuframe" name="menuframe">
     <frame src="$::form->{script}?action=acc_menu" name="acc_menu"  scrolling="auto" noresize marginwidth="0">
     <frame src="$callback" name="main_window" scrolling="auto">
index 2acf9fe..5b1bc51 100644 (file)
@@ -701,7 +701,7 @@ sub search {
 
   print $form->parse_html_template('oe/search', {
     %myconfig,
-    is_order => $form->{type} =~ /_order/,
+    is_order => scalar($form->{type} =~ /_order/),
   });
 
   $main::lxdebug->leave_sub();
index 44c290b..c8924ef 100644 (file)
@@ -222,7 +222,8 @@ global_level = NONE
 # default.
 watch_form = 0
 
-# Include menu options for debugging in the HTML menu
+# Include menu options for debugging in the HTML menu. Works only in
+# FastCGI mode.
 show_debug_menu = 0
 
 # If you want to debug the creation of LaTeX files then set this to 1.
diff --git a/css/frame_header/header.css b/css/frame_header/header.css
new file mode 100644 (file)
index 0000000..cfca081
--- /dev/null
@@ -0,0 +1,26 @@
+body {
+  margin: 0;
+  color: white;
+  background: url('../../image/fade.png') repeat-x;
+}
+
+a:link, a:visited, a:hover, a:active {
+  color: white;
+}
+
+body > * {
+  font-size: 12px;
+  font-family: verdana,arial,sans-serif;
+  vertical-align: middle;
+}
+
+table {
+  border: 0;
+  width: 100%;
+  background: url('../../image/bg_titel.gif');
+  border-spacing: 0;
+}
+
+td {
+  padding: 0;
+}
index eefcecb..b767552 100644 (file)
@@ -44,6 +44,7 @@
   - Bugfix 1633: Stammdatenaufruf aus SEPA-Modul
   - Bugfix 1575: Kundenrabatt geht verloren
   - Bugfix 1647: Lieferanten-Einkaufspreise verlieren Nachkommastellen
+  - Bugfix 1630: Rabatt wird auf der Rechnung auch auf nicht rabattierfähige Artikel gewährt
 
 2011-02-02 - Release 2.6.2
 
index 18a9e3c..bab8b42 100644 (file)
@@ -1,18 +1,19 @@
 == Lx-Office Konfigurationsdatei ab Version 2.6.3 ==
 
-Seit Lx-Office 2.6.3. findet sich die Hauptconfigurationsdatei von Lx-Office in
-der Datei config/lx_office.conf.
+Seit Lx-Office 2.6.3. gibt es nur noch eine Konfigurationsdatei die benötigt wird -  die: config/lx_office.conf.
 
-Diese muß bei der Erstinstallation von Lx-Office (oder Migration von älteren
-Versionen) angelegt werden, als Vorlage dient die Datei
-config/lx_office.conf.default. Die Datei lx_office.conf ist eine
-installationsspezifische Datei, enthält z.B. die wichtigsten Passwörter der
-lokalen Installation, und findet sich auch nicht im Git Repository.  Diese
-Konfigurationsdatei ist unabhängig von den verschiedenen Mandanten, die auf der
-Installation laufen.
+Diese muß bei der Erstinstallation von Lx-Office (oder Migration von älteren Versionen) angelegt werden.
+Als Vorlage dient die Datei config/lx_office.conf.default. 
 
-Die Konfigurationsdatei besteht aus mehreren Teilen, die entsprechend
-kommentiert sind:
+ $ cp config/lx_office.conf.default config/lx_office.conf
+
+Diese Datei (lx_office.conf) ist dann eine installationsspezifische Datei, 
+d.h. sie enthält bspw. lokale Passwörter und wird auch nicht im Versionsmanagement (git) verwaltet.
+
+Die Konfiguration ist ferner serverabhängig, d.h. für alle Mandaten, bzw. Datenbanken gleich.
+
+
+Die Konfigurationsdatei besteht aus mehreren Teilen, die entsprechend kommentiert sind:
 
 * authentication
 * authentication/database
@@ -28,8 +29,7 @@ kommentiert sind:
 * console
 * debug
 
-Die üblicherweise wichtigsten Parameter, die am Anfang einzustellen oder zu
-kontrollieren sind, sind:
+Die üblicherweise wichtigsten Parameter, die am Anfang einzustellen oder zu kontrollieren sind, sind:
 
 [authentication]
 admin_password = geheim
index d0bf2ac..ec22426 100644 (file)
@@ -1,6 +1,3 @@
-/* This is used in bin/mozilla/kopf.pl to switch the HTML side menu on/off
-   2010, Sven Donath, lxo@dexo.de  */
-
 var vSwitch_Menu = 1;
 var FrameSize = (parent.document.getElementById('menuframe').cols);
 
index 3eeba99..b3beb5e 100644 (file)
@@ -927,6 +927,7 @@ $self->{texts} = {
   'Konten'                      => 'Konten',
   'Kontonummernerweiterung (KNE)' => 'Kontonummernerweiterung (KNE)',
   'L'                           => 'L',
+  'LANGUAGES'                   => '',
   'LIABILITIES'                 => 'PASSIVA',
   'LP'                          => 'LP',
   'LaTeX Templates'             => 'LaTeX-Vorlagen',
@@ -1921,6 +1922,7 @@ $self->{texts} = {
   'Weight unit'                 => 'Gewichtseinheit',
   'What <b>term</b> you are looking for?' => 'Nach welchem <b>Begriff</b> wollen Sie suchen?',
   'What type of item is this?'  => 'Was ist dieser Artikel?',
+  'Which is located at doc/konfigurationsdatei.txt. Click here: ' => 'Zu finden in doc/konfigurationsdatei.txt. Oder hier klicken: ',
   'With Extension Of Time'      => 'mit Dauerfristverlängerung',
   'Workflow Delivery Order'     => 'Workflow Lieferschein',
   'Workflow purchase_order'     => 'Workflow Lieferantenauftrag',
index 190433f..52b8bb4 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
-for i in am dispatcher kopf login; do
+for i in am dispatcher login; do
        rm $i.pl 2> /dev/null
        ln -s admin.pl $i.pl
 done
-for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do 
+for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do
        rm $i.pl 2> /dev/null
        ln -s am.pl $i.pl
 done
index 3b6c94e..6e147cf 100644 (file)
  <p>
   [%- LxERP.t8('You can find information on the migration in the upgrade documentation.') %]
  </p>
+  <p>
+
+  [%- LxERP.t8('Which is located at doc/konfigurationsdatei.txt. Click here: ') %] <a href ="doc/konfigurationsdatei.txt">doc/konfigurationsdatei.txt</a>
+</p>
 
  <p>
   <a href="login.pl">[%- LxERP.t8('Back to login') %]</a>
index 359c940..4c2cbdd 100644 (file)
@@ -1,12 +1,5 @@
 [%- USE T8 %]
-<style type='text/css'>
-  body { margin: 0; color: white; background: url('image/fade.png') repeat-x; }
-  a:link, a:visited, a:hover, a:active { color:white }
-  body > * { font-size: 12px; font-family:verdana,arial,sans-serif; vertical-align:middle; }
-  table { border:0; width: 100%; background: url('image/bg_titel.gif'); border-spacing:0; }
-  td { padding: 0 }
-</style>
-<script language='javascript' src='js/switchmenuframe.js'></script>
+<script language="javascript" src="js/switchmenuframe.js"></script>
 <body>
  <table>
   <tr>
     [<a href="Javascript:top.main_window.history.forward();" title="[% 'Go one step forward' | $T8 %]">[% 'Fwd' | $T8 %]</a>]
    </td>
 [%- END %]
-[% IF show_debug %]
+[% IF is_fastcgi && LXCONFIG.debug.show_debug_menu %]
    <td align='center' nowrap>
     Debug:
     [<a href='controller.pl?action=DebugMenu/reload']>FCGI Reload</a>]
-    [<a href='controller.pl?action=DebugMenu/toggle&level=request_timer'>[% IF lxdebug.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>]
-    [<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF lxdebug.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>]
-    [<a href='controller.pl?action=DebugMenu/toggle&level=query'>[% IF lxdebug.level_by_name('query') %]<b>Query</b>[% ELSE %]Query[% END %]</a>]
+    [<a href='controller.pl?action=DebugMenu/toggle&level=request_timer'>[% IF LXDEBUG.level_by_name('request_timer') %]<b>Timing</b>[% ELSE %]Timing[% END %]</a>]
+    [<a href='controller.pl?action=DebugMenu/toggle&level=trace'>[% IF LXDEBUG.level_by_name('trace') %]<b>Trace</b>[% ELSE %]Trace[% END %]</a>]
+    [<a href='controller.pl?action=DebugMenu/toggle&level=query'>[% IF LXDEBUG.level_by_name('query') %]<b>Query</b>[% ELSE %]Query[% END %]</a>]
    </td>
 [%- END %]
    <td align="right" nowrap>