herderCvoMilkThisMonth method

num herderCvoMilkThisMonth(
  1. int herderId,
  2. DateTime dateMonthStart,
  3. DateTime dateMonthEnd
)

Implementation

num herderCvoMilkThisMonth(
        int herderId, DateTime dateMonthStart, DateTime dateMonthEnd) =>
    where((t) => t.status)
        .where((t) => t.ticketType == TicketType.spendDeferred)
        .where((t) => t.comment.isNotEmpty)
        .where((t) => t.contactId == herderId)
        .where((t) => t.date.isAfter(dateMonthStart))
        .where((t) => t.date.isBefore(dateMonthEnd))
        .fold(0.0, (prev, val) => prev + val.totalCostPromoVal);