<?php

namespace Modules\GlobalApplication\Controller;

use Helpers\Ariane\Ariane;
use Helpers\Highcharts\Highcharts;
use Helpers\Trad\Trad;
use Modules\GlobalApplication\Outil\Budget;
use Modules\GlobalApplication\Outil\TypeSuivi;
use Modules\GlobalApplication\WebService\ConsoBudget;
use Skeleton\Controller\Controller;

class ConsommationBudgetaireController extends Controller
{
    /**
     * @return string
     */
    public function indexAction(): string
    {
        $typeDoc = $this->request->getAttribute('typeDoc');
        $numDoc = $this->request->getAttribute('numDoc');

        $consoBudgetWSDL = new ConsoBudget();

        $xmlResult = $consoBudgetWSDL->getConsoBudget($typeDoc, $numDoc);

        $response = new \SimpleXMLElement($xmlResult->responseData);
        
        return $this->renderer->render('@GlobalApplication/ConsoBudgetaire/index', [
            'listeBudget' => $response,
        ]);
    }
}
