batchcard stock detail changes
This commit is contained in:
parent
f5f7745a3a
commit
e46ff49531
@ -524,12 +524,14 @@ class batchcard extends BaseController
|
|||||||
//echo "working";
|
//echo "working";
|
||||||
$overalltotal = 0;
|
$overalltotal = 0;
|
||||||
$date = $this->input->post('param1');
|
$date = $this->input->post('param1');
|
||||||
|
$cur_day = date('Y-m',strtotime($date));
|
||||||
//echo $date;
|
//echo $date;
|
||||||
$jsondata = $this->input->post('param2');
|
$jsondata = $this->input->post('param2');
|
||||||
$phpdata = json_decode($jsondata,TRUE);
|
$phpdata = json_decode($jsondata,TRUE);
|
||||||
//print_r($phpdata);
|
//print_r($phpdata);
|
||||||
//die();
|
//die();
|
||||||
$isExist = $this->batchcard_model->checkAbstractReport($date);
|
//$isExist = $this->batchcard_model->checkAbstractReport($date);
|
||||||
|
$isExist = $this->batchcard_model->checkAbstractReport($cur_day);
|
||||||
$c = $isExist[0]->count;
|
$c = $isExist[0]->count;
|
||||||
if($c == 0){
|
if($c == 0){
|
||||||
foreach($phpdata as $d)
|
foreach($phpdata as $d)
|
||||||
@ -574,7 +576,8 @@ class batchcard extends BaseController
|
|||||||
|
|
||||||
$datatostore = array('abstract_details'=>$abstract_details,'running_hrs'=>$running_hrs,'per_hr'=>$per_hr,'open_stock'=>$open_stock,'receipt'=>$receipt,'total'=>$total,'consumption'=>$consumption,'close_stock'=>$close_stock,'physical_stock'=>$physical_stock,'difference'=>$difference,'updatedby'=>$createdby);
|
$datatostore = array('abstract_details'=>$abstract_details,'running_hrs'=>$running_hrs,'per_hr'=>$per_hr,'open_stock'=>$open_stock,'receipt'=>$receipt,'total'=>$total,'consumption'=>$consumption,'close_stock'=>$close_stock,'physical_stock'=>$physical_stock,'difference'=>$difference,'updatedby'=>$createdby);
|
||||||
|
|
||||||
$res = $this->batchcard_model->updateAbstractReport($datatostore,$date,$abstract_details);
|
//$res = $this->batchcard_model->updateAbstractReport($datatostore,$date,$abstract_details);
|
||||||
|
$res = $this->batchcard_model->updateAbstractReport($datatostore,$cur_day,$abstract_details);
|
||||||
|
|
||||||
$overalltotal += $res;
|
$overalltotal += $res;
|
||||||
}
|
}
|
||||||
@ -589,13 +592,30 @@ class batchcard extends BaseController
|
|||||||
{
|
{
|
||||||
$month = $this->input->post('param1');
|
$month = $this->input->post('param1');
|
||||||
$year = $this->input->post('param2');
|
$year = $this->input->post('param2');
|
||||||
|
$currmonthyear = date('Y-m',strtotime($this->input->post('param3')));
|
||||||
|
$isExist = $this->batchcard_model->checkAbstractReport($currmonthyear);
|
||||||
|
$c = $isExist[0]->count;
|
||||||
|
|
||||||
$res = $this->batchcard_model->getPreviousMonthAbstractDetails($month,$year);
|
if($c == 0){//echo " for closestock";
|
||||||
echo json_encode($res);
|
|
||||||
|
$res = $this->batchcard_model->getPreviousMonthAbstractDetails($month,$year);
|
||||||
|
echo json_encode($res);
|
||||||
|
|
||||||
|
}
|
||||||
|
else{ //echo " for openstock";
|
||||||
|
$arr = $this->batchcard_model->getMonthAbstractDetails($currmonthyear);
|
||||||
|
echo json_encode($arr);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMonthAbstractDetails(){
|
||||||
|
|
||||||
|
$month = $this->input->post('param1');
|
||||||
|
$year = $this->input->post('param2');
|
||||||
|
$arr = $this->batchcard_model->getMonthAbstractDetails($month,$year);
|
||||||
|
echo json_encode($arr);
|
||||||
|
}
|
||||||
|
|
||||||
function getStockDetails()
|
function getStockDetails()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -133,7 +133,8 @@ class batchcard_model extends CI_Model
|
|||||||
{
|
{
|
||||||
$this->db->select('count(*) as count');
|
$this->db->select('count(*) as count');
|
||||||
$this->db->from('T_abstract_report');
|
$this->db->from('T_abstract_report');
|
||||||
$this->db->where('abstract_report_date',$date);
|
//$this->db->where('abstract_report_date',$date);
|
||||||
|
$this->db->where("date_format(abstract_report_date,'%Y-%m')",$date);
|
||||||
$res = $this->db->get();
|
$res = $this->db->get();
|
||||||
return $res->result();
|
return $res->result();
|
||||||
}
|
}
|
||||||
@ -147,7 +148,8 @@ class batchcard_model extends CI_Model
|
|||||||
|
|
||||||
function updateAbstractReport($datatostore,$date,$abstract_details)
|
function updateAbstractReport($datatostore,$date,$abstract_details)
|
||||||
{
|
{
|
||||||
$this->db->where('abstract_report_date',$date);
|
//$this->db->where('abstract_report_date',$date);
|
||||||
|
$this->db->where("date_format(abstract_report_date,'%Y-%m')",$date);
|
||||||
$this->db->where('abstract_details',$abstract_details);
|
$this->db->where('abstract_details',$abstract_details);
|
||||||
$this->db->update('T_abstract_report',$datatostore);
|
$this->db->update('T_abstract_report',$datatostore);
|
||||||
$res = $this->db->affected_rows();
|
$res = $this->db->affected_rows();
|
||||||
@ -158,17 +160,27 @@ class batchcard_model extends CI_Model
|
|||||||
|
|
||||||
function getPreviousMonthAbstractDetails($month,$year)
|
function getPreviousMonthAbstractDetails($month,$year)
|
||||||
{
|
{
|
||||||
$sql = "select abstract_details,close_stock from T_abstract_report where month(abstract_report_date) =? and year(abstract_report_date) =? ";
|
//$sql = "select abstract_details,close_stock from T_abstract_report where month(abstract_report_date) =? and year(abstract_report_date) =? ";
|
||||||
|
$sql = "select abstract_details,close_stock as Available from T_abstract_report where month(abstract_report_date) =? and year(abstract_report_date) =? ";
|
||||||
$res = $this->db->query($sql,array($month,$year));
|
$res = $this->db->query($sql,array($month,$year));
|
||||||
return $res->result();
|
return $res->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMonthAbstractDetails($month_year)
|
||||||
|
{
|
||||||
|
$sql = "select abstract_details,close_stock,open_stock as Available,physical_stock from T_abstract_report where date_format(abstract_report_date,'%Y-%m') = ? ";
|
||||||
|
$res = $this->db->query($sql,array($month_year));
|
||||||
|
|
||||||
|
return $res->result();
|
||||||
|
}
|
||||||
|
|
||||||
function getPreviousMonthClosedStockDetails($y,$m,$sn)
|
function getPreviousMonthClosedStockDetails($y,$m,$sn)
|
||||||
{
|
{
|
||||||
$month = 'month(ddate)';
|
$month = 'month(ddate)';
|
||||||
$year = 'year(ddate)';
|
$year = 'year(ddate)';
|
||||||
$this->db->select($sn);
|
//$this->db->select($sn);
|
||||||
|
$this->db->select($sn,'ddate');
|
||||||
$this->db->from('T_daily_batchcard_data');
|
$this->db->from('T_daily_batchcard_data');
|
||||||
$this->db->where($month,$m);
|
$this->db->where($month,$m);
|
||||||
$this->db->where($year,$y);
|
$this->db->where($year,$y);
|
||||||
|
|||||||
@ -1,14 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
if(!empty($data['previousmonthclosingstock']))
|
// print_r($data['previousmonthclosingstock']);
|
||||||
|
// print_r($previousmonthclosingstock);
|
||||||
|
// echo 'viewpage'.'<br>';
|
||||||
|
// $value = array_keys($data['previousmonthclosingstock']);
|
||||||
|
// echo $array[$value[0]];
|
||||||
|
if(!empty($previousmonthclosingstock))
|
||||||
{
|
{
|
||||||
$premonopen = $data['previousmonthclosingstock'];
|
//print_r($previousmonthclosingstock[0]);
|
||||||
|
//$value = array_keys($previousmonthclosingstock[0]);
|
||||||
|
//$premonopen = $previousmonthclosingstock[0]->$value[0];
|
||||||
|
foreach($previousmonthclosingstock[0] as $key=>$value){
|
||||||
|
//echo $value;
|
||||||
|
$premonopen = $value;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$premonopen = 0;
|
$premonopen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
;?>
|
// if(!empty($data['previousmonthclosingstock']))
|
||||||
|
// {
|
||||||
|
// $premonopen = $data['previousmonthclosingstock'];
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// $premonopen = 0;
|
||||||
|
// }
|
||||||
|
?>
|
||||||
<script src="<?php echo base_url()?>assets/js/jquery.CongelarFilaColumna.js"></script>
|
<script src="<?php echo base_url()?>assets/js/jquery.CongelarFilaColumna.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet">
|
||||||
|
|||||||
@ -188,7 +188,7 @@ $currentday = date('d');
|
|||||||
color:#000 ! important;
|
color:#000 ! important;
|
||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
}
|
}
|
||||||
<!--table{
|
table{
|
||||||
border:2px;
|
border:2px;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ td{ padding:3px;}
|
|||||||
text-align:center;
|
text-align:center;
|
||||||
border-color:#ebebe0;
|
border-color:#ebebe0;
|
||||||
|
|
||||||
}-->
|
}
|
||||||
/**/
|
/**/
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
@ -1067,8 +1067,13 @@ $(function(){
|
|||||||
var currentmonth = $('#month').val();
|
var currentmonth = $('#month').val();
|
||||||
currentmonth = currentmonth.split("-");
|
currentmonth = currentmonth.split("-");
|
||||||
var monthnumber = new Date(Date.parse(currentmonth[0] +" 1, 2018")).getMonth()+1;
|
var monthnumber = new Date(Date.parse(currentmonth[0] +" 1, 2018")).getMonth()+1;
|
||||||
|
var currentyearmonth = currentmonth[1]+'-'+(monthnumber <= 9 ? '0'+monthnumber : monthnumber );
|
||||||
//alert(monthnumber);
|
//alert(monthnumber);
|
||||||
//alert(currentmonth[1]);
|
//alert(currentmonth[1]);
|
||||||
|
alert(currentyearmonth);
|
||||||
|
var currmonth = monthnumber;
|
||||||
|
var curryear = currentmonth[1];
|
||||||
|
|
||||||
if(monthnumber == 1)
|
if(monthnumber == 1)
|
||||||
{
|
{
|
||||||
monthnumber = 12;
|
monthnumber = 12;
|
||||||
@ -1080,7 +1085,7 @@ $(function(){
|
|||||||
//alert(currentmonth[1]);
|
//alert(currentmonth[1]);
|
||||||
$('.content').loader('show');
|
$('.content').loader('show');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data:{param1:monthnumber,param2:currentmonth[1]},
|
data:{param1:monthnumber,param2:currentmonth[1],param3:currentyearmonth},
|
||||||
type:"POST",
|
type:"POST",
|
||||||
url:"<?php echo base_url().'batchcard/getPreviousMonthAbstractDetails'?>",
|
url:"<?php echo base_url().'batchcard/getPreviousMonthAbstractDetails'?>",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
@ -1099,11 +1104,13 @@ $(function(){
|
|||||||
// }
|
// }
|
||||||
if(index < 10)
|
if(index < 10)
|
||||||
{
|
{
|
||||||
//if(index != 7){
|
if(index != 7){
|
||||||
var id = 'OS'+index;
|
var id = 'OS'+index;
|
||||||
|
//document.getElementById(id).textContent = value.close_stock;
|
||||||
//document.getElementById(id).textContent = value.close_stock;
|
document.getElementById(id).textContent = value.Available;
|
||||||
//}
|
var PSid = 'PS'+index;
|
||||||
|
document.getElementById(PSid).textContent = value.physical_stock;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1112,7 +1119,7 @@ $(function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTimeout(function(){ whileModalShow(); }, 2000);
|
setTimeout(function(){ whileModalShow(); }, 4000);
|
||||||
|
|
||||||
//ED Details
|
//ED Details
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user