<?php

namespace Modules\Facture\MenuContextuel;

use Helpers\Outil\MenuContextuel;
use Helpers\Trad\ITrad;
use Skeleton\Router;

class AcquisitionFactureMenuContextuel extends MenuContextuel
{

    /**
     * @return array<mixed>
     */
    public function generateImport(\SimpleXMLElement $facture)
    {
        $menuContextuel = [];

        if ($facture->STATUT_LAD != 'T') {
            $menuContextuel['listeSecondaire'][] = [
                'libelle' => $this->trad->t('Transférer la facture'),
                'lienJs' => "transfertUnitaire('" . $facture->FIC_FACTURE_XML . "', '" . $facture->NO_RECORD_DANS_XML . "', '" . $facture->pdfNotFound . "')",
            ];
        }

        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Annuler le transfert'),
            'lienJs' => "annulerTransfert('" . $facture->FIC_FACTURE_XML . "')",
        ];

        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Archiver cette facture'),
            'lienJs' => "archiver('" . $facture->FIC_FACTURE_XML . "')",
        ];

        return $menuContextuel;
    }

    /**
     * @param array<mixed> $facture
     * @return array<mixed>
     */
    public function generateArchivage($facture)
    {
        $menuContextuel = [];

        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Annuler l\'archivage'),
            'lienJs' => "annulerArchivage('" . $facture['ID_LAD'] . "')",
        ];

        return $menuContextuel;
    }
}
