Balance Sheet Program

Submitted by Karthikeyan on

clea
clear all
set talk off
@1,15 say "Trading A/c for the Year Ended"
@2,2 say replicate("-",75)
@3,7 say "Particulars"
@3,45 say "Particulars"
@4,2 say repl("-",75)
store 0 to opst, pur, purret, tpur, tdeb, wage, wout, twage, carin
@5,2 say "To Opening stock"
@5,30 get opst
@6,2 say "To purchase"
@6,20 get pur
@7,4 say "Purchase Ret."
@7,20 get purret
read
tpur = pur - purret
@7,30 say tpur
@8,2 say "To wages"
@8,20 get wage
@9,4 say "Out.wages"
@9,20 get wout
read
twage = wage + wout
@9,30 say twage
@10,2 say "To carriage inwards"
@10,30 get carin
read
tdeb = opst + tpur + twage + carin

store 0 to sale, saleret, tsale, clstock, tcr

@5,40 say "By Sales"
@5,58 get sale
@6,40 say "(-)Sales Return"
@6,58 get saleret
read
tsale = sale - saleret
@6,68 say tsale
@7,40 say "By Closing Stock:"
@7,68 get clstock
read
tcr = clstock + tsale

store 0 to grpro, grloss, gramt
grpro = tcr - tdeb 
if grpro < 0
grloss = abs(grpro)
grpro = 0
@11,40 say "By Gross Loss:"
@11,68 say grloss
gramt = tdeb
else
@11,2 say "To Gross Profit:"
@11,30 say grpro
gramt = tcr
endif
@12,2 say repl("-",75)
@13,30 say gramt
@13,68 say gramt
@14,2 say repl("-",75)
wait""

clear

* Profit & Loss Account *
@1,15 say "Profit & Loss A/c for the Year Ended"
@2,2 say replicate("-",75)
@3,7 say "Particulars"
@3,45 say "Particulars"
@4,2 say repl("-",75)
if grloss = 0
@5,40 say "By Gross Profit B/D"
@5,68 say grpro
else
@5,2 say "To Gross Loss b/d"
@5,30 say grloss
endif
store 0 to sal, osal, tsal, rent, adv, pcr, pdb
@6,2 say "To Salaries"
@6,20 get sal
@7,3 say "(+)Out.Salary"
@7,20 get osal
read
tsal = sal + osal
@7,30 say tsal
@8,2 say "To Rent"
@8,30 get rent
@9,2 say "To Advertise"
@9,30 get adv
read
pdb = adv + rent + tsal + grloss
store 0 to dis, odb, ndb, debts, netpro, pamt, netloss
@6,40 say "By Disc. Receiv"
@6,68 get dis
@7,40 say "By Old debts"
@7,58 get odb
@8,40 say "(-) New debts"
@8,58 get ndb
read
debts = odb - ndb
@8,68 say debts

pcr = debts + dis + grpro
netpro = pcr - pdb
if netpro > 0
pamt = pcr
@10,2 say "To Net profit"
@10,30 say netpro
else
netloss = pdb - pcr
pamt = pdb
@10,42 say "To Net Loss:"
@10,68 say  netloss
endif
@11,2 say repl("-",75)
@12,30 say pamt
@12,68 say pamt
@13,2 say repl("-",75)
wait window
clear

**Balance Sheet**
store 0 to ass, land, cashb, cashh, rsrv, cap, aint 
@2,25 say "Balance sheet for the year Ended"
@3,2 say repl("-",75)
@4,3 say "Liablities         Amount"
@4,48 say "Assets           Amount"
@5,2 say repl("-",75)
@6,2 say "Capital"
@6,20 get cap
@7,2 say "Add. Int"
@7,20 get aint
read
if netpro > 0
@8,2 say "(+)Net pro"
@8,20 say netpro
cap = cap + aint + netpro
else
@8,2 say "(-)Net Loss:"
@8,20 say netloss
cap = cap + aint - netloss
endif
@8,30 say cap

@9,2 say "Reserve Fund"
@9,30 get rsrv
read
liab = rsrv + cap 
@6,48 say "Cash in Hand:"
@6,68 get cashh
@7,48 say "Cash at Bank:"
@7,68 get cashb
@8,48 say "Land:"
@8,68 get land
ass = land + cashb + cashh
@10,2 say repl("-",75)
@11,30 say liab
@11,68 say ass
@12,2 say repl("-",75)
wait window
return