Sales by client ADD Payment Method

Hi Guys,

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

i added to following to mld_reports.php

$this->db->select("
(
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) . "
) AS payment_method_id");

and everything works! i just need to get the payments methods names! now i am getting the IDs!

Please helppp almost theree

SOLUTION:

For the guys who wants PAYMENT METHODS on REPORT: Sales By Client

Do the following:

  • Edit file application/modules/reports/models/Mld_reports.php

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) . "

)
) AS payment_method_id");

  • GOTO: /application/views/reports/sales_by_client.php

Edit file:

ADD:

Labelname <?php _htmlsc($result->payment_method_id); ?>

Done!

Case Closed