You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the calculate_total_amount callback is only run on before_validation, the amount never gets updated unless you update the invoice. Even touching it or using something like AASM to change state won't trigger the callback to be run.
This should probably be changed to a more liberal callback or at least supported with a callback on line_item that gets triggered on save.
The text was updated successfully, but these errors were encountered:
@iffyuva This is one I'd like to address, however, any implementation will be opinionated so I'd like to get feedback first. Are we trying to avoid invoice total calculation with each line_item save for performance reasons?
Because the
calculate_total_amount
callback is only run on before_validation, the amount never gets updated unless you update the invoice. Even touching it or using something like AASM to change state won't trigger the callback to be run.This should probably be changed to a more liberal callback or at least supported with a callback on line_item that gets triggered on save.
The text was updated successfully, but these errors were encountered: