rangeSpendCoverCash method

  1. @action
num rangeSpendCoverCash(
  1. DateTime firstDate,
  2. DateTime lastDate
)

Implementation

@action
num rangeSpendCoverCash(DateTime firstDate, DateTime lastDate) => tickets
    .where((t) => t.status == true)
    .where((t) => t.date.isAfter(firstDate) && t.date.isBefore(lastDate))
    .where((t) => t.paymentType == PaymentType.cash)
    .where((t) => t.ticketType == TicketType.spendCovered)
    .fold(0, (prev, element) => prev + element.received);