select 
code as code_style_20_left
,date(created_on) as INV_date_style_20_left
,net_total as INV_amount_sum_2_style_20_right
,rpt_settled_amount as Settled_amount_sum_2_style_20_right
,rpt_returns_amount as Returns_sum_2_style_20_right
-- ,(net_total + rpt_cash_returns - rpt_returns_amount - rpt_settled_amount ) as Balance_sum_2_style_15_right

 ,0 as category_id
,'' as category

from tbl_sale_invoice
where tbl_sale_invoice.status in ('4')
and tbl_sale_invoice.is_settled = 1
and date(created_on) BETWEEN '{fromDate}' AND '{toDate}'
and (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