void Calculator::calculateRaports(){ raports_.clear(); calculateBuilds(); calculateMovements(); calculateAttacks(); calculateAssaults(); Logger::write("Finished calculating"); Logger::write(QString("Sending ").append(QString::number(raports_.size())).append(" raports")); preparedRaports(raports_); buildCommands_.clear(); moveCommands_.clear(); attackCommands_.clear(); assaults_.clear(); receivedCommands_ = 0; }
//--------------------fonction de remplissage de tableau par mois------------------------------------------- bool ProduceDoc::modele(QString & month, QString & day1 , //"yyyy-MM-dd" QString & lastDay ,//"yyyy-MM-dd" QTextTableFormat & tableFormatOrganized, QTextCursor *cursorForFunction ){ QString thisMonth = month; QString un = day1; QString trenteetquelque = lastDay; QTextTableFormat tableFormatModele = tableFormatOrganized; QTextCursor *cursorForFillFunction = cursorForFunction; LedgerIO lio(0); QList<QVector<QString> > tableLedgerMonth; if (WarnDebugMessage) qDebug() << __FILE__ << QString::number(__LINE__) << " thread 3 " ; tableLedgerMonth = lio.getDataReceiptsInVector(un,trenteetquelque,m_noNameChecked); if (WarnDebugMessage) qDebug() << __FILE__ << QString::number(__LINE__) << " thread 4 " ; //---------------itération recettes par type----------------------------------------------------------------- QList<QVector<QString> > tableLedgerTypeReceipts; for(int i = 0; i < m_typesReceipts.size(); i++){ QString typeRecettes = m_typesReceipts[i]; if (WarnDebugMessage) qDebug() << __FILE__ << QString::number(__LINE__) << " m_typesReceipts[i] =" << m_typesReceipts[i] ; QStringList listeLibelle; listeLibelle << tr("Cash") << tr("Cheques") << tr("Credit cards") << tr("Bankings"); for (int j = 0 ; j < listeLibelle.size() ; j++){ QVector<QString> vector; foreach(vector,tableLedgerMonth){ if(vector[ACTS]== typeRecettes && ((vector[j+PLACE_OF_CASH] == QString::number(0)) == false)) { QVector<QString> vectorLibelle; emit recupSlot(thisMonth+": "+vector[DATE]);//renseigne le QLabel label_5 vectorLibelle << vector[DATE] << vector[PATIENT_NAME] << vector[j+PLACE_OF_CASH] << vector[ACTS] ; tableLedgerTypeReceipts << vectorLibelle; } } } } QStringList sumsReceipts; sumsReceipts = calculateReceipts( un, trenteetquelque); if (WarnDebugMessage) qDebug() << "tableLedgerTypeReceipts.size()= "+ QString::number(tableLedgerTypeReceipts.size()) << __LINE__; QString emptyStringForReceipts; fillTable(tableLedgerTypeReceipts,tableFormatModele,cursorForFillFunction,thisMonth,sumsReceipts,RECEIPTS_TYPE,emptyStringForReceipts); //----------------tableau depenses--------------------------------------------------------- QList<QVector<QString> > tableLedgerMonthDepenses; tableLedgerMonthDepenses = lio.getDataMovementsInVector(un,trenteetquelque); //----------------iteration des depenses par type------------------------------------------------------ QList<QVector<QString> > tableauLivreTypeDepense; QStringList listOfTypeMovements; listOfTypeMovements = m_typesMovements; if (WarnDebugMessage) qDebug() << __FILE__ << QString::number(__LINE__) << "m_typesMovements.size() =" << QString::number(m_typesMovements.size()); for(int i = 0 ; i < listOfTypeMovements.size() ; i++){ QVector<QString> vector; foreach(vector,tableLedgerMonthDepenses){ if(vector[VM_LABEL] == listOfTypeMovements[i]){ if (WarnDebugMessage) qDebug() << __FILE__ << QString::number(__LINE__) << "vector[VM_LABEL] =" << vector[VM_LABEL] ; tableauLivreTypeDepense << vector; } } } QStringList sommedepenses; sommedepenses = calculateMovements( un, trenteetquelque); QString totalOfMovements; if (sommedepenses.size()>0) { totalOfMovements = sommedepenses.last().split("=")[1]; //sommedepenses.removeAt(0); } fillTable(tableauLivreTypeDepense,tableFormatModele,cursorForFillFunction,thisMonth,sommedepenses,MOVEMENTS_TYPE,totalOfMovements); return true; }