MT#13903 enable applying profile package

Change-Id: I74b57b80599575e9685e01924b234c8da6c2fe49
changes/14/2314/1
Rene Krenn 10 years ago
parent f17bafecbf
commit ca908406a1

@ -103,8 +103,8 @@ has_field 'balance_interval_start_mode' => (
type => 'Select',
label => 'Balance Interval Start',
options => [
{ value => 'create', label => 'upon customer creation' },
{ value => '1st', label => '1st day of month' },
{ value => 'create', label => 'upon customer creation' },
{ value => 'topup_interval', label => 'start interval upon top-up' },
{ value => 'topup', label => 'new interval for each top-up' },
],

@ -36,7 +36,7 @@ use constant _DEFAULT_PROFILE_FREE_TIME => 0;
use constant _DEFAULT_PROFILE_FREE_CASH => 0.0;
#use constant _DEFAULT_NOTOPUP_DISCARD_INTERVALS => undef;
use constant ENABLE_PROFILE_PACKAGES => 0;
use constant ENABLE_PROFILE_PACKAGES => 1;
sub get_contract_balance {
my %params = @_;
@ -676,7 +676,7 @@ sub check_profiles {
$mappings_counts = {};
return 0 unless prepare_package_profile_set(c => $c, resource => $resource, field => 'underrun_profiles', mappings_to_create => $mappings_to_create, mappings_counts => $mappings_counts, err_code => $err_code);
if ($mappings_counts->{count} > 0 && ! defined $resource->{underrun_profile_threshold}) {
return 0 unless &{$err_code}("If specifying underung profile mappings, 'underrun_profile_threshold' is required.",'underrun_profile_threshold');
return 0 unless &{$err_code}("If specifying underrun profile mappings, 'underrun_profile_threshold' is required.",'underrun_profile_threshold');
}
$mappings_counts = {};
return 0 unless prepare_package_profile_set(c => $c, resource => $resource, field => 'topup_profiles', mappings_to_create => $mappings_to_create, mappings_counts => $mappings_counts, err_code => $err_code);

Loading…
Cancel
Save