projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Taxbird-export: Mit Heuristik versuchen PLZ und Stadt aus dem Firmenadressfeld zu...
[kivitendo-erp.git]
/
SL
/
BP.pm
diff --git
a/SL/BP.pm
b/SL/BP.pm
index
9365d23
..
e2b7a2a
100644
(file)
--- a/
SL/BP.pm
+++ b/
SL/BP.pm
@@
-36,6
+36,8
@@
package BP;
use SL::DBUtils;
use SL::DBUtils;
+use strict;
+
sub get_vc {
$main::lxdebug->enter_sub();
sub get_vc {
$main::lxdebug->enter_sub();
@@
-45,7
+47,6
@@
sub get_vc {
my $dbh = $form->dbconnect($myconfig);
my %arap = (invoice => 'ar',
my $dbh = $form->dbconnect($myconfig);
my %arap = (invoice => 'ar',
- packing_list => 'ar',
sales_order => 'oe',
purchase_order => 'oe',
sales_quotation => 'oe',
sales_order => 'oe',
purchase_order => 'oe',
sales_quotation => 'oe',
@@
-56,7
+57,7
@@
sub get_vc {
my $vc = $form->{vc} eq "customer" ? "customer" : "vendor";
my $arap_type = defined($arap{$form->{type}}) ? $arap{$form->{type}} : 'ar';
my $vc = $form->{vc} eq "customer" ? "customer" : "vendor";
my $arap_type = defined($arap{$form->{type}}) ? $arap{$form->{type}} : 'ar';
- $query =
+
my
$query =
qq|SELECT count(*) | .
qq|FROM (SELECT DISTINCT ON (vc.id) vc.id FROM $vc vc, $arap_type a, status s | .
qq| WHERE a.${vc}_id = vc.id AND s.trans_id = a.id AND s.formname = ? | .
qq|SELECT count(*) | .
qq|FROM (SELECT DISTINCT ON (vc.id) vc.id FROM $vc vc, $arap_type a, status s | .
qq| WHERE a.${vc}_id = vc.id AND s.trans_id = a.id AND s.formname = ? | .
@@
-72,11
+73,11
@@
sub get_vc {
qq|WHERE a.${vc}_id = vc.id AND s.trans_id = a.id AND s.formname = ? | .
qq| AND s.spoolfile IS NOT NULL|;
qq|WHERE a.${vc}_id = vc.id AND s.trans_id = a.id AND s.formname = ? | .
qq| AND s.spoolfile IS NOT NULL|;
- $sth = $dbh->prepare($query);
+
my
$sth = $dbh->prepare($query);
$sth->execute($form->{type}) || $form->dberror($query . " ($form->{type})");
$form->{"all_${vc}"} = [];
$sth->execute($form->{type}) || $form->dberror($query . " ($form->{type})");
$form->{"all_${vc}"} = [];
- while (my $ref = $sth->fetchrow_hashref(
NAME_lc
)) {
+ while (my $ref = $sth->fetchrow_hashref(
"NAME_lc"
)) {
push @{ $form->{"all_${vc}"} }, $ref;
}
$sth->finish;
push @{ $form->{"all_${vc}"} }, $ref;
}
$sth->finish;
@@
-103,7
+104,7
@@
sub payment_accounts {
$sth->execute($form->{type}) || $form->dberror($query . " ($form->{type})");
$form->{accounts} = [];
$sth->execute($form->{type}) || $form->dberror($query . " ($form->{type})");
$form->{accounts} = [];
- while (my $ref = $sth->fetchrow_hashref(
NAME_lc
)) {
+ while (my $ref = $sth->fetchrow_hashref(
"NAME_lc"
)) {
push @{ $form->{accounts} }, $ref;
}
push @{ $form->{accounts} }, $ref;
}
@@
-181,7
+182,7
@@
sub get_spoolfiles {
}
}
}
}
- if ($form->{type} =~ /(invoice|sales_order|sales_quotation|p
acking_list|p
uchase_order|request_quotation)$/) {
+ if ($form->{type} =~ /(invoice|sales_order|sales_quotation|puchase_order|request_quotation)$/) {
if ($form->{transdatefrom}) {
$query .= " AND a.transdate >= ?";
push(@values, $form->{transdatefrom});
if ($form->{transdatefrom}) {
$query .= " AND a.transdate >= ?";
push(@values, $form->{transdatefrom});
@@
-192,7
+193,7
@@
sub get_spoolfiles {
}
}
}
}
- my @a = (
transdate, $invnumber, name
);
+ my @a = (
"transdate", $invnumber, "name"
);
my $sortorder = join ', ', $form->sort_columns(@a);
if (grep({ $_ eq $form->{sort} }
my $sortorder = join ', ', $form->sort_columns(@a);
if (grep({ $_ eq $form->{sort} }
@@
-207,7
+208,7
@@
sub get_spoolfiles {
$form->dberror($query . " (" . join(", ", @values) . ")");
$form->{SPOOL} = [];
$form->dberror($query . " (" . join(", ", @values) . ")");
$form->{SPOOL} = [];
- while (my $ref = $sth->fetchrow_hashref(
NAME_lc
)) {
+ while (my $ref = $sth->fetchrow_hashref(
"NAME_lc"
)) {
push @{ $form->{SPOOL} }, $ref;
}
push @{ $form->{SPOOL} }, $ref;
}
@@
-279,7
+280,7
@@
sub print_spool {
open(OUT, $output) or $form->error("$output : $!");
$form->{"spoolfile_$i"} =~ s|.*/||;
open(OUT, $output) or $form->error("$output : $!");
$form->{"spoolfile_$i"} =~ s|.*/||;
- $spoolfile = qq|$spool/$form->{"spoolfile_$i"}|;
+
my
$spoolfile = qq|$spool/$form->{"spoolfile_$i"}|;
# send file to printer
open(IN, $spoolfile) or $form->error("$spoolfile : $!");
# send file to printer
open(IN, $spoolfile) or $form->error("$spoolfile : $!");