sia-Inward report issues fixes

This commit is contained in:
venbatechnologies@gmail.com 2018-06-09 11:35:06 +05:30
parent 200e9d06d7
commit 0505148606
3 changed files with 60 additions and 111 deletions

View File

@ -2473,7 +2473,7 @@ $sql.="group by doc_no,material_name,supplier_name";
} }
function report_inwardcashbook($cname,$fa,$aa,$m,$frm,$t,$cat){ 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, $sql="select tinex.account_code as AccountCode,date_format(tinex.date,'%d-%m-%Y') as Date,ac.name as AccountName,date_format(tinex.created_on,'%d-%m-%Y') as CreatedDate,
tinex.type as type,tinex.cashtype as category ,tinex.merchant as merchantname,tinex.Supplier_id as Supplierid,sup.SupplierName as Suppliername, tinex.sgst as sgst, tinex.type as type,tinex.cashtype as category ,tinex.merchant as merchantname,tinex.Supplier_id as Supplierid,sup.SupplierName as Suppliername, tinex.sgst as sgst,
tinex.value_before_gst as Value,tinex.cgst as cgst,tinex.igst as igst,tinex.document as cashbookfile, tinex.value_before_gst as Value,tinex.cgst as cgst,tinex.igst as igst,tinex.document as cashbookfile,
tinex.total as Total tinex.total as Total
@ -2488,17 +2488,17 @@ $sql.="group by doc_no,material_name,supplier_name";
} }
if ($fa and $aa != ''){ if ($fa and $aa != ''){
$sql.=" and (tinex.created_on >= '".$fa."-04-01' and tinex.created_on <= '".$aa."-03-31')"; $sql.=" and (tinex.date >= '".$fa."-04-01' and tinex.date <= '".$aa."-03-31')";
} }
if ($m!= ''){ if ($m!= ''){
$sql.="and monthname(tinex.created_on) = '".$m."'"; $sql.="and monthname(tinex.date) = '".$m."'";
} }
if ($frm and $t != ''){ if ($frm and $t != ''){
$fromd= date("Y-m-d",strtotime($frm)); $fromd= date("Y-m-d",strtotime($frm));
$tod=date("Y-m-d",strtotime($t)); $tod=date("Y-m-d",strtotime($t));
$sql.="and date(tinex.created_on) >= '".$fromd."' $sql.="and date(tinex.date) >= '".$fromd."'
and date(tinex.created_on) <= '".$tod."'"; and date(tinex.date) <= '".$tod."'";
} }
if ($cat!= ''){ if ($cat!= ''){
$sql.=" and tinex.type = '".$cat."' "; $sql.=" and tinex.type = '".$cat."' ";

View File

@ -1,49 +1,35 @@
<?php
if(!empty($mms))
{
}
?>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$("#client_name").select2(); $("#client_name").select2();
$("#item_name").select2(); $("#item_name").select2();
});
});
</script> </script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
<style>
.dataTables_filter input {padding: 4px;} .dataTables_filter input {padding: 4px;}
.dataTables_filter { .dataTables_filter {
width: 50%; width: 50%;
float: right; float: right;
text-align: right; text-align: right;
} }
.dataTables_paginate { .dataTables_paginate {
width: 50%; width: 50%;
float: right; float: right;
text-align: right; text-align: right;
} }
div.dt-buttons { div.dt-buttons {
position: relative; position: relative;
float: right; float: right;
} }
.btn-success { .btn-success {
background-color: #3c8dbc; background-color: #3c8dbc;
border-color: #3c8dbc; border-color: #3c8dbc;
} }
</style>
</style> <div class="content-wrapper">
<div class="content-wrapper">
<section class="content"> <section class="content">
<div class="row" style="min-height: 600px;"> <div class="row" style="min-height: 600px;">
<!-- Left col --> <!-- Left col -->
@ -186,20 +172,17 @@ if(!empty($mms))
</div> </div>
<!-- <div class="container"> -->
<div class="modal fade" id="Fileshow" role="dialog"> <div class="modal fade" id="Fileshow" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<form> <form>
<div class="modal-content" style="width:800px;"> <div class="modal-content" style="width:800px;">
<!-- Table to show the line item of po --> <!-- Table to show the line item of po -->
<div id="content" > </div> <div id="content" > </div>
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;"> <table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>SNo</th> <th>SNo</th>
@ -213,7 +196,7 @@ if(!empty($mms))
<tbody id="tbleAppend1"> <tbody id="tbleAppend1">
</tbody> </tbody>
</table> </table>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a> <a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
@ -240,7 +223,6 @@ if(!empty($mms))
<th style="text-align:center">Supplier Name</th> <th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Total &nbsp;(<i class="fa fa-rupee "></i>)</th> <th style="text-align:center">Total &nbsp;(<i class="fa fa-rupee "></i>)</th>
<th style="text-align:center">Attachments</th> <th style="text-align:center">Attachments</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -248,7 +230,7 @@ if(!empty($mms))
$tot_tot = 0; $tot_tot = 0;
foreach($purchase as $rel) foreach($purchase as $rel)
{ {
?> ?>
<tr> <tr>
@ -265,27 +247,12 @@ if(!empty($mms))
$tot_tot= $tot_tot + round($rel->total,2); $tot_tot= $tot_tot + round($rel->total,2);
echo $rel->total; echo $rel->total;
?></span></td> ?></span></td>
<!-- <td style="text-align:center"><span>
<?php <td style="text-align:center"><span>
if(!empty($rel->file)){ ?>
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php }else if(!empty($rel->ifile)) { ?>
<a target="_blank" href="<?php echo base_url().''. $rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
<?php
}else
{
echo 'N/A';
}
?>
</span></td> -->
<td style="text-align:center"><span>
<?php <?php
if(!empty($rel->file)){ ?> if(!empty($rel->file)){ ?>
<a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="files<?php echo $rel->pono;?>">Download</button></a> <a target="_blank" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm splpofile" id="files<?php echo $rel->pono;?>">Download</button></a>
<?php }else if(!empty($rel->ifile)) { ?>
<?php }else if(!empty($rel->ifile)) { ?>
<a target="_blank" href="<?php echo base_url().''. $rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm">Download</button></a> <a target="_blank" href="<?php echo base_url().''. $rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button class="btn btn-info btn-sm">Download</button></a>
<?php <?php
}else { }else {
@ -302,30 +269,22 @@ if(!empty($mms))
</tbody> </tbody>
<tfoot width="100%"> <tfoot width="100%">
<tr> <tr>
<td style="text-align:center;"><strong>Total</strong></td> <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><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td> <td><strong>&nbsp</strong></td>
<td class="amount" style="text-align:right"> <td class="amount" style="text-align:right">
<strong> <strong><?php {
<?php echo number_format($tot_tot,2,'.','');
{ }
echo number_format($tot_tot,2,'.',''); ?></strong></td>
<td><strong>&nbsp</strong></td>
} </tr>
</tfoot>
?> <?php
</strong></td>
<td><strong>&nbsp</strong></td>
</tr>
</tfoot>
<?php
} }
?> ?>
</table> </table>
</div> </div>

View File

@ -303,7 +303,7 @@ table.dataTable thead > tr > td.sorting {
//$tot_inc = 0; //$tot_inc = 0;
$tot_tot = 0; $tot_tot = 0;
if(!empty($purchase)){ if(!empty($purchase)){
foreach($purchase as $rel) foreach($purchase as $key => $rel)
{ {
?> ?>
<tr id="lastvalue"> <tr id="lastvalue">
@ -380,8 +380,7 @@ table.dataTable thead > tr > td.sorting {
?> ?>
<tr> <tr>
<td style="text-align:left"><span><?php echo $cb->AccountCode;?></span></td> <td style="text-align:left"><span><?php echo $cb->AccountCode;?></span></td>
<td style="text-align:center"><span><?php echo $cb->created_date;?></span></td> <td style="text-align:center"><span><?php echo $cb->CreatedDate;?></span></td>
<!-- <td style="text-align:right"><span><?php echo $cb->created_time;?></span></td> -->
<td style="text-align:right"><span><?php echo '-';?></span></td> <td style="text-align:right"><span><?php echo '-';?></span></td>
<td style="text-align:center"><span><?php echo $cb->Date;?></span></td> <td style="text-align:center"><span><?php echo $cb->Date;?></span></td>
<td><span><?php echo $cb->AccountName;?></span></td> <td><span><?php echo $cb->AccountName;?></span></td>
@ -525,47 +524,37 @@ table.dataTable thead > tr > td.sorting {
// Set up your table // Set up your table
$(document).ready(function() { $(document).ready(function() {
$('.splpofile').click(function() { $('.splpofile').click(function() {
var id = $(this).attr('id'); var id = $(this).attr('id');
$("#Fileshow").modal("show"); $("#Fileshow").modal("show");
$.ajax({ $.ajax({
data:{id:id}, data:{id:id},
type:"POST", type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>report/Viewfiles", url:"<?php echo base_url() ?>report/Viewfiles",
success: function(data){ success: function(data){
//console.log((data));
var trHTML = ''; var trHTML = '';
$.each($.parseJSON(data), function (i, item) { $.each($.parseJSON(data), function (i, item) {
i=i+1; i=i+1;
trHTML += '<tr>' + trHTML += '<tr>' +
'<td align="right">' + i + '</td>' + '<td align="right">' + i + '</td>' +
'<td>' + item.BillNo+ '</td>' +
'<td>' + item.BillNo+ '</td>' + '<td>' + item.PONO+ '</td>' +
'<td>' + item.PONO+ '</td>' + '<td><a target="_blank" href = <?php echo base_url()?>uploads/BillFiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
'</tr>';
'<td><a target="_blank" href = <?php echo base_url()?>uploads/BillFiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
// '<td>' +item.FilePath+"<?php echo base_url().'uploads/BillFiles/'?>"> +'</td>'
'</tr>';
});
});
$("#tbleAppend1").empty(); $("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML); $('#Inwardgateregistertable1 > tbody').append(trHTML);
} }
}); });
}); });//onclick function closed
/******************** Datatable codes starts here **************************/
$.fn.dataTable.moment( 'DD-MM-YYYY' ); $.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( { table = $('#cc').DataTable( {
@ -595,6 +584,7 @@ $("#Fileshow").modal("show");
] ]
} ); } );
} ); } );
$('#mySelect').on('change',function(){ $('#mySelect').on('change',function(){