Artifacts Associated With Ticket c20546bb90

  1. Ticket change [5273d33101] (rid 4441) by nfrery on 2017-02-28 04:22:16:

    1. foundin initialized to: "0.7.6"
    2. icomment:
      Lors d'un essai de report à nouveau automatique d'un exercice test, j'ai eu l'erreur suivante: *Le montant ne peut être égal ou inférieur à zéro*.
      L'erreur provient d'un compte qui a pour somme 0 (-0.00 dans le grand livre) ou d'après la requête SQL de la fonction doReports(), ligne 159 de Exercices.php, j'obtiens 5.6843418860808e-14.
      Les deux SUM de la requête retourne chacun la somme 316.11 ce qui est tout à fait correct.
      
      Ce n'est pas un problème pour moi qui fait le report manuellement, mais ça pourrait poser soucis à certains.
      
      Je propose de rajouter deux round()
      ROUND(COALESCE((SELECT SUM(montant) FROM compta_journal WHERE compte_debit = compta_comptes.id AND id_exercice = 1), 0))
                  - ROUND(COALESCE((SELECT SUM(montant) FROM compta_journal WHERE compte_credit = compta_comptes.id AND id_exercice = 1), 0))
      
    3. login: "nfrery"
    4. mimetype: "text/x-fossil-plain"
    5. private_contact initialized to: "28dfee47b43f4215ddf0dcc15dce81f8f53221b8"
    6. severity initialized to: "Critical"
    7. status initialized to: "Open"
    8. title initialized to: "Problème calcul SQL"
    9. type initialized to: "Code_Defect"
  2. Ticket change [814e0223ed] (rid 4442) by nfrery on 2017-02-28 04:24:08:

    1. icomment:
      ROUND(COALESCE((SELECT SUM(montant) FROM compta_journal WHERE compte_debit = compta_comptes.id AND id_exercice = 1), 0),2) sera plus approprié !
      
    2. login: "nfrery"
    3. mimetype: "text/x-fossil-plain"
    4. priority changed to: "Immediate"
    5. resolution changed to: "Open"
  3. Ticket change [09b75c6931] (rid 4443) by bohwaz on 2017-02-28 05:00:54:

    1. icomment:
      Ah oui c'est un problème de nombre flottant.
      
      J'ai fait une gaffe ici, les nombres devraient être stockés comme integers et non comme floats, ce qui génère ce genre de problème.
      
      SQLite ne supporte pas le type "DECIMAL" il faudrait donc stocker les nombres en tant que "INTEGER", chiffres après la virgule compris, ce qui serait plus exact.
      
      Par exemple 42,99 € serait stocké "4299", et 12 € serait stocké "1200". La conversion en décimal serait effectuée à l'affichage au niveau de PHP en ajoutant une virgule au bon endroit.
      
      Je renomme correctement le ticket et vais essayer de faire ça pour la 0.8.0, sinon j'appliquerais ton idée en attendant.
      
    2. login: "bohwaz"
    3. mimetype: "text/x-fossil-plain"
    4. priority changed to: "High"
    5. severity changed to: "Severe"
    6. title changed to: "Changer le stockage de monnaie vers des INTEGER"
  4. Ticket change [a6de2e1de8] (rid 4990) by DaD on 2017-07-28 10:33:42:

    1. icomment:
      Bonjour.
      
      Dans certains logiciels il y a un peu plus que 2 chiffres après la virgules qui sont stockés en base.
      
      J’ai regardé un peu Dolibarr et j’ai vu qu’ils utilisaient 5 chiffres après la virgule.
      
    2. login: "DaD"
    3. mimetype: "text/x-fossil-plain"
  5. Ticket change [ef338819af] (rid 4993) by bohwaz on 2017-08-01 01:09:20:

    1. icomment:
      J'ai appliqué la modif. de nicolas dans la branche de dév. [d76c988ed81c8877a44a52f6780b10b50f4ef4ca]
      
      Je ne pourrais pas faire le changement de stockage pour la 0.8 il y a déjà trop de trucs prévus.
      
      @DaD: c'est parce qu'ils utilisent une plus grande précision à la base, par exemple tu peux avoir des produits en stock qui ont un prix de 0,009 € et tu applique une TVA etc. dessus, mais dans Garradin la précision est limitée à deux chiffres après la virgule.
      
    2. login: "bohwaz"
    3. mimetype: "text/x-fossil-plain"
  6. Ticket change [1d5888f99d] (rid 4994) by bohwaz on 2017-08-01 01:09:42:

    1. login: "bohwaz"
    2. mimetype: "text/x-fossil-plain"
    3. severity changed to: "Important"
    4. type changed to: "Feature_Request"
  7. Ticket change [f5d6a62b35] (rid 9113) by bohwaz on 2020-11-08 04:16:28:

    1. icomment: "OK dans 1.0"
    2. login: "bohwaz"
    3. mimetype: "text/x-fossil-plain"
    4. resolution changed to: "Fixed"
    5. status changed to: "Fixed"
    6. target_version changed to: "Future"