Free Invoice Generator โ Create & Download PDF Invoices | TechFeedNow๐งพ Free Invoice Generator
Create Professional Invoices
Download as PDF โ Free
Build invoices with GST breakdown, multiple line items, and your branding. No account needed, no watermarks, download instantly.
๐ข Your Business Details
Business Logo (optional)
Currency
GST Rate
| Description | Qty | Rate (โน) | Amount | |
|---|
Subtotalโน0.00
GST (18%)โน0.00
Discount-โน0.00
Totalโน0.00
Saved drafts are stored in your browser. Load them anytime on this device.
๐ Notes & Payment Info
Notes / Terms / Bank Details
๐ Your invoice data never leaves your device. Everything is processed in your browser โ 100% private and free.
Invoice Preview
Live Preview
| Description | Qty | Rate | Amount |
|---|
| Add line items to see them here |
`);
w.document.close();
}// Init
updatePreview();// โโ LOGO UPLOAD โโ
let logoDataUrl = '';
function uploadLogo(input){
const file = input.files[0];
if(!file) return;
const reader = new FileReader();
reader.onload = e => {
logoDataUrl = e.target.result;
document.getElementById('logoPreview').src = logoDataUrl;
document.getElementById('logoPreview').style.display = 'block';
document.getElementById('logoRemoveBtn').style.display = 'block';
document.getElementById('logoUploadArea').style.display = 'none';
// Show in preview
const pl = document.getElementById('prev-logo');
pl.src = logoDataUrl; pl.style.display = 'block';
};
reader.readAsDataURL(file);
}
function removeLogo(){
logoDataUrl = '';
document.getElementById('logoPreview').style.display = 'none';
document.getElementById('logoPreview').src = '';
document.getElementById('logoRemoveBtn').style.display = 'none';
document.getElementById('logoUploadArea').style.display = 'block';
const pl = document.getElementById('prev-logo');
pl.src = ''; pl.style.display = 'none';
}// โโ COLOUR PICKER โโ
let invoiceColour = '#6c63ff';
function setColour(colour, swatchEl){
invoiceColour = colour;
document.querySelectorAll('.colour-swatch').forEach(s=>s.classList.remove('selected'));
if(swatchEl) swatchEl.classList.add('selected');
document.getElementById('customColour').value = colour;
// Apply to preview
const preview = document.getElementById('invoicePreview');
preview.querySelectorAll('.inv-title h2').forEach(el=>el.style.color=colour);
preview.querySelectorAll('.inv-sec-title, .cl-sec-title').forEach(el=>el.style.color=colour);
preview.querySelectorAll('.inv-party-label').forEach(el=>el.style.color=colour);
// Update via inline style on preview container
preview.style.setProperty('--inv-accent', colour);
// Re-run preview to propagate colour
updatePreviewColour();
}
function updatePreviewColour(){
document.querySelectorAll('#invoicePreview .inv-title h2').forEach(el=>el.style.color=invoiceColour);
}// โโ SAVE / LOAD โโ
function getFormData(){
const fields = ['fromName','fromEmail','fromPhone','fromGST','fromAddress','toName','toEmail','toAddress','invNum','invDate','dueDate','currency','gstRate','discount','discLabel','notes'];
const data = {};
fields.forEach(id=>{ const el=document.getElementById(id); if(el) data[id]=el.value; });
data.items = items;
data.invoiceColour = invoiceColour;
return data;
}function saveInvoice(){
const data = getFormData();
localStorage.setItem('tfn-invoice-draft', JSON.stringify(data));
showToast('โ Draft saved!');
}function loadInvoice(){
const raw = localStorage.getItem('tfn-invoice-draft');
if(!raw){ showToast('No saved draft found', true); return; }
const data = JSON.parse(raw);
const fields = ['fromName','fromEmail','fromPhone','fromGST','fromAddress','toName','toEmail','toAddress','invNum','invDate','dueDate','currency','gstRate','discount','discLabel','notes'];
fields.forEach(id=>{ const el=document.getElementById(id); if(el&&data[id]!==undefined) el.value=data[id]; });
if(data.items) items = data.items;
if(data.invoiceColour){ setColour(data.invoiceColour, null); }
updatePreview();
showToast('โ Draft loaded!');
}function clearAll(){
if(!confirm('Clear all invoice data?')) return;
const fields = ['fromName','fromEmail','fromPhone','fromGST','fromAddress','toName','toEmail','toAddress','invNum','invDate','dueDate','discount','discLabel','notes'];
fields.forEach(id=>{ const el=document.getElementById(id); if(el) el.value=''; });
document.getElementById('invNum').value = 'INV-001';
items = [{desc:'',qty:1,rate:0}];
removeLogo();
updatePreview();
showToast('โ Cleared');
}// โโ TOAST โโ
function showToast(msg, isError=false){
let t = document.getElementById('tfn-toast');
if(!t){ t=document.createElement('div'); t.id='tfn-toast'; t.className='toast'; document.body.appendChild(t); }
t.textContent = msg;
t.style.borderColor = isError ? 'rgba(255,95,95,.3)' : 'rgba(45,216,130,.3)';
t.style.color = isError ? 'var(--red)' : 'var(--green)';
t.classList.add('show');
setTimeout(()=>t.classList.remove('show'), 2500);
}