Calculation of loss and selling price