Hello,
I don’t like to put this in “Bugs”, because from my point of view it’s more like a feature (with which I don’t really agree) than a bug.
I’m a french Vice-CEO of a (small) compagny, we are glad to use Dolibarr but we have few problems with its reports :
On my point of view, there is three kind of compagny comptability case in France :
a) Those who are laible to VAT
b) Those who are not
c) Those who are laible for some activities and not for others (these guys has some tricks to solve it by using (a) + 0% VAT rate)
In the report, there is 2 others cases to manage :
- comptamode = “CREANCES-DETTES”
- comptamode = “RECETTES-DEPENSES”
First a comment, why 1) is shown with 2 columns instead of one like 2) ?
Second the point would be more to differentiate a) from b) while 1) and 2) has only differences in the SQL requests.
Here is the mistake for me : a compagny when computing its result always think exclusively HT (a) or exclusively TTC (b), because VAT is a treasury issue (a) (because of the mouvements it implies), or need to be took in account totally (b).
Finally, in the current version VAT differential (out-in) is added to the result in both HT and TTC cases. This implies that the HT one is wrongly computed. For me considering VAT or not should lead you to the same result :
(INCOME_HT + IN_VAT) - (OUTCOME_HT + OUT_VAT) = RESULT_HT + (IN_VAT - OUT_VAT)
=> (INCOME_HT + IN_VAT) - (OUTCOME_HT + OUT_VAT) - (IN_VAT - OUT_VAT) = RESULT_HT
=> This is the TTC formula you expose in the code :
=> INCOME_TTC - OUTCOME_TTC - (IN_VAT - OUT_VAT) = RESULT_TTC
But in the column HT you do :
=> INCOME_HT - OUTCOME_HT - (IN_VAT - OUT_VAT) = RESULT_HT
Why (- (IN_VAT - OUT_VAT) ) sit in the HT formula ?
Anyway I think that for someone using dolibarr in the case (a) there is no interrest to see anything with TTC in the result section. And in contrario, there is no interrest for someone using dolibarr in the case (b) to see anything in HT in the result section (and anywhere else I guess).
I made for me the correction for the clienfourn.php case, I can do it for the other if this interrest you.