X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fbp.pl;h=f40708b80059739562b3e814da9f3750b1a01e0c;hb=a6ce2c7f3f7ae10f7065fb86121c8d11049617ee;hp=8054af52bd18bdd6324828bd2a77f452547eedec;hpb=8c7e44938a661e035f62840e1e177353240ace5d;p=kivitendo-erp.git diff --git a/bin/mozilla/bp.pl b/bin/mozilla/bp.pl index 8054af52b..f40708b80 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 @@ -33,11 +34,14 @@ 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 { @@ -46,593 +50,149 @@ 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 .= "