my %access_map = (
'invoice' => 'invoice_edit',
'sales_order' => 'sales_order_edit',
my %access_map = (
'invoice' => 'invoice_edit',
'sales_order' => 'sales_order_edit',
- $lxdebug->message(0, "1");
- if (!$auth->assert('sales_order_edit', 1)) {
- $lxdebug->message(0, "2");
- $auth->assert('invoice_edit') ;
+ $main::lxdebug->message(0, "1");
+ if (!$main::auth->assert('sales_order_edit', 1)) {
+ $main::lxdebug->message(0, "2");
+ $main::auth->assert('invoice_edit') ;
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ my ($name, $account, $onload);
# setup customer/vendor selection
BP->get_vc(\%myconfig, \%$form);
# setup customer/vendor selection
BP->get_vc(\%myconfig, \%$form);
map { $name .= "<option>$_->{name}--$_->{id}\n" }
@{ $form->{"all_$form->{vc}"} };
$name = qq|<select name=$form->{vc}><option>\n$name</select>|;
map { $name .= "<option>$_->{name}--$_->{id}\n" }
@{ $form->{"all_$form->{vc}"} };
$name = qq|<select name=$form->{vc}><option>\n$name</select>|;
invoice =>
{ title => 'Sales Invoices', name => 'Customer', l_invnumber => 'Y' },
packing_list =>
invoice =>
{ title => 'Sales Invoices', name => 'Customer', l_invnumber => 'Y' },
packing_list =>
receipt => { title => 'Receipts', name => 'Customer' });
$label{invoice}{invnumber} = qq|
receipt => { title => 'Receipts', name => 'Customer' });
$label{invoice}{invnumber} = qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
- <td colspan=3><input name=invnumber size=20></td>
- </tr>
+ <tr>
+ <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
+ <td colspan=3><input name=invnumber size=20></td>
+ </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
- <td colspan=3><input name=ordnumber size=20></td>
- </tr>
+ <tr>
+ <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
+ <td colspan=3><input name=ordnumber size=20></td>
+ </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Quotation Number') . qq|</th>
- <td colspan=3><input name=quonumber size=20></td>
- </tr>
+ <tr>
+ <th align=right nowrap>| . $locale->text('Quotation Number') . qq|</th>
+ <td colspan=3><input name=quonumber size=20></td>
+ </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Reference') . qq|</th>
- <td colspan=3><input name=chknumber size=20></td>
- </tr>
+ <tr>
+ <th align=right nowrap>| . $locale->text('Reference') . qq|</th>
+ <td colspan=3><input name=chknumber size=20></td>
+ </tr>
- <tr>
- <th align=right>Kunde</th>
- <td colspan=3>$name</td>
- </tr>
- $account
- $label{$form->{type}}{invnumber}
- $label{$form->{type}}{ordnumber}
- $label{$form->{type}}{quonumber}
- $label{$form->{type}}{chknumber}
- $label{$form->{type}}{rctnumber}
- <tr>
- <th align=right nowrap>| . $locale->text('From') . qq|</th>
+ <tr>
+ <th align=right>Kunde</th>
+ <td colspan=3>$name</td>
+ </tr>
+ $account
+ $label{$form->{type}}{invnumber}
+ $label{$form->{type}}{ordnumber}
+ $label{$form->{type}}{quonumber}
+ $label{$form->{type}}{chknumber}
+ $label{$form->{type}}{rctnumber}
+ <tr>
+ <th align=right nowrap>| . $locale->text('From') . qq|</th>
next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
}
next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
}
$form->{callback} .= "&header=1" if $form->{callback};
$form->redirect($locale->text('Removed spoolfiles!'))
$form->{callback} .= "&header=1" if $form->{callback};
$form->redirect($locale->text('Removed spoolfiles!'))
assert_bp_access();
$form->get_lists(printers => 'ALL_PRINTERS');
# use the command stored in the databse or fall back to $myconfig{printer}
assert_bp_access();
$form->get_lists(printers => 'ALL_PRINTERS');
# use the command stored in the databse or fall back to $myconfig{printer}
- my $selected_printer = (grep { $_->{id} eq $form->{printer} } @{ $form->{ALL_PRINTERS} })[0]->{'printer_command'} || $myconfig{printer};
+ my $selected_printer = first { $_ } map ({ $_ ->{printer_command} }
+ grep { $_->{id} eq $form->{printer} }
+ @{ $form->{ALL_PRINTERS} }),
+ $myconfig{printer};
- if (BP->print_spool(\%myconfig, \%$form, $spool, "| $selected_printer")) {
+ if (BP->print_spool(\%myconfig, \%$form, $main::spool, "| $selected_printer")) {
- $title = $form->escape($form->{title});
- $href = "bp.pl?action=list_spool&vc=$form->{vc}&type=$form->{type}&title=$title";
+ my $title = $form->escape($form->{title});
+ my $href = "bp.pl?action=list_spool&vc=$form->{vc}&type=$form->{type}&title=$title";
if ($form->{ $form->{vc} }) {
$callback .= "&$form->{vc}=" . $form->escape($form->{ $form->{vc} }, 1);
if ($form->{ $form->{vc} }) {
$callback .= "&$form->{vc}=" . $form->escape($form->{ $form->{vc} }, 1);
if ($form->{type} =~ /(invoice|packing_list|check|receipt)/) {
push @columns, "invnumber";
}
if ($form->{type} =~ /(invoice|packing_list|check|receipt)/) {
push @columns, "invnumber";
}
- push @columns, (name, spoolfile);
- @column_index = $form->sort_columns(@columns);
+ push @columns, qw(name spoolfile);
+ my @column_index = $form->sort_columns(@columns);
$column_header{checked} = "<th class=listheading> </th>";
$column_header{transdate} =
"<th><a class=listheading href=$href&sort=transdate>"
$column_header{checked} = "<th class=listheading> </th>";
$column_header{transdate} =
"<th><a class=listheading href=$href&sort=transdate>"
"<td><a href=$module?action=edit&id=$ref->{id}&type=$form->{type}&callback=$callback>$ref->{quonumber}</a></td>";
$column_data{name} = "<td>$ref->{name}</td>";
$column_data{spoolfile} =
"<td><a href=$module?action=edit&id=$ref->{id}&type=$form->{type}&callback=$callback>$ref->{quonumber}</a></td>";
$column_data{name} = "<td>$ref->{name}</td>";
$column_data{spoolfile} =