When getting the payment data for viewing invoice need to get payment
data not invoice_payment data.
{
return $this->wpdb->get_results(
$this->wpdb->prepare(
- "SELECT *
- FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoice_payments
- WHERE invoice = %d",
+ "SELECT P.*
+ FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoice_payments IP
+ LEFT OUTER JOIN " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "payments P
+ ON ( IP.payment = P.id )
+ WHERE IP.invoice = %d",
$invoice
),
ARRAY_A