Skip to main content
Home
Live to Learn!

Main navigation

  • Home
  • Learn
    • FoxPro
    • MS-DOS
    • C PRG
    • Java
    • ASP
    • Ruby on Rails
    • ASP.NET
    • E-Books
    • Exam Preparation
    • Tools
  • Blog
  • Forums
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home
  2. FoxPro Programming

Simple Ledger creation & Posting Program

Book navigation

  • FoxPro Commands - Part 1
  • Foxpro commands - Part 2
  • Data Types in FoxPro
  • Numeric Functions in FoxPro
  • Creating a Program
  • Input and Output Statements in Foxpro
  • Control Structures in Foxpro
  • Creating menu in Foxpro for DOS
  • Simple Journal Entry program
  • Simple Ledger creation & Posting Program
  • Trial Balance Program
  • Balance Sheet Program
  • Simple Weekly Calendar Generation
  • How to install FoxPro 2.6 in Windows 10 / Windows 8 / Windows 7?
  • How to install FoxPro 2.6 on Linux OS (Ubuntu 20.04 | 20.10 | 21.04)?
  • How to install FoxPro in Windows 10 64 bit using VDosPlus?
By Karthikeyan , 28 September, 2009

clear
clea all
set talk off
use jour1
store space(15) to acname
store 0 to r,p, ds, cs, br, bl, mamt
@10,10 say "Account Name" get acname
read
clear
set devi to scre
set print on
set print to ledger.out
@2,2 say replicate("-",75)
@3,3 say "Date"
@3,13 say "Particulars"
@3,28 say "Amount"
@3,41 say "Date"
@3,52 say "Particulars"
@3,67 say "Amount"
@4,2 say replicate("-",75)
@5,28 say [Ledger for ] + alltrim(acname)
@6,28 say "-------------------"
r = 7
p = 7
do while .not. eof()
scan for upper(part1) = upper(alltrim(acname))
@r,2 say date
@r,11 say "To " + part2
@r,26 say credit
ds = ds + credit
r = r+1
endscan
scan for upper(part2) = upper(alltrim(acname))
@p,40 say date
@p,50 say "By " + part1
@p,65 say debit
cs =  cs + debit
p = p+1
endscan
enddo 

if p>r
br = p
else
br = r
endif

if cs > ds
bl = cs - ds
mamt = cs
@r+1,11 say "To bal b/d"
@r+1,26 say bl
@br+5,50 say "By Bal c/d"
@br+5,65 say bl
else
bl = ds - cs
mamt = ds
@p+1, 50 say "By bal c/d"
@p+1, 66 say bl
@br+5,11 say "To Bal b/d"
@br+5,26 say bl
endif

@br+2,26 say "------------"
@br+2,66 say "------------"
@br+3,26 say mamt
@br+3,66 say mamt
@br+4,26 say "------------"
@br+4,66 say "------------"
@br+6,2 say replicate("-",75)
set devi to scre
set print to
set print off
return

Screenshots

FoxPro Ledger A/c selection

FoxPro Ledger A/c selection

Tags
Foxpro Programs

Comments

Featured Blog Posts

Convert Currency in Number to Words (Indian Rupees) - MS Excel
Foxpro Tutorial and Programs
Convert Currency in Number to Words in MS Word
Convert Currency in Number to Words (Indian Rupees) - Version 2
Best way to Use Rupee Symbol in Windows – Easy steps
Convert Currency in Number to Words - MS Access
Creating All in One Windows XP DVD with all Important Applications
RSS feed

© 2009-2025 Live to Learn.In

Terms of Use | Privacy Policy