X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;fp=FS%2FFS%2Fcust_main.pm;h=23d54b60747e503c1cf269b653abc02cb759b06d;hp=640eee359826cc993a6b484d9019903c107d4f42;hb=7e025dc076379f89e91803ec58d1a0d95cb02d1f;hpb=300ff26285e8de055a71d11df5d2954d5837a6b2 diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 640eee359..23d54b607 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -377,6 +377,10 @@ sub insert { join(', ', map { "$_: $options{$_}" } keys %options ). "\n" if $DEBUG; + return "You are not permitted to change customer invoicing terms." + if $self->invoice_terms #i.e. not the default + && ! $FS::CurrentUser::CurrentUser->access_right('Edit customer invoice terms'); + local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; local $SIG{QUIT} = 'IGNORE'; @@ -1385,6 +1389,10 @@ sub replace { && ! $self->locale && $conf->exists('cust_main-require_locale'); + return "You are not permitted to change customer invoicing terms." + if $old->invoice_terms ne $self->invoice_terms + && ! $curuser->access_right('Edit customer invoice terms'); + local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; local $SIG{QUIT} = 'IGNORE';