Found the problem, there is a NetSuite bundle for tax and discount calculation. This bundle adds a field on sales order which contains the amount after discount. However, when user updated the price to 0 it didn't update the amount after discount field. And when invoice is created, it showed the 700 even though invoice was for only 30.
Thanks for the suggestion😊