Blue Ledger — Invoices + GRN + Reports

Blue Ledger

Invoices • GRN • Reports — localStorage only

Quick Stats

Revenue (30d)
USD 0.00
Unpaid Invoices
0
Stock Value
USD 0.00

Quick Actions

`); w.document.close(); } // ---------- BACKUP / RESTORE function backup(){ const payload={invoices:store.get(keys.INV,[]), grn:store.get(keys.GRN,[]), items:store.get(keys.ITEMS,[]), clients:store.get(keys.CLIENTS,[]), suppliers:store.get(keys.SUPP,[]), seq:store.get(keys.SEQ,{})}; const blob=new Blob([JSON.stringify(payload,null,2)],{type:"application/json"}); const a=document.createElement("a"); a.href=URL.createObjectURL(blob); a.download="blue-ledger-backup.json"; a.click(); } function restore(file){ if(!file) return; const fr=new FileReader(); fr.onload=()=>{ try{ const d=JSON.parse(fr.result); if(d.items) store.set(keys.ITEMS,d.items); if(d.clients) store.set(keys.CLIENTS,d.clients); if(d.suppliers) store.set(keys.SUPP,d.suppliers); if(d.invoices) store.set(keys.INV,d.invoices); if(d.grn) store.set(keys.GRN,d.grn); if(d.seq) store.set(keys.SEQ,d.seq); alert("Restore complete."); renderStats(); renderMaster(); renderInvList(); runReports(); }catch(e){ alert("Invalid backup file."); } }; fr.readAsText(file); } // helpers function esc(s){return String(s||"").replace(/[&<>"']/g,m=>({"&":"&","<":"<",">":">","\"":""","'":"'"}[m]))} // defaults $("#invDate").value=today(); $("#grnDate").value=today(); $("#rFrom").value=new Date(new Date().getFullYear(),0,1).toISOString().slice(0,10); $("#rTo").value=today(); renderMaster(); renderInvList(); runReports(); })();

Comments

Popular posts from this blog

How to Leverage AI for Better Graphic Design

"The Rise of the Global Brain in 2025: A Vision Inspired by Arthur C. Clarke" How does it affect you?

Attendance sheet version 7