diff --git a/application/controllers/Corporate.php b/application/controllers/Corporate.php index bce0ac9..a317d4c 100644 --- a/application/controllers/Corporate.php +++ b/application/controllers/Corporate.php @@ -41,6 +41,11 @@ class Corporate extends CI_Controller { $this->checksess(); $this->load->view('corporate/dashboard'); } + + public function tmc_dashboard(){ + $this->checksess(); + $this->load->view('corporate/tmc'); + } public function get_alike_tkts($gid = null){ $this->checksess(); @@ -379,7 +384,7 @@ class Corporate extends CI_Controller { // if($gid) // $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 td_inv_date between "'.$fromdate.'" and "'.$todate.'" order by td_id desc'); + $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'); $fres['data'] = array(); $res2 = new stdClass(); foreach($res->result() as $res1){ @@ -416,12 +421,12 @@ class Corporate extends CI_Controller { $fromdate = $this->input->post('fromdate'); $todate = $this->input->post('todate'); if($gid) - $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_id = "'.$gid.'"'); + $res = $this->db->query('select *,am_code as supplier_code from gstr2a_data where is_active = 1 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_id = "'.$gid.'" and gd.is_active = 1'); // $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 where gd_id = "'.$gid.'"'); // $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_id = "'.$gid.'"'); 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_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.'"'); $fres['data'] = array(); $res2 = new stdClass(); diff --git a/application/controllers/Tmc.php b/application/controllers/Tmc.php index c7c4421..505d5a0 100644 --- a/application/controllers/Tmc.php +++ b/application/controllers/Tmc.php @@ -467,5 +467,65 @@ class Tmc extends CI_Controller { echo json_encode($data); } + + public function delete_tmc(){ + $update_data['is_active'] = 0; + $this->db->where('f_id', $this->input->post('id')); + $data = $this->db->update('files',$update_data); + if ($data) { + $this->db->where('td_tfid', $this->input->post('id')); + $data1 = $this->db->update('tmc_data',$update_data); + if ($data1) { + echo 1; + } else { + echo 0; + } + } else { + echo 0; + } + + } + + public function delete_tmc_recon(){ + $update_data['is_active'] = 0; + $this->db->where('td_id', $this->input->post('id')); + $data = $this->db->update('tmc_data',$update_data); + if ($data) { + echo 1; + } else { + echo 0; + } + + } + + public function delete_gst2ra(){ + $update_data['is_active'] = 0; + $this->db->where('f_id', $this->input->post('id')); + $data = $this->db->update('files',$update_data); + if ($data) { + $this->db->where('gd_gid', $this->input->post('id')); + $data1 = $this->db->update('gstr2a_data',$update_data); + if ($data1) { + echo 1; + } else { + echo 0; + } + } else { + echo 0; + } + + } + + public function delete_gst2ra_recon(){ + $update_data['is_active'] = 0; + $this->db->where('gd_id', $this->input->post('id')); + $data = $this->db->update('gstr2a_data',$update_data); + if ($data) { + echo 1; + } else { + echo 0; + } + + } } diff --git a/application/models/Corporate_model.php b/application/models/Corporate_model.php index c5e20fa..ee10281 100644 --- a/application/models/Corporate_model.php +++ b/application/models/Corporate_model.php @@ -48,6 +48,7 @@ class Corporate_model extends CI_Model { function get_tmc(){ $con['f_type'] = 'tmc'; + $con['is_active'] = 1; $con['f_corporateid'] = $this->session->userdata['recon_sess_i']['u_corporateid']; $this->db->from('files tmc'); $this->db->join('corporates c','c.c_id=tmc.f_corporateid','inner'); diff --git a/application/views/corporate/gstr2a.php b/application/views/corporate/gstr2a.php index b906a05..cd97945 100644 --- a/application/views/corporate/gstr2a.php +++ b/application/views/corporate/gstr2a.php @@ -618,7 +618,8 @@ "render": function ( data, type, full, meta ) { // return '    '; - return ''; + return ` +   `; } } @@ -674,6 +675,40 @@ $('#download_modal').modal('show'); } + + function deletetmc(data) + { + console.log(data); + var r=confirm("Are you sure you want to delte this"); + if (r==true) + { + //User Pressed okay. Delete + $.ajax({ + url: '', + type: 'POST', + data: { id : data }, + success: function(data) { + if (data == 1) { + alert("Deleted") + location.reload(); + } + else{ + alert("Request failed. Kindly try after sometime") + } + }, + error: function() { + alert('Request failed. Kindly try after sometime.'); + } + }); + } + else + { + //user pressed cancel. Do nothing + console.log("done"); + } + + } + diff --git a/application/views/corporate/gstr2a_recon.php b/application/views/corporate/gstr2a_recon.php index 74355b8..9aca9c8 100644 --- a/application/views/corporate/gstr2a_recon.php +++ b/application/views/corporate/gstr2a_recon.php @@ -741,13 +741,16 @@ function() { "targets": 20, "width": 300, "render": function ( data, type, full, meta ) { + console.log(data,"kkkkk"); return ''; } }, { "targets": 22, "render": function ( data, type, full, meta ) { - return ''; + console.log(data); + return '' + + ' ' } } ] @@ -916,6 +919,41 @@ function() { }) } */ + + function deletegst2rarecon(data) + { + + console.log(data,"data"); + var r=confirm("Are you sure you want to delete this"); + if (r==true) + { + //User Pressed okay. Delete + $.ajax({ + url: '', + type: 'POST', + data: { id : data }, + success: function(data) { + if (data == 1) { + alert("Deleted") + // location.reload(); + $("#formid").submit() + } + else{ + alert("Request failed. Kindly try after sometime") + } + }, + error: function() { + alert('Request failed. Kindly try after sometime.'); + } + }); + } + else + { + //user pressed cancel. Do nothing + console.log("done"); + } + + } diff --git a/application/views/corporate/includes/top_nav.php b/application/views/corporate/includes/top_nav.php index c8822df..b537eb9 100644 --- a/application/views/corporate/includes/top_nav.php +++ b/application/views/corporate/includes/top_nav.php @@ -82,7 +82,8 @@ Files
diff --git a/application/views/corporate/tmc.php b/application/views/corporate/tmc.php index 68f6249..a5406c4 100644 --- a/application/views/corporate/tmc.php +++ b/application/views/corporate/tmc.php @@ -228,6 +228,47 @@ + + + + + + @@ -485,7 +530,7 @@ }); $("#usrforma").submit(function(e) { - + console.log("aaaaaaaa"); $('#loading1').show(); $('#submit1').hide(); e.preventDefault(); // avoid to execute the actual submit of the form. @@ -493,17 +538,90 @@ var formData = new FormData($("#usrforma")[0]); $.ajax({ type: "POST", - url: '', + url: '', + data: formData, + processData: false, + contentType: false, + cache: false, + async: false, + success: function(data) { + $('#loading1').hide(); + $('#submit1').show(); + var pdata = JSON.parse(data); + if (pdata.status == 1) { + $('#addclose').trigger('click'); + usrforma.reset(); + alert('File uploaded successfully.'); +// alert('File uploaded successfully. Records insertred - ' + pdata.added_records); + // getcorplisting(); + location.reload(); + } else if (pdata.status == 31) { + alert('File already uploaded for this criteria.'); + } else if (pdata.status == 13) { + alert('Error. Column mismatch.'); + } else if (pdata.status == 0) { + $('#fileref').val(pdata.insref); + var content = 'Total Records - '+pdata.ttlrows+'
Invalid Records - '+pdata.invalidrows; + if(pdata.duprecords != 0) + content += '
Duplicate Records - '+pdata.duprecords; +// var content = 'Error in
'; +// var row = 1; +// $.each(pdata.error, function(k, v){ +// $.each(v, function(kk, vv) { +// var l = 0; +// if (kk == 'column') { +// if (l == 0) { +// content += 'Row ' + row + ' - '; +// l = l + 1; +// } +// for (var i = 0; i < vv.length; i++) { +// content += vv[i] + ','; +// } +// content += '
'; +// row = row + 1; +// } +// }) +// }) + $('#addclose').trigger('click'); + $('#responsecontent').html(content+'
*Note : If you proceed only valid records will be uploaded.'); + $('#responsemref').trigger('click'); + + // console.log(content); + // var content='Error in \n'; + // $.each(pdata.error,function(k,v){ + // var sary = v.split('-'); + // content += 'Row '+sary[0]+' - Column - '+sary[1]+'\n'; + // }) + // content += 'Kindly correct the data and upload'; + // alert(content); + } else { + alert('Request failed. Kindly try after sometime'); + } + }, + error: function() { + alert('Request failed. Kindly try after sometime'); + } + }); + }); + + + $("#usrformb").submit(function(e) { + $('#loading1').show(); + $('#submit1').hide(); + e.preventDefault(); // avoid to execute the actual submit of the form. + // var form = $(this); + var formData = new FormData($("#usrformb")[0]); + $.ajax({ + type: "POST", + url: '', data: formData, processData: false, contentType: false, cache: false, async: false, success: function(data) { - $('#loading1').hide(); $('#submit1').show(); - var pdata = JSON.parse(data); if (pdata.status == 1) { $('#addclose').trigger('click'); @@ -607,7 +725,9 @@ "render": function(data, type, full, meta) { // return '    '; - return ''; + return ` +   +   `; } } @@ -655,10 +775,11 @@ type: "POST", url: url, success: function(data) { - console.log(data); if(data.length > 2){ oTable.clear(); var jsonData = JSON.parse(data); + // console.log(jsonData.data[0].f_id); + // console.log(jsonData); var jd = jsonData.data; var htmlData = ''; var i = 0; @@ -681,6 +802,49 @@ $('#download_modal').modal('show'); } + function deletetmc(data) + { + console.log(data); + var r=confirm("Are you sure you want to delte this"); + if (r==true) + { + //User Pressed okay. Delete + $.ajax({ + url: '', + type: 'POST', + data: { id : data }, + success: function(data) { + if (data == 1) { + alert("Deleted") + location.reload(); + } + else{ + alert("Request failed. Kindly try after sometime") + } + }, + error: function() { + alert('Request failed. Kindly try after sometime.'); + } + }); + } + else + { + //user pressed cancel. Do nothing + console.log("done"); + } + + } + + function uploadfn(data1,data2,data3,data4) + { + console.log(data1); + $("#upload_id").val(data1); + $("#f_month").val(data2); + $("#f_year").val(data3); + $("#f_agent").val("dummy"); + $('#upload_modal').modal('show'); + } + diff --git a/application/views/corporate/tmc_recon.php b/application/views/corporate/tmc_recon.php index 8fdceaa..f5da554 100644 --- a/application/views/corporate/tmc_recon.php +++ b/application/views/corporate/tmc_recon.php @@ -684,7 +684,8 @@ function() { "targets": 13, "width": 300, "render": function ( data, type, full, meta ) { - return ''; + return ` +  `; } } ] @@ -713,6 +714,41 @@ function() { oTable.columns(remaining_column).visible(true); }); + + function deletetmcrecon(data) + { + + + var r=confirm("Are you sure you want to delete this"); + if (r==true) + { + //User Pressed okay. Delete + $.ajax({ + url: '', + type: 'POST', + data: { id : data }, + success: function(data) { + if (data == 1) { + alert("Deleted") + // location.reload(); + $("#formid").submit() + } + else{ + alert("Request failed. Kindly try after sometime") + } + }, + error: function() { + alert('Request failed. Kindly try after sometime.'); + } + }); + } + else + { + //user pressed cancel. Do nothing + console.log("done"); + } + + } diff --git a/application/views/tmc/tmc.php b/application/views/tmc/tmc.php index 1a9c332..ccf2be8 100644 --- a/application/views/tmc/tmc.php +++ b/application/views/tmc/tmc.php @@ -726,7 +726,8 @@ // return '    '; return ` -   `; +   +   `; } } @@ -801,6 +802,39 @@ $('#download_modal').modal('show'); } + function deletetmc(data) + { + console.log(data); + var r=confirm("Are you sure you want to delte this"); + if (r==true) + { + //User Pressed okay. Delete + $.ajax({ + url: '', + type: 'POST', + data: { id : data }, + success: function(data) { + if (data == 1) { + alert("Deleted") + location.reload(); + } + else{ + alert("Request failed. Kindly try after sometime") + } + }, + error: function() { + alert('Request failed. Kindly try after sometime.'); + } + }); + } + else + { + //user pressed cancel. Do nothing + console.log("done"); + } + + } + function uploadfn(data1,data2,data3,data4) { console.log(data1); diff --git a/application/views/tmc/tmc_recon.php b/application/views/tmc/tmc_recon.php index a6c3b99..975a832 100644 --- a/application/views/tmc/tmc_recon.php +++ b/application/views/tmc/tmc_recon.php @@ -116,7 +116,7 @@
- +
@@ -162,7 +162,7 @@ - +
@@ -391,6 +391,8 @@ function() { diff --git a/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681897945.xlsx b/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681897945.xlsx new file mode 100644 index 0000000..de5beac Binary files /dev/null and b/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681897945.xlsx differ diff --git a/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681898212.xlsx b/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681898212.xlsx new file mode 100644 index 0000000..030ab43 Binary files /dev/null and b/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681898212.xlsx differ diff --git a/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681984011.xlsx b/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681984011.xlsx new file mode 100644 index 0000000..de5beac Binary files /dev/null and b/uploads/2/gstr2a/GSTR2A-ASAASA-Jan-2023-1681984011.xlsx differ diff --git a/uploads/2/tmc/TMC-A-Jan-2020-1681887908.xlsx b/uploads/2/tmc/TMC-A-Jan-2020-1681887908.xlsx new file mode 100644 index 0000000..3927cbd Binary files /dev/null and b/uploads/2/tmc/TMC-A-Jan-2020-1681887908.xlsx differ diff --git a/uploads/2/tmc/TMC-TEST-Jan-2020-1681887516.xlsx b/uploads/2/tmc/TMC-TEST-Jan-2020-1681887516.xlsx new file mode 100644 index 0000000..3927cbd Binary files /dev/null and b/uploads/2/tmc/TMC-TEST-Jan-2020-1681887516.xlsx differ diff --git a/uploads/2/tmc/TMC-TEST-Jan-2020-1681887603.xlsx b/uploads/2/tmc/TMC-TEST-Jan-2020-1681887603.xlsx new file mode 100644 index 0000000..3927cbd Binary files /dev/null and b/uploads/2/tmc/TMC-TEST-Jan-2020-1681887603.xlsx differ diff --git a/uploads/2/tmc/TMC-TEST-Jan-2020-1681890292.xlsx b/uploads/2/tmc/TMC-TEST-Jan-2020-1681890292.xlsx new file mode 100644 index 0000000..5ac5287 Binary files /dev/null and b/uploads/2/tmc/TMC-TEST-Jan-2020-1681890292.xlsx differ diff --git a/uploads/2/tmc/TMC-dummy-Jan-2020-1681890129.xlsx b/uploads/2/tmc/TMC-dummy-Jan-2020-1681890129.xlsx new file mode 100644 index 0000000..5ac5287 Binary files /dev/null and b/uploads/2/tmc/TMC-dummy-Jan-2020-1681890129.xlsx differ diff --git a/uploads/2/tmc/TMC-dummy-Jan-2020-1681890402.xlsx b/uploads/2/tmc/TMC-dummy-Jan-2020-1681890402.xlsx new file mode 100644 index 0000000..c55387e Binary files /dev/null and b/uploads/2/tmc/TMC-dummy-Jan-2020-1681890402.xlsx differ diff --git a/uploads/2/tmc/TMC-dummy-Jan-2020-1681897749.xlsx b/uploads/2/tmc/TMC-dummy-Jan-2020-1681897749.xlsx new file mode 100644 index 0000000..aa198e1 Binary files /dev/null and b/uploads/2/tmc/TMC-dummy-Jan-2020-1681897749.xlsx differ diff --git a/uploads/2/tmc/TMC-testagent-Jan-2020-1681887718.xlsx b/uploads/2/tmc/TMC-testagent-Jan-2020-1681887718.xlsx new file mode 100644 index 0000000..3927cbd Binary files /dev/null and b/uploads/2/tmc/TMC-testagent-Jan-2020-1681887718.xlsx differ diff --git a/uploads/2/tmc/TMC-testagent-Jan-2020-1681889907.xlsx b/uploads/2/tmc/TMC-testagent-Jan-2020-1681889907.xlsx new file mode 100644 index 0000000..3927cbd Binary files /dev/null and b/uploads/2/tmc/TMC-testagent-Jan-2020-1681889907.xlsx differ diff --git a/uploads/2/tmc/TMC-testagent-Jan-2020-1681972327.xlsx b/uploads/2/tmc/TMC-testagent-Jan-2020-1681972327.xlsx new file mode 100644 index 0000000..aa198e1 Binary files /dev/null and b/uploads/2/tmc/TMC-testagent-Jan-2020-1681972327.xlsx differ