my %column_defs = (
'id' => { 'text' => $locale->text('ID'), },
"$form->{db}number" => { 'text' => $locale->text('Number'), },
- 'name' => { 'text' => $locale->text('Name'), },
+ 'name' => { 'text' => $form->{IS_CUSTOMER} ? $::locale->text('Customer Name') : $::locale->text('Vendor Name'), },
'contact' => { 'text' => $locale->text('Contact'), },
'phone' => { 'text' => $locale->text('Phone'), },
'fax' => { 'text' => $locale->text('Fax'), },
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- $form->get_lists("employees" => "ALL_EMPLOYEES",
- "taxzones" => "ALL_TAXZONES");
+ $form->get_lists(employees => "ALL_EMPLOYEES",
+ taxzones => "ALL_TAXZONES");
$form->get_pricegroup(\%myconfig, { all => 1 });
+ $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter;
+
$form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES};
$form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
$form->{is_admin} = $myconfig{role} eq 'admin';
}
# /saving the history
&edit;
- exit;
+
$main::lxdebug->leave_sub();
+ ::end_of_request();
}
sub delete {
my %myconfig = %main::myconfig;
CT->get_shipto(\%myconfig, \%$form);
- print $form->ajax_response_header(), join '__pjx__', map $form->{"shipto$_"},
- qw(name department_1 department_2 street zipcode city country contact phone fax email used);
+ print $form->ajax_response_header(), join('__pjx__', map($form->{"shipto$_"}, qw(name department_1 department_2 street zipcode city country contact phone fax email used)));
$main::lxdebug->leave_sub();
}
sub get_delivery {
- $main::lxdebug->enter_sub();
+ $::lxdebug->enter_sub;
- $main::auth->assert('customer_vendor_edit');
+ $::auth->assert('customer_vendor_edit');
+ $::auth->assert('sales_all_edit');
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- CT->get_delivery(\%myconfig, \%$form );
- $form->{IS_CUSTOMER} = $form->{db} eq 'customer';
+ CT->get_delivery(\%::myconfig, $::form );
- print $form->ajax_response_header(), $form->parse_html_template('ct/get_delivery');
+ print $::form->ajax_response_header,
+ $::form->parse_html_template('ct/get_delivery', {
+ is_customer => $::form->{db} eq 'customer',
+ });
- $main::lxdebug->leave_sub();
+ $::lxdebug->leave_sub;
}
sub delete_shipto {