removed unnecessary use of session for admin::Utils::prepare_call_list

fixes issue #765
3.2
Daniel Tiefnig 15 years ago
parent 0c005ffb21
commit b9acb8cd60

@ -1177,14 +1177,15 @@ sub call_data : Local {
{ id => $$subscriber{account_id} },
\$account
);
my $bilprof = {};
if(eval { defined $$account{billing_profile} }) {
return 1 unless $c->model('Provisioning')->call_prov($c, 'billing', 'get_billing_profile',
{ handle => $$account{billing_profile} },
\$c->session->{voip_account}{billing_profile}
\$bilprof
);
}
$c->stash->{call_list} = admin::Utils::prepare_call_list($c, $calls, $listfilter);
$c->stash->{call_list} = admin::Utils::prepare_call_list($c, $calls, $listfilter, $bilprof);
$c->stash->{subscriber}{list_filter} = $listfilter if defined $listfilter;
undef $c->stash->{call_list} unless eval { @{$c->stash->{call_list}} };

@ -128,7 +128,7 @@ sub get_qualified_number_for_subscriber {
# as returned by the prov. interface and returns a reference to an
# array suited for TT display
sub prepare_call_list {
my ($c, $call_list, $filter) = @_;
my ($c, $call_list, $filter, $bilprof) = @_;
my $callentries = [];
my @time = localtime time;
@ -167,7 +167,7 @@ sub prepare_call_list {
if(defined $$call{call_fee}) {
# money is allways returned as cents
$callentry{call_fee} = sprintf $c->session->{voip_account}{billing_profile}{data}{currency} . " %.04f", $$call{call_fee}/100;
$callentry{call_fee} = sprintf $$bilprof{data}{currency} . " %.04f", $$call{call_fee}/100;
} else {
$callentry{call_fee} = '';
}

Loading…
Cancel
Save