From bd820a7939c471b868d2da640ba408442f4acffe Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Fri, 5 Jun 2026 11:37:23 +0530 Subject: [PATCH] fix(orgcase): use insurance amount1 in union invoice query --- app/Controllers/Billing/CaseMaster.php | 4 ++-- app/Models/OrganizationCaseModel.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Controllers/Billing/CaseMaster.php b/app/Controllers/Billing/CaseMaster.php index 341b954..afb3f53 100644 --- a/app/Controllers/Billing/CaseMaster.php +++ b/app/Controllers/Billing/CaseMaster.php @@ -570,8 +570,8 @@ class CaseMaster extends BaseController date_format(i.inv_date,'%d-%m-%Y') AS str_date, concat(t.item_name) AS Description,i.invoice_code AS Code, t.item_amount AS Amount,t.org_code AS orgcode, - case when it.item_rate is not null and it.item_rate <> t.item_rate then 1 else 0 end AS discount_amount, - it.item_rate AS d_rate + case when it.amount1 is not null and it.amount1 <> t.item_rate then 1 else 0 end AS discount_amount, + it.amount1 AS d_rate from invoice_master i join organization_case_master c on i.insurance_case_id = c.id join invoice_item t on t.inv_master_id = i.id diff --git a/app/Models/OrganizationCaseModel.php b/app/Models/OrganizationCaseModel.php index 6daf2df..f9f5854 100644 --- a/app/Models/OrganizationCaseModel.php +++ b/app/Models/OrganizationCaseModel.php @@ -60,8 +60,8 @@ class OrganizationCaseModel extends Model date_format(i.inv_date,'%d-%m-%Y') AS str_date, concat(t.item_name) AS Description,i.invoice_code AS Code, t.item_amount AS Amount,t.org_code AS orgcode, - case when it.item_rate is not null and it.item_rate <> t.item_rate then 1 else 0 end AS discount_amount, - it.item_rate AS d_rate + case when it.amount1 is not null and it.amount1 <> t.item_rate then 1 else 0 end AS discount_amount, + it.amount1 AS d_rate from invoice_master i join organization_case_master c on i.insurance_case_id = c.id join invoice_item t on t.inv_master_id = i.id