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

View file

@ -164,8 +164,13 @@ class BillingController extends Zend_Controller_Action {
if ($apply_vat) { if ($apply_vat) {
Billing::addVatToInvoice($result["invoiceid"]); Billing::addVatToInvoice($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"]); self::viewInvoice($result["invoiceid"]);
} }
}
} else { } else {
$this->view->form = $form; $this->view->form = $form;
} }