__PACKAGE__->run_before(
'_create_customer_vendor',
only => [
- 'new',
+ 'add',
]
);
-sub action_new {
+sub action_add {
my ($self) = @_;
$self->_pre_render();
$self->action_edit();
}
+
+sub action_search {
+ my ($self) = @_;
+
+ my $url = 'ct.pl?action=search&db='. ($self->is_vendor() ? 'vendor' : 'customer');
+
+ if ( $::form->{callback} ) {
+ $url .= '&callback='. $::from->escape($::form->{callback});
+ }
+
+ print $::form->redirect_header($url);
+}
+
+
+sub action_search_contact {
+ my ($self) = @_;
+
+ my $url = 'ct.pl?action=search_contact&db=customer';
+
+ if ( $::form->{callback} ) {
+ $url .= '&callback='. $::from->escape($::form->{callback});
+ }
+
+ print $::form->redirect_header($url);
+}
+
+
sub action_get_delivery {
my ($self) = @_;
my $curr_employee = SL::DB::Manager::Employee->current;
- foreach ( 'cv.creditlimit', 'cv.discount' ) {
- my ($namespace, $varname) = split('.', $_, 2);
- $::form->{$namespace}->{$varname} = $::form->parse_amount(\%::myconfig, $::form->{$namespace}->{$varname});
- }
- $::form->{cv}->{discount} /= 100;
-
if ( $::form->{cv}->{id} ) {
if ( $self->is_vendor() ) {
$self->{cv} = SL::DB::Vendor->new(id => $::form->{cv}->{id})->load();
$self->{template_args} = {};
- $self->{cv}->discount($self->{cv}->discount * 100);
-
-
$::request->{layout}->add_javascripts('autocomplete_customer.js');
}