This fixes David's post to do your requirement.
DROP TABLE IF EXISTS #tbl_Receivable;
Create table #tbl_Receivable (Rec_ID int,Customer_ID int,Rec_Date date,Rec_Amount varchar(50),Inv_type varchar(50));
INSERT INTO #tbl_Receivable VALUES
(111,1,'2020-03-06',5000,'Payable'),
(112,1,'2020-03-07',2000,'Received'),
(113,1,'2020-03-08',1000,'Payable'),
(114,1,'2020-03-08',2000,'Payable'),
(115,1,'2020-03-09',4000,'Received');
declare @begin_date date = '2020-03-07';
declare @end_date date = '2020-03-09';
with q as
(
select Rec_ID,
Customer_ID,
Rec_Date,
case when Inv_type = 'Received' then Rec_Amount else 0 end Received,
case when Inv_type = 'Payable' then Rec_Amount else 0 end Payable
from #tbl_Receivable
), opening_balances as
(
select 0 as linenum,
Customer_ID,
'Opening' as Descript,
null Rec_ID,
dateadd(day,-1,@begin_date) as Rec_Date,
0 as Payable,
0 as Received,
sum(Payable)-sum(Received) as Balance
from q
where Rec_Date < @begin_date
group by Customer_ID
), daily_balances as
(
select * from opening_balances
union all
select ROW_NUMBER() OVER (ORDER BY Rec_date, Payable, Received ) AS linenum,
Customer_ID, null as Descript, Rec_ID, Rec_date, Payable, Received, Payable-Received Balance
from q
where q.Rec_Date between @begin_date and @end_date
)
select Customer_ID, Descript, Rec_date, Payable Payable, Received Received,
sum(Balance) over (partition by customer_id order by rec_date,Rec_id) Balance
from daily_balances
ORDER BY linenum