package com.fitbank.installment.query; import java.math.BigDecimal; import com.fitbank.dto.management.Detail; import com.fitbank.dto.management.Record; import com.fitbank.dto.management.Table; import com.fitbank.processor.query.QueryCommand; public class ObtainQuotaInterest extends QueryCommand{ public Detail execute(Detail pDetail) throws Exception { Table tquery = pDetail.findTableByName("CUOTA"); BigDecimal capital = new BigDecimal((String)tquery.findCriterionByName("CAPITAL").getValue()); // realiza el calculo // devuelve los valores calculados Record qrec = new Record(); qrec.findFieldByNameCreate("INTERES"); qrec.findFieldByName("INTERES").setValue(capital); qrec.findFieldByNameCreate("NUMERODIASPROVISION"); qrec.findFieldByName("NUMERODIASPROVISION").setValue(100); tquery.clearRecords(); tquery.addRecord(qrec); return pDetail; } }