Calculate unit price when counter amount changes

Allow the counter amount to be edited.
Calculate the unit price when the counter amount is modified.

Fixes #854.