TT#44963 fix getting contract in /api/capabilities

Change-Id: I9aa8d5fe40bd4092d88ba65a93f08f7656292c83
changes/57/23957/4
Rene Krenn 8 years ago
parent bc926d6ae9
commit 36169c0271

@ -68,23 +68,8 @@ sub _item_rs {
$rtcengine &= ($c->user->reseller->rtc_user // 0);
} else {
$rtcengine &= ($c->user->voip_subscriber->contract->contact->reseller->rtc_user // 0);
my $customer_rs = NGCP::Panel::Utils::Contract::get_customer_rs(
c => $c,
contract_id => $c->user->account_id,
);
$customer_rs = $customer_rs->search({
'-or' => [
'product.class' => 'sipaccount',
'product.class' => 'pbxaccount',
],
},{
'+select' => [ 'product.class' ],
'+as' => [ 'product_class' ],
});
my $customer = $customer_rs->first;
my $customer = $c->user->voip_subscriber->contract;
$rtcengine &= ($customer->contact->reseller->rtc_user // 0);
my $cpbx = ($customer->product->class eq 'pbxaccount') ? 1 : 0;
$cloudpbx &= $cpbx;

Loading…
Cancel
Save