diff --git a/application/controllers/Corporate.php b/application/controllers/Corporate.php index 89b5f50..e26d0ee 100644 --- a/application/controllers/Corporate.php +++ b/application/controllers/Corporate.php @@ -455,7 +455,7 @@ class Corporate extends CI_Controller { $data['inv_received'] = 1; $this->db->where('td_id', $res1->ti_tdid); $this->db->update('tmc_data', $data); - $res1->d_remarks = 'Invoice Manual Received'; + $res1->d_remarks = 'Invoice Received(Manual)'; } else{ $data['inv_received'] = 2; @@ -620,7 +620,7 @@ class Corporate extends CI_Controller { } } else { $variance = 0; // Set variance to 0 if td_gstr2a_match_id is null or zero - $res1->gd_remarks = 'No Match Found'; // Clear gd_remarks if td_gstr2a_match_id is null or zero + $res1->gd_remarks = 'TMC Invoice Missing'; // Clear gd_remarks if td_gstr2a_match_id is null or zero } if($res1->ti_file_name == '') $res1->gd_file_status = 'Invoice Missing'; @@ -5153,23 +5153,32 @@ public function upload_tmc(){ echo json_encode($data); } - public function tmc_gst_inv(){ $this->checksess(); - $this->load->database('default', TRUE); - $this->db->select('tmc_data.td_pax as tmc_pax,tmc_data.td_airline_pnr as tmc_airline,tmc_data.td_sector as tmc_sector,tmc_data.td_inv_date as tmc_date,tmc_data.td_tkt_fare as tmc_ticket_fare , gstr2a_data.gd_inv_value as gstr2a_value , tmc_data.td_tkt_fare as tmc_ticket_fare , REPLACE(tmc_data.td_tkt," ","") as tmc_tkt , REPLACE(tmc_data.td_pnr," ","") as tmc_pnr , REPLACE(gstr2a_data.gd_inv_no, " ", "") as gstr2a_inv , invoice_no as inv_invoice_no , pnr as inv_pnr , ticket_no as inv_tkt_no , total_values'); - $this->db->from('gst1.air_invoice_details'); - $this->db->join('reconciler_test.tmc_data', 'replace(tmc_data.td_tkt," ","") = replace(air_invoice_details.ticket_no," ","") or replace(tmc_data.td_pnr," ","") = replace(air_invoice_details.pnr," ","")'); - $this->db->join('reconciler_test.gstr2a_data', 'air_invoice_details.invoice_no = gstr2a_data.gd_inv_no'); - $query = $this->db->get(); - $result['data'] = $query->result(); + + $from_date = $this->input->post('from_date'); // Retrieve 'from' date from the form + $to_date = $this->input->post('to_date'); - $this->load->view('corporate/tmc_gst_inv',$result); - } + $this->load->database('default', TRUE); + $this->db->select('tmc_data.td_tkt as tmc_ticket_no,tmc_data.td_pax as tmc_pax,tmc_data.td_tkt_fare as tmc_tkt_fare,air_invoice_details.total_inv_value as airline_fare,air_invoice_details.ticket_no as airline_ticket_no,air_invoice_details.invoice_no as airline_inv_no,gstr2a_data.gd_inv_value as gst_fare, gstr2a_data.gd_inv_no as gst_invoice_no'); + $this->db->from('air_invoice_details'); + $this->db->join('tmc_data', 'air_invoice_details.ticket_no = tmc_data.td_tkt', 'left'); + $this->db->join('gstr2a_data', 'air_invoice_details.invoice_no = gstr2a_data.gd_inv_no', 'left'); + + // Filter data based on the date range + $this->db->where("( + (gstr2a_data.gd_inv_date BETWEEN '$from_date' AND '$to_date') + OR + (tmc_data.td_inv_date BETWEEN '$from_date' AND '$to_date') + )"); + + $query = $this->db->get(); + $result['data'] = $query->result(); + + $this->load->view('corporate/tmc_gst_inv', $result); +} } - - diff --git a/application/views/corporate/includes/top_nav.php b/application/views/corporate/includes/top_nav.php index a9c2c33..1d753a5 100644 --- a/application/views/corporate/includes/top_nav.php +++ b/application/views/corporate/includes/top_nav.php @@ -47,7 +47,7 @@ session->flashdata('corporate_id') != 1) { ?> diff --git a/application/views/corporate/tmc_gst_inv.php b/application/views/corporate/tmc_gst_inv.php index 6068929..b2b7234 100644 --- a/application/views/corporate/tmc_gst_inv.php +++ b/application/views/corporate/tmc_gst_inv.php @@ -36,7 +36,7 @@ - + @@ -74,11 +132,10 @@ - - + - +
@@ -102,7 +159,7 @@
-
+
- - - + +
+ + +
+
+ + + +
+
+ +
+ +
+ - + +
- - - +
+
+
- +
-
- - + +
- - - - - - - - - - - - + + + + + + + + + + + + + - + +
TICKET NO (TMC)PASS NAME(TMC) AIRLINE(TMC)SECTOR(TMC)TRAVEL DAT(TMC)ETICKET NUMBER(TMC)VALUE (TMC)INV NO (GST)INV NO(GST)PNR NO(GST)TICKET NO(GST)TOTAL (GST)TMC Pax NameTMC Tkt numberTMC Tkt FareGST Inv NumberGST Inv ValueAirline Inv NumberAirline Tkt NumberAirline Tkt Fare
-
- + +
- - - + +
- + @@ -316,7 +393,6 @@ - @@ -325,7 +401,7 @@ diff --git a/application/views/tmc/tmc_recon.php b/application/views/tmc/tmc_recon.php index a41f354..6c38b79 100644 --- a/application/views/tmc/tmc_recon.php +++ b/application/views/tmc/tmc_recon.php @@ -851,8 +851,7 @@ function() { { data : "td_id"} ], - // "columnDefs": [ - "columnDefs": [ + "columnDefs": [ { "targets":11, "visible": false @@ -881,16 +880,13 @@ function() { "width": 300, "render": function ( data, type, full, meta ) { console.log(full['inv']); - if (full['inv'] !=" ") { - return 'Invoice Received'; - } else if (full['ti_recieved'] === "0") { - return 'Invoice Received (Manual)'; - } - else{ - return 'Invoice Not Received'; - } - } - + if (full['inv'] !== " ") { + return 'Invoice Received'; +} else { + // Show d_remarks here + return full['d_remarks']; +} +} }, { diff --git a/uploads/1/airline_invoice/1700196224___1700129180___TaxInvoiceTS1222302BJ68723_8.pdf b/uploads/1/airline_invoice/1700196224___1700129180___TaxInvoiceTS1222302BJ68723_8.pdf new file mode 100644 index 0000000..b214dbc Binary files /dev/null and b/uploads/1/airline_invoice/1700196224___1700129180___TaxInvoiceTS1222302BJ68723_8.pdf differ