-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
FIX Accounting Closure Duplicates, Subledger accounts, Account Labels and more... Update bookkeeping.class.php #32194
Conversation
FIX I did further testing and investigation and I fixed the following issues that stop doing a full closure without duplicate lines generated by an unclean database : - different label_compte with same account number - removing label_compte is raising an issue and the code in the line around 2770 $bookkeeping->label_compte = $obj->label_compte; - different subledger_label with same subledger_account - empty versus null values for subledger_label and subledger_account - opening_balance is 0 as it creates a bookkeeping entry for now. FIX - Update Accounting closure with missing too many A-Nouveau Dolibarr#30039)
if ($separate_auxiliary_account) { | ||
$sql .= ' ,t.subledger_account, t.subledger_label'; | ||
$sql .= " , NULLIF(t.subledger_account, '')"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a function call into a group by is strange. DoesYour fix work if you replace this with
$sql .= ", subledger_account";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eldy
It does not work if you remove the NULLIF function. We still get duplicates.
Here are some screenshots with and without:
Hi @eldy |
@aspangaro is this patch looks ok for you ? |
It looks pretty good to me, and completes my patch for the sub-accounts section. I'll do a few tests and confirm that. |
Hi @aspangaro and @eldy |
Yes please, close old one and merge it into one request (this pr), so it will be easier to follow all the changes of the fix... |
This will help to better and understand and follow this fix
@@ -2732,23 +2736,38 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep | |||
$bookkeeping = new BookKeeping($this->db); | |||
$bookkeeping->doc_date = $new_fiscal_period->date_start; | |||
$bookkeeping->date_lim_reglement = ''; | |||
$bookkeeping->doc_ref = $new_fiscal_period->label; | |||
$bookkeeping->doc_ref = $fiscal_period->label; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have an interrogation with this replacement.
Why $fiscal_period->label instead of $new_fiscal_period->label ? Done on prupose ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @eldy
Yes it is done on purpose.
Let's assume we are reporting AN from 2023 to 2024.
doc_ref has to get the value $fiscal_period->label (e.g. ANNEE 2023) and label_operation is getting the $new_fiscal_period->label (e.g. ANNEE 2024).
In some Accounting software the values are RAN (Report A-Nouveau) for doc_ref and the label_operation is A.N. au 01/01/2024
I followed what was already there in term of labelling maybe done by @aspangaro
I found a small bug in the meantime as for the income, I did not change it for the income AN report.
I will change it as soon as you validate it.
Just so that I follow correctly, this is still about fixing the option where the details of the RAN are merged in a single transaction per subaccount, not yet the new feature where the details of the RAN would be integrated one by one into the AN journal (which would actually duplicates the operation label/account I guess) ? |
Yes this is correct for now this is a balance mode with subledgers. Doing it in a more detailed view requires a bit more of work as there are several issues as taking in consideration the 'lettrage' for e.g. and some other aspects. I am working right now with 2 accounting experts as my first version I did was a bit incomplete. I used the label and amount to avoid duplicates but it was not perfect at all. So this is requiring a bit more of work. |
FIX I did further testing and investigation and I fixed the following issues that stop doing a full closure without duplicate lines generated by an unclean database :
See other comments here on this draft: #30653
See also Fix required here : FIX - Update Accounting closure with missing too many A-Nouveau #30039)](#30039)