Last active
April 20, 2024 01:30
-
-
Save carlosleonam/04c4cd6f98a4832a01d854422e80f6e3 to your computer and use it in GitHub Desktop.
Gerar Parcelas ( by Breno )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($param['mes'] == '12') | |
{ // mes de dezembro, troca o mes para janeiro e muda para o ano seguinte | |
$mes_vecto = '01'; | |
$ano_vecto = $param['ano'] + 1; | |
} | |
else | |
{ | |
$mes_vecto = $param['mes'] + 1; | |
$ano_vecto = $param['ano']; | |
} | |
// Montagem do dia do vencimento | |
$dia_vecto = $contrato->dia_vencimento; | |
if($contrato->dia_vencimento > 28) | |
{ | |
if ($mes_vecto == '02') | |
{ | |
$dia_vecto = '28'; | |
} | |
else | |
{ | |
if ($dia_vecto == '31') | |
{ | |
if ($mes_vecto == '04' || $mes_vecto == '06' || $mes_vecto == '09' || $mes_vecto == '11') | |
{ | |
$dia_vecto = '30'; | |
} | |
} | |
} | |
} | |
return $ano_vecto.'-'.$mes_vecto.'-'.$dia_vecto; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment