gestionBdd = $gestionBdd; $this->rootFolder = $rootFolder; $this->dataProcessor = new DevisDataProcessor($gestionBdd); $this->pdfGenerator = new DevisPdfGenerator($rootFolder); } public function generateDevisRecap($filter, $month, $year, $idNextCloud, $filterType, $montant) { $storage = $this->rootFolder->getUserFolder($idNextCloud); $configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN)); $currentConfig = $configs[0]; $devisData = $this->getDevisData($filter, $month, $year, $currentConfig, $filterType); if (empty($devisData)) { return null; } $processedData = $this->dataProcessor->prepareDevisData($devisData, $currentConfig, $filter, $idNextCloud); $clientInfo = $this->dataProcessor->getClientInfoForDevis($processedData[0], $filterType); return $this->pdfGenerator->generatePdfDocument( $storage, $currentConfig, $processedData, $clientInfo, $month, $year, $montant ); } private function getDevisData($filter, $month, $year, $currentConfig, $filterType) { $isFilterByClient = $filterType === MultipleFactureTypeConstant::CLIENT_FILTER_TYPE; if ($isFilterByClient) { return $this->gestionBdd->getDevisPdfDataByClientAndMonthYear($filter, $month, $year, $currentConfig); } else { return $this->gestionBdd->getDevisPdfDataByClientGroupFacturationAndMonthYear($filter, $month, $year, $currentConfig); } } // Méthodes utilitaires conservées pour la compatibilité CSV public function generateCsvContent($devisData) { return $this->dataProcessor->generateCsvContent($devisData); } public function getClientNameForFolder($firstDevis, $filterType) { return $this->dataProcessor->getClientNameForFolder($firstDevis, $filterType); } public function getRecapFilename($month, $year) { return $this->dataProcessor->getRecapFilename($month, $year); } }