custom service added to calculate margin
custom service added to calculate margin