Loading data/generated-documents/activity/bordereau.docx +173 B (31 KiB) File changed.No diff preview for this file type. View original file View changed file module/Oscar/config/module.config.php +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ return array( //////////////////////////////////////////////////////////////// [ 'controller' => 'Activity', 'action' => ['show', 'show2', 'edit', 'new', 'duplicate','persons', 'organizations', 'makeProject', 'delete', 'visualization', 'documentsJson', 'activitiesOrganizations', 'changeProject', 'delete', 'visualization', 'documentsJson', 'activitiesOrganizations', 'changeProject', 'jsonApi', 'notifications', 'generateNotifications', 'generatedDocument', 'requestFor', 'adminDemande', 'api', 'gant', 'estimatedSpent','estimatedSpentExport', 'spentList', 'newInStructure', 'spentSynthesisActivity'], 'roles' => ['user'], ], Loading module/Oscar/config/routes.yml +7 −0 Original line number Diff line number Diff line Loading @@ -892,6 +892,13 @@ contract: defaults: action: exportJSON json: type: segment options: route: /json/:id defaults: action: jsonApi generatedocument: type: segment options: Loading module/Oscar/src/Oscar/Controller/ProjectGrantController.php +10 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ use Oscar\Entity\ValidationPeriodRepository; use Oscar\Exception\OscarException; use Oscar\Form\ProjectGrantForm; use Oscar\Formatter\ActivityPaymentFormatter; use Oscar\Formatter\ActivityToJsonFormatter; use Oscar\Formatter\CSVDownloader; use Oscar\Formatter\JSONFormatter; use Oscar\Formatter\Spent\EstimatedSpentActivityHTMLFormater; Loading Loading @@ -647,7 +648,16 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif ]; } public function jsonApiAction(){ // Accès global au activité $this->getOscarUserContextService()->check(Privileges::ACTIVITY_SHOW); $activity = $this->getActivityFromRoute(); $formatter = new ActivityToJsonFormatter(); $json = $formatter->format($activity); return $this->jsonOutput($json); die("TODO : $activity"); } /** * Génération automatique de documents. Loading module/Oscar/src/Oscar/Entity/Activity.php +15 −1 Original line number Diff line number Diff line Loading @@ -414,6 +414,14 @@ class Activity implements ResourceInterface return $this->totalSpent; } public function getPercentSpent(){ return 100 / $this->getAmount() * abs($this->getTotalSpent()); } public function getRemainder(){ return $this->getAmount() - abs($this->getTotalSpent()); } /** * @param float $totalSpent */ Loading Loading @@ -1849,7 +1857,8 @@ class Activity implements ResourceInterface 'amount' => $this->getAmount(), 'pfi' => $this->getCodeEOTP(), 'oscar' => $this->getOscarNum(), 'montant' => number_format((double)$this->getAmount(), 2, ',', ' ') . $this->getCurrency()->getSymbol(), 'montant' => number_format( (double)$this->getAmount(), 2, ',', ' ') . $this->getCurrency()->getSymbol(), 'annee-debut' => $this->getDateStartStr('Y'), 'annee-fin' => $this->getDateEndStr('Y'), 'debut' => $this->getDateStartStr('d/m/Y'), Loading @@ -1865,6 +1874,11 @@ class Activity implements ResourceInterface $sluger = Slugify::create(); // Dépenses $datas['total-depense'] = number_format($this->getTotalSpent(),2,',', ' '); // as $spent) $datas['total-depense-percent'] = number_format($this->getPercentSpent(),2, ',', ''); // as $spent) $datas['total-reste'] = number_format($this->getRemainder(),2, ',', ' '); $persons = []; Loading Loading
data/generated-documents/activity/bordereau.docx +173 B (31 KiB) File changed.No diff preview for this file type. View original file View changed file
module/Oscar/config/module.config.php +1 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ return array( //////////////////////////////////////////////////////////////// [ 'controller' => 'Activity', 'action' => ['show', 'show2', 'edit', 'new', 'duplicate','persons', 'organizations', 'makeProject', 'delete', 'visualization', 'documentsJson', 'activitiesOrganizations', 'changeProject', 'delete', 'visualization', 'documentsJson', 'activitiesOrganizations', 'changeProject', 'jsonApi', 'notifications', 'generateNotifications', 'generatedDocument', 'requestFor', 'adminDemande', 'api', 'gant', 'estimatedSpent','estimatedSpentExport', 'spentList', 'newInStructure', 'spentSynthesisActivity'], 'roles' => ['user'], ], Loading
module/Oscar/config/routes.yml +7 −0 Original line number Diff line number Diff line Loading @@ -892,6 +892,13 @@ contract: defaults: action: exportJSON json: type: segment options: route: /json/:id defaults: action: jsonApi generatedocument: type: segment options: Loading
module/Oscar/src/Oscar/Controller/ProjectGrantController.php +10 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ use Oscar\Entity\ValidationPeriodRepository; use Oscar\Exception\OscarException; use Oscar\Form\ProjectGrantForm; use Oscar\Formatter\ActivityPaymentFormatter; use Oscar\Formatter\ActivityToJsonFormatter; use Oscar\Formatter\CSVDownloader; use Oscar\Formatter\JSONFormatter; use Oscar\Formatter\Spent\EstimatedSpentActivityHTMLFormater; Loading Loading @@ -647,7 +648,16 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif ]; } public function jsonApiAction(){ // Accès global au activité $this->getOscarUserContextService()->check(Privileges::ACTIVITY_SHOW); $activity = $this->getActivityFromRoute(); $formatter = new ActivityToJsonFormatter(); $json = $formatter->format($activity); return $this->jsonOutput($json); die("TODO : $activity"); } /** * Génération automatique de documents. Loading
module/Oscar/src/Oscar/Entity/Activity.php +15 −1 Original line number Diff line number Diff line Loading @@ -414,6 +414,14 @@ class Activity implements ResourceInterface return $this->totalSpent; } public function getPercentSpent(){ return 100 / $this->getAmount() * abs($this->getTotalSpent()); } public function getRemainder(){ return $this->getAmount() - abs($this->getTotalSpent()); } /** * @param float $totalSpent */ Loading Loading @@ -1849,7 +1857,8 @@ class Activity implements ResourceInterface 'amount' => $this->getAmount(), 'pfi' => $this->getCodeEOTP(), 'oscar' => $this->getOscarNum(), 'montant' => number_format((double)$this->getAmount(), 2, ',', ' ') . $this->getCurrency()->getSymbol(), 'montant' => number_format( (double)$this->getAmount(), 2, ',', ' ') . $this->getCurrency()->getSymbol(), 'annee-debut' => $this->getDateStartStr('Y'), 'annee-fin' => $this->getDateEndStr('Y'), 'debut' => $this->getDateStartStr('d/m/Y'), Loading @@ -1865,6 +1874,11 @@ class Activity implements ResourceInterface $sluger = Slugify::create(); // Dépenses $datas['total-depense'] = number_format($this->getTotalSpent(),2,',', ' '); // as $spent) $datas['total-depense-percent'] = number_format($this->getPercentSpent(),2, ',', ''); // as $spent) $datas['total-reste'] = number_format($this->getRemainder(),2, ',', ' '); $persons = []; Loading