Commit 5e8c6ee6 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Correction lors de la demande de mise en paiement, pour que la liste de centre...

Correction lors de la demande de mise en paiement, pour que la liste de centre de coût permmette de choisir un EOTP même si son centre de coût parent n'est pas de la même activité (#48286)
parent ce6c640d
Loading
Loading
Loading
Loading
+110 −232
Original line number Diff line number Diff line
@@ -6,8 +6,7 @@
 * @param {string} id
 * @returns {DemandeMiseEnPaiement}
 */
function DemandeMiseEnPaiement(id)
{
function DemandeMiseEnPaiement(id) {
    this.id = id;
    this.element = $(".demande-mise-en-paiement#" + this.id);
    this.params = this.element.data('params');
@@ -15,8 +14,7 @@ function DemandeMiseEnPaiement(id)
    this.miseEnPaiementSequence = 1;
    this.changes = {};

    this.showError = function (serviceElement, errorStr)
    {
    this.showError = function (serviceElement, errorStr) {
        var out = '<div class="alert alert-danger alert-dismissible" role="alert">'
            + '<i class="fas fa-exclamation"></i> '
            + errorStr
@@ -26,21 +24,17 @@ function DemandeMiseEnPaiement(id)
    }



    /**
     *
     *
     * @returns {undefined}
     */
    this.demanderToutesHeuresEnPaiement = function ()
    {
    this.demanderToutesHeuresEnPaiement = function () {
        this.element.find(".heures-non-dmep:visible").click();
    }



    this.changeUpdate = function (miseEnPaiementId, propertyName, newValue)
    {
    this.changeUpdate = function (miseEnPaiementId, propertyName, newValue) {
        if (this.changes[miseEnPaiementId] == undefined) {
            this.changes[miseEnPaiementId] = {};
        }
@@ -48,16 +42,12 @@ function DemandeMiseEnPaiement(id)
    }



    this.changeInsert = function (miseEnPaiementId, properties)
    {
    this.changeInsert = function (miseEnPaiementId, properties) {
        this.changes[miseEnPaiementId] = properties;
    }



    this.changeDelete = function (miseEnPaiementId)
    {
    this.changeDelete = function (miseEnPaiementId) {
        if (0 === miseEnPaiementId.indexOf('new-')) {
            delete this.changes[miseEnPaiementId];
        } else {
@@ -66,13 +56,11 @@ function DemandeMiseEnPaiement(id)
    }



    /**
     *
     * @returns {Boolean}
     */
    this.valider = function ()
    {
    this.valider = function () {
        var result = true;
        var services = {};
        for (var id in this.misesEnPaiementListes) {
@@ -113,13 +101,11 @@ function DemandeMiseEnPaiement(id)
    }



    /**
     *
     * @returns {boolean}
     */
    this.sauvegarder = function ()
    {
    this.sauvegarder = function () {
        if (!this.valider()) {
            alert('Enregistrement impossible');
            return false;
@@ -129,31 +115,26 @@ function DemandeMiseEnPaiement(id)
    }



    /**
     * Initialisation
     *
     * @returns {undefined}
     */
    this.init = function ()
    {
    this.init = function () {
        var that = this;

        this.element.find(".mise-en-paiement-liste").each(function ()
        {
        this.element.find(".mise-en-paiement-liste").each(function () {
            var id = $(this).attr('id');

            that.misesEnPaiementListes[id] = new MiseEnPaiementListe(that, $(this));
            that.misesEnPaiementListes[id].init();
        });

        this.element.find(".toutes-heures-non-dmep").on("click", function ()
        {
        this.element.find(".toutes-heures-non-dmep").on("click", function () {
            that.demanderToutesHeuresEnPaiement();
        });

        this.element.find("form").on("submit", function ()
        {
        this.element.find("form").on("submit", function () {
            return that.sauvegarder();
        });
    }
@@ -164,17 +145,13 @@ function DemandeMiseEnPaiement(id)
 * @param {string} id
 * @returns {DemandeMiseEnPaiement}
 */
DemandeMiseEnPaiement.get = function (id)
{
DemandeMiseEnPaiement.get = function (id) {
    if (null == DemandeMiseEnPaiement.instances) DemandeMiseEnPaiement.instances = new Array();
    if (null == DemandeMiseEnPaiement.instances[id]) DemandeMiseEnPaiement.instances[id] = new DemandeMiseEnPaiement(id);
    return DemandeMiseEnPaiement.instances[id];
}





/**
 * Liste de mises en paiement (par service ou par service référentiel)
 *
@@ -184,8 +161,7 @@ DemandeMiseEnPaiement.get = function (id)
 * @param {Object} element
 * @returns {MiseEnPaiementListe}
 */
function MiseEnPaiementListe(demandeMiseEnPaiement, element)
{
function MiseEnPaiementListe(demandeMiseEnPaiement, element) {
    this.demandeMiseEnPaiement = demandeMiseEnPaiement;
    this.id = element.attr('id');
    this.element = element;
@@ -194,20 +170,17 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    this.initializing = true;



    /**
     * Détermine si la liste est en lecture seule ou non
     *
     * @returns {boolean}
     */
    this.isReadOnly = function ()
    {
    this.isReadOnly = function () {
        return this.element.hasClass('read-only');
    }


    this.valider = function ()
    {
    this.valider = function () {
        var that = this;

        this.validation = true;
@@ -218,15 +191,13 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
            this.showError('Trop d\'heures de paiement ont été demandées.');
        }

        this.element.find("select[name='centre-cout']").each(function ()
        {
        this.element.find("select[name='centre-cout']").each(function () {
            if ($(this).val() == '') {
                that.showError('Centre de coûts à définir.');
            }
        });

        this.element.find("select[name='domaine-fonctionnel']").each(function ()
        {
        this.element.find("select[name='domaine-fonctionnel']").each(function () {
            if ($(this).val() == '') {
                that.showError('Domaine fonctionnel à définir.');
            }
@@ -236,9 +207,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.showError = function (errorStr)
    {
    this.showError = function (errorStr) {
        var out = '<div class="alert alert-danger alert-dismissible" role="alert">'
            + '<i class="fas fa-exclamation"></i> '
            + errorStr
@@ -249,14 +218,12 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @param {string} id
     * @returns {DemandeMiseEnPaiement}
     */
    this.removeMiseEnPaiement = function (id)
    {
    this.removeMiseEnPaiement = function (id) {
        miseEnPaiement = this.element.find(".mise-en-paiement#" + id);
        miseEnPaiement.empty();
        this.params['demandes-mep'][id] = 'removed';
@@ -267,7 +234,6 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @param {Object}  miseEnPaiementListe
@@ -276,8 +242,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
     * @param {string}  centreCoutId
     * @returns {DemandeMiseEnPaiement}
     */
    this.addMiseEnPaiement = function (id, heures, centreCoutId, domaineFonctionnelId, focus)
    {
    this.addMiseEnPaiement = function (id, heures, centreCoutId, domaineFonctionnelId, focus) {
        var that = this;
        var isNew = undefined === id;

@@ -294,8 +259,8 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)

        this.element.append(this.renderMiseEnPaiement(id));

        WidgetInitializer.includeJs(Url('vendor/bootstrap-select-1.14.0/dist/js/bootstrap-select.min.js'));
        WidgetInitializer.includeCss(Url('vendor/bootstrap-select-1.14.0/dist/css/bootstrap-select.min.css'));
        WidgetInitializer.includeJs(Url('vendor/bootstrap-select-1.14.0/js/bootstrap-select.min.js'));
        WidgetInitializer.includeCss(Url('vendor/bootstrap-select-1.14.0/css/bootstrap-select.min.css'));
        $('.selectpicker').selectpicker();

        if (isNew) {
@@ -308,23 +273,19 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)

        /* Connexion des événements */
        var heuresElement = this.element.find(".mise-en-paiement#" + id + " input[name='heures']");
        heuresElement.on('change', function ()
        {
        heuresElement.on('change', function () {
            that.onHeuresChange($(this));
        });

        this.element.find(".mise-en-paiement#" + id + " select[name='centre-cout']").on('change', function ()
        {
        this.element.find(".mise-en-paiement#" + id + " select[name='centre-cout']").on('change', function () {
            that.onCentreCoutChange($(this));
        });

        this.element.find(".mise-en-paiement#" + id + " select[name='domaine-fonctionnel']").on('change', function ()
        {
        this.element.find(".mise-en-paiement#" + id + " select[name='domaine-fonctionnel']").on('change', function () {
            that.onDomaineFonctionnelChange($(this));
        });

        this.element.find(".mise-en-paiement#" + id + " .action-delete").on('click', function ()
        {
        this.element.find(".mise-en-paiement#" + id + " .action-delete").on('click', function () {
            that.removeMiseEnPaiement(id);
        });

@@ -336,9 +297,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.renderMiseEnPaiement = function (id)
    {
    this.renderMiseEnPaiement = function (id) {
        var data = this.params['demandes-mep'][id];

        var out = '<tr class="mise-en-paiement" id="' + id + '"><td class="nombre" style="vertical-align:middle">';
@@ -359,9 +318,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.renderHeures = function (data)
    {
    this.renderHeures = function (data) {
        var out;
        var max = this.params['heures-total'] - this.params['heures-mep'];

@@ -375,9 +332,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.renderCentreCout = function (data)
    {
    this.renderCentreCout = function (data) {
        var outC = '';

        ccCount = Util.json.count(this.params['centres-cout']);
@@ -403,7 +358,8 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
                    }
                    outC += this.renderCentreCoutOption(this.params['centres-cout'][ccId], ccId, data['centre-cout-id']);
                    outC += '</optgroup>';
                } else if (this.params['centres-cout'][ccId]['parent'] == null) {
                } else (this.params['centres-cout'][ccId]['parent'] == null)
                {
                    outC += this.renderCentreCoutOption(this.params['centres-cout'][ccId], ccId, data['centre-cout-id']);
                }
            }
@@ -416,9 +372,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.renderCentreCoutOption = function (params, value, selVal)
    {
    this.renderCentreCoutOption = function (params, value, selVal) {
        var selected = value == selVal ? ' selected="selected"' : '';
        var bad = params['bad'] != undefined;
        var badText = '<span title=\'Centre de coûts supprimé ou incohérent\' class=\'label label-danger\'>' + params['libelle'] + '</span>';
@@ -427,9 +381,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.renderDomaineFonctionnel = function (data)
    {
    this.renderDomaineFonctionnel = function (data) {
        var outDF = '';

        ;
@@ -451,8 +403,7 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }


    this.renderActions = function (data)
    {
    this.renderActions = function (data) {
        var outA;

        if (data['read-only']) {
@@ -469,14 +420,12 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @param {integer} centreCoutId
     * @returns {undefined}
     */
    this.centreCoutGetChildren = function (centreCoutId)
    {
    this.centreCoutGetChildren = function (centreCoutId) {
        var result = {};
        for (var ccId in this.params['centres-cout']) {
            if (this.params['centres-cout'][ccId]['parent'] == centreCoutId) {
@@ -487,13 +436,11 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @param {Object} element
     */
    this.onHeuresChange = function (element)
    {
    this.onHeuresChange = function (element) {
        var miseEnPaiementId = element.parents('.mise-en-paiement').attr('id');
        var heures = Formatter.stringToFloat(element.val());

@@ -508,14 +455,12 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @param {Object} element
     * @returns {undefined}
     */
    this.onCentreCoutChange = function (element)
    {
    this.onCentreCoutChange = function (element) {
        var miseEnPaiementId = element.parents('.mise-en-paiement').attr('id');
        var centreCoutId = element.val();
        this.params['demandes-mep'][miseEnPaiementId]['centre-cout-id'] = centreCoutId;
@@ -524,27 +469,23 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @param {Object} element
     * @returns {undefined}
     */
    this.onDomaineFonctionnelChange = function (element)
    {
    this.onDomaineFonctionnelChange = function (element) {
        var miseEnPaiementId = element.parents('.mise-en-paiement').attr('id');
        var domaineFonctionnelId = element.val();
        this.demandeMiseEnPaiement.changeUpdate(miseEnPaiementId, 'domaine-fonctionnel-id', domaineFonctionnelId);
    }



    /**
     *
     * @returns {undefined}
     */
    this.onAddHeuresRestantes = function ()
    {
    this.onAddHeuresRestantes = function () {
        if (this.params['heures-non-dmep'] < 0) {
            alert('Il est impossible d\'ajouter des HETD négatifs.');
        } else {
@@ -553,13 +494,11 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     *
     * @returns {undefined}
     */
    this.updateHeuresRestantes = function ()
    {
    this.updateHeuresRestantes = function () {
        this.params['heures-dmep'] = 0;
        for (var miseEnPaiementId in this.params['demandes-mep']) {
            if (this.params['demandes-mep'][miseEnPaiementId] !== 'removed') {
@@ -594,14 +533,12 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     * Initialisation des lignes du formulaire à partir des données
     *
     * @returns {undefined}
     */
    this.populate = function ()
    {
    this.populate = function () {
        for (var miseEnPaiementId in this.params['demandes-mep']) {
            this.addMiseEnPaiement(miseEnPaiementId);
        }
@@ -609,17 +546,14 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    /**
     * Initialisation
     *
     * @returns {undefined}
     */
    this.init = function ()
    {
    this.init = function () {
        var that = this;
        this.element.find('.heures-non-dmep').on('click', function ()
        {
        this.element.find('.heures-non-dmep').on('click', function () {
            that.onAddHeuresRestantes();
        });
        this.populate();
@@ -627,51 +561,40 @@ function MiseEnPaiementListe(demandeMiseEnPaiement, element)
    }



    this.onChange = function ()
    {
    this.onChange = function () {
        if (!this.initializing) {
            $('.dmep-budget').dmepBudget('changed');
        }
    }



    this.getHeuresTotal = function ()
    {
    this.getHeuresTotal = function () {
        return this.params['heures-total'];
    }


    this.getHeuresDMEP = function ()
    {
    this.getHeuresDMEP = function () {
        return this.params['heures-dmep'];
    }


    this.getHeuresMEP = function ()
    {
    this.getHeuresMEP = function () {
        return this.params['heures-mep'];
    }


    this.getServiceAPayerElement = function ()
    {
    this.getServiceAPayerElement = function () {
        return this.element.parents("div.service-a-payer");
    }
}





/**
 * paiementMiseEnPaiementRechercheForm
 */
$.widget("ose.paiementMiseEnPaiementRechercheForm", {

    onTypeIntervenantChange: function ()
    {
    onTypeIntervenantChange: function () {
        var structureElement = this.getStructureElement()
        if (structureElement) {
            structureElement.val('');
@@ -679,8 +602,7 @@ $.widget("ose.paiementMiseEnPaiementRechercheForm", {
        this.onStructureChange();
    },

    onStructureChange: function ()
    {
    onStructureChange: function () {
        var periodeElement = this.getPeriodeElement()
        if (periodeElement) {
            periodeElement.val('');
@@ -688,14 +610,12 @@ $.widget("ose.paiementMiseEnPaiementRechercheForm", {
        this.onPeriodeChange();
    },

    onPeriodeChange: function ()
    {
    onPeriodeChange: function () {
        this.intervenantsSelectNone();
        this.getSuiteElement().click();
    },

    onIntervenantsChange: function ()
    {
    onIntervenantsChange: function () {
        if (this.getIntervenantsElement().is(':visible')) {
            this.getSuiteElement().hide();
            if (this.getIntervenantsElement().val() == null) {
@@ -709,40 +629,32 @@ $.widget("ose.paiementMiseEnPaiementRechercheForm", {
        }
    },

    hideActions: function ()
    {
    hideActions: function () {
        this.getAfficherElement().hide();
        this.getExporterPdfElement().hide();
        this.getExporterCsvEtat().hide();
        this.getExporterCsvWinpaie().hide();
    },

    showActions: function ()
    {
    showActions: function () {
        this.getAfficherElement().show();
        this.getExporterPdfElement().show();
        this.getExporterCsvEtat().show();
        this.getExporterCsvWinpaie().show();
    },

    intervenantsSelectAll: function ()
    {
    intervenantsSelectAll: function () {
        this.getIntervenantsElement().find("option").prop("selected", "selected");
        this.onIntervenantsChange();
    },

    intervenantsSelectNone: function ()
    {
    intervenantsSelectNone: function () {
        this.getIntervenantsElement().val([]);
        this.onIntervenantsChange();
    },





    _create: function ()
    {
    _create: function () {
        var that = this;

        var $radios = this.element.find('input:radio[name=type-intervenant]');
@@ -750,13 +662,20 @@ $.widget("ose.paiementMiseEnPaiementRechercheForm", {
            $radios.filter('[value=""]').attr('checked', true);
        }

        this.getTypeIntervenantElement().change(function () { that.onTypeIntervenantChange() });
        this.getStructureElement().change(function () { that.onStructureChange() });
        this.getPeriodeElement().change(function () { that.onPeriodeChange() });
        this.getIntervenantsElement().change(function () { that.onIntervenantsChange() });
        this.getTypeIntervenantElement().change(function () {
            that.onTypeIntervenantChange()
        });
        this.getStructureElement().change(function () {
            that.onStructureChange()
        });
        this.getPeriodeElement().change(function () {
            that.onPeriodeChange()
        });
        this.getIntervenantsElement().change(function () {
            that.onIntervenantsChange()
        });

        $("body").on("mise-en-paiement-form-submit", function (event, data)
        {
        $("body").on("mise-en-paiement-form-submit", function (event, data) {
            if ($("div .messenger, div .alert", event.div).length ? false : true) {

                document.location.href = event.a.data('url-redirect');
@@ -765,71 +684,56 @@ $.widget("ose.paiementMiseEnPaiementRechercheForm", {
        this.onIntervenantsChange();
    },

    getTypeIntervenantElement: function ()
    {
    getTypeIntervenantElement: function () {
        return this.element.find('[name="type-intervenant"]');
    },

    getStructureElement: function ()
    {
    getStructureElement: function () {
        return this.element.find('[name="structure"]');
    },

    getPeriodeElement: function ()
    {
    getPeriodeElement: function () {
        return this.element.find('[name="periode"]');
    },

    getIntervenantsElement: function ()
    {
    getIntervenantsElement: function () {
        return this.element.find('[name="intervenants[]"]');
    },

    getSuiteElement: function ()
    {
    getSuiteElement: function () {
        return this.element.find('[name="suite"]');
    },

    getAfficherElement: function ()
    {
    getAfficherElement: function () {
        return this.element.find('[name="afficher"]');
    },

    getExporterPdfElement: function ()
    {
    getExporterPdfElement: function () {
        return this.element.find('[name="exporter-pdf"]');
    },

    getExporterCsvEtat: function ()
    {
    getExporterCsvEtat: function () {
        return this.element.find('[name="exporter-csv-etat"]');
    },

    getExporterCsvWinpaie: function ()
    {
    getExporterCsvWinpaie: function () {
        return this.element.find('[name="exporter-csv-winpaie"]');
    },

    getEtat: function ()
    {
    getEtat: function () {
        return this.element.parents('.filter').data('etat');
    }

});

$(function ()
{
$(function () {
    WidgetInitializer.add('paiement-mise-en-paiement-recherche-form', 'paiementMiseEnPaiementRechercheForm');
});





$.widget("ose.paiementMiseEnPaiementForm", {

    onPeriodeChange: function ()
    {
    onPeriodeChange: function () {
        var periodeId = this.getPeriodeElement().val();
        var dates = this.element.data('dates-mise-en-paiement');
        var periodePaiementTardifId = this.element.data('periode-paiement-tardif-id');
@@ -846,70 +750,59 @@ $.widget("ose.paiementMiseEnPaiementForm", {
    },



    _create: function ()
    {
    _create: function () {
        var that = this;
        this.getPeriodeElement().change(function () { that.onPeriodeChange() });
        this.getPeriodeElement().change(function () {
            that.onPeriodeChange()
        });
    },



    getPeriodeElement: function ()
    {
    getPeriodeElement: function () {
        return this.element.find('[name="periode"]');
    },



    getDateMiseEnPaiementElement: function ()
    {
    getDateMiseEnPaiementElement: function () {
        return this.element.find('[name="date-mise-en-paiement"]');
    }
});

$(function ()
{
$(function () {
    WidgetInitializer.add('paiement-mise-en-paiement-form', 'paiementMiseEnPaiementForm');
});





$.widget("ose.dmepBudget", {

    oriData: undefined,
    depassement: false,


    _create: function ()
    {
    _create: function () {
        var that = this;

        this.oriData = this.getData();
        this.getElementsEnveloppes().each(function ()
        {
        this.getElementsEnveloppes().each(function () {
            that.setDiffValue($(this).data('type-ressource'), $(this).data('structure'), 0);
        });

        this.updateBlocageDepassement();

        setTimeout(function () { that.update() }, 5000);
        setTimeout(function () {
            that.update()
        }, 5000);
    },



    update: function ()
    {
    update: function () {
        var that = this;
        var updateUrl = this.element.data('update-url');
        var diffData = this.getDiffData();

        data = $.getJSON(updateUrl, function (data) {

            that.getElementsEnveloppes().each(function ()
            {
            that.getElementsEnveloppes().each(function () {
                var structureId = $(this).data('structure');
                var typeRessourceId = $(this).data('type-ressource');

@@ -931,18 +824,17 @@ $.widget("ose.dmepBudget", {
            that.updateBlocageDepassement();
        });

        setTimeout(function () { that.update() }, 5000);
        setTimeout(function () {
            that.update()
        }, 5000);
    },



    changed: function ()
    {
    changed: function () {
        var that = this;
        var data = this.getDiffData();

        this.getElementsEnveloppes().each(function ()
        {
        this.getElementsEnveloppes().each(function () {
            var structureId = $(this).data('structure');
            var typeRessourceId = $(this).data('type-ressource');
            var value = 0;
@@ -960,9 +852,7 @@ $.widget("ose.dmepBudget", {
    },



    getDiffData: function ()
    {
    getDiffData: function () {
        var data = this.getData();

        for (structureId in this.oriData) {
@@ -980,13 +870,10 @@ $.widget("ose.dmepBudget", {
    },



    getData: function ()
    {
    getData: function () {
        var data = {};

        $('.demande-mise-en-paiement .mise-en-paiement').each(function ()
        {
        $('.demande-mise-en-paiement .mise-en-paiement').each(function () {
            var id = $(this).attr('id');
            var params = $(this).parents('.mise-en-paiement-liste').data('params');
            var structureId = params['structure-id'];
@@ -1011,9 +898,7 @@ $.widget("ose.dmepBudget", {
    },



    setDiffValue: function (typeRessourceId, structureId, value)
    {
    setDiffValue: function (typeRessourceId, structureId, value) {
        var progress = this.getElementEnveloppe(typeRessourceId, structureId);
        var bar = progress.find('.progress-bar');
        var dotation = progress.data('dotation');
@@ -1044,9 +929,7 @@ $.widget("ose.dmepBudget", {
    },



    updateBlocageDepassement: function ()
    {
    updateBlocageDepassement: function () {
        if (this.depassement) {
            $('.demande-mise-en-paiement .sauvegarde').hide();
            $('.demande-mise-en-paiement .depassement-budget').show();
@@ -1058,21 +941,16 @@ $.widget("ose.dmepBudget", {
    },



    getElementEnveloppe: function (typeRessourceId, structureId)
    {
    getElementEnveloppe: function (typeRessourceId, structureId) {
        return this.element.find('.enveloppe[data-type-ressource=' + typeRessourceId + '][data-structure=' + structureId + ']');
    },



    getElementsEnveloppes: function ()
    {
    getElementsEnveloppes: function () {
        return this.element.find('.enveloppe');
    }
});

$(function ()
{
$(function () {
    WidgetInitializer.add('dmep-budget', 'dmepBudget');
});