shop = '$form->{shop}',
ve = '$form->{ve}',
gv = '$form->{gv}',
+ ean = '$form->{ean}',
not_discountable = '$form->{not_discountable}',
microfiche = '$form->{microfiche}',
partsgroup_id = $partsgroup_id
}
}
+ if ($form->{ean}) {
+ $var = $form->like(lc $form->{ean});
+ $where .= " AND lower(ean) LIKE '$var'";
+ }
+
if ($form->{searchitems} eq 'part') {
$where .= " AND p.inventory_accno_id > 0";
}
}
$sth->finish;
- if ($form->{id}) {
- $query = qq|SELECT weightunit
- FROM defaults|;
+ if (!$form->{id}) {
+ $query = qq|SELECT current_date FROM defaults|;
$sth = $dbh->prepare($query);
$sth->execute || $form->dberror($query);
- ($form->{weightunit}) = $sth->fetchrow_array;
- $sth->finish;
-
- } else {
- $query = qq|SELECT weightunit, current_date
- FROM defaults|;
- $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
-
- ($form->{weightunit}, $form->{priceupdate}) = $sth->fetchrow_array;
+ ($form->{priceupdate}) = $sth->fetchrow_array;
$sth->finish;
}
} else {
$transdate = $form->{deliverydate};
}
+ } elsif ($form->{type} eq "credit_note") {
+ $transdate = $form->{invdate};
} else {
$transdate = $form->{transdate};
}
if (!$ref) {
$dbh->disconnect();
- return $lxdebug->leave_sub();
+ return $main::lxdebug->leave_sub();
}
$ref->{"inventory_accno_id"} = undef unless ($ref->{"is_part"});
$ref = $sth->fetchrow_hashref();
$sth->finish();
$dbh->disconnect();
-
+
unless ($ref) {
$main::lxdebug->leave_sub();
return;
# " || taxaccounts_$index " . $form->{"taxaccounts_$index"} .
# " || taxaccounts " . $form->{"taxaccounts"});
- $sth->finish();
-
$main::lxdebug->leave_sub();
}
1;