This commit is contained in:
suseendhiran17 2023-08-02 16:55:43 +05:30
parent 39c40498fd
commit cb9d8bf955
16 changed files with 72 additions and 16 deletions

View File

@ -53,7 +53,10 @@ class Admin extends CI_Controller {
public function add_corpdetail(){ public function add_corpdetail(){
$this->checksess(); $this->checksess();
$data = $this->input->post('usr'); $data = $this->input->post();
$data = $data['usr'];
$con['c_code'] = $data['c_code']; $con['c_code'] = $data['c_code'];
$echk = $this->admin->get_corp($con); $echk = $this->admin->get_corp($con);
if($echk->num_rows()>0){ if($echk->num_rows()>0){
@ -66,10 +69,20 @@ class Admin extends CI_Controller {
echo 3; exit; echo 3; exit;
} }
else{ else{
unset($data['payment']);
$data['c_createdby'] = $this->session->userdata['recon_sess_i']['u_id']; $data['c_createdby'] = $this->session->userdata['recon_sess_i']['u_id'];
$data['c_createdon'] = date('Y-m-d H:i:s',time()); $data['c_createdon'] = date('Y-m-d H:i:s',time());
$this->db->insert('corporates',$data); // echo json_encode($data);
echo 1; exit; try {
$this->db->insert('corporates',$data);
echo 1; exit;
} catch (Exception $e) {
log_message('error', 'Exception occurred: ' . $e->getMessage());
show_error('An error occurred. Please try again later.');
}
} }
} }
} }

View File

@ -417,6 +417,9 @@ class Corporate extends CI_Controller {
$this->load->database('second', TRUE); $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(); $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])){ if(isset($res_2[0])){
// $uptData['inv_received'] = 1;
// $this->db->where('td_id', $value->td_id);
// $data = $this->db->update('tmc_data',$uptData);
$value->inv = $res_2[0]->invoice_no; $value->inv = $res_2[0]->invoice_no;
} }
else{ else{
@ -467,6 +470,22 @@ class Corporate extends CI_Controller {
else else
$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 left join airline_invoice ai on gd.gd_id=ai.ti_gdid or gd.gd_inv_no=ai.ti_gst_nub where gd.is_active = 1 and gd_inv_date between "'.$fromdate.'" and "'.$todate.'" order by gd_id desc'); $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 left join airline_invoice ai on gd.gd_id=ai.ti_gdid or gd.gd_inv_no=ai.ti_gst_nub where gd.is_active = 1 and gd_inv_date between "'.$fromdate.'" and "'.$todate.'" order by gd_id desc');
// $res = $this->db->query('select * from gstr2a_data gd left join (select *,group_concat(td_gst_inv) g_td_gst_inv from tmc_data group by td_tkt) td on gd.gd_tkt_no=td.td_tkt where gd_inv_date between "'.$fromdate.'" and "'.$todate.'"'); // $res = $this->db->query('select * from gstr2a_data gd left join (select *,group_concat(td_gst_inv) g_td_gst_inv from tmc_data group by td_tkt) td on gd.gd_tkt_no=td.td_tkt where gd_inv_date between "'.$fromdate.'" and "'.$todate.'"');
foreach ($res->result() as $key => $value) {
// print_r($value);die();
if ($value) {
$this->load->database('second', TRUE);
$res_2 = $this->db2->where('invoice_no' , $value->gd_inv_no)->get('air_invoice_details')->result();
if(isset($res_2[0])){
// $uptData['inv_received'] = 1;
// $this->db->where('td_id', $value->td_id);
// $data = $this->db->update('tmc_data',$uptData);
$value->inv = $res_2[0]->invoice_no;
}
else{
$value->inv = " ";
}
}
}
$fres['data'] = array(); $fres['data'] = array();
$res2 = new stdClass(); $res2 = new stdClass();
if($gid){ if($gid){
@ -1884,6 +1903,7 @@ class Corporate extends CI_Controller {
force_download('Payment_Advice_Sample.xlsx', $pth); force_download('Payment_Advice_Sample.xlsx', $pth);
} }
public function p_tmc_sample_download(){ public function p_tmc_sample_download(){
$this->checksess(); $this->checksess();
$this->load->helper('download'); $this->load->helper('download');

View File

@ -337,12 +337,15 @@
$("#usrforma").submit(function(e) { $("#usrforma").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form. e.preventDefault(); // avoid to execute the actual submit of the form.
var form = $(this); var form = $(this);
console.log(form.serialize());
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '<?php echo base_url('admin/add_corpdetail'); ?>', url: '<?php echo base_url('admin/add_corpdetail'); ?>',
data: form.serialize(), // serializes the form's elements. data: form.serialize(), // serializes the form's elements.
success: function(data) success: function(data)
{ {
console.log(JSON.parse(data));
if(data == 1){ if(data == 1){
$('#addclose').trigger('click'); $('#addclose').trigger('click');
usrforma.reset(); usrforma.reset();
@ -359,7 +362,8 @@
alert('Request failed. Kindly try after sometime'); alert('Request failed. Kindly try after sometime');
} }
}, },
error:function(){ error:function(err){
console.log(err);
alert('Request failed. Kindly try after sometime'); alert('Request failed. Kindly try after sometime');
} }
}); });

View File

@ -188,7 +188,7 @@
<th>REFID</th> <th>REFID</th>
<th>SEARCH</th> <th>SEARCH</th>
<th>MANUAL TKT NO</th> <th>MANUAL TKT NO</th>
<th>TICKET NO</th> <!-- <th>TICKET NO</th> -->
<th>INVOICE</th> <th>INVOICE</th>
@ -737,6 +737,16 @@ function() {
// return '<input type="text" class="form-control" data-refid="'+full['gd_id']+'" value="'+data+'" onblur="onblurrfn('+full['gd_id']+',this.value)" />'; // return '<input type="text" class="form-control" data-refid="'+full['gd_id']+'" value="'+data+'" onblur="onblurrfn('+full['gd_id']+',this.value)" />';
// } // }
// }, // },
{
"targets": 18,
"width": 300,
"render": function ( data, type, full, meta ) {
if(full['inv'] == " ")
return 'Invoice Missing';
else
return 'Invoice Received';
}
},
{ {
"targets": 19, "targets": 19,
"width": 300, "width": 300,
@ -757,16 +767,15 @@ function() {
{ {
"targets": 22, "targets": 22,
"render": function ( data, type, full, meta ) { "render": function ( data, type, full, meta ) {
return '<button class="form-control buttons tktdelredraw td_'+data+'" id="td_'+data+'">Search</button>' + return '<a onclick="deletegst2rarecon('+data+')" style="font-size:16px;"><i class="fa fa-trash" title="Delete"></i></a>'
'&nbsp;<a onclick="deletegst2rarecon('+data+')" style="font-size:16px;"><i class="fa fa-trash" title="Delete"></i></a>'
} }
}, },
{ {
"targets": 25, "targets": 24,
// "width": 300, // "width": 300,
"render": function ( data, type, full, meta ) { "render": function ( data, type, full, meta ) {
console.log(full['gd_id']); console.log(full['gd_id']);
return '<button type="text" style="border:none;" class="form-control" id="'+full['gd_id']+'" data-refid="'+full['gd_inv_no']+'" value="'+full['gd_inv_no']+'" onclick="viewinvfn('+full['gd_id']+')" >'+full['gd_inv_no']+'</button>'; return '<button type="text" style="border:none;" class="form-control" id="'+full['gd_id']+'" data-refid="'+full['gd_inv_no']+'" value="'+full['gd_inv_no']+'" onclick="viewinvfn('+full['gd_id']+')" >'+full['inv']+'</button>';
} }
} }
] ]

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lan="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
@ -530,7 +530,7 @@
}); });
$("#usrforma").submit(function(e) { $("#usrforma").submit(function(e) {
// alert('sdd') console.log("aaaaaaaa");
$('#loading1').show(); $('#loading1').show();
$('#submit1').hide(); $('#submit1').hide();
e.preventDefault(); // avoid to execute the actual submit of the form. e.preventDefault(); // avoid to execute the actual submit of the form.
@ -545,11 +545,9 @@
cache: false, cache: false,
async: false, async: false,
success: function(data) { success: function(data) {
console.log(data);
$('#loading1').hide(); $('#loading1').hide();
$('#submit1').show(); $('#submit1').show();
var pdata = JSON.parse(data); var pdata = JSON.parse(data);
console.log(pdata);
if (pdata.status == 1) { if (pdata.status == 1) {
$('#addclose').trigger('click'); $('#addclose').trigger('click');
usrforma.reset(); usrforma.reset();

View File

@ -228,7 +228,7 @@
<td><?php echo $value-> inv_tkt_no; ?></td> <td><?php echo $value-> inv_tkt_no; ?></td>
<?php <?php
if ($value->tmc_ticket_fare === $value->gstr2a_value && $value->tmc_ticket_fare === $value->total_values) if ($value->tmc_ticket_fare == $value->gstr2a_value && $value->tmc_ticket_fare == $value->total_values)
{ ?> { ?>
<td ><?php echo $value->total_values; ?></td> <td ><?php echo $value->total_values; ?></td>
<?php } <?php }

View File

@ -714,12 +714,24 @@ function() {
return data; return data;
} }
}, },
{
"targets": 12,
"width": 300,
"render": function ( data, type, full, meta ) {
console.log(full['inv']);
if (full['inv'] != " ") {
return 'Invoice Received';
}
else{
return 'Invoice Not Received';
}
}
},
{ {
"targets": 13, "targets": 13,
"width": 300, "width": 300,
"render": function ( data, type, full, meta ) { "render": function ( data, type, full, meta ) {
return `<button type="text" class="form-control" data-refid="${data}" value="${data}" onclick="viewfn(${data},1)" >View</button> return `<a id="${data}" onclick="deletetmcrecon(${data})" style="font-size:16px;text-align:center;"><i class="fa fa-trash" title="Delete"></i></a>`;
&nbsp;<a id="${data}" onclick="deletetmcrecon(${data})" style="font-size:16px;"><i class="fa fa-trash" title="Delete"></i></a>`;
} }
}, },
{ {

Binary file not shown.

Binary file not shown.

Binary file not shown.