Closed wandored closed 5 months ago
Calculation for previous_count not calculation correctly for each item. line 90 in count route
`
for count_entry in multi_form.counts.data: items_object = InvItems.query.filter_by(id=count_entry["item_id"]).first() filter_item = InvCount.query.filter( InvCount.store_id == session["store"], InvCount.item_id == multi_form.counts.data[0]["item_id"], ) previous_count = filter_item.order_by(InvCount.trans_date.desc()).first() if previous_count is None: total_previous = 0 else: total_previous = previous_count.count_total
Might be better to calculate previous count on the fly rather then writing to the database. Only used in the details route
Calculation for previous_count not calculation correctly for each item. line 90 in count route
`
get previous count
`