use SL::Common;
use SL::DBUtils;
use SL::DO;
+use SL::GenericTranslations;
use SL::MoreCommon;
use List::Util qw(min);
: "current_date";
# get vendor
- @values = ();
+ my @values = ();
+ my $where = '';
if ($vid) {
$where .= 'AND v.id = ?';
push @values, $vid;
}
my $query =
qq|SELECT
- v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
+ v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
v.creditlimit, v.terms, v.notes AS intnotes,
v.email, v.cc, v.bcc, v.language_id, v.payment_id,
v.street, v.zipcode, v.city, v.country, v.taxzone_id,
$where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|;
push @values, $form->{"partnumber_$i"};
}
-
+
if ($form->{"description_$i"}) {
$where .= " ORDER BY p.description";
} else {
'trans_id' => $form->{vendor_id});
map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables };
+ $form->{cp_greeting} = GenericTranslations->get('dbh' => $dbh,
+ 'translation_type' => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'),
+ 'allow_fallback' => 1);
+
$dbh->disconnect();
$main::lxdebug->leave_sub();