X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=57a79af0d813bee1414ea650183d92eef3fad3bd;hb=b4ddf2d433ca367128cdab950d2fcc391657de38;hp=47a3e5d671a71f23a5510e795d36d5ae629753a6;hpb=ea13528447272a1d79ccd348253a551e84e5720b;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 47a3e5d67..57a79af0d 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -62,9 +62,10 @@ use strict; # end of main sub _may_view_or_edit_this_invoice { - return 1 if $::auth->assert('invoice_edit', 1); # may edit all invoices - return 0 if !$::form->{id}; # creating new invoices isn't allowed without invoice_edit - return 0 if !$::form->{globalproject_id}; # existing records without a project ID are not allowed + return 1 if $::auth->assert('invoice_edit', 1); # may edit all invoices + return 0 if !$::form->{id}; # creating new invoices isn't allowed without invoice_edit + return 1 if $::auth->assert('sales_invoice_view', 1); # viewing is allowed with this right + return 0 if !$::form->{globalproject_id}; # existing records without a project ID are not allowed return SL::DB::Project->new(id => $::form->{globalproject_id})->load->may_employee_view_project_invoices(SL::DB::Manager::Employee->current); } @@ -385,7 +386,7 @@ sub setup_is_action_bar { disabled => !$may_edit_create ? t8('You must not change this invoice.') : !$form->{id} ? t8('This invoice has not been posted yet.') : undef, - only_if => $::instance_conf->get_is_show_mark_as_paid && $form->{type} ne "invoice_for_advance_payment", + only_if => ($::instance_conf->get_is_show_mark_as_paid && $form->{type} ne "invoice_for_advance_payment") || $form->{type} eq 'final_invoice', ], ], # end of combobox "Post"