Register Your Company
Professional CIPC Registration With Automated Invoice & PDF
Select Company Type
Director Details
Company Details
Add-ons
Invoice Summary
let companyType="", basePrice=0, directors=[], directorCount=0;
function start(){ document.getElementById("typeSection").classList.add("active"); }
function chooseType(){ companyType=document.getElementById("companyType").value; if(!companyType){ alert("Select company type"); return; }
basePrice = companyType==="pty"?650:companyType==="npc"?650:850;
document.getElementById("typeSection").style.display="none"; document.getElementById("directorSection").classList.add("active");
document.getElementById("directorContainer").innerHTML=""; directors=[]; directorCount=0;
document.getElementById("directorNotice").innerText = (companyType==="npc"||companyType==="cc")? "Minimum 3 directors required.": "Minimum 1 director required.";
addDirector(); }
function addDirector(){ directorCount++; let box=document.createElement("div"); box.className="director-box"; box.innerHTML=`
Director ${directorCount}
`; document.getElementById("directorContainer").appendChild(box); }
function validateDirectors(){ let boxes=document.querySelectorAll(".director-box");
if((companyType==="npc"||companyType==="cc") && boxes.length<3){ alert("Minimum 3 directors required."); return; } directors=[]; boxes.forEach(b=>{ directors.push({ name:b.querySelector(".dName").value, id:b.querySelector(".dID").value, date:b.querySelector(".dDate").value, phone:b.querySelector(".dPhone").value, email:b.querySelector(".dEmail").value, address:b.querySelector(".dAddress").value }); });
document.getElementById("directorSection").style.display="none"; document.getElementById("companySection").classList.add("active"); }
function showAddons(){ document.getElementById("companySection").style.display="none"; document.getElementById("addonSection").classList.add("active");
if(companyType==="npc"){ document.getElementById("npcAddon").style.display="block"; } }
function generateInvoice(){
let total=basePrice; let ref="INV-"+Math.floor(1000+Math.random()*9000);
let addonsText=""; document.querySelectorAll("#addonSection input:checked").forEach(ch=>{ total+=parseInt(ch.value); addonsText+="- "+ch.parentElement.innerText+"\n"; });
let directorText=""; directors.forEach((d,i)=>{ directorText+= "Director "+(i+1)+"\n"+ "Full Name: "+d.name+"\n"+ "ID Number: "+d.id+"\n"+ "Date of Issue: "+d.date+"\n"+ "Phone: "+d.phone+"\n"+ "Email: "+d.email+"\n"+ "Address: "+d.address+"\n\n"; });
// 🔥 FIXED: EMAIL RESTORED openEmail(ref,total,directorText,addonsText);
// PDF generatePDF(ref,total);
document.getElementById("invoiceSection").classList.add("active"); document.getElementById("addonSection").style.display="none"; }
function openEmail(ref,total,dir,addons){
let body= "PHUSHANAWE TECHNOLOGY APPLICATION\n\n"+ "Reference: "+ref+"\n"+ "Company Type: "+companyType+"\n"+ "Total: R"+total+"\n\n"+
"COMPANY DETAILS\n"+ "Name1: "+document.getElementById("name1").value+"\n"+ "Name2: "+document.getElementById("name2").value+"\n"+ "Name3: "+document.getElementById("name3").value+"\n"+ "Name4: "+document.getElementById("name4").value+"\n"+ "Phone: "+document.getElementById("companyPhone").value+"\n"+ "Email: "+document.getElementById("companyEmail").value+"\n"+ "Address: "+document.getElementById("companyAddress").value+"\n\n"+
"DIRECTORS\n"+dir+"\n"+ "ADDONS\n"+(addons||"None");
window.location.href= "mailto:customercare@phushanawe.co.za?subject=Registration "+ref+ "&body="+encodeURIComponent(body); }
function generatePDF(ref,total){
const { jsPDF } = window.jspdf; let doc = new jsPDF();
let y=20;
doc.setFillColor(0,0,0); doc.rect(0,0,210,25,"F");
doc.setTextColor(255,255,255); doc.text("PHUSHANAWE TECHNOLOGY",20,15); doc.text("INVOICE",160,15);
doc.setTextColor(0,0,0); y=35;
let today=new Date().toLocaleDateString();
doc.text("Ref: "+ref,20,y); doc.text("Date: "+today,150,y);
y+=10;
doc.text("Billed To:",20,y); y+=6; doc.text(document.getElementById("name1").value,20,y); y+=5; doc.text(document.getElementById("companyEmail").value,20,y); y+=5; doc.text(document.getElementById("companyPhone").value,20,y);
y+=10;
doc.text("SERVICES:",20,y); y+=6;
doc.text("Company Registration ("+companyType.toUpperCase()+") - R"+basePrice,20,y); y+=6;
let addonTotal=0;
document.querySelectorAll("#addonSection input:checked").forEach(ch=>{ let text=ch.parentElement.innerText; let price=parseInt(ch.value); addonTotal+=price; doc.text(text+" - R"+price,20,y); y+=6; });
let grandTotal = basePrice + addonTotal;
y+=4; doc.text("TOTAL: R"+grandTotal,20,y);
y+=10;
doc.text("BANKING DETAILS",20,y); y+=6; doc.text("Bank: Nedbank",20,y); y+=5; doc.text("Account Name: Shego n Bucie Trading Projects",20,y); y+=5; doc.text("Account No: 1288764154",20,y); y+=5; doc.text("Branch Code: 141505",20,y); y+=5; doc.text("Reference: "+ref,20,y);
doc.save("Phushanawe-"+ref+".pdf"); }
function submitApplication(){ alert("Application Submitted Successfully"); }
