I want to display Payment Methods on Report Sales By Client. I added this code:
$this->db->select("
(
SELECT payment_method_name FROM ip_payment_methods
WHERE ip_payment_methods.payment_method_name = (SELECT MAX(ip_payment_methods.payment_method_name) FROM ip_payment_methods)
) AS payment_method_name");
to: application/modules/reports/models/Mld_reports.php
and i added the next line to this file: /application/views/reports/sales_by_client.php
Betaling
<?php echo $result->payment_method_name; ?>
The result: All payments has the same payment method. But i have 3 different payment methods. pls help
under line → public function sales_by_client($from_date = null, $to_date = null)
{
ADD:
$this->db->select("
(
SELECT payment_method_name FROM ip_payment_methods
WHERE ip_payment_methods.payment_method_id IN
(
SELECT payment_method FROM ip_invoices
WHERE ip_invoices.client_id = ip_clients.client_id
AND invoice_date_created >= " . $this->db->escape($from_date) . "
AND invoice_date_created <= " . $this->db->escape($to_date) . "