$query = qq|SELECT id, description FROM business ORDER BY id|;
$form->{all_business} = selectall_hashref_query($form, $dbh, $query);
- # get tax zones
- $query = qq|SELECT id, description FROM tax_zones|;
- $form->{TAXZONE} = selectall_hashref_query($form, $dbh, $query);
-
# get shipto address
$query =
qq|SELECT shipto_id, shiptoname, shiptodepartment_1 | .
conv_i($form->{salesman_id}),
conv_i($form->{language_id}),
conv_i($form->{payment_id}),
- conv_i($form->{taxzone_id}),
+ conv_i($form->{taxzone_id}, 0),
$form->{user_password},
$form->{c_vendor_id},
conv_i($form->{klass}),
$form->{obsolete} ? 't' : 'f',
$form->{ustid},
conv_i($form->{payment_id}),
- conv_i($form->{taxzone_id}),
+ conv_i($form->{taxzone_id}, 0),
conv_i( $form->{language_id}),
$form->{username},
$form->{user_password},
$sortorder =
$form->{sort} && $allowed_sort_columns{$form->{sort}} ?
$form->{sort} : "name";
+ $form->{sort} = $sortorder;
$sortorder = "country,city,street" if ($sortorder eq "address");
if ($form->{"${cv}number"}) {
$form->{l_invnumber} = $form->{l_ordnumber} = $form->{l_quonumber} = "";
}
+ if ($form->{obsolete} eq "Y") {
+ $where .= qq| AND obsolete|;
+ } elsif ($form->{obsolete} eq "N") {
+ $where .= qq| AND NOT obsolete|;
+ }
+
+ if ($form->{business_id}) {
+ $where .= qq| AND (business_id = ?)|;
+ push(@values, conv_i($form->{business_id}));
+ }
+
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| invoice.description, invoice.unit | .
+ qq| i.description, i.unit, i.sellprice | .
qq|FROM $arap | .
qq|LEFT JOIN shipto s ON | .
($arap eq "ar"