Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
K
kohinos-tav
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • agplv3
  • kohinos-tav
  • Merge Requests
  • !98

Merged
Opened May 08, 2024 by Yvon Kerdoncuff@Yvon 
  • Report abuse
Report abuse

create two commands : one triggers ccas reconversion, the other sends an email…

create two commands : one triggers ccas reconversion, the other sends an email with ccas transaction export

  • Discussion 21
  • Commits 7
  • Changes 15
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Yvon Kerdoncuff @Yvon

    added 1 commit

    • 2e3eb012 - remove debug stuff

    Compare with previous version

    May 08, 2024

    added 1 commit

    • 2e3eb012 - remove debug stuff

    Compare with previous version

    added 1 commit <ul><li>2e3eb012 - remove debug stuff</li></ul> [Compare with previous version](https://gl.cooperatic.fr/cooperatic/kohinos-tav/merge_requests/98/diffs?diff_id=3021&start_sha=77c5af9cd49efd0c33bed363a486bf6e077f3062)
    Toggle commit list
  • Damien Moulard
    @DamienM started a discussion on an old version of the diff May 10, 2024
    Resolved by Damien Moulard May 14, 2024
    src/Command/SendCcasTransactionsExportToPrestatairesCommand.php 0 → 100644
    229 if ($data) {
    230 list($path, $prestaTotal) = $this->createExportFile($year, $month, $p, $dir, $data, $nf);
    231 }
    232 //Send mail as soon as there are data or prestataire is CCAS OK
    233 //If there is no data, just inform there is nothing to do
    234 if ($data || $p->getCcasOk()) {
    235 $mail = $this->prepareMail($p, $month, $year, $prestaTotal);
    236 if ($path) {
    237 $mail->attach(\Swift_Attachment::fromPath($path));
    238 //see below why not used $filesToDelete[] = $path;
    239 }
    240 $this->mailer->send($mail);
    241 }
    242 }
    243
    244 //TODO : if we really want to delete files, we need to find another way
    • Damien Moulard @DamienM commented May 10, 2024
      Master

      pourquoi pas un troisième cron qui tourne 30min plus tard et qui supprime tous les fichiers du dossier ?

      Edited May 10, 2024 by Damien Moulard
      pourquoi pas un troisième cron qui tourne 30min plus tard et qui supprime tous les fichiers du dossier ?
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      bonne idée

      bonne idée
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      j'en ai profité pour ajouter une section cron à install.md

      j'en ai profité pour ajouter une section cron à install.md
    • Yvon Kerdoncuff @Yvon

      changed this line in version 4 of the diff

      May 13, 2024

      changed this line in version 4 of the diff

      changed this line in [version 4 of the diff](https://gl.cooperatic.fr/cooperatic/kohinos-tav/merge_requests/98/diffs?diff_id=3030&start_sha=52b57d1993b27cfe8118ce3692cb726b46aea6df#313d56f2ce44c2ceb4107b97cdefdca80330b4a6_246_249)
      Toggle commit list
    • Damien Moulard @DamienM commented May 14, 2024
      Master

      ok

      ok
    Please register or sign in to reply
  • Damien Moulard
    @DamienM started a discussion on the diff May 10, 2024
    Resolved by Damien Moulard May 14, 2024
    src/Repository/FluxRepository.php
    107 $to->setDate($Y,$m+1,0)->setTime(23,59,59);
    108 $statement->bindValue(':to', $to->format("Y-m-d H:i:s"));
    109
    110 $statement->bindValue(":is_ccas", true);
    111 $statement->bindValue(":type", Transaction::TYPE_TRANSACTION_ADHERENT_PRESTATAIRE);
    112
    113 $statement->execute();
    114 return $statement->fetchAll();
    115 }
    116
    117 /**
    118 * @param Prestataire $presta [description]
    119 * @param integer $m From 1 to 12
    120 * @param integer $Y Format YYYY
    121 */
    122 public function getSumOfValidCcasTransactionsByPrestaAndMonth(Prestataire $presta, $m, $Y)
    • Damien Moulard @DamienM commented May 10, 2024
      Master

      Est-ce qu'il ne suffirait pas d'appeler la fonction précédente et de parcourir les résultats pour en faire la somme ? Ce qui éviterait de créer deux requêtes.

      Est-ce qu'il ne suffirait pas d'appeler la fonction précédente et de parcourir les résultats pour en faire la somme ? Ce qui éviterait de créer deux requêtes.
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      C'est vrai que ça aurait pu être plus rapide, mais j'ai d'abord codé la methode pour faire la somme, (ce qui m'a permis de retravailler getQueryByPrestataire), avant de me rendre compte que la méthode pour récupérer toutes les transactions est plus complexe à écrire à cause de la nécessité de join adherent.

      Une seule requête au lieu de deux mais pas énormément moins de code car il faut faire une boucle pour sommer les résultats. Il est aussi plus efficace (et je trouve plus élégant) d'utiliser les capacités des langages de bdd quand c'est possible.

      Edited May 13, 2024 by Yvon Kerdoncuff
      C'est vrai que ça aurait pu être plus rapide, mais j'ai d'abord codé la methode pour faire la somme, (ce qui m'a permis de retravailler getQueryByPrestataire), avant de me rendre compte que la méthode pour récupérer toutes les transactions est plus complexe à écrire à cause de la nécessité de join adherent. Une seule requête au lieu de deux mais pas énormément moins de code car il faut faire une boucle pour sommer les résultats. Il est aussi plus efficace (et je trouve plus élégant) d'utiliser les capacités des langages de bdd quand c'est possible.
    • Damien Moulard @DamienM commented May 14, 2024
      Master

      Ok, ça marche

      Ok, ça marche
    Please register or sign in to reply
  • Damien Moulard
    @DamienM started a discussion on the diff May 10, 2024
    Resolved by Damien Moulard May 14, 2024
    src/Utils/OperationUtils.php
    135 136 );
    136 137 // $account->addOperation($operation);
    137 138 $account->addAmount($operation->getMontant());
    138 if(
    139 $flux instanceof Transaction //only process $flux with getIsCcas method
    140 && $flux->getIsCcas() //check if this flux should increment ccas balance
    141 && $account instanceof AccountPrestataire //only process the prestataire side of the flux
    142 ) {
    139 $updateBalanceCcas =
    140 //only process isCcas or reconversionCcas $flux
    141 ( $flux instanceof Transaction && $flux->getIsCcas() || $flux instanceof Reconversion && $flux->getReconversionCcas() )
    142 //only process the prestataire side of the flux
    143 && $account instanceof AccountPrestataire;
    144 if ($updateBalanceCcas) {
    143 145 $account->addAmountCcas($operation->getMontant());
    • Damien Moulard @DamienM commented May 10, 2024
      Master

      je rajouterais un commentaire pour expliquer que le montant d'une opération de reconversion est négatif, et que donc la balance ccas est bien diminuée ici (j'ai du aller chercher l'info)

      je rajouterais un commentaire pour expliquer que le montant d'une *opération* de reconversion est négatif, et que donc la balance ccas est bien diminuée ici (j'ai du aller chercher l'info)
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      Je pense qu'il faut éviter d'écrire un commentaire spécifique à cette ligne car c'est une logique générale. Je vais ajouter un commentaire moins spécifique tu me diras.

      Je pense qu'il faut éviter d'écrire un commentaire spécifique à cette ligne car c'est une logique générale. Je vais ajouter un commentaire moins spécifique tu me diras.
    • Damien Moulard @DamienM commented May 14, 2024
      Master

      ok !

      ok !
    Please register or sign in to reply
  • Damien Moulard
    @DamienM started a discussion on the diff May 10, 2024
    Resolved by Damien Moulard May 14, 2024
    src/Command/SendCcasTransactionsExportToPrestatairesCommand.php 0 → 100644
    12 use NumberFormatter;
    13 use Symfony\Component\Console\Command\Command;
    14 use Symfony\Component\Console\Input\InputInterface;
    15 use Symfony\Component\Console\Input\InputOption;
    16 use Symfony\Component\Console\Output\OutputInterface;
    17 use Symfony\Component\Console\Style\SymfonyStyle;
    18 use Symfony\Component\HttpKernel\KernelInterface;
    19 use Twig\Environment;
    20 use Twig\Error\LoaderError;
    21 use Twig\Error\RuntimeError;
    22 use Twig\Error\SyntaxError;
    23
    24 /**
    25 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
    26 */
    27 class SendCcasTransactionsExportToPrestatairesCommand extends Command
    • Damien Moulard @DamienM commented May 10, 2024
      Master

      Je rajouterais éventuellement un commentaire expliquant que cette commande va de paire avec la précédente dans le processus automatisé, et pourquoi les deux commandes ont été séparées

      Je rajouterais éventuellement un commentaire expliquant que cette commande va de paire avec la précédente dans le processus automatisé, et pourquoi les deux commandes ont été séparées
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      yes

      yes
    Please register or sign in to reply
  • Damien Moulard
    @DamienM started a discussion on the diff May 10, 2024
    Resolved by Damien Moulard May 14, 2024
    .gitignore
    67 67 #INTELLIJ
    68 68 .idea/
    69 69
    70 #dir containg exported reconversions xml
    70 #dir containing exported reconversions xml
    71 71 reconversions/*
    72 72 !reconversions/.versionme
    73
    74 #dir containing ccas transactions csv
    75 ccastransactions/*
    76 !ccastransactions/.versionme
    • Damien Moulard @DamienM commented May 10, 2024
      Master

      pourquoi donc ce fichier et ne pas mettre tout le dossier en gitignore ?

      pourquoi donc ce fichier et ne pas mettre tout le dossier en gitignore ?
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      j'ai l'intuition qu'il est préférable de versionner la structure de stockage des données

      j'ai l'intuition qu'il est préférable de versionner la structure de stockage des données
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      comme j'ai commencé comme ça avec le dossier reconversions, je continue sur la même logique

      comme j'ai commencé comme ça avec le dossier reconversions, je continue sur la même logique
    • Damien Moulard @DamienM commented May 14, 2024
      Master

      Ok

      Ok
    Please register or sign in to reply
  • Damien Moulard
    @DamienM started a discussion May 10, 2024
    Resolved by Damien Moulard May 14, 2024
    • Damien Moulard @DamienM commented May 10, 2024
      Master

      J'ai cette erreur quand je lance la deuxième commande :

      image

      Possible que ce soit à cause de mon install locale. Tu confirmes que ça fonctionne chez toi ?

      J'ai cette erreur quand je lance la deuxième commande : ![image](/uploads/1bf052681e034c5e19065cc5a920f1c2/image.png) Possible que ce soit à cause de mon install locale. Tu confirmes que ça fonctionne chez toi ?
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      le kohinos:ssa est en double dans ta commande

      le kohinos:ssa est en double dans ta commande
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      mais non effectivement ça ne marche pas chez moi non plus car j'avais oublié que l'on ne passe pas forcément en paramètre le mois et l'année

      mais non effectivement ça ne marche pas chez moi non plus car j'avais oublié que l'on ne passe pas forcément en paramètre le mois et l'année
    • Yvon Kerdoncuff @Yvon commented May 13, 2024
      Master

      je corrige ça

      je corrige ça
    • Damien Moulard @DamienM commented May 14, 2024
      Master

      Ha bah oui....

      Ha bah oui....
    Please register or sign in to reply
  • Yvon Kerdoncuff @Yvon

    added 1 commit

    • 52b57d19 - add cron section in install.md + add comments in commands

    Compare with previous version

    May 13, 2024

    added 1 commit

    • 52b57d19 - add cron section in install.md + add comments in commands

    Compare with previous version

    added 1 commit <ul><li>52b57d19 - add cron section in install.md + add comments in commands</li></ul> [Compare with previous version](https://gl.cooperatic.fr/cooperatic/kohinos-tav/merge_requests/98/diffs?diff_id=3029&start_sha=2e3eb012b2c22a7a4f59c5642fc9348da95fd6a4)
    Toggle commit list
  • Yvon Kerdoncuff @Yvon

    added 3 commits

    • 4ac3ab4e - add comment in executeOperations
    • 590faf8c - remove irrelevant comments
    • 4f738436 - send ccas transaction cmd : handle case when yearmonth option is not provided

    Compare with previous version

    May 13, 2024

    added 3 commits

    • 4ac3ab4e - add comment in executeOperations
    • 590faf8c - remove irrelevant comments
    • 4f738436 - send ccas transaction cmd : handle case when yearmonth option is not provided

    Compare with previous version

    added 3 commits <ul><li>4ac3ab4e - add comment in executeOperations</li><li>590faf8c - remove irrelevant comments</li><li>4f738436 - send ccas transaction cmd : handle case when yearmonth option is not provided</li></ul> [Compare with previous version](https://gl.cooperatic.fr/cooperatic/kohinos-tav/merge_requests/98/diffs?diff_id=3030&start_sha=52b57d1993b27cfe8118ce3692cb726b46aea6df)
    Toggle commit list
  • Yvon Kerdoncuff @Yvon

    added 1 commit

    • 272fbd00 - improve month display in export ccas email

    Compare with previous version

    May 13, 2024

    added 1 commit

    • 272fbd00 - improve month display in export ccas email

    Compare with previous version

    added 1 commit <ul><li>272fbd00 - improve month display in export ccas email</li></ul> [Compare with previous version](https://gl.cooperatic.fr/cooperatic/kohinos-tav/merge_requests/98/diffs?diff_id=3031&start_sha=4f738436036b22685dd68aa061afefff26df831b)
    Toggle commit list
  • Damien Moulard @DamienM

    resolved all discussions

    May 14, 2024

    resolved all discussions

    resolved all discussions
    Toggle commit list
  • Damien Moulard @DamienM

    merged

    May 14, 2024

    merged

    merged
    Toggle commit list
  • Damien Moulard @DamienM

    mentioned in commit ac19947d

    May 14, 2024

    mentioned in commit ac19947d

    mentioned in commit ac19947dcc03bdfb62f2e988081a60a632977809
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
Reference: agplv3/kohinos-tav!98
×

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.