X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fglobal_Mixin.pm;h=59eaaaaec6469f9b02b174b5520b22df18b9e7ab;hb=dc83512c36dc6bea2585abada4f88d714c600e55;hp=31d178d8cd3bcdb823a33a5f79d4972f11f31d5a;hpb=c894ab1b3132128b297d7fb556882c1753ef80ec;p=freeside.git diff --git a/FS/FS/part_pkg/global_Mixin.pm b/FS/FS/part_pkg/global_Mixin.pm index 31d178d8c..59eaaaaec 100644 --- a/FS/FS/part_pkg/global_Mixin.pm +++ b/FS/FS/part_pkg/global_Mixin.pm @@ -19,17 +19,21 @@ sub validate_moneyn { my ($option, $valref) = @_; if ( $$valref eq '' ) { return ''; - } elsif ( $$valref =~ /^\s*(\-)?\s*(\d*)(\.\d{1})\s*$/ ) { + } elsif ( $$valref =~ /^\s*(\d*)(\.\d{1})\s*$/ ) { #handle one decimal place without barfing out - $$valref = ( ($1||''). ($2||''). ($3.'0') ) || 0; - } elsif ( $$valref =~ /^\s*(\-)?\s*(\d*)(\.\d{2})?\s*$/ ) { - $$valref = ( ($1||''). ($2||''). ($3||'') ) || 0; + $$valref = ( ($1||''). ($2.'0') ) || 0; + } elsif ( $$valref =~ /^\s*(\d*)(\.\d{2})?\s*$/ ) { + $$valref = ( ($1||''). ($2||'') ) || 0; } else { return "Illegal (money) $option: ". $$valref; } return ''; } +tie my %count_available_phones, 'Tie::IxHash', ( + 0 => 'Provisioned phone services', + 1 => 'All available phone services', +); %info = ( 'disabled' => 1, @@ -63,6 +67,11 @@ sub validate_moneyn { 'name' => 'Automatic suspension period before cancelling (configuration setting part_pkg-delay_cancel-days)', 'type' => 'checkbox', }, + 'count_available_phones' => { 'name' => 'Count taxable phone lines', + 'type' => 'radio', + 'options' => \%count_available_phones, + 'default' => 0, + }, # miscellany--maybe put this in a separate module? @@ -134,6 +143,8 @@ sub validate_moneyn { unused_credit_change delay_cancel + count_available_phones + a2billing_tariff a2billing_type a2billing_simultaccess