use SL::PE;
use SL::AM;
use Data::Dumper;
+
+sub _check_io_auth {
+ $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
+ 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' .
+ 'purchase_delivery_order_edit | sales_delivery_order_edit');
+}
+
########################################
# Eintrag fuer Version 2.2.0 geaendert #
# neue Optik im Rechnungsformular #
sub display_row {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' .
- 'sales_delivery_order_edit | purchase_delivery_order_edit');
+ _check_io_auth();
my $numrows = shift;
sub set_pricegroup {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
my $rowcount = shift;
for $j (1 .. $rowcount) {
sub select_item {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
@column_index = qw(ndx partnumber description onhand unit sellprice);
sub item_selected {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
# replace the last row with the checked row
$i = $form->{rowcount};
sub new_item {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
# change callback
$form->{old_callback} = $form->escape($form->{callback}, 1);
sub check_form {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
my @a = ();
my $count = 0;
sub invoicetotal {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
$form->{oldinvtotal} = 0;
sub validate_items {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
# check if items are valid
if ($form->{rowcount} == 1) {
sub order {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
if ($form->{second_run}) {
$form->{print_and_post} = 0;
sub quotation {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
if ($form->{second_run}) {
$form->{print_and_post} = 0;
sub edit_e_mail {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
if ($form->{second_run}) {
$form->{print_and_post} = 0;
sub send_email {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
my $callback = $form->{script} . "?action=edit";
map({ $callback .= "\&${_}=" . E($form->{$_}); } qw(type id));
sub print_options {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | dunning_edit |' .
- 'sales_delivery_order_edit | purchase_delivery_order_edit');
+ _check_io_auth();
my %options = @_;
sub print {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' .
- 'purchase_delivery_order_edit | sales_delivery_order_edit');
+ _check_io_auth();
if ($form->{print_nextsub}) {
call_sub($form->{print_nextsub});
sub print_form {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit |' .
- 'sales_delivery_order_edit | purchase_delivery_order_edit');
+ _check_io_auth();
my ($old_form) = @_;
sub customer_details {
$lxdebug->enter_sub();
+
IS->customer_details(\%myconfig, \%$form, @_);
+
$lxdebug->leave_sub();
}
sub post_as_new {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
$form->{postasnew} = 1;
map { delete $form->{$_} } qw(printed emailed queued);
sub ship_to {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
if ($form->{second_run}) {
$form->{print_and_post} = 0;
sub new_license {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
my $row = shift;
sub relink_accounts {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
$form->{"taxaccounts"} =~ s/\s*$//;
$form->{"taxaccounts"} =~ s/^\s*//;
sub set_duedate {
$lxdebug->enter_sub();
- $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' .
- 'request_quotation_edit | sales_quotation_edit | purchase_order_edit');
+ _check_io_auth();
$form->get_duedate(\%myconfig);
$result = "$form->{duedate}";
print $q->header();
print $result;
- $lxdebug->leave_sub();
+ $lxdebug->leave_sub();
}