diff --git a/application/controllers/Corporate.php b/application/controllers/Corporate.php index d9dd049..ac4c4a9 100644 --- a/application/controllers/Corporate.php +++ b/application/controllers/Corporate.php @@ -56,6 +56,13 @@ class Corporate extends CI_Controller { echo json_encode($res); } + public function get_inv_no(){ + $this->checksess(); + $this->load->database('second', TRUE); + $res = $this->db2->get('air_invoice_details')->result(); + echo json_encode($res); + } + public function tmc_dashboard(){ $this->checksess(); $this->load->view('corporate/dashboard_tmc'); @@ -399,6 +406,21 @@ class Corporate extends CI_Controller { // $res = $this->db->query('select *,am_code as supplier_code from gstr2a_data gd left join (select *,group_concat(td_gst_inv) g_td_gst_inv,sum(td_net) td_net_ref from tmc_data where td_show_status = 1 group by td_tkt) td on gd.gd_id=td.td_gstr2a_match_id left join airline_master am on am.am_name=gd.gd_supplier_type where gd_id = "'.$gid.'"'); // else $res = $this->db->query('select * from tmc_data td left join (select *,sum(ti_amount) s_amt from airline_invoice group by ti_tdid) ti on ti.ti_tdid = td.td_id where is_active = 1 and td_inv_date between "'.$fromdate.'" and "'.$todate.'" order by td_id desc'); + // print_r($res);die(); + + foreach ($res->result() as $key => $value) { + // print_r($value);die(); + if ($value) { + $this->load->database('second', TRUE); + $res_2 = $this->db2->where('pnr' , $value->td_tkt)->or_where('ticket_no' , $value->td_tkt)->get('air_invoice_details')->result(); + if(isset($res_2[0])){ + $value->inv = $res_2[0]->invoice_no; + } + else{ + $value->inv = " "; + } + } + } $fres['data'] = array(); $res2 = new stdClass(); foreach($res->result() as $res1){ diff --git a/application/models/Corporate_model.php b/application/models/Corporate_model.php index ee10281..afdbcbf 100644 --- a/application/models/Corporate_model.php +++ b/application/models/Corporate_model.php @@ -111,6 +111,7 @@ class Corporate_model extends CI_Model { function get_gstr2a(){ $con['f_type'] = 'gstr2a'; + $con['is_active'] = '1'; $con['f_corporateid'] = $this->session->userdata['recon_sess_i']['u_corporateid']; $this->db->from('files f'); $this->db->join('corporates c','c.c_id=f.f_corporateid','inner'); diff --git a/application/views/corporate/gstr2a.php b/application/views/corporate/gstr2a.php index cd97945..8f60b4b 100644 --- a/application/views/corporate/gstr2a.php +++ b/application/views/corporate/gstr2a.php @@ -618,7 +618,7 @@ "render": function ( data, type, full, meta ) { // return ' '; - return ` + return ` `; } } diff --git a/application/views/corporate/gstr2a_recon.php b/application/views/corporate/gstr2a_recon.php index 9732e0b..c71c02e 100644 --- a/application/views/corporate/gstr2a_recon.php +++ b/application/views/corporate/gstr2a_recon.php @@ -180,7 +180,7 @@