Click here to Skip to main content
15,913,669 members

Comments by Furqan Akhtar (Top 4 by date)

Furqan Akhtar 15-Jul-21 16:36pm View    
for ($y = $addPreviousEntryDate; $y <= $nowDate->format('Y'); $y++) {
// Find Years..
$year_arr = [$y];
$fn_month = 07;

foreach ($year_arr as $year) {
// Get start date and end date of each financial year..
$end_date = new \DateTime($year . '-' . $fn_month . '-01');
//last amount with interest
$sum = $amountwithinterest;
$start_date = clone $end_date;
$start_date->modify('+1 year');
$end_date->modify('+2year , -1day');
$year = array();
$year[] = array('start_date' => $start_date->format('d-m-Y'), 'end_date' => $end_date->format('d-m-Y'));
}

foreach($year as $example){
// Get no of days different each year.
echo "".$example['start_date']." - ".$example['end_date'].'-';

$difference = strtotime($example['end_date'])-strtotime($example['start_date']);
$diffinDaysYears = floor($difference/(60*60*24));

//Get Interest rate of each year..
$interest = $sum*($lastInterest->interest_rate**($diffinDaysYears/365));
echo $interest;
}
}
Furqan Akhtar 15-Jul-21 16:35pm View    
it's give same amount in every year.
Furqan Akhtar 15-Jul-21 15:43pm View    
i want to add my last amount to next financial year end amount.
my year is in foreach
Furqan Akhtar 15-Jul-21 14:17pm View    
i have a project where interest rate calculated according to last amount, if amount enter to 2010 it given interest rate of each financial and add it to last amount year till todays date