Fix for billing downgrade with no new invoice created

This commit is contained in:
drigato 2015-07-31 13:42:47 -04:00
parent 5530142174
commit 8a52178765
1 changed files with 7 additions and 1 deletions

View File

@ -165,7 +165,13 @@ class BillingController extends Zend_Controller_Action {
Billing::addVatToInvoice($result["invoiceid"]);
}
self::viewInvoice($result["invoiceid"]);
// there may not be an invoice created if the client is downgrading
if (!empty($result["invoiceid"])) {
self::viewInvoice($result["invoiceid"]);
} else {
$this->_redirect('billing/invoices?planupdated');
return;
}
}
} else {
$this->view->form = $form;