Permalink
Browse files

Fixed #23

  • Loading branch information...
EsmondTan committed Jul 5, 2016
1 parent 9f657ee commit 5d4753cf4f34fcc2cd7ce10a6b41c59fce5807c3
@@ -162,8 +162,11 @@ public function invoice() {
'text' => $this->currency->format($total['value'], $invoice_info['currency_code'], $invoice_info['currency_value'])
);
}
$pending_status = is_array($this->config->get('config_pending_status')) ? $this->config->get('config_pending_status') : array();
$overdue_status = is_array($this->config->get('config_overdue_status')) ? $this->config->get('config_overdue_status') : array();
if (in_array($invoice_info['status_id'], $this->config->get('config_pending_status')) || in_array($invoice_info['status_id'], $this->config->get('config_overdue_status'))) {
if (in_array($invoice_info['status_id'], $pending_status) || in_array($invoice_info['status_id'], $overdue_status)) {
$this->data['payment_url'] = $this->url->link('account/invoice/payment', 'invoice_id=' . $invoice_info['invoice_id'], true);
} else {
$this->data['payment_url'] = '';
@@ -189,7 +192,10 @@ public function payment() {
$invoice_info = $this->model_billing_invoice->getInvoice((int)$this->request->get['invoice_id'], $this->customer->getId());
if ($invoice_info) {
if (!(in_array($invoice_info['status_id'], $this->config->get('config_pending_status')) || in_array($invoice_info['status_id'], $this->config->get('config_overdue_status')))) {
$pending_status = is_array($this->config->get('config_pending_status')) ? $this->config->get('config_pending_status') : array();
$overdue_status = is_array($this->config->get('config_overdue_status')) ? $this->config->get('config_overdue_status') : array();
if (!(in_array($invoice_info['status_id'], $pending_status) || in_array($invoice_info['status_id'], $overdue_status))) {
return new Action('error/not_found');
}
@@ -420,8 +426,11 @@ public function view() {
'text' => $this->currency->format($total['value'], $invoice_info['currency_code'], $invoice_info['currency_value'])
);
}
$pending_status = is_array($this->config->get('config_pending_status')) ? $this->config->get('config_pending_status') : array();
$overdue_status = is_array($this->config->get('config_overdue_status')) ? $this->config->get('config_overdue_status') : array();
if (in_array($invoice_info['status_id'], $this->config->get('config_pending_status')) || in_array($invoice_info['status_id'], $this->config->get('config_overdue_status'))) {
if (in_array($invoice_info['status_id'], $pending_status) || in_array($invoice_info['status_id'], $overdue_status)) {
$this->data['payment_url'] = $this->url->link('account/invoice/payment', 'invoice_id=' . $invoice_info['invoice_id'], true);
} else {
$this->data['payment_url'] = '';
@@ -56,7 +56,10 @@ public function confirm() {
$invoice_info = $this->model_billing_invoice->getInvoice($invoice_id, $this->customer->getId());
if ($invoice_info) {
if (!(in_array($invoice_info['status_id'], $this->config->get('config_pending_status')) || in_array($invoice_info['status_id'], $this->config->get('config_overdue_status')))) {
$pending_status = is_array($this->config->get('config_pending_status')) ? $this->config->get('config_pending_status') : array();
$overdue_status = is_array($this->config->get('config_overdue_status')) ? $this->config->get('config_overdue_status') : array();
if (!(in_array($invoice_info['status_id'], $pending_status) || in_array($invoice_info['status_id'], $overdue_status))) {
$json['redirect'] = $this->url->link('account/invoice/invoice', 'invoice_id=' . $invoice_id, true);
}
@@ -40,7 +40,10 @@ public function confirm() {
$invoice_info = $this->model_billing_invoice->getInvoice($invoice_id, $this->customer->getId());
if ($invoice_info) {
if (!(in_array($invoice_info['status_id'], $this->config->get('config_pending_status')) || in_array($invoice_info['status_id'], $this->config->get('config_overdue_status')))) {
$pending_status = is_array($this->config->get('config_pending_status')) ? $this->config->get('config_pending_status') : array();
$overdue_status = is_array($this->config->get('config_overdue_status')) ? $this->config->get('config_overdue_status') : array();
if (!(in_array($invoice_info['status_id'], $pending_status) || in_array($invoice_info['status_id'], $overdue_status))) {
return new Action('error/not_found');
}
@@ -42,7 +42,10 @@ public function confirm() {
$invoice_info = $this->model_billing_invoice->getInvoice($invoice_id, $this->customer->getId());
if ($invoice_info) {
if (!(in_array($invoice_info['status_id'], $this->config->get('config_pending_status')) || in_array($invoice_info['status_id'], $this->config->get('config_overdue_status')))) {
$pending_status = is_array($this->config->get('config_pending_status')) ? $this->config->get('config_pending_status') : array();
$overdue_status = is_array($this->config->get('config_overdue_status')) ? $this->config->get('config_overdue_status') : array();
if (!(in_array($invoice_info['status_id'], $pending_status) || in_array($invoice_info['status_id'], $overdue_status))) {
return new Action('error/not_found');
}

0 comments on commit 5d4753c

Please sign in to comment.