Your new stored procedure should look like this:
CREATE PROCEDURE sp_get_total_qty_rate
@customerid char(15),
@datefrom datetime,
@dateto datetime
AS
DECLARE @dDateFrom datetime, @dDateTo datetime, @sCustomerid char(15), @fdnqty numeric, @nRate numeric
set nocount on
/* Create temporary table*/
CREATE...