diff --git a/application/controllers/klinik/doctorv5/Anamnesedoctor.php b/application/controllers/klinik/doctorv5/Anamnesedoctor.php index 08859fc9..bd067068 100644 --- a/application/controllers/klinik/doctorv5/Anamnesedoctor.php +++ b/application/controllers/klinik/doctorv5/Anamnesedoctor.php @@ -3196,22 +3196,40 @@ function get_data_order_anamnesis($orderID){ $search_esc = $this->db_onedev->escape_str($search); $sql = "SELECT - spm.T_TestID as id, - t.T_TestSasCode as code, - t.T_TestName as name, + spm.Ss_PriceMouID as ss_price_mou_id, + spm.Ss_PriceMouM_MouID as mouid, + 0 as xid, + spm.Nat_TestID as nat_testid, + spm.nat_test, + spm.is_packet, + spm.packet_id, + spm.px_type as type, + spm.T_TestID as pxid, + t.T_TestCode as pxcode, + t.T_TestSasCode as pxsascode, + t.T_TestName as test_name, + CONCAT(t.T_TestSasCode,' ',t.T_TestName) as pxname, + t.T_TestIsResult as isresult, JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceAmount')) as bruto, JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDisc')) as discountpersen, JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDiscRp')) as discountrp, + if(JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDisc')) <> 0, + (((JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDisc')) / 100) + * JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceAmount'))) + + JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDiscRp'))), + JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDiscRp')) + ) as discount, ( JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceAmount')) - ((JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDisc')) / 100) * JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceAmount'))) - JSON_UNQUOTE(JSON_EXTRACT(one_json_sum(spm.Ss_PriceMouID),'$.T_PriceDiscRp')) - ) as total + ) as total, + spm.child_test FROM one_lab.ss_price_mou spm JOIN one_lab.t_test t ON spm.T_TestID = t.T_TestID AND t.T_TestIsActive = 'Y' WHERE spm.Ss_PriceMouM_MouID = {$mou_id} AND spm.is_packet = 'N' - AND t.T_TestName LIKE CONCAT('%', '{$search_esc}', '%') + AND CONCAT(t.T_TestSasCode,' ',t.T_TestName) LIKE CONCAT('%', '{$search_esc}', '%') ORDER BY t.T_TestName LIMIT 50";