Commit 71624206 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Dépenses : Gestion des comptes ignorés

- Fix : Montant mal arrondis
parent a98a7874
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -518,6 +518,12 @@ class SpentLine
        $this->dateServiceFait = $dateServiceFait;
    }

    public function __toString()
    {
        return sprintf("%s : %s (cpt: %s)", $this->getId(), $this->getMontant(), $this->getCompteGeneral());
    }


    public function getDetailsHeaders(){
        return [
                "ID(oscar)",
+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ class SpentTypeGroup implements ITrackable
     */
    public function getAnnexe()
    {
        if( $this->getBlind() ){
            return "0";
        }
        return $this->annexe;
    }

+7 −2
Original line number Diff line number Diff line
@@ -736,19 +736,25 @@ class SpentService implements UseLoggerService, UseOscarConfigurationService, Us
                /** @var SpentTypeGroup $spentType */
                $spentType = $this->getSpentTypeRepository()->findOneByCode($infos['code']);
            } else {
                $this->getLoggerService()->error("Le compte $codeCompteFull n'existe pas dans le plan comptable.");
                throw new OscarException("Le compte $codeCompteFull n'existe pas dans le plan comptable.");
            }

            if( $compteAffectation == '1' ){
                // Recette / Ignorer
                $spentType->setBlind(false);
                $spentType->setAnnexe($compteAffectation);
            }
            elseif ( $compteAffectation == '0' ){
                $spentType->setAnnexe('0');
                $spentType->setBlind(true);
            }
            elseif ( $compteAffectation == '' ){
                $this->getLoggerService()->error("Erreur d'affectation pour $codeCompteFull (valeur nulle).");
                throw new OscarException("Erreur d'affectation (valeur nulle)");
            }
            else {
                $spentType->setBlind(false);
                $spentType->setAnnexe($compteAffectation);
            }
            $this->getEntityManager()->flush($spentType);
@@ -990,13 +996,12 @@ class SpentService implements UseLoggerService, UseOscarConfigurationService, Us
        foreach ( $spents as $spent) {
            $compte = $this->getCompte($spent->getCompteGeneral());
            $comptes[$spent->getCompteGeneral()] = $compte;
            $masse = $masseGroup = $compte['annexe'] ? $compte['annexe'] : $compte['masse_inherit'];
            $masse = $masseGroup = $compte['annexe'] != '' ? $compte['annexe'] : $compte['masse_inherit'];
            $type = $this->getTypeByCode($spent->getCompteGeneral());
            $spentArray = $spent->toArray();
            $spentArray['masse'] = $masse;
            $spentArray['compte'] = $compte['code'] . ' : ' . $compte['label'];
            $spentArray['type'] = $type;

            $array[] = $spentArray;
        }
        return [
+3 −1
Original line number Diff line number Diff line
@@ -56,7 +56,9 @@
                Vue.use(VueResource);
                Vue.http.options.emulateJSON = true;
                Vue.http.options.emulateHTTP = true;
                Vue.filter('money', VueFilters.default.money);
                Vue.filter('money', function( d ){
                    return d.toFixed(2);
                });
                new Vue({
                    el: "#spentlines",
                    render(h){
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading