X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=537372a7cd2b759b5d3f1224e37a3b483c25ba96;hb=4311578257aa2e5808580def7e80a38d493646b0;hp=4586677687e61485cbddcc4d8358a3d3c583ba10;hpb=e1e19a485c7092c6675b2a80bdf799edbaf7be3d;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 458667768..537372a7c 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -508,9 +508,9 @@ sub parse_html_template { $additional_params->{"myconfig_jsc_dateformat"} = $jsc_dateformat; } - $additional_params->{"conf_jscalendar"} = $main::jscalendar; - $additional_params->{"conf_lizenzen"} = $main::lizenzen; - $additional_params->{"conf_latex_templates"} = $main::latex; + $additional_params->{"conf_webdav"} = $main::webdav; + $additional_params->{"conf_lizenzen"} = $main::lizenzen; + $additional_params->{"conf_latex_templates"} = $main::latex; $additional_params->{"conf_opendocument_templates"} = $main::opendocument_templates; my @additional_param_names = keys(%{$additional_params}); @@ -1520,10 +1520,7 @@ sub _get_shipto { $key = "all_shipto" unless ($key); # get shipping addresses - my $query = - qq|SELECT shipto_id, shiptoname, shiptodepartment_1 | . - qq|FROM shipto | . - qq|WHERE trans_id = ?|; + my $query = qq|SELECT * FROM shipto WHERE trans_id = ?|; $self->{$key} = selectall_hashref_query($self, $dbh, $query, $vc_id); @@ -1704,6 +1701,20 @@ sub _get_vendors { $main::lxdebug->leave_sub(); } +sub _get_departments { + $main::lxdebug->enter_sub(); + + my ($self, $dbh, $key) = @_; + + $key = "all_departments" unless ($key); + + my $query = qq|SELECT * FROM department|; + + $self->{$key} = selectall_hashref_query($self, $dbh, $query); + + $main::lxdebug->leave_sub(); +} + sub get_lists { $main::lxdebug->enter_sub(); @@ -1778,6 +1789,10 @@ sub get_lists { $self->_get_payments($dbh, $params{"payments"}); } + if($params{"departments"}) { + $self->_get_departments($dbh, $params{"departments"}); + } + $dbh->disconnect(); $main::lxdebug->leave_sub(); @@ -2463,10 +2478,9 @@ sub save_history { sub get_history { $main::lxdebug->enter_sub(); - my $self = shift(); - my $dbh = shift(); - my $trans_id = shift(); - my $restriction = shift(); + my ($self, $dbh, $trans_id, $restriction, $order) = @_; + my ($orderBy, $desc) = split(/\-\-/, $order); + $order = " ORDER BY " . ($order eq "" ? " h.itime " : ($desc == 1 ? $orderBy . " DESC " : $orderBy . " ")); my @tempArray; my $i = 0; if ($trans_id ne "") { @@ -2474,7 +2488,7 @@ sub get_history { qq|SELECT h.employee_id, h.itime::timestamp(0) AS itime, h.addition, h.what_done, emp.name, h.snumbers, h.trans_id AS id | . qq|FROM history_erp h | . qq|LEFT JOIN employee emp ON (emp.id = h.employee_id) | . - qq|WHERE trans_id = ? | + qq|WHERE trans_id = ? |. $order . $restriction; my $sth = $dbh->prepare($query) || $self->dberror($query);