X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbp.pl;h=10acafdaa079005eb069856c80df4b768f83835f;hb=08c340d2caca21066fd8797e29f07facfde7a07c;hp=a39cdd1b145f7e88bb2c9a4df33487860ed2a755;hpb=72539cb39a3d19f930a8e0e41e46bf41afe9a8f1;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index a39cdd1b1..10acafdaa 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -32,13 +32,56 @@ #====================================================================== use SL::BP; +use Data::Dumper; +use List::Util qw(first); 1; +require "bin/mozilla/common.pl"; + +use strict; + # end of main +sub assert_bp_access { + my $form = $main::form; + + my %access_map = ( + 'invoice' => 'invoice_edit', + 'sales_order' => 'sales_order_edit', + 'sales_quotation' => 'sales_quotation_edit', + 'purchase_order' => 'purchase_order_edit', + 'request_quotation' => 'request_quotation_edit', + 'check' => 'cash', + 'receipt' => 'cash', + ); + + if ($form->{type} && $access_map{$form->{type}}) { + $main::auth->assert($access_map{$form->{type}}); + + } elsif ($form->{type} eq 'packing_list') { + $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->message(0, "3"); + + } else { + $main::auth->assert('DOES_NOT_EXIST'); + } +} + sub search { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + + my ($name, $account, $onload); + + assert_bp_access(); # $locale->text('Sales Invoices') # $locale->text('Packing Lists') @@ -63,7 +106,7 @@ sub search { # $locale->text('Customer') # $locale->text('Vendor') - %label = ( + my %label = ( invoice => { title => 'Sales Invoices', name => 'Customer', l_invnumber => 'Y' }, packing_list => @@ -128,7 +171,7 @@ sub search { $account .= qq|