projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
is: Payment_terms und duedate ajax gefixt.
[kivitendo-erp.git]
/
SL
/
DN.pm
diff --git
a/SL/DN.pm
b/SL/DN.pm
index
bd4b509
..
e1a6342
100644
(file)
--- a/
SL/DN.pm
+++ b/
SL/DN.pm
@@
-41,6
+41,8
@@
use SL::Mailer;
use SL::MoreCommon;
use SL::Template;
use SL::MoreCommon;
use SL::Template;
+use strict;
+
sub get_config {
$main::lxdebug->enter_sub();
sub get_config {
$main::lxdebug->enter_sub();
@@
-457,7
+459,7
@@
sub get_invoices {
push(@values, $form->{minamount});
}
push(@values, $form->{minamount});
}
- $query =
+
my
$query =
qq|SELECT id
FROM dunning_config
WHERE dunning_level = (SELECT MAX(dunning_level) FROM dunning_config)|;
qq|SELECT id
FROM dunning_config
WHERE dunning_level = (SELECT MAX(dunning_level) FROM dunning_config)|;
@@
-512,7
+514,7
@@
sub get_invoices {
$form->{DUNNINGS} = [];
$form->{DUNNINGS} = [];
- while (my $ref = $sth->fetchrow_hashref(
NAME_lc
)) {
+ while (my $ref = $sth->fetchrow_hashref(
"NAME_lc"
)) {
next if ($ref->{pastdue} < $ref->{terms});
$ref->{interest} = $form->round_amount($ref->{interest}, 2);
next if ($ref->{pastdue} < $ref->{terms});
$ref->{interest} = $form->round_amount($ref->{interest}, 2);
@@
-537,7
+539,7
@@
sub get_dunning {
# connect to database
my $dbh = $form->dbconnect($myconfig);
# connect to database
my $dbh = $form->dbconnect($myconfig);
- $where = qq| WHERE (da.trans_id = a.id)|;
+
my
$where = qq| WHERE (da.trans_id = a.id)|;
my @values;
my @values;
@@
-663,9
+665,10
@@
sub melt_pdfs {
$form->error($main::locale->text('Could not spawn the printer command.')) unless $out;
} else {
$form->error($main::locale->text('Could not spawn the printer command.')) unless $out;
} else {
+ my $dunning_filename = $form->get_formname_translation('dunning');
$out = IO::File->new('>-');
$out->print(qq|Content-Type: Application/PDF\n| .
$out = IO::File->new('>-');
$out->print(qq|Content-Type: Application/PDF\n| .
- qq|Content-Disposition: attachment; filename="
dunning
_${dunning_id}.pdf"\n\n|);
+ qq|Content-Disposition: attachment; filename="
${dunning_filename}
_${dunning_id}.pdf"\n\n|);
}
while (my $line = <$in>) {
}
while (my $line = <$in>) {
@@
-712,7
+715,7
@@
sub print_dunning {
my $sth = prepare_execute_query($form, $dbh, $query, $dunning_id);
my $first = 1;
my $sth = prepare_execute_query($form, $dbh, $query, $dunning_id);
my $first = 1;
- while (my $ref = $sth->fetchrow_hashref(
NAME_lc
)) {
+ while (my $ref = $sth->fetchrow_hashref(
"NAME_lc"
)) {
if ($first) {
$form->{TEMPLATE_ARRAYS} = {};
map({ $form->{TEMPLATE_ARRAYS}->{"dn_$_"} = []; } keys(%{$ref}));
if ($first) {
$form->{TEMPLATE_ARRAYS} = {};
map({ $form->{TEMPLATE_ARRAYS}->{"dn_$_"} = []; } keys(%{$ref}));
@@
-737,7
+740,7
@@
sub print_dunning {
LEFT JOIN contacts co ON (ar.cp_id = co.cp_id)
WHERE (d.dunning_id = ?)
LIMIT 1|;
LEFT JOIN contacts co ON (ar.cp_id = co.cp_id)
WHERE (d.dunning_id = ?)
LIMIT 1|;
- $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
+
my
$ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
map { $form->{$_} = $ref->{$_} } keys %{ $ref };
$query =
map { $form->{$_} = $ref->{$_} } keys %{ $ref };
$query =
@@
-832,7
+835,7
@@
sub print_invoice_for_fees {
FROM ar
LEFT JOIN customer c ON (ar.customer_id = c.id)
WHERE ar.id = ?|;
FROM ar
LEFT JOIN customer c ON (ar.customer_id = c.id)
WHERE ar.id = ?|;
- $ref = selectfirst_hashref_query($form, $dbh, $query, $ar_id);
+
my
$ref = selectfirst_hashref_query($form, $dbh, $query, $ar_id);
map { $form->{$_} = $ref->{$_} } keys %{ $ref };
$query = qq|SELECT * FROM employee WHERE login = ?|;
map { $form->{$_} = $ref->{$_} } keys %{ $ref };
$query = qq|SELECT * FROM employee WHERE login = ?|;