qq|account_number = ?, | .
qq|bank_code = ?, | .
qq|bank = ?, | .
+ qq|iban = ?, | .
+ qq|bic = ?, | .
qq|obsolete = ?, | .
qq|direct_debit = ?, | .
qq|ustid = ?, | .
qq|taxzone_id = ?, | .
qq|user_password = ?, | .
qq|c_vendor_id = ?, | .
- qq|klass = ?, | .
- qq|v_customer_id = ? | .
+ qq|klass = ? | .
qq|WHERE id = ?|;
my @values = (
$form->{customernumber},
$form->{account_number},
$form->{bank_code},
$form->{bank},
+ $form->{iban},
+ $form->{bic},
$form->{obsolete} ? 't' : 'f',
$form->{direct_debit} ? 't' : 'f',
$form->{ustid},
$form->{user_password},
$form->{c_vendor_id},
conv_i($form->{klass}),
- $form->{v_customer_id},
$form->{id}
);
do_query( $form, $dbh, $query, @values );
qq| account_number = ?, | .
qq| bank_code = ?, | .
qq| bank = ?, | .
+ qq| iban = ?, | .
+ qq| bic = ?, | .
qq| obsolete = ?, | .
qq| direct_debit = ?, | .
qq| ustid = ?, | .
$form->{account_number},
$form->{bank_code},
$form->{bank},
+ $form->{iban},
+ $form->{bic},
$form->{obsolete} ? 't' : 'f',
$form->{direct_debit} ? 't' : 'f',
$form->{ustid},
$where .= qq| AND ($cvar_where)|;
push @values, @cvar_values;
}
- # Um nach Straße in der Berichtsmaske zu suchen ... jb 13.11.2008
- if ($form->{addr_street}) {
- $where .= qq| AND (street ILIKE ?)|;
- push @values, ('%' . $form->{addr_street} . '%');
- }
-
- # Um nach PLZ in der Berichtsmaske zu suchen ... jb 13.11.2008
- if ($form->{addr_zipcode}) {
- $where .= qq| AND (zipcode ILIKE ?)|;
- push @values, ($form->{addr_zipcode} . '%');
- }
+
+ if ($form->{addr_street}) {
+ $where .= qq| AND (street ILIKE ?)|;
+ push @values, '%' . $form->{addr_street} . '%';
+ }
+
+ if ($form->{addr_zipcode}) {
+ $where .= qq| AND (zipcode ILIKE ?)|;
+ push @values, $form->{addr_zipcode} . '%';
+ }
+
my $query =
qq|SELECT ct.*, b.description AS business | .
qq|FROM $cv ct | .
}
my $query =
qq|SELECT s.shiptoname, i.qty, | .
- qq| ${arap}.transdate, ${arap}.invnumber, ${arap}.ordnumber, | .
- qq| i.description, i.unit, i.sellprice | .
+ qq| ${arap}.id, ${arap}.transdate, ${arap}.invnumber, ${arap}.ordnumber, | .
+ qq| i.description, i.unit, i.sellprice, | .
+ qq| oe.id AS oe_id | .
qq|FROM $arap | .
qq|LEFT JOIN shipto s ON | .
($arap eq "ar"
: qq|(ap.id = s.trans_id) |) .
qq|LEFT JOIN invoice i ON (${arap}.id = i.trans_id) | .
qq|LEFT join parts p ON (p.id = i.parts_id) | .
+ qq|LEFT JOIN oe ON (oe.ordnumber = ${arap}.ordnumber AND NOT ${arap}.ordnumber = '') | .
$where .
qq|ORDER BY ${arap}.transdate DESC LIMIT 15|;
$main::lxdebug->leave_sub();
}
+sub get_bank_info {
+ $main::lxdebug->enter_sub();
+
+ my $self = shift;
+ my %params = @_;
+
+ Common::check_params(\%params, qw(vc id));
+
+ my $myconfig = \%main::myconfig;
+ my $form = $main::form;
+
+ my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig);
+
+ my $table = $params{vc} eq 'customer' ? 'customer' : 'vendor';
+ my @ids = ref $params{id} eq 'ARRAY' ? @{ $params{id} } : ($params{id});
+ my $placeholders = ('?') x scalar @ids;
+ my $query = qq|SELECT id, name, account_number, bank, bank_code, iban, bic
+ FROM ${table}
+ WHERE id IN (${placeholders})|;
+
+ my $result = selectall_hashref_query($form, $dbh, $query, map { conv_i($_) } @ids);
+
+ if (ref $params{id} eq 'ARRAY') {
+ $result = { map { $_->{id} => $_ } @{ $result } };
+ } else {
+ $result = $result->[0] || { 'id' => $params{id} };
+ }
+
+ $main::lxdebug->leave_sub();
+
+ return $result;
+}
+
1;