Greetings guys, I pose my problem:
I must make an increase of 15% to an amount after 5 days of the date on which the person had to pay. A practical example is:
Current Date: 08-30-2017 Payment Date: 08-25-2017 Total = amount + (amount * 0.15)
As you can see, that is what must be fulfilled in my conditionals.
I tried this:
$hoy = date('d-m-Y');
$fecha_pago = new DateTime($row['fecha_a_pagar']);
$fecha = new DateTime($hoy);
$diff = $fecha->diff($fecha_pago);
$multa = 0;
if($diff->days >= 5 && $diff->invert):
$multa = $row['monto']*0.15;
$total = $row['monto']+$multa;
endif;
Makes the increase well, but when I'm going to pay an advanced fee eg:
Date today: 08-30-2017
Date of quota to pay: 12-09-10
I still do the increase, I'm not comparing the months. Only the days.