I'm having a hard time putting together a script, I'm not sure how to calculate date interpolation with javascript, I was thinking of doing a screen that calculates interest, but returns real-time values on inputs that are disabled
follow code:
<fieldset>
<legend>Calcular Juros</legend>
<label>Data de Vencimento:</label>
<input id="datavenc" type="date"/><br />
<label>Data de Pagamento: </label>
<input id="datapag" type="date"/><br />
<label>Valor do Titulo: </label>
<input id="valortitulo" type="text"/><br />
<label>Outras Despesas: </label>
<input id="despesas" type="text"/><br /><br />
<label>Dias em Atraso: </label>
<input id="diasematraso" type="text" disabled/><br />
<label>Juros: </label>
<input id="juros" type="text" disabled/><br />
<label>Valor Total a Pagar: </label>
<input id="valortotal" type="text" disabled/><br />
</fieldset>
For example,
maturity date = 01/09/2017
payment date = 09/30/2017
value of the title = 2000
other expenses = 100
overdue days = 29
interest = 96.67
total amount payable = 2,196.67
Overdue days = due date - payment date
Interest = (title value * 5%) / 30 * days overdue
Other expenditure = expenditure
Amount to be paid = value of title + interest + expenses