Skip to content

Generate a ledger based on Credit and Debit data of a Client

License

Notifications You must be signed in to change notification settings

usmanialiq/ledger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ledger

Generate a ledger based on Credit and Debit data of a Client.


Requirements

  • Node.js
  • Express.js
  • EJS
  • Mongo.js
  • Underscore.js

Create a MongoDB instance

Create three collections in the 'db_billing' database you have created,

  • Invoices
  • Payments
  • Clients
 
 // This is how you create a collection, if using local machine db, else look at the mongo.js documentation
 // Run these commands separately
 db.createCollection("invoices")
 db.createCollection("payments")
 db.createCollection("clients")
 

Format of Invoice Data

  
    let invoice = {
            inv_no: 1,
            date: DD/MM/YYY,
            c_name: 'John Doe',
            item_code: 'PEN-001',
            item_desc: 'Blue Ink Pen from Parker',
            qty: 10,
            price: 200,
            total: 2000
     };
   

Format of Payment Data

  
    let payment = {
            pmt_no: 1,
            date: DD/MM/YYYY,
            client: 'John Doe',
            amount: 1500,
            cheque_no: 'XYZ76762319'
    };
   

Format of Client Data

  
    let clientData = {
            company: "John Doe",
            contact: '3333333222',
            address: 'St.# 1, Planet Earth's Best Place'
    }
   
Make sure, if inserting data manually into the db, the format should be the same, for example...
  
    db.invoices.insert({ "inv_no": 1, "date": "DD/MM/YYY", "c_name": 'John Doe', "item_code": 'PEN-001', "item_desc": 'Blue Ink Pen from Parker', "qty": 10, "price": 200, "total": 2000})
   

In the end, if still you feel you need guidance, feel free to contact me anytime.

Releases

No releases published

Packages

No packages published