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);
sub action_reload {
my ($self, %params) = @_;
- print $::cgi->redirect('kopf.pl');
+ print $::cgi->redirect('controller.pl?action=FrameHeader/header');
exit;
}
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;
}
--- /dev/null
+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;
$::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);
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;
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};
# 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
=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
=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
push(@ { $form->{AJAX} }, $pjx);
- $form->{stylesheets} = "list_accounts.css";
+ $form->use_stylesheet("list_accounts.css");
$form->{title} = $locale->text('Chart of Accounts');
$form->header;
&& ($form->{"description_$i"} eq "")) {
$form->{rowcount}--;
$form->{"discount_$i"} = "";
+ $form->{"not_discountable_$i"} = "";
display_form();
} else {
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);
}
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}";
}
+++ /dev/null
-#!/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;
-
-#
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">
print $form->parse_html_template('oe/search', {
%myconfig,
- is_order => $form->{type} =~ /_order/,
+ is_order => scalar($form->{type} =~ /_order/),
});
$main::lxdebug->leave_sub();
# 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.
--- /dev/null
+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;
+}
- 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
== 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
* 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
-/* 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);
'Konten' => 'Konten',
'Kontonummernerweiterung (KNE)' => 'Kontonummernerweiterung (KNE)',
'L' => 'L',
+ 'LANGUAGES' => '',
'LIABILITIES' => 'PASSIVA',
'LP' => 'LP',
'LaTeX Templates' => 'LaTeX-Vorlagen',
'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',
#!/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
<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>
[%- 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>