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

Fix : Les recettes sont affichées sur 2 colonnes (Et pas le total des 2 colonnes)

parent ac4cff44
Loading
Loading
Loading
Loading
Loading
+23 −28
Original line number Diff line number Diff line
@@ -31,14 +31,16 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
    /**
     * @return SpentService
     */
    public function getSpentService(){
    public function getSpentService()
    {
        return $this->getServiceContainer()->get(SpentService::class);
    }

    /**
     * @return ProjectGrantService
     */
    public function getProjectGrantService(){
    public function getProjectGrantService()
    {
        return $this->getServiceContainer()->get(ProjectGrantService::class);
    }

@@ -53,7 +55,8 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
    /**
     * @return OscarUserContext
     */
    public function getOscarUserContext(){
    public function getOscarUserContext()
    {
        return $this->getOscarUserContextService();
    }

@@ -68,14 +71,16 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
    /**
     * @return Logger
     */
    public function getLogger(){
    public function getLogger()
    {
        return $this->getServiceContainer()->get(LoggerService::class);
    }

    /**
     * @return EntityManager
     */
    public function getEntityManager() :EntityManager {
    public function getEntityManager() :EntityManager
    {
        return $this->getServiceContainer()->get(EntityManager::class);
    }

@@ -111,23 +116,18 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
                    $this->getLogger()->debug(print_r($_POST, true));
                    if ($this->params()->fromPost("moved")) {
                        $result = $this->getSpentService()->moved($this->params()->fromPost('moved'), $this->params()->fromPost('to'));
                    }
                    elseif ($this->params()->fromPost("admin") == 'reset') {
                    } elseif ($this->params()->fromPost("admin") == 'reset') {
                        $this->getSpentService()->loadPCG();
                        return $this->getResponseOk();
                    }
                    elseif ($this->params()->fromPost("admin") == 'sort') {
                    } elseif ($this->params()->fromPost("admin") == 'sort') {
                        $this->getSpentService()->orderSpentsByCode();
                        return $this->getResponseOk();
                    }
                    elseif ($this->params()->fromPost("action") == 'blind') {
                    } elseif ($this->params()->fromPost("action") == 'blind') {
                        $spent = $this->getSpentService()->getSpentTypeById($this->params()->fromPost('id'));
                        $spent->setBlind(!$spent->getBlind());
                        $this->getEntityManager()->flush($spent);
                        return $this->getResponseOk();
                    }

                    elseif ($this->params()->fromPost("action") == 'annexe') {
                    } elseif ($this->params()->fromPost("action") == 'annexe') {
                        try {
                            $id = $this->params()->fromPost('id');

@@ -154,9 +154,7 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
                        } catch (\Exception $e) {
                            return $this->getResponseInternalError($e->getMessage());
                        }
                    }

                    else {
                    } else {
                        $result = $this->getSpentService()->updateSpentTypeGroup($this->params()->fromPost());
                    }
                    return $this->jsonOutput([
@@ -172,7 +170,8 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
                    $this->getLogger()->debug(print_r($_GET, true));
                    $deleteId = $this->params()->fromQuery('id');
                    $result = $this->getSpentService()->deleteNode(
                        $this->getSpentService()->getSpentGroupNodeData($deleteId));
                        $this->getSpentService()->getSpentGroupNodeData($deleteId)
                    );
                    return $this->jsonOutput([
                        'spenttypegroups' => $this->getSpentService()->getAllArray()
                    ]);
@@ -200,11 +199,11 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
        }
    }

    public function compteAffectationAction(){
    public function compteAffectationAction()
    {
        $method = $this->getHttpXMethod();

        if ($method == 'POST') {

            // Vérifiaction des droits d'accès
            $this->getOscarUserContextService()->check(Privileges::MAINTENANCE_SPENDTYPEGROUP_MANAGE);

@@ -218,7 +217,6 @@ class DepenseController extends AbstractOscarController implements UseServiceCon

            try {
                $this->getSpentService()->updateAffectation(json_decode($postedAffectations, true));

            } catch (\Exception $e) {
                return $this->getResponseInternalError($e->getMessage());
            }
@@ -233,7 +231,8 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
     *
     * @return \Laminas\Http\Response|JsonModel
     */
    public function activityApiAction(){
    public function activityApiAction()
    {

        try {
            $idactivity = $this->params()->fromRoute('id');
@@ -280,13 +279,11 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
                        $formatter = new SpentActivityExcelFormater($spents, $activity);
                        $content = $formatter->format(['download' => true]);
                        die();
                    }
                    elseif( $mode == 'details' ){
                    } elseif ($mode == 'details') {
                        $formatter = new SpentActivityDetailsExcelFormater($spents, $activity);
                        $content = $formatter->format(['download' => true]);
                        die("Pas encore disponible");
                    }
                    else {
                    } else {
                        throw new OscarException("Impossible de télécharger les dépenses, le mode $mode n'est pas disponible.");
                    }

@@ -296,8 +293,6 @@ class DepenseController extends AbstractOscarController implements UseServiceCon
                    throw new OscarException("Format demandé non-pris en charge");
                    break;
            }


        } catch (\Exception $e) {
            return $this->getResponseInternalError("Impossible de charger l'activité : " . $e->getMessage());
        }
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@
    "src": "src/ActivityNotes.js"
  },
  "src/ActivitySpentDetails.js": {
    "file": "assets/activityspentdetails-b5c3e1f3.js",
    "file": "assets/activityspentdetails-1ce1581e.js",
    "imports": [
      "_vendor.js",
      "_vendor7.js",
+1 −1
Original line number Diff line number Diff line
import{p as v,o as i,c as a,b as h,i as f,T as g,d as s,F as m,j as p,t as l,a as o,g as u,h as c,w as C,k}from"./vendor.js";import{_ as w}from"./vendor7.js";const _={props:{url:{default:""},standalone:{default:!0},datas:{default:{}}},computed:{synthesis(){return this.standalone?this.infos:this.datas}},data(){return{infos:null,pendingMsg:null,showCuration:!1,masses:[]}},methods:{fetch(){this.pendingMsg="Chargement des données financières",v.get(this.url).then(t=>{this.infos=t.data.synthesis,this.masses=t.data.masses},t=>{console.log(t)}).then(t=>{this.pendingMsg=!1})}},mounted(){this.fetch()}},I={key:0,class:"overlay"},M={class:"overlay-content"},N={class:"card row"},B={class:"col-md-4"},T={class:"col-md-8"},V=["onUpdate:modelValue","onChange"],A=["value"],x={key:0,class:"alert alert-danger"},D={key:0,class:"alert-warning alert"},E={key:0,class:"pending"},L={class:""},R={key:0},j={key:0,class:"table table-condensed card synthesis"},F=["href"],S={style:{"text-align":"right"},class:"text-private"},U={style:{"text-align":"right"},class:"text-private"},q={class:"total"},z={style:{"text-align":"right"},class:"text-private"},H={style:{"text-align":"right"},class:"text-private"},Q={key:0},X={href:"#repport-nb",class:"label label-info"},G={style:{"text-align":"right"},class:"text-private"},J={style:{"text-align":"right"},class:"text-private"},K={class:"table table-condensed card synthesis"},O={class:"label label-info xs",href:"#repport-1"},P={style:{"text-align":"right"},class:"text-private"},W={key:1},Y={key:0},Z={key:1},$={key:0,class:"table table-condensed card synthesis"},ss={class:"label label-info",href:"#repport-0"},es={style:{"text-align":"right"},class:"text-private"};function ts(t,e,ns,ls,y,n){return i(),a("section",null,[h(g,{name:"fade"},{default:f(()=>[y.showCuration?(i(),a("div",I,[s("div",M,[s("h3",null,[e[4]||(e[4]=o(" Qualification des comptes ")),s("span",{class:"overlay-closer",onClick:e[0]||(e[0]=r=>y.showCuration=!1)},"X")]),e[10]||(e[10]=s("p",null,"Les comptes suivants ne sont pas qualifiés, vous pouvez utiliser cet écran pour les attribuer à une masse budgétaire :",-1)),(i(!0),a(m,null,p(n.synthesis.curations,r=>(i(),a("div",N,[s("div",B,[s("strong",null,l(r.compte),1),e[5]||(e[5]=o(" - ")),s("em",null,l(r.compteInfos.label),1)]),s("div",T,[C(s("select",{name:"",id:"",class:"form-control","onUpdate:modelValue":d=>t.affectations[r.compte]=d,onChange:d=>t.updateAffectations(r.compte,d)},[e[6]||(e[6]=s("option",{value:"0"},"Ignorer",-1)),e[7]||(e[7]=s("option",{value:"1"},"Traiter comme une recette",-1)),(i(!0),a(m,null,p(y.masses,(d,b)=>(i(),a("option",{value:b},l(d),9,A))),256))],40,V),[[k,t.affectations[r.compte]]])])]))),256)),e[11]||(e[11]=s("hr",null,null,-1)),s("button",{onClick:e[1]||(e[1]=(...r)=>t.handlerCurationCancel&&t.handlerCurationCancel(...r)),class:"btn btn-danger"},e[8]||(e[8]=[s("i",{class:"icon-cancel-circled"},null,-1),o("Annuler")])),s("button",{onClick:e[2]||(e[2]=(...r)=>t.handlerCurationConfirm&&t.handlerCurationConfirm(...r)),class:"btn btn-success"},e[9]||(e[9]=[s("i",{class:"icon-floppy"},null,-1),o("Enregistrer")]))])])):u("",!0)]),_:1}),h(g,{name:"fade"},{default:f(()=>[t.error?(i(),a("div",x,[e[12]||(e[12]=s("i",{class:"icon-attention-1"},null,-1)),o(" Il y'a eut un problème lors de la récupération des données financières : "+l(t.error),1)])):u("",!0)]),_:1}),h(g,{name:"fade"},{default:f(()=>[t.warning?(i(),a("div",D,[e[13]||(e[13]=s("i",{class:"icon-warning-empty"},null,-1)),o(" Les données affichées peuvent ne pas être à jour : "+l(t.warning),1)])):u("",!0)]),_:1}),h(g,{name:"fade"},{default:f(()=>[y.pendingMsg?(i(),a("div",E,[s("div",L,[e[14]||(e[14]=s("i",{class:"icon-spinner animate-spin"},null,-1)),o(" "+l(y.pendingMsg),1)])])):u("",!0)]),_:1}),n.synthesis?(i(),a("div",R,[n.synthesis?(i(),a("table",j,[e[17]||(e[17]=s("thead",null,[s("tr",null,[s("th",null,"Masse"),s("th",{style:{"text-align":"right"}},"Engagé"),s("th",{style:{"text-align":"right"}},"Réalisé")])],-1)),s("tbody",null,[(i(!0),a(m,null,p(n.synthesis.masses,(r,d)=>(i(),a("tr",null,[s("th",null,[s("small",null,l(r),1),s("a",{class:"label label-info xs",href:"#repport-"+d},l(n.synthesis.synthesis[d].nbr_effectue)+" / "+l(n.synthesis.synthesis[d].nbr_engage),9,F)]),s("td",S,l(t.$filters.money(n.synthesis.synthesis[d].total_engage)),1),s("td",U,l(t.$filters.money(n.synthesis.synthesis[d].total_effectue)),1)]))),256))]),s("tbody",null,[s("tr",q,[e[15]||(e[15]=s("th",null,"Total",-1)),s("td",z,l(t.$filters.money(n.synthesis.synthesis.totaux.engage)),1),s("td",H,l(t.$filters.money(n.synthesis.synthesis.totaux.effectue)),1)])]),s("tbody",null,[n.synthesis.synthesis["N.B"].total!=0?(i(),a("tr",Q,[s("th",null,[e[16]||(e[16]=s("small",null,[s("i",{class:"icon-attention"}),o(" Hors-masse")],-1)),s("a",X,l(n.synthesis.synthesis["N.B"].nbr),1)]),s("td",G,l(t.$filters.money(n.synthesis.synthesis["N.B"].total_engage)),1),s("td",J,l(t.$filters.money(n.synthesis.synthesis["N.B"].total_effectue)),1)])):u("",!0)])])):u("",!0),s("div",null,[e[19]||(e[19]=s("h3",null,[s("i",{class:"icon-calculator"}),o("Recettes")],-1)),s("table",K,[s("tbody",null,[s("tr",null,[s("th",null,[e[18]||(e[18]=o("Recette ")),s("a",O,l(n.synthesis.synthesis[1].nbr),1)]),s("td",P,l(t.$filters.money(n.synthesis.synthesis[1].total)),1)])])])])])):u("",!0),t.manageIgnored&&n.synthesis&&n.synthesis.synthesis[0].total!=0?(i(),a("div",W,[s("a",{href:"#",onClick:e[3]||(e[3]=c(r=>t.displayIgnored=!t.displayIgnored,["prevent"]))},[t.displayIgnored?(i(),a("span",Y,e[20]||(e[20]=[s("i",{class:"icon-eye-off"},null,-1),o(" Cacher")]))):(i(),a("span",Z,e[21]||(e[21]=[s("i",{class:"icon-eye"},null,-1),o(" Montrer")]))),e[22]||(e[22]=o(" les données ignorées "))]),t.spentlines&&t.displayIgnored?(i(),a("table",$,[s("tbody",null,[s("tr",null,[s("th",null,[e[23]||(e[23]=o(" Ignorées ")),s("a",ss,l(n.synthesis.synthesis[0].nbr),1)]),s("td",es,l(t.$filters.money(n.synthesis.synthesis[0].total)),1)])])])):u("",!0)])):u("",!0)])}const os=w(_,[["render",ts]]);export{os as A};
import{p as v,o as i,c as a,b as h,i as f,T as g,d as s,F as m,j as p,t as l,a as o,g as u,h as c,w as C,k}from"./vendor.js";import{_}from"./vendor7.js";const w={props:{url:{default:""},standalone:{default:!0},datas:{default:{}}},computed:{synthesis(){return this.standalone?this.infos:this.datas}},data(){return{infos:null,pendingMsg:null,showCuration:!1,masses:[]}},methods:{fetch(){this.pendingMsg="Chargement des données financières",v.get(this.url).then(t=>{this.infos=t.data.synthesis,this.masses=t.data.masses},t=>{console.log(t)}).then(t=>{this.pendingMsg=!1})}},mounted(){this.fetch()}},I={key:0,class:"overlay"},M={class:"overlay-content"},N={class:"card row"},B={class:"col-md-4"},T={class:"col-md-8"},V=["onUpdate:modelValue","onChange"],x=["value"],A={key:0,class:"alert alert-danger"},D={key:0,class:"alert-warning alert"},E={key:0,class:"pending"},L={class:""},R={key:0},j={key:0,class:"table table-condensed card synthesis"},F=["href"],S={style:{"text-align":"right"},class:"text-private"},U={style:{"text-align":"right"},class:"text-private"},q={class:"total"},z={style:{"text-align":"right"},class:"text-private"},H={style:{"text-align":"right"},class:"text-private"},Q={key:0},X={href:"#repport-nb",class:"label label-info"},G={style:{"text-align":"right"},class:"text-private"},J={style:{"text-align":"right"},class:"text-private"},K={class:"table table-condensed card synthesis"},O={class:"label label-info xs",href:"#repport-1"},P={style:{"text-align":"right"},class:"text-private"},W={style:{"text-align":"right"},class:"text-private"},Y={key:1},Z={key:0},$={key:1},ss={key:0,class:"table table-condensed card synthesis"},es={class:"label label-info",href:"#repport-0"},ts={style:{"text-align":"right"},class:"text-private"};function ns(t,e,ls,is,y,n){return i(),a("section",null,[h(g,{name:"fade"},{default:f(()=>[y.showCuration?(i(),a("div",I,[s("div",M,[s("h3",null,[e[4]||(e[4]=o(" Qualification des comptes ")),s("span",{class:"overlay-closer",onClick:e[0]||(e[0]=r=>y.showCuration=!1)},"X")]),e[10]||(e[10]=s("p",null,"Les comptes suivants ne sont pas qualifiés, vous pouvez utiliser cet écran pour les attribuer à une masse budgétaire :",-1)),(i(!0),a(m,null,p(n.synthesis.curations,r=>(i(),a("div",N,[s("div",B,[s("strong",null,l(r.compte),1),e[5]||(e[5]=o(" - ")),s("em",null,l(r.compteInfos.label),1)]),s("div",T,[C(s("select",{name:"",id:"",class:"form-control","onUpdate:modelValue":d=>t.affectations[r.compte]=d,onChange:d=>t.updateAffectations(r.compte,d)},[e[6]||(e[6]=s("option",{value:"0"},"Ignorer",-1)),e[7]||(e[7]=s("option",{value:"1"},"Traiter comme une recette",-1)),(i(!0),a(m,null,p(y.masses,(d,b)=>(i(),a("option",{value:b},l(d),9,x))),256))],40,V),[[k,t.affectations[r.compte]]])])]))),256)),e[11]||(e[11]=s("hr",null,null,-1)),s("button",{onClick:e[1]||(e[1]=(...r)=>t.handlerCurationCancel&&t.handlerCurationCancel(...r)),class:"btn btn-danger"},e[8]||(e[8]=[s("i",{class:"icon-cancel-circled"},null,-1),o("Annuler")])),s("button",{onClick:e[2]||(e[2]=(...r)=>t.handlerCurationConfirm&&t.handlerCurationConfirm(...r)),class:"btn btn-success"},e[9]||(e[9]=[s("i",{class:"icon-floppy"},null,-1),o("Enregistrer")]))])])):u("",!0)]),_:1}),h(g,{name:"fade"},{default:f(()=>[t.error?(i(),a("div",A,[e[12]||(e[12]=s("i",{class:"icon-attention-1"},null,-1)),o(" Il y'a eut un problème lors de la récupération des données financières : "+l(t.error),1)])):u("",!0)]),_:1}),h(g,{name:"fade"},{default:f(()=>[t.warning?(i(),a("div",D,[e[13]||(e[13]=s("i",{class:"icon-warning-empty"},null,-1)),o(" Les données affichées peuvent ne pas être à jour : "+l(t.warning),1)])):u("",!0)]),_:1}),h(g,{name:"fade"},{default:f(()=>[y.pendingMsg?(i(),a("div",E,[s("div",L,[e[14]||(e[14]=s("i",{class:"icon-spinner animate-spin"},null,-1)),o(" "+l(y.pendingMsg),1)])])):u("",!0)]),_:1}),n.synthesis?(i(),a("div",R,[n.synthesis?(i(),a("table",j,[e[17]||(e[17]=s("thead",null,[s("tr",null,[s("th",null,"Masse"),s("th",{style:{"text-align":"right"}},"Engagé"),s("th",{style:{"text-align":"right"}},"Réalisé")])],-1)),s("tbody",null,[(i(!0),a(m,null,p(n.synthesis.masses,(r,d)=>(i(),a("tr",null,[s("th",null,[s("small",null,l(r),1),s("a",{class:"label label-info xs",href:"#repport-"+d},l(n.synthesis.synthesis[d].nbr_effectue)+" / "+l(n.synthesis.synthesis[d].nbr_engage),9,F)]),s("td",S,l(t.$filters.money(n.synthesis.synthesis[d].total_engage)),1),s("td",U,l(t.$filters.money(n.synthesis.synthesis[d].total_effectue)),1)]))),256))]),s("tbody",null,[s("tr",q,[e[15]||(e[15]=s("th",null,"Total",-1)),s("td",z,l(t.$filters.money(n.synthesis.synthesis.totaux.engage)),1),s("td",H,l(t.$filters.money(n.synthesis.synthesis.totaux.effectue)),1)])]),s("tbody",null,[n.synthesis.synthesis["N.B"].total!=0?(i(),a("tr",Q,[s("th",null,[e[16]||(e[16]=s("small",null,[s("i",{class:"icon-attention"}),o(" Hors-masse")],-1)),s("a",X,l(n.synthesis.synthesis["N.B"].nbr),1)]),s("td",G,l(t.$filters.money(n.synthesis.synthesis["N.B"].total_engage)),1),s("td",J,l(t.$filters.money(n.synthesis.synthesis["N.B"].total_effectue)),1)])):u("",!0)])])):u("",!0),s("div",null,[e[19]||(e[19]=s("h3",null,[s("i",{class:"icon-calculator"}),o("Recettes")],-1)),s("table",K,[s("tbody",null,[s("tr",null,[s("th",null,[e[18]||(e[18]=o("Recette ")),s("a",O,l(n.synthesis.synthesis[1].nbr),1)]),s("td",P,l(t.$filters.money(n.synthesis.synthesis[1].total_engage)),1),s("td",W,l(t.$filters.money(n.synthesis.synthesis[1].total_effectue)),1)])])])])])):u("",!0),t.manageIgnored&&n.synthesis&&n.synthesis.synthesis[0].total!=0?(i(),a("div",Y,[s("a",{href:"#",onClick:e[3]||(e[3]=c(r=>t.displayIgnored=!t.displayIgnored,["prevent"]))},[t.displayIgnored?(i(),a("span",Z,e[20]||(e[20]=[s("i",{class:"icon-eye-off"},null,-1),o(" Cacher")]))):(i(),a("span",$,e[21]||(e[21]=[s("i",{class:"icon-eye"},null,-1),o(" Montrer")]))),e[22]||(e[22]=o(" les données ignorées "))]),t.spentlines&&t.displayIgnored?(i(),a("table",ss,[s("tbody",null,[s("tr",null,[s("th",null,[e[23]||(e[23]=o(" Ignorées ")),s("a",es,l(n.synthesis.synthesis[0].nbr),1)]),s("td",ts,l(t.$filters.money(n.synthesis.synthesis[0].total)),1)])])])):u("",!0)])):u("",!0)])}const rs=_(w,[["render",ns]]);export{rs as A};
+2 −5
Original line number Diff line number Diff line
@@ -98,7 +98,8 @@
          <tbody>
          <tr>
            <th>Recette <a class="label label-info xs" href="#repport-1">{{ synthesis.synthesis['1'].nbr}}</a></th>
            <td style="text-align: right"  class="text-private">{{ $filters.money(synthesis.synthesis['1'].total)}}</td>
            <td style="text-align: right"  class="text-private">{{ $filters.money(synthesis.synthesis['1'].total_engage)}}</td>
            <td style="text-align: right"  class="text-private">{{ $filters.money(synthesis.synthesis['1'].total_effectue)}}</td>
          </tr>
          </tbody>
        </table>
@@ -123,10 +124,6 @@
        </tbody>
      </table>
    </div>
<!--    <small v-if="dateUpdated">-->
<!--      Données mise à jour :-->
<!--      <strong v-if="dateUpdated">{{ $filters.fullDate(dateUpdated.date) }}</strong>-->
<!--    </small>-->
  </section>
</template>
<script>
Loading