0
Guys I know nothing of java and I believe that is what I will need. Next situation:
Below the script to generate the value with interest and fine the value between maturity date and payment date and their respective fields:
<input name="form_fatura_datapag" type="text" value="<?php if ($coluna[fatura_datapag]=='0') echo date('d/m/Y'); else echo inteirodata(@mysql_result($sql,0,fatura_datapag));?>" size="15"/>
<input name="form_fatura_valor" type="text" value="<?= number_format($valorDocComJuros,2,",",".");?>" size="15"/>
<?php
$sql = mysql_query("SELECT * FROM faturas WHERE id_fatura=$_GET[id]");
while ($coluna = @mysql_fetch_array($sql)) {
$dat_venc = inteirodata($coluna[fatura_data]);
if ($coluna[fatura_datapag]=='0') $dat_novo_venc = date('d/m/Y'); else $dat_novo_venc = inteirodata($coluna[fatura_datapag]); //CALCULO DE JUROS E MULTA DEIXA DE SER CALCULADO QDO SE COLOCA DATA DE PAGAMENTO
$valor_doc = "$coluna[fatura_parcela]";
$juros = (((($valor_doc*1)/100)/30 * (diasEntreData($dat_venc,$dat_novo_venc ))));
if(diasEntreData($dat_venc,$dat_novo_venc)==0)
{$multa = 0;}
else
{$multa = ((2 * $valor_doc) / 100);}//Moeda(($valor_doc * 2) / 100);
$valorDocComJuros = $valor_doc + ($juros + $multa);
?>
In case it will have to calculate between two dates, date 1=maturity and date 2= of payment and generate the value of the automatic invoice in the input with interest of the difference of this date.
Example invoice 10,00
maturity 30/01/2016
Today the invoice is in 10,15
placing the payment date of yesterday 02/02/2016
it records value in the database of 10,15
and not 10,10
as it should be paid on yesterday’s date.
Oops, I believe you’re missing some data on your friend doubt. Ah, taking the opportunity, I suggest you know a little more the functioning of Sopt. Visit http://answall.com/tour. and take the welcome tour.
– Weslley Tavares
But are you sure your problem is tagged right? I see so much PHP code there that I can’t associate anything with Java reality.
– Weslley Tavares
Looks like it’s supposed to be javascript.
– user28595
Well people, I put what I had done in PHP, but I believe that the field done inside the inputs should be in java, of course I could be wrong.
– Alexsander Duques