report_cumulative_year_inward

This commit is contained in:
venbatechnologies@gmail.com 2018-06-26 17:48:58 +05:30
parent af519ede09
commit a410275700
2 changed files with 36 additions and 2 deletions

View File

@ -1171,6 +1171,7 @@ join ip_products on ip_products.product_id= T_FinalProduct_History.ProductCode
where ProductCode=? and Transactiondate >= ? and Transactiondate <= ?';
$query = $this->db->query($subQuery,array($product_id,$starting_date,$end_date));
//print_r($this->db->last_query());
return $query->result_array();
}

View File

@ -198,12 +198,42 @@ $(document).ready(function() {
},
'colvis'
]
],
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === 'string' ?
parseFloat(i.replace(/[^0.00-9.00]+/g,"")*1) :
typeof i === 'number' ?
parseFloat(i) : 0;
};
TotalQTY = api
.column( 2, { search:'applied' } )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 2 ).footer() ).html( TotalQTY.toFixed().bold() );
TotalVALUE = api
.column( 3, { search:'applied' } )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 3 ).footer() ).html( TotalVALUE.toFixed(2).bold() );
}
} );
} );
$('#mySelect').on('change',function(){
table
table
.column(4)
.search(this.value)
.draw();
@ -211,6 +241,9 @@ $(document).ready(function() {
</script>