ReportStockAbstract<C extends ClosingRangeAbstract> constructor

ReportStockAbstract<C extends ClosingRangeAbstract>({
  1. required List<TicketWeebi> tickets,
  2. required List<C> closingsObjects,
  3. required DateTime startDate,
  4. required DateTime endDate,
  5. required int objectId,
  6. required List<CalibreWeebi<ArticleRawAbstract>> articlesC,
})

Implementation

ReportStockAbstract({
  required List<TicketWeebi> tickets,
  required List<C> closingsObjects,
  required DateTime startDate,
  required DateTime endDate,
  required this.objectId,
  required this.articlesC,
})  : emptyReportStockArtCalibres = List.generate(articlesC.length, (index) {
        final rAs = <ReportStockArticle>[];
        for (final a in articlesC[index].articles) {
          final rA = ReportStockArticle(
              calibreId: a.calibreId,
              id: a.id,
              start: startDate,
              end: endDate,
              initialQtCl: 0.0,
              finalQtCl: 0.0,
              qtIn: 0.0,
              qtOut: 0.0,
              designation: a.designation,
              kind: a.kind);
          rAs.add(rA);
        }
        return ReportStockArtCalibre(
            id: articlesC[index].id,
            title: articlesC[index].title,
            start: startDate,
            end: endDate,
            initialQtCl: 0.0,
            finalQtCl: 0.0,
            varQtTickets: 0.0,
            // initialQtTickets: 0.0,
            articles: rAs);
      }),
      super(
        tickets,
        closingsObjects,
        startDate,
        endDate,
      );