monthly GST report added

This commit is contained in:
gandhimathi 2018-06-08 20:32:04 +05:30
parent 850afe2a59
commit 200e9d06d7
6 changed files with 933 additions and 0 deletions

View File

@ -276,6 +276,7 @@ $route['cashbookyearlyexpenses']="report/yearexpenses";
$route['Empperform']="report/per";
$route['cashbookcumulativereport']="report/cashbook_cumulative_report";
$route['cashbookcumulativemonthreport']="report/cashbook_month_cumulative_report";
$route['Report_monthly_gst'] = "report/monthly_gst";
// Company Information
$route['companyview'] = 'companycontroller/companyview';

View File

@ -1014,6 +1014,45 @@ class report extends BaseController
$this->loadviews("Report_pending_purchase",$this->global,$data, NULL);
}
public function monthly_gst()
{
$this->global['pageTitle'] = 'Siddharth : Reports';
if ($this->input->post('btn_submit')) {
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
//print_r($prod);
$data['monthly_gst_purchase']=$this->dahsboard_Model->monthly_gst_purchase($m,$frm,$t);
$data['monthly_gst_sales']=$this->dahsboard_Model->monthly_gst_sales($m,$frm,$t);
}
$data['finyear']=$this->dahsboard_Model->report_finyear();
$this->loadviews("Report_monthly_gst",$this->global,$data, NULL);
//print_r($data);die();
}
public function monthly_gst_table()
{
$this->global['pageTitle'] = 'Siddharth : Reports';
$m=$this->input->get('m');
$frm = $this->input->get('frm');
$t = $this->input->get('t');
// print_r($frm);
// print_r($t);
// print_r($m);die();
$data['monthly_gst_purchase']=$this->dahsboard_Model->purchase_gst($m,$frm,$t);
$data['monthly_gst_sales']=$this->dahsboard_Model->sales_gst($m,$frm,$t);
$this->loadviews("Report_monthly_gst_table",$this->global,$data, NULL);
//print_r($data);die();
}
/*******************Performance report start **************/
public function getFinancialStartDate()

View File

@ -2257,7 +2257,220 @@ if ($cname!= ''){
//echo $sql;
return $query->result();
}
function monthly_gst_purchase($m,$frm,$t){
$sql="select g.doc_no,g.date,g.doc_type,g.hsn_code,sum(g.value) as value,sum(g.others) as others,sum(g.sgst) as sgst,sum(g.cgst) as cgst,sum(g.igst) as igst,sum(g.total) as total from
(SELECT pm.PONO as doc_no,date_format(pm.PODate,'%d-%m-%Y') as date,
'Purchase' as doc_type,mm.HSNCODE as hsn_code,
mm.MaterialName as material_name,sd.SupplierName as supplier_name,
round(ifnull(sum(distinct pl.Quantity * pl.Rate),0),2) as value,
if(POType = 'IMPORT' or POType = 'CAPITAL',sum(distinct pm.ExchangeRate),0) as exchange_rate,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0) as sgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0) as cgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0) as igst,
(ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
+ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ifnull(rt.Insurance,0)
-ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)) as others,
round((
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0))
,2) as total
FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where
pm.Status != 'ST030' and pm.Status != 'ST056' and pm.Status != 'ST027'
group by doc_no,material_name,supplier_name) as g
left join T_PurchaseOrder_Master p on p.PONO = g.doc_no
where g.doc_no != 'null' ";
if ($m!= ''){
$sql.="and monthname(p.PODate) = '".$m."'";
}
if ($frm and $t != ''){
// $fromd= date("Y-m-d",strtotime($frm));
// $tod=date("Y-m-d",strtotime($t));
$sql.="and g.date >= '".$frm."'
and g.date <= '".$t."'";
}
//echo $sql;
$query = $this->db->query($sql);
return $query->result();
}
public function monthly_gst_sales($m=null,$frm=null,$t=null)
{
$sql = "select ii.invoice_id as invoice_id,ii.invoice_number as invoice_number,date_format(ii.invoice_date_created,'%d-%m-%Y') as dates,
sum(ifnull(((sgst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100),0))
as sgst,
sum(ifnull(((iit.item_quantity * iit.item_price) * cgst.tax_rate_percent)/100,0))
as cgst,
sum(ifnull((igst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100,0))
as igst,
sum((ifnull(((sgst.tax_rate_percent * iia.item_subtotal)/100),0)
+
ifnull(((iia.item_subtotal * cgst.tax_rate_percent)/100),0)
+
ifnull(((igst.tax_rate_percent * iia.item_subtotal)/100),0)))
as total
from ip_invoices ii
join ip_invoice_custom icf on icf.invoice_id = ii.invoice_id
join ip_invoice_items iit on iit.invoice_id = ii.invoice_id
join ip_invoice_item_amounts iia on iia.item_id = iit.item_id
join ip_clients ic on ic.client_id = ii.client_id
join ip_products ip on ip.product_id = iit.item_product_id
left join ip_tax_rates sgst on sgst.tax_rate_id = iit.sgst_item_tax_rate_id
left join ip_tax_rates cgst on cgst.tax_rate_id = iit.cgst_item_tax_rate_id
left join ip_tax_rates igst on igst.tax_rate_id = iit.igst_item_tax_rate_id
where icf.invoice_custom_fieldid = '8' and ii.invoice_status_id != 1 ";
if ($m!= ''){
$sql.="and monthname(ii.invoice_date_created) = '".$m."'";
}
if ($frm and $t != ''){
$fromdate= date("Y-m-d",strtotime($frm));
$todate=date("Y-m-d",strtotime($t));
$sql.="and ii.invoice_date_created >= '".$fromdate."'
and ii.invoice_date_created <= '".$todate."'";
}
//echo $sql;
$query = $this->db->query($sql);
return $query->result();
}
function sales_gst($m=null,$frm=null,$t=null)
{
$sql = "select ii.invoice_id as invoice_id,ii.client_id as client_id,ip.product_sku as hsn_code,ii.invoice_number as doc_no,date_format(ii.invoice_date_created,'%d-%m-%Y') as date,'Sales' as doc_type,TIME_FORMAT(ii.invoice_time_created,'%l:%i %p') as invoice_time_created,icf.invoice_custom_fieldvalue as vehicle_no,ip.product_description as product_description,concat(ic.client_name,'-',ic.client_surname)as client_name,sum(iit.item_quantity) as item_quantity,sum(iit.item_price) as item_price,sum(iia.item_subtotal) as value,
sum(ifnull(((sgst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100),0))
as sgst,
sum(ifnull(((iit.item_quantity * iit.item_price) * cgst.tax_rate_percent)/100,0))
as cgst,
sum(ifnull((igst.tax_rate_percent * (iit.item_quantity * iit.item_price))/100,0))
as igst,
round(sum((iia.item_subtotal + ifnull(((sgst.tax_rate_percent * iia.item_subtotal)/100),0)
+
ifnull(((iia.item_subtotal * cgst.tax_rate_percent)/100),0)
+
ifnull(((igst.tax_rate_percent * iia.item_subtotal)/100),0))),2)
as total
from ip_invoices ii
join ip_invoice_custom icf on icf.invoice_id = ii.invoice_id
join ip_invoice_items iit on iit.invoice_id = ii.invoice_id
join ip_invoice_item_amounts iia on iia.item_id = iit.item_id
join ip_clients ic on ic.client_id = ii.client_id
join ip_products ip on ip.product_id = iit.item_product_id
left join ip_tax_rates sgst on sgst.tax_rate_id = iit.sgst_item_tax_rate_id
left join ip_tax_rates cgst on cgst.tax_rate_id = iit.cgst_item_tax_rate_id
left join ip_tax_rates igst on igst.tax_rate_id = iit.igst_item_tax_rate_id
where icf.invoice_custom_fieldid = '8' and ii.invoice_status_id != 1 ";
if ($m!= ''){
$sql.="and monthname(ii.invoice_date_created) = '".$m."'";
}
if ($frm and $t != ''){
$fromdate= date("Y-m-d",strtotime($frm));
$todate=date("Y-m-d",strtotime($t));
$sql.="and ii.invoice_date_created >= '".$fromdate."'
and ii.invoice_date_created <= '".$todate."'";
}
// echo $fromdate;
//echo $sql;
$sql.="group by doc_no,product_description";
$query = $this->db->query($sql);
return $query->result();
}
function purchase_gst($m,$frm,$t){
$sql="SELECT pm.PONO as doc_no,pm.POType as potype,date_format(pm.PODate,'%d-%m-%Y') as date,
TIME_FORMAT(pm.PODate,'%l:%i %p') as created_time,'Purchase' as doc_type,mm.HSNCODE as hsn_code,
mm.MaterialName as material_name,sd.SupplierName as supplier_name,
ifnull(sum(distinct pl.Quantity),0) as quantity,mm.UOM as UOM,ifnull(sum(distinct pl.Rate),0) as rate,
round(ifnull(sum(distinct pl.Quantity * pl.Rate),0),2) as value,
if(POType = 'IMPORT' or POType = 'CAPITAL',sum(distinct pm.ExchangeRate),0) as exchange_rate,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0) as sgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0) as cgst,
ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0) as igst,
(ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
+ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ifnull(rt.Insurance,0)
-ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)) as others,
round((
if(POType = 'IMPORT',sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)),
if(POType = 'CAPITAL' && CapitalRange = 0,sum(distinct pm.ExchangeRate * (pl.Quantity * pl.Rate)),
ifnull(sum(pl.Quantity * pl.Rate),0)))
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterSGST),sum(distinct st.After_SGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterCGST),sum(distinct st.After_CGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterIGST),sum(distinct st.After_IGST)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterFreightValue),sum(distinct st.AfterFreightValue)),0)
+ ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterPackagingValue),0),0)
+ ifnull(rt.Insurance,0)
- ifnull(if(POType = 'REVENUE',sum(distinct rt.AfterDiscount),sum(distinct st.Afterdiscountval)),0)),2) as total
FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where
pm.Status != 'ST030' and pm.Status != 'ST056' and pm.Status != 'ST027' ";
if ($m!= ''){
$sql.="and monthname(pm.PODate) = '".$m."'";
}
if ($frm and $t != ''){
$fromd= date("Y-m-d",strtotime($frm));
$tod=date("Y-m-d",strtotime($t));
$sql.="and date(pm.PODate) >= '".$fromd."'
and date(pm.PODate) <= '".$tod."'";
}
$sql.="group by doc_no,material_name,supplier_name";
//echo $sql;
$query = $this->db->query($sql);
return $query->result();
}
function report_inwardcashbook($cname,$fa,$aa,$m,$frm,$t,$cat){
$sql="select tinex.account_code as AccountCode,date_format(tinex.date,'%d-%m-%Y') as Date,ac.name as AccountName,

View File

@ -0,0 +1,352 @@
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
}
th, td { white-space: nowrap; }
.dataTable > thead > tr > th[class*="sort"]:after{
content: "" !important;
}
table.dataTable thead > tr > th.sorting_asc,
table.dataTable thead > tr > th.sorting_desc,
table.dataTable thead > tr > th.sorting,
table.dataTable thead > tr > td.sorting_asc,
table.dataTable thead > tr > td.sorting_desc,
table.dataTable thead > tr > td.sorting {
padding-right: inherit;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Report - Monthly GST</b>
<br><br>
<?php
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
if($this->input->post('from_date') && $this->input->post('to_date')){
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
echo $frm.'-to-'.$t;
}
?>
</p></h3></center>
</div>
<!-- /.box-header -->
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-4">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-4">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2"><br><br>
<input type="submit" class="btn btn-success" name="btn_submit" style="margin-top: -14px;margin-bottom: 28px;"
value="View Report">
</div>
</div>
</form>
</div>
<div class="box-body">
<div class = "table-responsive">
<center><table class="table table-bordered" id="cc" width="70%" style="font-size:12px !important;">
<thead>
<tr>
<th style="text-align:center">Name</th>
<th style="text-align:center">Sales &nbsp;(<i class="fa fa-rupee " ></i>)</th>
<th style="text-align:center">Purchase &nbsp;(<i class="fa fa-rupee " ></i>)</th>
<th style="text-align:center">Net &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php
$m=$this->input->post('month');
$frm=$this->input->post('from_date');
$t=$this->input->post('to_date');
if(!empty($monthly_gst_purchase) and !empty($monthly_gst_sales)){ ?>
<tr>
<td style="text-align:center"><span>SGST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->sgst,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->sgst,2);?></span></td>
<td style="text-align:right"><span><?php
$sgst_net = $monthly_gst_sales[0]->sgst - $monthly_gst_purchase[0]->sgst;
echo round($sgst_net,2);?></span></td>
</tr>
<tr>
<td style="text-align:center"><span>CGST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->cgst,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->cgst,2);?></span></td>
<td style="text-align:right"><span><?php
$cgst_net = $monthly_gst_sales[0]->cgst - $monthly_gst_purchase[0]->cgst;
echo round($cgst_net,2);?></span></td>
</tr>
<tr>
<td style="text-align:center"><span>IGST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->igst,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->igst,2);?></span></td>
<td style="text-align:right"><span><?php
$igst_net = $monthly_gst_sales[0]->igst - $monthly_gst_purchase[0]->igst;
echo round($igst_net,2);?></span></td>
</tr>
<tr>
<td style="text-align:center"><span>Total GST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->total,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->total,2);?></span></td>
<td style="text-align:right"><span><?php
$total_net = $monthly_gst_sales[0]->total - $monthly_gst_purchase[0]->total;
echo round($total_net,2);?></span></td>
</tr>
<?php } ?>
</tbody>
<tfoot width="100%">
<!--<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td class="amount" style="text-align:right">
<strong>
// <?php
// {
// echo number_format($tot_pac,2,'.','');
// }
// ?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
// <?php
// {
// echo number_format($tot_inc,2,'.','');
// }
// ?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
// <?php
// {
// echo number_format($tot_tot,2,'.','');
// }
// ?>
</strong></td>
</tr>-->
</tfoot>
</table></center>
<div class="col-md-2" style="float: right;">
<form>
<a href="<?= base_url() ?>report/monthly_gst_table?m=<?php echo $m;?>&frm=<?php echo $frm;?>&t=<?php echo $t;?>"><input style="width: 100px; padding: 10px; cursor: pointer; box-shadow: 6px 6px 5px; #999; -webkit-box-shadow: 6px 6px 5px #999; -moz-box-shadow: 6px 6px 5px #999; font-weight: bold; background: #3c8dbc; color: #000; border-radius: 10px; border: 1px solid #999; font-size: 100%;" type="button" value="View details"/></a>
</form>
</div>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": false,
"info": false,
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: 'Report Monthly GST',
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$('#mySelect').on('change',function(){
table
.column(4)
.search(this.value)
.draw();
});
$( function() {
//var dateFormat = "mm/dd/yy",
from = $( "#min-date" )
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
to.datepicker("option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
function Reset()
{
$('#mySelect').val('');
}
</script>

View File

@ -0,0 +1,324 @@
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #3c8dbc;
border-color: #3c8dbc;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Monthly GST Summary Report</b><br><br>
</p></h3></center>
</div>
<!-- /.box-header -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" >
<thead>
<tr>
<th style="text-align:center">Date</th>
<th style="text-align:center">Document Number</th>
<th style="text-align:center">Document Type</th>
<th style="text-align:center">HSN CODE</th>
<th style="text-align:center">Value &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Others &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">SGST &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">CGST &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">IGST &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Total &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php
$tot_val = 0;
$tot_oth = 0;
$tot_sgst = 0;
$tot_cgst = 0;
$tot_igst = 0;
$tot_tot = 0;
if(!empty($monthly_gst_purchase)){
foreach($monthly_gst_purchase as $rel)
{
?>
<tr>
<td style="text-align:center"><span><?php echo $rel->date;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_no;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_type;?></span></td>
<td style="text-align:center"><span><?php echo $rel->hsn_code;?></span></td>
<td style="text-align:right"><span><?php
$tot_val= $tot_val + round($rel->value,2);
echo $rel->value;
?></span></td>
<td style="text-align:right"><span><?php
$tot_oth= $tot_oth + round($rel->others,2);
echo $rel->others;
?></span></td>
<td style="text-align:right"><span><?php
$tot_sgst= $tot_sgst + round($rel->sgst,2);
echo $rel->sgst;
?></span></td>
<td style="text-align:right"><span><?php
$tot_cgst= $tot_cgst + round($rel->cgst,2);
echo $rel->cgst;
?></span></td>
<td style="text-align:right"><span><?php
$tot_igst= $tot_igst + round($rel->igst,2);
echo $rel->igst;
?></span></td>
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
echo $rel->total;
?></span></td>
</tr>
<?php
}
}
if(!empty($monthly_gst_sales)){
foreach($monthly_gst_sales as $rel)
{
?>
<tr>
<td style="text-align:center"><span><?php echo $rel->date;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_no;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_type;?></span></td>
<td style="text-align:center"><span><?php echo $rel->hsn_code;?></span></td>
<td style="text-align:right"><span><?php
$tot_val= $tot_val + round($rel->value,2);
echo round($rel->value,2);
?></span></td>
<td></td>
<td style="text-align:right"><span><?php
$tot_sgst= $tot_sgst + round($rel->sgst,2);
echo round($rel->sgst,2);
?></span></td>
<td style="text-align:right"><span><?php
$tot_cgst= $tot_cgst + round($rel->cgst,2);
echo round($rel->cgst,2);
?></span></td>
<td style="text-align:right"><span><?php
$tot_igst= $tot_igst + round($rel->igst,2);
echo round($rel->igst,2);
?></span></td>
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
echo round($rel->total,2);
?></span></td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_val,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_oth,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_sgst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_cgst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_igst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_tot,2,'.','');
}
?>
</strong></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$( function() {
//var dateFormat = "mm/dd/yy",
from = $( "#min-date" )
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
to.datepicker("option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
function Reset()
{
$('#mySelect').val('');
}
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>

View File

@ -68,6 +68,10 @@
<a href="<?php echo base_url(); ?>cashbookyearlyexpenses" target="_blank" ><p class="uk-text uk-margin-remove">Cashbook Yearly Expenses</p></a>-->
</div>
<div class="col-xs-3">
<h4><span class="fa fa-money ">&nbsp; GST Reports </span></h4>
<a href="<?php echo base_url(); ?>Report_monthly_gst" target="_blank" > Monthly GST Summary Report <p class="uk-text uk-margin-remove"></p></a>
</div>
</div>
</div>