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.37k stars 2.77k forks source link

Ready to add: improvement of yearly financial stats table #13234

Closed caos30 closed 3 years ago

caos30 commented 4 years ago

@eldy i made an slight change on the file /htdocs/compta/facture/stats/index.php to improve the yearly statistics on Financial main menu section of Dolibarr.

I made a screenshot of the BEFORE vs the AFTER:

mothly-stats-financial-stats

I worked over the Dolibarr 10.0.6 version, but i suppose that it's the same for 11.0.x This is the ZIP file containing the changes: 2020-02-28_financial_stats.zip

Briefly, the improvements

add new columns:

modified the DIFF (%) columns:

To do:

If you need to me to do something else please tell me. I know that usually is recommended to do a PULL REQUEST, but i think that for a so minor change is faster for me and your do it so. At least me, i don't have very clear which branch exactly to add the change... you know.

Cheers, Sergi

atm-maxime commented 4 years ago

Hi. Thanks for joining the community! When you do a new feature like this one, you must do it in the develop branch and make a pull request so we can integrate your changes. This is the faster and easier way. Only bugfix are allowed in previous branches.

Now regarding this, adding the average column why not, but modifying the % column seems wrong to me. I think it would be better to compare same months as previous year.

caos30 commented 4 years ago

Thanks for your kindly answer @atm-maxime ! I didn't know that i could do this: make a pull request for a new feature. I will try it tomorrow :-)

Said this, i understand your comment about the % calculation. Sincerely, i had the same doubt. But think about it: whatever you average or comparison you do will have different consequences, obviously. I means, that some indexes or parameters calculated in a way or in another have different benefits and limitations.

I know that the markets usually have an important SEASONAL behaviour. In this sense, i agree with your of the interest of compare the 2 first months of this year with the 2 first of the last year. Buuuut, it would be -maybe- more interesting compare it with the last 2 months of the last year. It would have more sense if the seasonal influence is not so heavy, but it's more important a progressive growth of the activity and success of your business. In fact, Google Analytics do this type of comparison: the current period of time with the previous one.

So, i try to say that it's impossible to put our trust in a unique formula or criteria for comparison, and it probably would be more useful in some cases one or another.

Said this, i thought in a third kind of comparison which is more loyal to this statistical itself: compare the results of one year with the previous years. In this sense, the current criteria applied in Dolibarr need to be FIXED asap! I means: it calculates the % of the number of invoices in the current year (although we're still on February !!!) with the total number of the invoices of the whole previous year!?

I probably were choose your approach (compare jan-feb'2020 with Jan-Feb'2019) but it has several practical problems:

Please, don't hesitate to continue this discussion. I really found it interesting. But let me insist that my approach is not only good enough but in a certain sense even convenient.

Cheers!

caos30 commented 4 years ago

Reviewing my previous comment, i realise about this: that statistical YEARLY table must contain indexes (columns/parameters) calculated/defined RELATIVE TO THE YEAR. In other words: we're trying to compare years in this table. So, for this reason we compare -for example- the "number of invoices" of each year.

This parameter (number invoices in a year) has many sense if you compare 2 completed years. The question here is that in the current table on Dolibarr the first row at top, corresponding to the current year HAS NO SENSE to be compared with the others, at least with the current columns.

For this reason we need to add a column with an index that don't depend on the portion of the year elapsed. In this sense i found that -let me insist- the index "average number of invoices per month" is an interesting value to be considered when comparing two years, it returns a reliable "measure" of the year financial progress EVEN if we have truncated one of the years (the first and the last years are usually truncated).

My point is that i don't want to compare the first trimester of 2020 with the first trimester of 2019. I want to compare (as close as possible) the finance of "one year" with the finance of "another year". So, a monthly average seems quite good for me.

Even more: when you compare 2 completed years, the difference (in percentage) between one year of another RETURNS EXACTLY THE SAME VALUE if you compare their "total number of invoices" or their "average of total number of invoices per month". So, uhmmm, i think that my proposal is a quite sharp improvement of the % column being used currently on Dolibarr... which is obviously incorrect.

In other words: with my improvement it only will be improved the % comparing the current year with the previous year not affecting the comparison made until now for the other completed years ;-)

It sounds perfect for me. I means: preserve the current meaning of that % column, but fix the weird result for the top row (current year compared with previous year).

Sorry again for my enthusiasm. Please i would like to hear your (or another people) opinion.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).