Note: changes applied to version 1.1.1
Changes to file ~InvoicePlane/application/modules/clients/controllers/clients.php
:
--- ~current_InvoicePlane/application/modules/clients/controllers/clients.php
+++ ~new_InvoicePlane/application/modules/clients/controllers/clients.php
@@ -119,6 +119,7 @@
$this->load->model('clients/mdl_client_notes');
$this->load->model('invoices/mdl_invoices');
$this->load->model('quotes/mdl_quotes');
+ $this->load->model('payments/mdl_payments');
$this->load->model('custom_fields/mdl_custom_fields');
$client = $this->mdl_clients->with_total()->with_total_balance()->with_total_paid()->where('ip_clients.client_id', $client_id)->get()->row();
@@ -134,6 +135,7 @@
'client_notes' => $this->mdl_client_notes->where('client_id', $client_id)->get()->result(),
'invoices' => $this->mdl_invoices->by_client($client_id)->limit(20)->get()->result(),
'quotes' => $this->mdl_quotes->by_client($client_id)->limit(20)->get()->result(),
+ 'payments' => $this->mdl_payments->by_client($client_id)->limit(20)->get()->result(),
'custom_fields' => $this->mdl_custom_fields->by_table('ip_client_custom')->get()->result(),
'quote_statuses' => $this->mdl_quotes->statuses(),
'invoice_statuses' => $this->mdl_invoices->statuses(),
@@ -144,6 +146,7 @@
array(
array('invoice_table', 'invoices/partial_invoice_table'),
array('quote_table', 'quotes/partial_quote_table'),
+ array('payment_table', 'payments/partial_payment_table'),
array('partial_notes', 'clients/partial_notes'),
array('content', 'clients/view')
)
Changes to file ~InvoicePlane/application/modules/clients/views/view.php
:
--- ~current_InvoicePlane/application/modules/clients/views/view.php
+++ ~new_InvoicePlane/application/modules/clients/views/view.php
@@ -48,9 +48,9 @@
<i class="fa fa-file"></i> <?php echo lang('create_quote'); ?>
</a>
<a href="#" class="btn btn-sm btn-default client-create-invoice"
- data-client-name="<?php echo $client->client_name; ?>">
- <i class="fa fa-file-text""></i> <?php echo lang('create_invoice'); ?>
- </a>
+ data-client-name="<?php echo $client->client_name; ?>">
+ <i class="fa fa-file-text""></i> <?php echo lang('create_invoice'); ?>
+ </a>
<a href="<?php echo site_url('clients/form/' . $client->client_id); ?>"
class="btn btn-sm btn-default">
<i class="fa fa-edit"></i> <?php echo lang('edit'); ?>
@@ -187,6 +187,10 @@
<?php echo $invoice_table; ?>
</div>
+ <div id="clientPayments" class="tab-pane">
+ <?php echo $payment_table; ?>
+ </div>
+
</div>
</div>
@@ -198,6 +202,7 @@
<li class="active"><a data-toggle="tab" href="#clientDetails"><?php echo lang('details'); ?></a></li>
<li><a data-toggle="tab" href="#clientQuotes"><?php echo lang('quotes'); ?></a></li>
<li><a data-toggle="tab" href="#clientInvoices"><?php echo lang('invoices'); ?></a></li>
+ <li><a data-toggle="tab" href="#clientPayments"><?php echo lang('payments'); ?></a></li>
</ul>
</div>
</nav>
Changes to file ~InvoicePlane/application/modules/payments/models/mdl_payments.php
:
--- ~current_InvoicePlane/application/modules/payments/models/mdl_payments.php
+++ ~current_InvoicePlane/application/modules/payments/models/mdl_payments.php
@@ -29,6 +29,7 @@
ip_payment_methods.*,
ip_invoice_amounts.*,
ip_clients.client_name,
+ ip_clients.client_id,
ip_invoices.invoice_number,
ip_invoices.invoice_date_created,
ip_payments.*", FALSE);
@@ -169,6 +170,12 @@
return TRUE;
}
+ public function by_client($client_id)
+ {
+ $this->filter_where('ip_clients.client_id', $client_id);
+ return $this;
+ }
+
}
?>
Changes to file ~InvoicePlane/application/modules/payments/views/partial_payment_table.php
--- ~current_InvoicePlane/application/modules/payments/views/partial_payment_table.php
+++ ~new_InvoicePlane/application/modules/payments/views/partial_payment_table.php
@@ -20,7 +20,12 @@
<td><?php echo date_from_mysql($payment->payment_date); ?></td>
<td><?php echo date_from_mysql($payment->invoice_date_created); ?></td>
<td><?php echo anchor('invoices/view/' . $payment->invoice_id, $payment->invoice_number); ?></td>
- <td><?php echo $payment->client_name; ?></td>
+ <td>
+ <a href="<?php echo site_url('clients/view/' . $payment->client_id); ?>"
+ title="<?php echo lang('view_client'); ?>">
+ <?php echo $payment->client_name; ?>
+ </a>
+ </td>
<td><?php echo format_currency($payment->payment_amount); ?></td>
<td><?php echo $payment->payment_method_name; ?></td>
<td><?php echo $payment->payment_note; ?></td>
Miquel