Fix for bringing customer to view invoice that doesn't exist after downgrade

This commit is contained in:
drigato 2015-07-31 11:48:20 -04:00
parent 7de507c99a
commit 278ca264eb
1 changed files with 6 additions and 1 deletions

View File

@ -164,7 +164,12 @@ class BillingController extends Zend_Controller_Action {
if ($apply_vat) { if ($apply_vat) {
Billing::addVatToInvoice($result["invoiceid"]); Billing::addVatToInvoice($result["invoiceid"]);
} }
self::viewInvoice($result["invoiceid"]);
// invoice id can be 0 if client is downgrading and they don't
// owe any money
if (!empty($result["invoiceid"])) {
self::viewInvoice($result["invoiceid"]);
}
} }
} else { } else {
$this->view->form = $form; $this->view->form = $form;