select 
tbl_sale_invoice.code as code_style_10_left
,c.customer_name  AS Customer_style_30_left
,date(tbl_sale_invoice.created_on) as INV_date_style_15_center
,net_total as INV_amount_sum_2_style_15_right
,rpt_settled_amount as Settled_amount_sum_2_style_10_right
,rpt_returns_amount as Returns_sum_2_style_10_right
,(net_total + rpt_cash_returns - rpt_returns_amount - rpt_settled_amount ) as Balance_sum_2_style_10_right

 ,0 as category_id
,'' as category

from tbl_sale_invoice
inner join tbl_customers c on c.customer_id = tbl_sale_invoice.customer_id
where tbl_sale_invoice.status in ('4')
and tbl_sale_invoice.is_settled = 0
and date(tbl_sale_invoice.created_on) BETWEEN '{fromDate}' AND '{toDate}'
and (tbl_sale_invoice.customer_id =  '{customer}'  or  '{customer}'='0')




-- ************************
--  on_hand_qty_sum_6_style_20_right 
-- on_hand_qty = column name
-- sum = this column values get sum

--  * _style_20_right = td/th styles   * mandatory **
-- 20 = td/th width 
-- right = text align     left/right/center