Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.11k stars 2.68k forks source link

Bank Journal - Auxiliary account - "NotDefined" is returned instead of a clear value #22744

Open thibdrev opened 1 year ago

thibdrev commented 1 year ago

Bug

In the Auxiliary Account column of the Bank Journal, NotDefined is returned instead of a default value: image

Environment Version

16.0.1

Environment OS

Linux builder.o2switch.net 4.18.0-348.12.2.lve.el7h.x86_64

Environment Web server

Apache

Environment PHP

7.4.30

Environment Database

MySQL or MariaDB 5.5.5-10.5.17-MariaDB

Environment URL(s)

/htdocs/accountancy/journal/bankjournal.php?id_journal=3

Expected and actual behavior

Steps to reproduce the behavior

At first I thought this was linked to the user accountancy account not being defined before I made the payment. But I checked the following on a test instance: create a user and fill in its accountancy account > create an expense report, validate it and pay it. And I still get this behaviour.

The translated message is located here on Transifex: https://www.transifex.com/dolibarr-association/dolibarr/translate/#fr_FR/accountancy/165994858 Compte auxiliaire non défini ou tiers ou utilisateur inconnu. Nous utiliserons %s

It is linked to the translation key ThirdpartyAccountNotDefinedOrThirdPartyUnknown which is used here: https://github.com/Dolibarr/dolibarr/blob/57feb24f4acd82c25fe28c8706d902335d70220f/htdocs/accountancy/journal/bankjournal.php#L1287

So I'm guessing the $tabcompany[$key]['code_compta'] is the NotDefined value.

Attached files

No response

ouitec commented 1 year ago

Hello,

Exactly in the same situation. We've upgraded to 16.0.3 and we still have the issue, when do you think you can fix this issue ?

We also have this issue on the modules "Paiements/Salaires" :

Capture d’écran 2023-01-25 à 17 17 30

And "Paiements/Paiements Divers" :

Capture d’écran 2023-01-25 à 18 05 31

It was working before upgrade to 16.0.x I guess.

Amael-PE commented 1 year ago

I can report the same here, on a Doli 16.0.3 I am investigating root causes in the code, without much success

Amael-PE commented 1 year ago

After a bit of investiguation, this is a false alert. The auxiliary code, if defined, is used. The point is taht it make impossible to know if it is defined...

AurelienBISOTTI commented 1 year ago

Then it is not a bug, but you might open a separate request if you think the message needs to change

Amael-PE commented 1 year ago

@AurelienBISOTTI I do think it is a bug The code is defined, and the user alterted that it is not

Amael-PE commented 1 year ago

Unfortunately, even looking for a while to the code, I was not able to get where the issue comes from

AurelienBISOTTI commented 1 year ago

Then I don't get the "The auxiliary code, if defined, is used" Where is it used ? In the bookeeping ? But not showed in bank account ?

More screenshots would be welcome, so I could test if there is still this issue in v18

Amael-PE commented 1 year ago

Yes, exactly. The auxiliary code is difned, but not showned in the Bank journal "ventilation", and used properly in the bookeeping

Amael-PE commented 1 year ago

In the "ventilation" for bank journal: Doli capture ventilation

In the bookeeping, the exact same entry : Doli capture livre

Amael-PE commented 1 year ago

In the bookkeeping, everything is ok

AurelienBISOTTI commented 1 year ago

In bank journal, account is 220, but is 2310 in bookkeeping.

Are you sure bookkeeping was not modified afterward ?

Can you try again to create salary, and check it ? From the bank journal, you can also check that this line is "in accouting"

Screenshot-7 Capture d’écran du 2023-06-10 16-42-38

Amael-PE commented 1 year ago

Yes, I am 200 % sure. I did modified the master code in the bookeeping, because of another strange behaviour in Dolibarr, but I can guarantee that in 17.0.0, use in prod, I still have the problem of missing auxiliary count. Thanks god, the auxiliary is working properly n the bookeeping ^^" I create about 20 salaries per months, and then ventilate every beginning of following month, so I can ensure the bug is not fixed. In the "Ventilation" part, the php doesn't get the auxiliary account for an unknown reason, and report it as missing, while it is not.

AurelienBISOTTI commented 1 year ago

How can you explain that "main" account number (not the auxiliary) has changed between the "ventilation" for bank journal and bookkeeping (220 vs 2310) ?

Amael-PE commented 1 year ago

I simply changed it inthe bookeeping, but this is a complete other story, definitly unrelated to the fact that:

The variable in htdocs/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3 supposed to carry the auxiliary account is broken.

AurelienBISOTTI commented 1 year ago

Okay, I have been able to reproduce the problem

Capture d’écran du 2023-06-10 21-55-38 Capture d’écran du 2023-06-10 21-55-57 Capture d’écran du 2023-06-10 21-56-16

ksar-ksar commented 9 months ago

Hello,

Is it still the case on V18 ?

thibdrev commented 9 months ago

Hi @ksar-ksar,

Yes, I still observe this behaviour on a V18.0.2.

If I create an expense report, validate it and bound it to a finance account, then I see it normally in the Expense reports Journal: image

However, once I pay it and check the Bank journal, I still get the message: image

It seems that the subledger account is not retrieved.

I have a similar message on a salary payment : image

An here as well, the bank entry is rightly linked to a user with an accountancy code (421xxx).

StephaneBRT commented 5 months ago

Hello @thibdrev ,

I confirm. I have the same problem in the bank journal for expense reports on a version 18.0.4.

soerpoers commented 5 months ago

same for me on 18.0.4