Skip to content

FyefoxxM/cobol-invoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

COBOL Invoice Generator

Overview

A command-line invoice generator written in GnuCOBOL 3.2.0. Generates formatted text invoices with automatic client registry management, collision-safe invoice numbering (e.g. NATL0001), line item entry with running totals, tax calculation, and a buffered line item system supporting unlimited items per invoice. Built as a practical exploration of COBOL's file I/O and data processing capabilities.

Requirements

  • GnuCOBOL 3.2.0+
  • WSL or Linux environment

Project Structure

bin/ - compiled binaries data/ - client registry output/ - generated invoices src/ - COBOL source files

Building

cobc -free -c src/calcs.cob -o bin/calcs.o cobc -x -free src/invoice.cob bin/calcs.o -o bin/invoice

Usage

Run the program from the project root:

./bin/invoice

Menu Options:

1. Create New Invoice
   - Enter client name and confirm or override the auto-generated 4-letter client code
   - Enter client address and tax rate
   - Enter line items (description, quantity, unit, rate)
   - Program calculates line totals, subtotal, tax, and grand total automatically
   - Invoice is saved to output/ as a formatted text file e.g. NATL0001.txt
   - Client registry in data/ is updated automatically

2. View Last Invoice
   - Enter an invoice number e.g. NATL0001
   - Displays the invoice directly in the terminal

3. Exit

Invoice Numbering:

Invoice numbers are generated from the first 4 letters of the client name 
plus a zero-padded sequence number e.g. NATL0001, NATL0002. The client 
registry prevents code collisions between different clients.

Limitations

  • Text output only
  • 20 line items per batch flush
  • Invoices are immutable once written

Future Plans

  • PDF conversion pipeline
  • Batch processing
  • Void invoice functionality

About

A COBOL exploration of invoicing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages