$main::lxdebug->leave_sub();
}
-sub add_price_factor {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text('Add Price Factor');
- $form->{callback} ||= build_std_url('action=add_price_factor');
-
- $form->header();
- print $form->parse_html_template('am/edit_price_factor');
-
- $main::lxdebug->leave_sub();
-}
-
-sub edit_price_factor {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text('Edit Price Factor');
- $form->{callback} ||= build_std_url('action=add_price_factor');
-
- AM->get_price_factor(\%myconfig, $form);
-
- $form->{factor} = $form->format_amount(\%myconfig, $form->{factor} * 1);
-
- $form->header();
- print $form->parse_html_template('am/edit_price_factor');
-
- $main::lxdebug->leave_sub();
-}
-
-sub list_price_factors {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->get_all_price_factors(\%myconfig, \%$form);
-
- foreach my $current (@{ $form->{PRICE_FACTORS} }) {
- $current->{factor} = $form->format_amount(\%myconfig, $current->{factor} * 1);
- }
-
- $form->{callback} = build_std_url('action=list_price_factors');
- $form->{title} = $locale->text('Price Factors');
- $form->{url_base} = build_std_url('callback');
-
- $form->header();
- print $form->parse_html_template('am/list_price_factors');
-
- $main::lxdebug->leave_sub();
-}
-
-sub save_price_factor {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->isblank("description", $locale->text('Description missing!'));
- $form->isblank("factor", $locale->text('Factor missing!'));
-
- $form->{factor} = $form->parse_amount(\%myconfig, $form->{factor});
-
- AM->save_price_factor(\%myconfig, $form);
-
- $form->{callback} .= '&MESSAGE=' . $form->escape($locale->text('Price factor saved!')) if ($form->{callback});
-
- $form->redirect($locale->text('Price factor saved!'));
-
- $main::lxdebug->leave_sub();
-}
-
-sub delete_price_factor {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->delete_price_factor(\%myconfig, \%$form);
-
- $form->{callback} .= '&MESSAGE=' . $form->escape($locale->text('Price factor deleted!')) if ($form->{callback});
-
- $form->redirect($locale->text('Price factor deleted!'));
-
- $main::lxdebug->leave_sub();
-}
-
sub add_warehouse {
$main::lxdebug->enter_sub();