X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fbp.pl;h=439709ebcd87f061a2f9c37376fb81b58cc095b3;hb=577042c61c5e1fffb8747079b4f9826e51532ee8;hp=edbd98486704eb39afd7e3a549d8016e359ba5ff;hpb=dc3cd296e62eb09a16fa694d9b3a7158e4cf63bf;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index edbd98486..439709ebc 100644 --- a/bin/mozilla/bp.pl +++ b/bin/mozilla/bp.pl @@ -24,7 +24,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # Batch printing @@ -32,12 +33,16 @@ #====================================================================== use SL::BP; +use SL::Locale::String qw(t8); use Data::Dumper; +use List::Util qw(first); 1; require "bin/mozilla/common.pl"; +use strict; + # end of main sub assert_bp_access { @@ -46,593 +51,185 @@ sub assert_bp_access { 'sales_order' => 'sales_order_edit', 'sales_quotation' => 'sales_quotation_edit', 'purchase_order' => 'purchase_order_edit', + 'packing_list' => 'sales_delivery_order_edit|purchase_delivery_order_edit', 'request_quotation' => 'request_quotation_edit', 'check' => 'cash', 'receipt' => 'cash', ); - if ($form->{type} && $access_map{$form->{type}}) { - $auth->assert($access_map{$form->{type}}); - - } elsif ($form->{type} eq 'packing_list') { - $lxdebug->message(0, "1"); - if (!$auth->assert('sales_order_edit', 1)) { - $lxdebug->message(0, "2"); - $auth->assert('invoice_edit') ; - } - $lxdebug->message(0, "3"); + if ($::form->{type} && $access_map{$::form->{type}}) { + $::auth->assert($access_map{$::form->{type}}); } else { - $auth->assert('DOES_NOT_EXIST'); + $::auth->assert('DOES_NOT_EXIST'); } } sub search { - $lxdebug->enter_sub(); + $::lxdebug->enter_sub; assert_bp_access(); - # $locale->text('Sales Invoices') - # $locale->text('Packing Lists') - # $locale->text('Sales Orders') - # $locale->text('Purchase Orders') - # $locale->text('Quotations') - # $locale->text('RFQs') - # $locale->text('Checks') - # $locale->text('Receipts') - - # setup customer/vendor selection - BP->get_vc(\%myconfig, \%$form); - - if (@{ $form->{"all_$form->{vc}"} }) { - map { $name .= "