dolibarr-bugtrack
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-bugtrack] [Bug #1336] postgresql cast compta/bank/class/accoun


From: Doliforge
Subject: [Dolibarr-bugtrack] [Bug #1336] postgresql cast compta/bank/class/account.class.php:615
Date: Tue, 08 Apr 2014 09:32:20 +0200

Doliforge
Ce message ne s'affiche pas correctement?
mettez à jour vos préférences utilisateur.

postgresql cast compta/bank/class/account.class.php:615

Dernières modifications

08/04/2014 09:32 (Europe/Paris)
J'ai retenté une migration avec le module, et je n'ai pas reproduit.
Du coup je clos l'anomalie, elle est du probablement au module de migration vers PG et non a Dolibarr.
Au besion pour poursuivre l'investigation merci d'ouvrir l'anomalie ici : https://doliforge.org/projects/MigrationToPG/
Changements :
  • Status: 
Need more infoClosed
  • Assigned to: 
AucunHENRY Florian (fhenry)
  • Resolution: 
AucunWont Fix

Répondre

État

 Détails
Submitted by:  Yann Verry (yverry) Submitted on:  06/04/2014 00:55
Last Modified On:  07/04/2014 22:44 
Summary:  postgresql cast compta/bank/class/account.class.php:615
Description:  Bonjour,

Récemment migré en pg avec dolibarr je ne peut pas afficher l'onglet de banques/caisses en raison d'un erreur SQL:

=> SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant, ba.clos, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation, ba.proprio, ba.owner_address, ba.state_id, ba.fk_pays as country_id, ba.account_number, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, p.code as country_code, p.libelle as country, d.code_departement as state_code, d.nom as state FROM llx_bank_account as ba LEFT JOIN llx_c_pays as p ON ba.fk_pays = p.rowid LEFT JOIN llx_c_departements as d ON ba.state_id = d.rowid WHERE entity IN (1) AND ba.rowid = 1;
ERROR: operator does not exist: character varying = integer
LINE 1: ...LEFT JOIN llx_c_departements as d ON ba.state_id = d.rowid ...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

La solution est d'ajouté un CAST(ba.state_id as numeric) dans la requête. Évidemment cela n'est pas compatible avec MySQL

Cdlt,
Step to reproduce bug:  Afficher l'onglet banques/caisses avec une installation PG
Detected in version:  3.5.1 Category:  Module: Banks and Cash
Severity:  2 OS Type/Version:  Debian
PHP version:  5.5.10 Database type and version:  PG9.3
 Etat
Status:  Closed Assigned to:  HENRY Florian (fhenry)
Resolution:  Wont Fix 

Commentaires

HENRY Florian 08/04/2014 09:32
J'ai retenté une migration avec le module, et je n'ai pas reproduit.
Du coup je clos l'anomalie, elle est du probablement au module de migration vers PG et non a Dolibarr.
Au besion pour poursuivre l'investigation merci d'ouvrir l'anomalie ici : https://doliforge.org/projects/MigrationToPG/
Yann Verry 07/04/2014 22:44
PHP: 5.5.10
MySQL: MariaDB 10.0.10
PostgreSQL: 9.3.4
HENRY Florian 07/04/2014 22:39
Ok so I think the problem come from the module. I will check why. What was you mysql version ?
Yann Verry 07/04/2014 22:32
I have done my migration with module in dolstore (with few modifications).
I can try if necessary with wiki instructions
HENRY Florian 06/04/2014 23:01
how did you migrate to PgSQL ? With the module on DolStore or by following the wiki ?
Yann Verry 06/04/2014 22:59
On my two databases (MySQL and PostgreSQL) the row in field state_id is null. With your comment I have modified my bank information. Now I have an integer in state_id but is not enough.

Now I have an integer but the type is varchar(50).OK let's go to fix that :

ALTER TABLE llx_bank_account ALTER COLUMN state_id TYPE integer USING (state_id::integer);

After that it's ok.
Laurent Destailleur 06/04/2014 21:30
With version 3.5, the field state_id of llx_bank_account should be an integer, so cast should be useless.
This means yur database does not match 3.5 format.
Do you have idea why this fields is not numeric ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]