current value depending on financial year
This commit is contained in:
parent
b6b6a6cd27
commit
946a433390
@ -16,6 +16,11 @@ $IsActive = '';
|
||||
$openstock='';
|
||||
$date='';
|
||||
$reorder='';
|
||||
$total = 0;
|
||||
|
||||
$date_today = date("Y-m-d");
|
||||
|
||||
//print_r($materialDetails);
|
||||
|
||||
if(!empty($materialDetails))
|
||||
{
|
||||
@ -51,6 +56,8 @@ if(!empty($materialDetails))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!empty($currentstock))
|
||||
{
|
||||
|
||||
@ -58,7 +65,44 @@ if(!empty($currentstock))
|
||||
|
||||
$x = $openstock;
|
||||
$y = $currentstock;
|
||||
$total= $x + $y;
|
||||
// $total= $x + $y;
|
||||
|
||||
$todaydateyear = date('Y', strtotime($date_today));
|
||||
$todaydatemonth = date('m', strtotime($date_today));
|
||||
$todaydatedate = date('d', strtotime($date_today));
|
||||
|
||||
$openstockdateyear = date('Y', strtotime($date));
|
||||
$parts = explode('-',$date);
|
||||
$openstockdatemonth = $parts[1];
|
||||
$openstockdatedate = $parts[2];
|
||||
|
||||
|
||||
if($openstockdateyear==$todaydateyear)
|
||||
{
|
||||
if($openstockdatemonth<=03)
|
||||
{
|
||||
$total= $y==''?'0':$y;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$total= $x + $y;
|
||||
}
|
||||
|
||||
}
|
||||
else if($openstockdateyear<$todaydateyear)
|
||||
{
|
||||
//$total= $y;
|
||||
$total= $y==''?'0':$y;
|
||||
}
|
||||
else if($openstockdateyear>$todaydateyear)
|
||||
{
|
||||
$total= $x + $y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user