diff --git a/rate-o-mat.pl b/rate-o-mat.pl index 85fdd50..c570828 100755 --- a/rate-o-mat.pl +++ b/rate-o-mat.pl @@ -713,7 +713,7 @@ sub add_interval { } elsif($unit eq "hour") { $to_time = mktime($from_second,$from_minute,$from_hour + $count,$from_day,$from_month,$from_year); } elsif($unit eq "day") { - $to_time = mktime($from_second,$from_minute,$from_hour,$from_day + $count,$from_month,$from_year); + $to_time = mktime($from_second,$from_minute,$from_hour,$from_day + $count,$from_month,$from_year); } elsif($unit eq "week") { $to_time = mktime($from_second,$from_minute,$from_hour,$from_day + 7*$count,$from_month,$from_year); } elsif($unit eq "month") { diff --git a/t/Utils/Api.pm b/t/Utils/Api.pm index 90e148b..3fcaa13 100644 --- a/t/Utils/Api.pm +++ b/t/Utils/Api.pm @@ -692,15 +692,17 @@ sub setup_provider { ); $provider->{profile} = $profile_fee->{profile}; $provider->{provider_fee} = $profile_fee; + $provider->{contract} = update_item($provider->{contract}, + billing_profile_id => $provider->{profile}->{id}, + ); } else { ok(!$split_peak_parts,'provider rate required for split cdrs'); - $provider->{profile} = create_billing_profile( - reseller_id => $provider->{reseller}->{id}, - ); + #use default billing profile id, which already comes with fees. + #$provider->{profile} = create_billing_profile( + # reseller_id => $provider->{reseller}->{id}, + #); } - $provider->{contract} = update_item($provider->{contract}, - billing_profile_id => $provider->{profile}->{id}, - ); + $provider->{domain} = create_domain( reseller_id => $provider->{reseller}->{id}, domain => $domain_name.'.', diff --git a/t/rateomat-split-cdr.t b/t/rateomat-split-cdr.t index 7c34780..30b5a06 100644 --- a/t/rateomat-split-cdr.t +++ b/t/rateomat-split-cdr.t @@ -5,7 +5,7 @@ use Utils::Api qw(); use Utils::Rateomat qw(); use Test::More; -#THIS TEST CASE REQUIRES RATEOMAT_SPLIT_PEAK_PARTS=1 ! +$ENV{RATEOMAT_SPLIT_PEAK_PARTS} = 1; #use Text::Table; #use Text::Wrap;