MT#4129 prohibit customer with diverging resellers

that is, a customer where billing_profile has one
reseller and contact has a different one
agranig/rest
Gerhard Jungwirth 13 years ago committed by Andreas Granig
parent fa3c979fda
commit 77698535e6

@ -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;

Loading…
Cancel
Save