You are on page 1of 1

SELECT b.loan_request_id AS "Loan Request ID", a.emp_name AS "Name", a.

company_name
AS "Company Code",
a.status_application AS "Status",
# count(*) as tenor, b.final_monthly_installment, b.`final_interest_rate`,
(100/(100+(b.`final_interest_rate`*(COUNT(*)/12)))) * b.final_monthly_installment *
COUNT(*) AS Amount,
(100/(100+(b.`final_interest_rate`*(COUNT(*)/12)))) * b.final_monthly_installment *
COUNT(*) * 0.01 AS "Commision (1%)",
DATE_SUB(c.due_date, INTERVAL 1 MONTH)as "Disburtion Date"
FROM application_bank a
LEFT JOIN koinworks b ON a.id = b.application_bank_id
LEFT JOIN history_transactions c ON a.id = c.application_bank_id
WHERE (status_application="Live" OR status_application="Lunas")
AND loan_request_id <> 1010
GROUP BY c.application_bank_id
;

You might also like