frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.68k stars 614 forks source link

Fix ytd chart issues divide by 0 #821

Closed Isaac-GC closed 5 months ago

Isaac-GC commented 5 months ago

In the Dashboard, when selecting "Year to Date", an error occurs as the graph is trying to generate off an array that only contains a single item. As the graph is trying to figure out where to place the item, the count of items (1 in this case) has an item subtracted from it... accidentally resulting in a divide-by-zero edge case