use SL::Common;
use SL::CVar;
use SL::DBUtils;
+use SL::DB::Default;
use SL::FU;
use SL::Notes;
use SL::TransNumber;
qq|c_vendor_id = ?, | .
qq|klass = ?, | .
qq|currency_id = (SELECT id FROM currencies WHERE name = ?), | .
- qq|taxincluded_checked = ? | .
+ qq|taxincluded_checked = ?, | .
+ qq|delivery_term_id = ? | .
qq|WHERE id = ?|;
my @values = (
$form->{customernumber},
conv_i($form->{klass}),
$form->{currency},
$form->{taxincluded_checked} ne '' ? $form->{taxincluded_checked} : undef,
+ conv_i($form->{delivery_term_id}),
$form->{id}
);
do_query( $form, $dbh, $query, @values );
qq| username = ?, | .
qq| user_password = ?, | .
qq| v_customer_id = ?, | .
- qq| currency_id = (SELECT id FROM currencies WHERE name = ?) | .
+ qq| currency_id = (SELECT id FROM currencies WHERE name = ?), | .
+ qq| delivery_term_id = ? | .
qq|WHERE id = ?|;
my @values = (
$form->{vendornumber},
$form->{user_password},
$form->{v_customer_id},
$form->{currency},
+ conv_i($form->{delivery_term_id}),
$form->{id}
);
do_query($form, $dbh, $query, @values);
"zipcode" => "ct.zipcode",
"city" => "ct.city",
"country" => "ct.country",
+ "discount" => "ct.discount",
"salesman" => "e.name"
);
}
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
- if ($sortorder !~ /(business|id)/ && !$join_records) {
+ if ($sortorder !~ /(business|id|discount)/ && !$join_records) {
$sortorder = "lower($sortorder) ${sortdir}";
} else {
$sortorder .= " ${sortdir}";
my ($self, $myconfig, $form) = @_;
my $locale = $main::locale;
+ my $defaults = SL::DB::Default->get;
+ $form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates;
+ $form->{templates} = $defaults->templates;
+
$form->{formname} = 'sales_quotation';
$form->{type} = 'sales_quotation';
$form->{format} = 'excel';
$form->{notes} =~ s/^\s+//g;
- $form->{templates} = $myconfig->{templates};
-
delete $form->{printer_command};
$form->get_employee_info($myconfig);