On Point Progress

ESTIMATES · JOBS · PROGRESS

Projects

Project details

Project overview photos

Photos are newest first. Original camera date is read when available; otherwise the upload date is labeled. You can correct dates manually. Keep backups.

Progress

0%

Each task's weight is a percentage of the entire project. Subtasks divide their parent task; their weights should total 100%. Assign weights totaling 100% for a complete plan. You can change them anytime.

Add a task

%

Optional templates

Tasks are never saved as templates unless you choose to save them. Templates contain tasks, subtasks, and percentages, not completion status.

Saved locally on this device and browser. Export backups regularly. No account or online homeowner sharing in this version.

`; } function customerEstimateWindow(id){let e=findEst(id);if(!e)return;let w=window.open('','_blank');if(!w){alert('Allow pop-ups to preview this estimate.');return}w.document.open();w.document.write(customerEstimateHtml(e));w.document.close()} function customerEstimateDownload(id){let e=findEst(id);if(!e)return;let blob=new Blob([customerEstimateHtml(e)],{type:'text/html;charset=utf-8'});let url=URL.createObjectURL(blob),a=document.createElement('a');a.href=url;a.download='estimate-'+String(e.invoiceNumber??0).padStart(4,'0')+'.html';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000)} function customerEstimateFile(e){return new File([customerEstimateHtml(e)],'estimate-'+String(e.invoiceNumber??0).padStart(4,'0')+'.html',{type:'text/html'});} async function customerEstimateShareFile(id){const e=findEst(id);if(!e)return;const f=customerEstimateFile(e);try{if(navigator.canShare&&navigator.canShare({files:[f]})){await navigator.share({files:[f],title:'Estimate #'+e.invoiceNumber,text:'Please review the attached estimate.'});return}}catch(err){if(err.name==='AbortError')return}customerEstimateDownload(id);alert('Your device cannot directly share this document. The customer estimate has been downloaded. Attach it in your text or email app.');} async function customerEstimateCopyLink(id){ const e=findEst(id);if(!e)return; const link=e.publicEstimateUrl; if(!link){alert('This estimate does not have a public link yet. Choose Set customer link after publishing the customer document online. A downloaded HTML file cannot generate a public link.');return;} const msg='Please review your On Point Builds and Repairs estimate #'+String(e.invoiceNumber??0).padStart(4,'0')+': '+link; try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(msg);alert('Estimate message and link copied. Paste into your text message.');return}}catch(err){} const area=document.createElement('textarea');area.value=msg;area.style.cssText='position:fixed;left:8px;top:8px;width:85%;height:90px;z-index:99999';document.body.appendChild(area);area.focus();area.select();let copied=false;try{copied=document.execCommand('copy')}catch(err){}if(copied){area.remove();alert('Estimate message and link copied. Paste into your text message.')}else{prompt('Copy this message and paste into your text message:',msg);area.remove()} } function customerEstimateHostedLink(id){const e=findEst(id);if(!e)return;const link=prompt('Paste the public HTTPS link for this customer estimate (after uploading it to your website or hosting service):',e.publicEstimateUrl||'');if(link===null)return;let url;try{url=new URL(link);if(url.protocol!=='https:')throw Error()}catch(_){alert('Enter a valid https:// link. A local file path cannot be opened by customers.');return}e.publicEstimateUrl=url.href;persist();alert('Customer link saved. You can now use Text link or Email link.');} function customerEstimateSendLink(id,channel){const e=findEst(id);if(!e)return;const link=e.publicEstimateUrl;if(!link){alert('A public link has not been set up yet. First host this customer estimate online, then choose Set customer link. You can use Share document in the meantime.');return}const message='Please review your On Point Builds and Repairs estimate #'+String(e.invoiceNumber??0).padStart(4,'0')+': '+link;if(channel==='text'){location.href='sms:'+encodeURIComponent(e.customerPhone||'')+'?body='+encodeURIComponent(message)}else{location.href='mailto:'+encodeURIComponent(e.customerEmail||'')+'?subject='+encodeURIComponent('Your estimate #'+e.invoiceNumber)+'&body='+encodeURIComponent(message)}} function customerEstimateShare(id){let e=findEst(id);if(!e)return;let text=`Estimate #${String(e.invoiceNumber??0).padStart(4,'0')} for ${e.customerName||'customer'}: ${e.name}. Total price: ${money(customerEstimatePrice(e))}. Please review the attached estimate and reply with your decision.`;if(navigator.share){navigator.share({title:'Estimate '+e.invoiceNumber,text}).catch(()=>{})}else if(navigator.clipboard){navigator.clipboard.writeText(text).then(()=>alert('Estimate summary copied. Attach the saved PDF or HTML document to your message.')).catch(()=>prompt('Copy estimate summary',text))}else prompt('Copy estimate summary',text)} function setCustomerDisplayMode(id,mode){let e=findEst(id);if(!e)return;e.customerDisplayMode=mode;persist()} function customerApprovalRecorded(id){let e=findEst(id);if(!e)return;if(!confirm('Did this customer explicitly accept this estimate? This records approval locally and creates the invoice; it does not verify online acceptance.'))return;estApprove(id)} const PAYMENT_METHODS=['Zelle','Venmo','Cash App','Cash']; function invoiceAmount(e){return Number(e.agreedPrice||e.target||estSum(e).total)||0} function createInvoiceFromEstimate(e){ if(e.invoice)return e.invoice; const existing=allEstimateRecords().map(x=>Number(x.invoice?.number)).filter(Number.isFinite); e.invoice={number:existing.length?Math.max(...existing)+1:1,date:new Date().toISOString().slice(0,10),dueDate:'',description:e.scope||e.name,amount:invoiceAmount(e),status:'Unpaid',payments:[],paymentMethods:[...PAYMENT_METHODS],paymentInstructions:'',notes:''}; return e.invoice; } function invoiceEdit(id,field,value){let e=allEstimateRecords().find(x=>x.id===id);if(!e?.invoice)return;e.invoice[field]=field==='amount'?Math.max(0,Number(value)||0):value;persist()} function invoiceMethod(id,method,checked){let e=allEstimateRecords().find(x=>x.id===id);if(!e?.invoice)return;let m=new Set(e.invoice.paymentMethods||[]);checked?m.add(method):m.delete(method);e.invoice.paymentMethods=[...m];persist()} function invoicePayments(e){return (e.invoice?.payments||[]).reduce((a,p)=>a+Number(p.amount||0),0)} function invoiceAddPayment(id){let e=allEstimateRecords().find(x=>x.id===id);if(!e?.invoice)return;let method=prompt('Payment method: Zelle, Venmo, Cash App, or Cash','Cash');if(!method)return;let amount=Number(prompt('Payment received ($)','0'));if(!(amount>0))return;e.invoice.payments.push({id:eid(),method,amount,date:new Date().toISOString().slice(0,10)});e.invoice.status=invoicePayments(e)>=Number(e.invoice.amount)?'Paid':'Partially paid';persist()} function invoiceRemovePayment(id,pid){let e=allEstimateRecords().find(x=>x.id===id);if(!e?.invoice)return;e.invoice.payments=e.invoice.payments.filter(p=>p.id!==pid);e.invoice.status=invoicePayments(e)>=Number(e.invoice.amount)?'Paid':invoicePayments(e)>0?'Partially paid':'Unpaid';persist()} function invoicePrint(id){ let e=allEstimateRecords().find(x=>x.id===id),v=e?.invoice;if(!v)return; let paid=invoicePayments(e),balance=Math.max(0,Number(v.amount)-paid); let clean=x=>esc(String(x??'')); let addr=[e.billingStreet,e.billingCity,e.billingState,e.billingZip].filter(Boolean).join(', '); let job=[e.jobStreet,e.cityState,e.jobZip].filter(Boolean).join(', '); let methods=(v.paymentMethods||[]).join(', '); let html=`Invoice ${clean(v.number)}

INVOICE

ON POINT BUILDS & REPAIRS LLC
On Point Progress · Estimates & Repairs
Invoice #${clean(v.number)}

Date: ${clean(v.date)}

Due: ${clean(v.dueDate||'As agreed')}

Bill to

${clean(e.customerName)}
${clean(e.customerCompany||'')}
${clean(addr)}
${clean(e.customerPhone||'')}
${clean(e.customerEmail||'')}

Job location: ${clean(job)}

DescriptionAmount
${clean(e.name)}

${clean(v.description)}

${money(v.amount)}

Invoice amount: ${money(v.amount)}
Payments received: ${money(paid)}

Balance due: ${money(balance)}

Accepted payment methods

${clean(methods)}

${clean(v.paymentInstructions||'Zelle: 443-814-6132 · Venmo: @opbar · Cash App: $ddhsllc · Cash accepted by arrangement')}

${clean(v.notes)}

Customer invoice. Internal costs, profit and progress tracking are not shown.`; let w=window.open('','_blank');if(!w){alert('Allow pop-ups to print this invoice.');return}w.document.write(html);w.document.close();w.focus();w.print(); } function renderInvoices(){ let host=document.getElementById('invoiceHost');if(!host)return; let records=allEstimateRecords().filter(e=>e.invoice); host.innerHTML=`

Invoices · Customer-facing

Invoices are created when estimates are approved. This page is separate from the project progress sheet. Internal material costs, labor costs, and profit are not included on customer invoices.

Accepted payment options: Zelle · Venmo · Cash App · Cash

${records.length?records.map(e=>{let v=e.invoice,paid=invoicePayments(e);return `
Invoice #${esc(v.number)} · ${esc(e.customerName||'Customer')} · ${esc(e.name)} · ${money(v.amount)} · ${esc(v.status)}

Accepted payment methods

${PAYMENT_METHODS.map(m=>``).join('')}

Paid: ${money(paid)} · Balance: ${money(Math.max(0,v.amount-paid))}

${(v.payments||[]).map(p=>`

${esc(p.date)} · ${esc(p.method)} · ${money(p.amount)}

`).join('')}
`}).join(''):'

No invoices yet. Approve an estimate to create its invoice.

'}
`; } function renderCustomerEstimates(){let host=document.getElementById('customerEstimateHost');if(!host)return;host.innerHTML=`

Customer estimates

Prepare a clean work description, project dates, and payment terms. Internal walkthrough notes, costs, and profit never appear on the customer copy.

${estimates().map(e=>`
#${esc(String(e.invoiceNumber??0).padStart(4,'0'))} · ${esc(e.customerName||'Customer')} · ${esc(e.name)} · ${money(customerEstimatePrice(e))}

Work descriptions (in order)

${customerPhases(e).map((p,i)=>`
`).join('')}

Check work descriptions, deposit and dates before sending. Individual work-item prices do not change the agreed total automatically.

`).join('')}
`} const originalRender=render;render=function(){originalRender();renderEstimating();renderInvoices();renderCustomerEstimates()}; const originalSetTab=setTab;setTab=function(tab){if(tab==='customerEstimates'){activeTab=tab;el('editView').classList.add('hidden');el('overviewView').classList.add('hidden');el('estimatingHost').classList.add('hidden');el('invoiceHost').classList.add('hidden');el('customerEstimateHost').classList.remove('hidden');['editTab','overviewTab','estimateTab','invoiceTab'].forEach(id=>el(id).className='secondary');el('customerEstimateTab').className='active';renderCustomerEstimates()}else if(tab==='invoices'){el('customerEstimateHost').classList.add('hidden');el('customerEstimateTab').className='secondary';activeTab=tab;el('editView').classList.add('hidden');el('overviewView').classList.add('hidden');el('estimatingHost').classList.add('hidden');el('invoiceHost').classList.remove('hidden');el('editTab').className='secondary';el('overviewTab').className='secondary';el('estimateTab').className='secondary';el('invoiceTab').className='active';renderInvoices()}else if(tab==='estimating'){el('customerEstimateHost').classList.add('hidden');el('customerEstimateTab').className='secondary';el('invoiceHost').classList.add('hidden');el('invoiceTab').className='secondary';activeTab=tab;el('editView').classList.add('hidden');el('overviewView').classList.add('hidden');el('estimatingHost').classList.remove('hidden');el('editTab').className='secondary';el('overviewTab').className='secondary';el('estimateTab').className='active';renderEstimating()}else{el('customerEstimateHost').classList.add('hidden');el('customerEstimateTab').className='secondary';el('estimatingHost').classList.add('hidden');el('invoiceHost').classList.add('hidden');el('invoiceTab').className='secondary';el('estimateTab').className='secondary';originalSetTab(tab)}}; const nav=document.querySelector('nav.tabs');nav.insertAdjacentHTML('beforeend','');document.querySelector('main').insertAdjacentHTML('beforeend','');document.querySelector('nav.tabs').insertAdjacentHTML('beforeend','');document.querySelector('main').insertAdjacentHTML('beforeend','');document.querySelector('nav.tabs').insertAdjacentHTML('beforeend','');document.querySelector('main').insertAdjacentHTML('beforeend','');renderEstimating();renderInvoices();renderCustomerEstimates();