Auto Double-Calculate
Posted: 2014-07-15 15:02
Situation:
I have a table LOTTI and a related table LOTTI_LINES
In LOTTI I have fields:
ID_LOTTO
INITIAL_QUANTITY (manual filled)
FINAL_QUANTITY (auto calculate)
In LOTTI_LINES I have fields:
ID_LOTTO
TRASH_QUANTITY (manual filled)
Now I would like to auto fill FINAL_QUANTITY like yhis:
INITIAL_QUANTITY - (SUM OF ALL RELATED TRASH_QUANTITY)...
Is it possible to do it?
I have already put some calculation on before_update and before_insert section of HOOK file to calculate some % between FIANL_QUANTITY and INITIAL_QUANTITY to know the final %...and works fine.
Thanks.
I have a table LOTTI and a related table LOTTI_LINES
In LOTTI I have fields:
ID_LOTTO
INITIAL_QUANTITY (manual filled)
FINAL_QUANTITY (auto calculate)
In LOTTI_LINES I have fields:
ID_LOTTO
TRASH_QUANTITY (manual filled)
Now I would like to auto fill FINAL_QUANTITY like yhis:
INITIAL_QUANTITY - (SUM OF ALL RELATED TRASH_QUANTITY)...
Is it possible to do it?
I have already put some calculation on before_update and before_insert section of HOOK file to calculate some % between FIANL_QUANTITY and INITIAL_QUANTITY to know the final %...and works fine.
Thanks.