Skip to content
Snippets Groups Projects
Commit eb6309df authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#267 - order payments by date

parent 89f8adac
Branches
Tags
No related merge requests found
......@@ -130,8 +130,8 @@ public class PaymentController extends BaseController
private List<Payment> getPaymentsForMonthAndYear(int month, int year)
{
DateTime startDate = DateTime.now().withYear(year).withMonthOfYear(month).withDayOfMonth(1);
DateTime startDate = DateTime.now().withYear(year).withMonthOfYear(month).minusMonths(1).dayOfMonth().withMaximumValue();
DateTime endDate = DateTime.now().withYear(year).withMonthOfYear(month).dayOfMonth().withMaximumValue();
return paymentRepository.findAllByDateBetween(startDate, endDate);
return paymentRepository.findAllByDateBetweenOrderByDate(startDate, endDate);
}
}
\ No newline at end of file
......@@ -9,5 +9,5 @@ import java.util.List;
public interface PaymentRepository extends JpaRepository<Payment, Integer>
{
List<Payment> findAllByDateBetween(DateTime startDate, DateTime endDate);
List<Payment> findAllByDateBetweenOrderByDate(DateTime startDate, DateTime endDate);
}
\ No newline at end of file
......@@ -33,7 +33,9 @@
</td>
<td>
<div>${payment.name}</div>
<#if payment.description??>
<div class="italic">${payment.description}</div>
</#if>
</td>
<#if payment.amount < 0>
<td class="bold text-red">${helpers.getCurrencyString(payment.amount)}</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment