<commit_before><?php

class ExportFacturePaiementsCSV {

    protected $facture = null;
    protected $header = false;

    public function __construct($doc_or_id, $header = true, $que_les_non_verses_comptablement = false) {
        if ($doc_or_id instanceof Facture) {
            $this->facture = $doc_or_id;
        } else {
            $this->facture = FactureClient::getInstance()->find($doc_or_id);
        }

        if (!$this->facture) {
            echo sprintf("WARNING;Le document n'existe pas %s\n", $doc_or_id);
            return;
        }
       $this->floatHelper = FloatHelper::getInstance();

        $this->header = $header;
        $this->que_les_non_verses_comptablement = $que_les_non_verses_comptablement;
    }

    public static function getHeaderCsv() {
        return "Identifiant;Raison Sociale;Code comptable client;Numero facture;Date de paiement;Montant;Type de reglement;Commentaire;Montant restant a payer;Execute;Exporte;Facture doc ID;Paiement ID;Date facture;Sens;Code journal;Numero remise; Numero compte\n";
    }

    public function export() {
        if($this->header) {

            $csv .= $this->getHeaderCsv();
        }

        $csv .= $this->exportFacturePaiements();

        return $csv;
    }


    public function exportFacturePaiements($date_max = null, $set_verse = false) {

        $societe = $this->facture->getSociete();
        $code_journal = FactureConfiguration::getInstance()->getCodeJournal();
        $general_compte = FactureConfiguration::getInstance()->getGeneralCompte();
        $banque_compte = FactureConfiguration::getInstance()->getBanqueCompte();

        $date_facturation = DateTime::createFromFormat("Y-m-d",$this->facture->date_facturation)->format("d/m/Y");<commit_msg>inutile car n'est plus utilisé<commit_after><?php

class ExportFacturePaiementsCSV {

    protected $facture = null;
    protected $header = false;

    public function __construct($doc_or_id, $header = true, $que_les_non_verses_comptablement = false) {
        if ($doc_or_id instanceof Facture) {
            $this->facture = $doc_or_id;
        } else {
            $this->facture = FactureClient::getInstance()->find($doc_or_id);
        }

        if (!$this->facture) {
            echo sprintf("WARNING;Le document n'existe pas %s\n", $doc_or_id);
            return;
        }

        $this->header = $header;
        $this->que_les_non_verses_comptablement = $que_les_non_verses_comptablement;
    }

    public static function getHeaderCsv() {
        return "Identifiant;Raison Sociale;Code comptable client;Numero facture;Date de paiement;Montant;Type de reglement;Commentaire;Montant restant a payer;Execute;Exporte;Facture doc ID;Paiement ID;Date facture;Sens;Code journal;Numero remise; Numero compte\n";
    }

    public function export() {
        if($this->header) {

            $csv .= $this->getHeaderCsv();
        }

        $csv .= $this->exportFacturePaiements();

        return $csv;
    }


    public function exportFacturePaiements($date_max = null, $set_verse = false) {

        $societe = $this->facture->getSociete();
        $code_journal = FactureConfiguration::getInstance()->getCodeJournal();
        $general_compte = FactureConfiguration::getInstance()->getGeneralCompte();
        $banque_compte = FactureConfiguration::getInstance()->getBanqueCompte();

        $date_facturation = DateTime::createFromFormat("Y-m-d",$this->facture->date_facturation)->format("d/m/Y");
{'fraction_non_alphanumeric': 0.1264799306959284, 'fraction_numerical': 0.0, 'mean_word_length': 3.319201995012469, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6747150', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1065, 'n_words': 185}