Generate a ledger based on Credit and Debit data of a Client.
- Node.js
- Express.js
- EJS
- Mongo.js
- Underscore.js
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")
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
};
let payment = {
pmt_no: 1,
date: DD/MM/YYYY,
client: 'John Doe',
amount: 1500,
cheque_no: 'XYZ76762319'
};
let clientData = {
company: "John Doe",
contact: '3333333222',
address: 'St.# 1, Planet Earth's Best Place'
}
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})