X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/eda8d185d9230b47f2795978c68bdc55a8bea438..1ec0f541eb70afb7b2058acf9d6847e6e6e21dff:/SL/Form.pm
diff --git a/SL/Form.pm b/SL/Form.pm
index 050614d56..70d3a6550 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -501,12 +501,13 @@ sub header {
push @header, "";
}
- push @header, map { qq|| } $self->use_stylesheet;
+ push @header, map { qq|| } $self->use_stylesheet;
push @header, "" if $self->{landscape};
push @header, "" if -f $self->{favicon};
push @header, map { qq|| }
qw(jquery common jscalendar/calendar jscalendar/lang/calendar-de jscalendar/calendar-setup part_selection jquery-ui jqModal switchmenuframe);
+ push @header, $self->{javascript} if $self->{javascript};
push @header, map { qq|| }
qw(main menu tabcontent list_accounts jquery.autocomplete jquery.multiselect2side frame_header/header ui-lightness/jquery-ui-1.8.12.custom);
push @header, map { qq|| }
@@ -594,7 +595,7 @@ sub set_standard_title {
$::lxdebug->enter_sub;
my $self = shift;
- $self->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $self->{version}";
+ $self->{titlebar} = "kivitendo " . $::locale->text('Version') . " $self->{version}";
$self->{titlebar} .= "- $::myconfig{name}" if $::myconfig{name};
$self->{titlebar} .= "- $::myconfig{dbname}" if $::myconfig{name};
@@ -1113,10 +1114,10 @@ sub parse_template {
$suffix = $self->{IN};
$suffix =~ s/.*\.//;
($temp_fh, $self->{tmpfile}) = File::Temp::tempfile(
- 'lx-office-printXXXXXX',
+ 'kivitendo-printXXXXXX',
SUFFIX => '.' . ($suffix || 'tex'),
DIR => $userspath,
- UNLINK => 1,
+ UNLINK => ($::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files})? 0 : 1,
);
close $temp_fh;
@@ -1994,8 +1995,17 @@ sub get_duedate {
$reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date';
my $dbh = $self->get_standard_dbh($myconfig);
+ my $payment_id;
+
+ if($self->{payment_id}) {
+ $payment_id = $self->{payment_id};
+ } elsif($self->{vendor_id}) {
+ my $query = 'SELECT payment_id FROM vendor WHERE id = ?';
+ ($payment_id) = selectrow_query($self, $dbh, $query, $self->{vendor_id});
+ }
+
my $query = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|;
- my ($duedate) = selectrow_query($self, $dbh, $query, $self->{payment_id});
+ my ($duedate) = selectrow_query($self, $dbh, $query, $payment_id);
$main::lxdebug->leave_sub();
@@ -2566,7 +2576,8 @@ sub all_vc {
# setup sales contacts
$query = qq|SELECT e.id, e.name
FROM employee e
- WHERE (e.sales = '1') AND (NOT e.id = ?)|;
+ WHERE (e.sales = '1') AND (NOT e.id = ?)
+ ORDER BY name|;
$self->{all_employees} = selectall_hashref_query($self, $dbh, $query, $self->{employee_id});
# this is for self
@@ -2574,11 +2585,6 @@ sub all_vc {
{ id => $self->{employee_id},
name => $self->{employee} });
- # sort the whole thing
- @{ $self->{all_employees} } =
- sort { $a->{name} cmp $b->{name} } @{ $self->{all_employees} };
-
-
# prepare query for departments
$query = qq|SELECT id, description
FROM department