From 77698535e60eecb602d77a2ec222f4de40da96c4 Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Thu, 24 Oct 2013 14:41:00 +0200 Subject: [PATCH] MT#4129 prohibit customer with diverging resellers that is, a customer where billing_profile has one reseller and contact has a different one --- lib/NGCP/Panel/Controller/Customer.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/NGCP/Panel/Controller/Customer.pm b/lib/NGCP/Panel/Controller/Customer.pm index cabc3c2094..892e68e240 100644 --- a/lib/NGCP/Panel/Controller/Customer.pm +++ b/lib/NGCP/Panel/Controller/Customer.pm @@ -162,6 +162,11 @@ sub create :Chained('list_customer') :PathPart('create') :Args(0) { product_id => $product_id, }); + if($contract->contact->reseller_id // -1 != + $billing_profile->reseller_id // -1) { + die( ["Contact and Billing profile should have the same reseller", "showdetails"] ); + } + NGCP::Panel::Utils::Contract::create_contract_balance( c => $c, profile => $billing_profile, @@ -356,6 +361,11 @@ sub edit :Chained('base') :PathPart('edit') :Args(0) { }); } + if($contract->contact->reseller_id // -1 != + $billing_mapping->billing_profile->reseller_id // -1) { + die( ["Contact and Billing profile should have the same reseller", "showdetails"] ); + } + delete $c->session->{created_objects}->{contact}; delete $c->session->{created_objects}->{billing_profile}; my $contract_id = $contract->id;