Calculate amount_tax properly when there is discount in Purchase Order

Amount Tax in purchase order doesn't take into consideration discount in lines