date = new GDDate(expenditure.getNextPaymentDate());
int frequency = expenditure.getFrequency();
if (expenditure.getNumberOfOcurrencies() > 0) {
int i = 1;
while (i <= expenditure.getNumberOfOcurrencies()) {
if ( date.afterOrEqualsDay(fromDate) && date.beforeOrEqualsDay(toDate) ){
// Expenditure myBill = new Expenditure(expenditure.getId(), expenditure.getDescription(), new GDDate(date), expenditure.getFrequency(), expenditure.getNumberOfOcurrencies(), expenditure.getValue(), expenditure.isFixedValue(), expenditure.getCategoryId(), expenditure.getObservation());
Expenditure myBill = new Expenditure(expenditure.getId(), expenditure.getDescription(), new GDDate(date), expenditure.getFrequency(), expenditure.getNumberOfOcurrencies(), expenditure.getValue(), expenditure.isFixedValue(), expenditure.getCategoryId(), expenditure.getObservation(),expenditure.getFirstPaymentDate(),expenditure.getLastPaymentDate());
list.add(myBill);
}
date = skip(date, frequency);