Fix customer determination in dashboard.

Properly filter by product class.
agranig/peering-route
Andreas Granig 13 years ago
parent 23675b4da3
commit 85365959dd

@ -74,7 +74,6 @@ sub index :Path Form {
login => $user,
is_active => 1,
is_superuser => 0,
reseller_id => { '>' => 1 },
],
}],
}

@ -29,9 +29,9 @@ around handle => sub {
domains => $c->model('DB')->resultset('domain_resellers')->search_rs({}),
customers => $c->model('DB')->resultset('contracts')->search_rs({
status => { '!=' => 'terminated' },
product_id => undef,
'product.class' => { 'not in' => [ 'reseller', 'sippeering', 'pstnpeering' ] },
}, {
join => 'billing_mappings',
join => { 'billing_mappings' => 'product' },
}),
subscribers => $c->model('DB')->resultset('voip_subscribers')->search_rs({
status => { '!=' => 'terminated' },

@ -28,8 +28,9 @@ around handle => sub {
customers => $c->model('DB')->resultset('contracts')->search({
'me.status' => { '!=' => 'terminated' },
'contact.reseller_id' => $c->user->reseller_id,
'product.class' => { 'not in' => [ 'reseller', 'sippeering', 'pstnpeering' ] },
},{
join => 'contact',
join => [ 'contact', { 'billing_mappings' => 'product' } ],
}),
subscribers => $c->model('DB')->resultset('voip_subscribers')->search({
'contact.reseller_id' => $c->user->reseller_id,

Loading…
Cancel
Save