Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during invoice creation in develop #6859

Closed
saxa opened this issue May 17, 2017 · 7 comments
Closed

Error during invoice creation in develop #6859

saxa opened this issue May 17, 2017 · 7 comments

Comments

@saxa
Copy link

saxa commented May 17, 2017

Bug

I am getting the DB error below when creating the invoice from an order.

Environment

Expected and actual behavior

No error should appear.

Steps to reproduce the behavior

Click button create invoice and click confirm.

O Dolibarr detectou um erro técnico.
You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.
Esta informação pode ser útil para fins de diagnóstico :
Data: 20170517141617
Dolibarr: 6.0.0-alpha
Nível de funções: 2
PHP: 5.6.30
Server: Apache/2.4.25 (Unix) PHP/5.6.30
OS: Linux braserv 4.4.38 #2 SMP Sun Dec 11 16:18:36 CST 2016 x86_64
UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL solicitada: /htdocs/compta/facture/card.php?facid=655&action=confirm_valid&confirm=yes&idwarehouse=1
Referer: http://localhost/htdocs/compta/facture/card.php?facid=655&action=valid
Administração do menu: eldy_menu.php

Tipo de gerente de base de dados: mysqli
Últimos erros de acesso ao banco de dados: 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.accountancy_journal, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, ba.datec as date_creation, ba.tms as date_update, c.code as country_code, c.label as country, d.code_departement as state_code, d.nom as state FROM llx_bank_account as ba LEFT JOIN llx_c_country as c ON ba.fk_pays = c.rowid LEFT JOIN llx_c_departements as d ON ba.state_id = d.rowid WHERE entity IN (1) AND ba.rowid = 4
Código de retorno do último erro de acesso ao banco de dados: DB_ERROR_NOSUCHFIELD
Informação do último erro de acesso ao banco de dados: Unknown column 'ba.accountancy_journal' in 'field list'

@saxa
Copy link
Author

saxa commented May 17, 2017

This error happens when you classify the order as invoiced.

O Dolibarr detectou um erro técnico.
You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.
Esta informação pode ser útil para fins de diagnóstico :
Data: 20170517142225
Dolibarr: 6.0.0-alpha
Nível de funções: 2
PHP: 5.6.30
Server: Apache/2.4.25 (Unix) PHP/5.6.30
OS: Linux braserv 4.4.38 #2 SMP Sun Dec 11 16:18:36 CST 2016 x86_64
UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL solicitada: /htdocs/comm/propal/card.php?id=964&action=classifybilled&socid=7
Referer: http://localhost/htdocs/comm/propal/card.php?id=964
Administração do menu: eldy_menu.php

Tipo de gerente de base de dados: mysqli
Últimos erros de acesso ao banco de dados: 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.accountancy_journal, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, ba.datec as date_creation, ba.tms as date_update, c.code as country_code, c.label as country, d.code_departement as state_code, d.nom as state FROM llx_bank_account as ba LEFT JOIN llx_c_country as c ON ba.fk_pays = c.rowid LEFT JOIN llx_c_departements as d ON ba.state_id = d.rowid WHERE entity IN (1) AND ba.rowid = 3
Código de retorno do último erro de acesso ao banco de dados: DB_ERROR_NOSUCHFIELD
Informação do último erro de acesso ao banco de dados: Unknown column 'ba.accountancy_journal' in 'field list'

@saxa
Copy link
Author

saxa commented May 17, 2017

It also seems this is in some way replated to the payment and some other functions of dolibarr.
I get the third party card with the following error in the Payment bank account:

O Dolibarr detectou um erro técnico.
You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.
Esta informação pode ser útil para fins de diagnóstico :
Data: 20170517142621
Dolibarr: 6.0.0-alpha
Nível de funções: 2
PHP: 5.6.30
Server: Apache/2.4.25 (Unix) PHP/5.6.30
OS: Linux braserv 4.4.38 #2 SMP Sun Dec 11 16:18:36 CST 2016 x86_64
UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

URL solicitada: /htdocs/comm/card.php?socid=7
Referer: http://localhost/htdocs/societe/card.php?socid=7
Administração do menu: eldy_menu.php

Tipo de gerente de base de dados: mysqli
Últimos erros de acesso ao banco de dados: 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.accountancy_journal, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, ba.datec as date_creation, ba.tms as date_update, c.code as country_code, c.label as country, d.code_departement as state_code, d.nom as state FROM llx_bank_account as ba LEFT JOIN llx_c_country as c ON ba.fk_pays = c.rowid LEFT JOIN llx_c_departements as d ON ba.state_id = d.rowid WHERE entity IN (1) AND ba.rowid = 3
Código de retorno do último erro de acesso ao banco de dados: DB_ERROR_NOSUCHFIELD
Informação do último erro de acesso ao banco de dados: Unknown column 'ba.accountancy_journal' in 'field list'

@saxa
Copy link
Author

saxa commented May 17, 2017

I forgot to run the installer after upgrading the sources, but during the run of installer I get the following error:

Errore DB_ERROR_1452: ALTER TABLE llx_bank_account ADD CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid);
Cannot add or update a child row: a foreign key constraint fails (banco_dolibarr.#sql-4a2_12aaf, CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid))

Any ideas on how to fix this ?

@saxa
Copy link
Author

saxa commented May 25, 2017

This error still persists. Any idea on how to fix that ?

Errore DB_ERROR_1452: ALTER TABLE llx_bank_account ADD CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid);
Cannot add or update a child row: a foreign key constraint fails (banco_dolibarr.#sql-4a2_197f1, CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid))

@eldy
Copy link
Member

eldy commented May 29, 2017

Can you run this request and tell result
UPDATE llx_bank_account as ba set fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal as aj where ba.accountancy_journal = aj.code) where accountancy_journal not in ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');

Then paste content of table llx_accounting_journal

@saxa
Copy link
Author

saxa commented May 29, 2017

MariaDB [banco_dolibarr]> UPDATE llx_bank_account as ba set fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal as aj where ba.accountancy_journal = aj.code) where accountancy_journal not in ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
ERROR 1054 (42S22): Unknown column 'accountancy_journal' in 'where clause'
MariaDB [banco_dolibarr]>
MariaDB [banco_dolibarr]> select * from llx_accounting_journal;
+-------+------+---------------------------------+--------+--------+--------+
| rowid | code | label | nature | active | entity |
+-------+------+---------------------------------+--------+--------+--------+
| 1 | VT | Journal des ventes | 2 | 1 | 1 |
| 2 | AC | Journal des achats | 3 | 1 | 1 |
| 3 | BQ | Journal de banque | 4 | 1 | 1 |
| 4 | OD | Journal des op�rations diverses | 1 | 1 | 1 |
| 5 | AN | Journal des �-nouveaux | 9 | 1 | 1 |
+-------+------+---------------------------------+--------+--------+--------+
5 rows in set (0.00 sec)

MariaDB [banco_dolibarr]>

@atm-maxime
Copy link
Member

Too old version, please upgrade and reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants