issues fixed in inward summary report

This commit is contained in:
venbatechnologies@gmail.com 2018-06-23 15:57:00 +05:30
parent 291b612779
commit 586195e305
5 changed files with 263 additions and 202 deletions

View File

@ -514,7 +514,7 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat);
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$cat);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
@ -1198,5 +1198,19 @@ class report extends BaseController
$this->loadviews("cashbook_cumulative_month_report",$this->global,$data, NULL);
}
function Viewfiles()
{
$PO= $this->input->post('id');
$PONO= substr($PO,5);
$data = $this->dahsboard_Model->getfile($PONO);
echo json_encode($data);
}
}
?>

View File

@ -9,8 +9,17 @@ class dahsboard_Model extends CI_Model
$query =$this->db->query($sql);
return $query->result();
}
function getfile($PONO)
{
$this->db->select('*');
$this->db->from('T_PurchaseOrder_BillUpload');
$this->db->where('PONO',$PONO);
$query = $this->db->get();
$result = $query->result_array();
return $result;
}
/* HR DASHBOART Model START*/
function totemp()

View File

@ -1,43 +1,36 @@
<script>
$(document).ready(function () {
$("#client_name").select2();
$("#item_name").select2();
});
$("#item_name").select2();
});
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
<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 {
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="content-wrapper">
<section class="content"><br/>
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
@ -179,21 +172,51 @@
</div>
<div class="modal fade" id="Fileshow" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:800px;">
<!-- Table to show the line item of po -->
<div id="content" > </div>
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>SNo</th>
<th>BillNO</th>
<th>PONO</th>
<th>FileName</th>
</tr>
</thead>
<tbody id="tbleAppend1">
</tbody>
</table>
<div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
</form>
</div>
</div>
<!-- </div> -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" >
<thead>
<tr>
<th style="text-align:center">PO No</th>
<th style="text-align:center">Date</th>
<th style="text-align:center">IGR Created Date</th>
<th style="text-align:center">Material Received Date</th>
<th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Total &nbsp;(&#8377;)</th>
<th style="text-align:center">Attachments</th>
</tr>
</thead>
<tbody>
@ -201,7 +224,7 @@
$tot_tot = 0;
foreach($purchase as $rel)
foreach($purchase as $rel)
{
?>
<tr>
@ -218,21 +241,18 @@
$tot_tot= $tot_tot + round($rel->total,2);
echo $rel->total;
?></span></td>
<td style="text-align:center"><span>
<td style="text-align:center"><span>
<?php
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>
<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)) { ?>
<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
}else
{
echo 'Not Available';//echo 'N/A';
}else {
echo 'N/A';
}
?>
</span></td>
</tr>
<?php
@ -242,30 +262,22 @@
</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_tot,2,'.','');
}
?>
</strong></td>
<td><strong>&nbsp</strong></td>
</tr>
</tfoot>
<?php
<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_tot,2,'.','');
}
?></strong></td>
<td><strong>&nbsp</strong></td>
</tr>
</tfoot>
<?php
}
?>
?>
</table>
</div>
@ -276,7 +288,7 @@
<!-- /.col -->
</div>
</section>
</div>
</div>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
@ -294,21 +306,61 @@
// Set up your table
$(document).ready(function() {
$('.splpofile').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>report/Viewfiles",
success: function(data){
//console.log((data));
var trHTML = '';
$.each($.parseJSON(data), function (i, item) {
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td>' + item.BillNo+ '</td>' +
'<td>' + item.PONO+ '</td>' +
'<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();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
});
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {
"language": {
"emptyTable":"<center> Data Not Found ! </center>"
},
"aaSorting": [[ 2, "desc" ]],
"autoWidth": false,
orderCellsTop: true,
"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',
messageTop: 'Report Purchase-Inward',
messageTop: 'Report Attachment-Inward',
title: $('h3').text(),
exportOptions: {
columns: ':visible'

View File

@ -557,7 +557,7 @@ $(document).ready(function() {
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 8 ).footer() ).html( TotalExRATE.toFixed().bold() );
$( api.column( 8 ).footer() ).html( TotalExRATE.toFixed(2).bold() );
TotalSGST = api
.column( 9, { search:'applied' } )

View File

@ -46,8 +46,8 @@ table.dataTable thead > tr > td.sorting {
</style>
<div class="content-wrapper">
<section class="content"><br/>
<div class="content-wrapper">
<section class="content"><br/>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
@ -215,6 +215,41 @@ table.dataTable thead > tr > td.sorting {
</div>
<div class="modal fade" id="Fileshow" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:800px;">
<!-- Table to show the line item of po -->
<div id="content" > </div>
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>SNo</th>
<th>BillNO</th>
<th>PONO</th>
<th>FileName</th>
</tr>
</thead>
<tbody id="tbleAppend1">
</tbody>
</table>
<div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div>
</div>
</form>
</div>
</div>
<span style="color:red;">*Insurance field not included </span>
<div class="box-body">
@ -223,9 +258,9 @@ table.dataTable thead > tr > td.sorting {
<thead>
<tr>
<th>PO No</th>
<th>Date</th>
<th>IGR Created Date</th>
<th>Time</th>
<th>Materialrcvd Date</th>
<th>Material Received Date</th>
<th>Material Name</th>
<th>Category</th>
<th>Supplier Name</th>
@ -233,7 +268,7 @@ table.dataTable thead > tr > td.sorting {
<th>UOM</th>
<th>Rate &nbsp;(&#8377;)</th>
<th>Value &nbsp;(&#8377;)</th>
<th>Exchange Rate</th>
<th>Exchange Rate</th>
<th>SGST &nbsp;(&#8377;)</th>
<th>CGST &nbsp;(&#8377;)</th>
<th>IGST &nbsp;(&#8377;)</th>
@ -241,11 +276,12 @@ table.dataTable thead > tr > td.sorting {
<th>Freight &nbsp;(&#8377;)</th>
<th>Package &nbsp;(&#8377;)</th>
<th>Total &nbsp;(&#8377;)</th>
<th>Attachments</th>
</tr>
</thead>
<tbody>
<?php if(!empty($purchase)){
<?php
$tot_qty = 0;
$tot_rate = 0;
$tot_value = 0;
@ -258,12 +294,12 @@ table.dataTable thead > tr > td.sorting {
$tot_pac = 0;
//$tot_inc = 0;
$tot_tot = 0;
foreach($purchase as $rel)
if(!empty($purchase)){
foreach($purchase as $key => $rel)
{
?>
<tr>
<td><span>
<tr id="lastvalue">
<td id="pono<?php echo $key?>"><span>
<a href="<?php echo base_url().'purchaseorder/CreatePOPrint?PONO='.$rel->pono.'&ReqType='.$rel->potype; ?>"><?php echo $rel->pono;?></a>
</span></td>
<td style="text-align:center"><span><?php echo $rel->created_date;?></span></td>
@ -307,146 +343,63 @@ table.dataTable thead > tr > td.sorting {
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
?>
echo number_format($rel->total,2,'.','');
?></span></td>
<td id="download<?php echo $key?>" style="text-align:center"><span>
<?php
if(!empty($rel->file)){ ?><!-- if for Inward po 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"><?php echo number_format($rel->total,2,'.','');?></a>
<a target="_blank" class="yourlink" 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)) { ?><!-- else if for igr file -->
<a target="_blank" href="<?php echo base_url().''.$rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
<?php }else { echo number_format($rel->total,2,'.',''); } ?><!-- both inwardpo file and Igr file empty means -->
<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 } else { echo 'N/A'; } ?><!-- both inwardpo file and Igr file empty means -->
</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><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</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"><strong><?php echo $tot_qty; ?> </strong></td>
<td class="amount"><strong><?php //echo format_currency($tot_rate,2,'.',''); ?> </strong></td>
<td class="amount" style="text-align:right"><strong>
<?php
{
echo $tot_qty;
}
?>
</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_value,2,'.','');
}
?>
</strong>
</td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo $tot_ex;
}
?>
</strong>
</td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_SCGT,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_ICGT,2,'.','');
}
?>
</strong>
</td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_dis,2,'.','');
<td class="amount"><strong><?php //echo format_currency($tot_rate,2,'.',''); ?> </strong></td>
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_value,2,'.',''); ?></strong></td>
<td class="amount" style="text-align:right"><strong><?php echo $tot_ex; ?></strong></td>
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_SCGT,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_ICGT,2,'.',''); ?></strong></td>
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_dis,2,'.',''); ?></strong></td>
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_frg,2,'.',''); ?></strong></td>
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_frg,2,'.','');
}
?>
</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_pac,2,'.',''); ?></strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_tot,2,'.','');
}
?>
</strong></td>
</tr>
<td class="amount" style="text-align:right"><strong><?php echo number_format($tot_tot,2,'.',''); ?></strong></td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
@ -457,8 +410,7 @@ table.dataTable thead > tr > td.sorting {
<!-- /.col -->
</div>
</section>
</div>
</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>
@ -466,20 +418,54 @@ table.dataTable thead > tr > td.sorting {
<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() {
$('[data-toggle="tooltip"]').tooltip();
/** On click for Displaying File MOdal***/
$('.splpofile').click(function() {
var id = $(this).attr('id');
$("#Fileshow").modal("show");
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>report/Viewfiles",
success: function(data){
var trHTML = '';
$.each($.parseJSON(data), function (i, item) {
i=i+1;
trHTML += '<tr>' +
'<td align="right">' + i + '</td>' +
'<td>' + item.BillNo+ '</td>' +
'<td>' + item.PONO+ '</td>' +
'<td><a target="_blank" href = <?php echo base_url()?>uploads/BillFiles/'+item.FilePath+'>'+ item.FilePath +'</a></td>' +
'</tr>';
});
$("#tbleAppend1").empty();
$('#Inwardgateregistertable1 > tbody').append(trHTML);
}
});
});//onclick function closed
/******************** Datatable codes starts here **************************/
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {
"language": {
"emptyTable": "<center> Data Not Found ! </center>"
},
"aaSorting": [[ 3, "asc" ]],
"aaSorting": [[ 3, "desc" ]],
"autoWidth": false,
orderCellsTop: true,
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
@ -525,7 +511,7 @@ $(document).ready(function() {
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 10 ).footer() ).html( TotalVALUE.toFixed(2) );
TotalExRATE = api