<?php

namespace Modules\Additional\Specifique\Client123\Modules\Facture\Controller;

use GuzzleHttp\Psr7\Response;
use Skeleton\Controller\Controller;

class AjaxFactureController extends Controller
{
    public function changeCdcAction()
    {
        $post = $this->request->getParsedBody();
        $result = [];

        $outilCompteComptable = new \Modules\Additional\Specifique\Client123\Modules\Outil\CompteComptable();
        $result = array_merge($result, $outilCompteComptable->initApresChangementCompteComptable($this->pdo, $post));
        
        return new Response(200, [
            
        ], (string) \json_encode($result));
    }

    public function changeCodeTaxeAction()
    {
        $post = $this->request->getParsedBody();
        $result = [];
        
        $outilCalculCodeTaxe = new \Modules\Additional\Specifique\Client123\Modules\Outil\CalculCodeTaxe();
        $result = $outilCalculCodeTaxe->calculTauxTva($this->pdo, $post['CodeTaxe']);

        return new Response(200, [
            
        ], (string) \json_encode($result));
    }
}
