diff --git a/apps/web/app/(portal)/mypage/invoices/page.tsx b/apps/web/app/(portal)/mypage/invoices/page.tsx
index 77d3bc6..0998a15 100644
--- a/apps/web/app/(portal)/mypage/invoices/page.tsx
+++ b/apps/web/app/(portal)/mypage/invoices/page.tsx
@@ -93,16 +93,21 @@ export default async function MyInvoicesPage() {
>
Pay Now โ Card / Apple Pay
- {/* PDF download */}
+ {/* View / download PDF */}
{inv.pdfUrl && !inv.pdfUrl.startsWith('data:') && (
-
- Download PDF
-
+ <>
+
+ View Invoice
+
+
+ Download PDF
+
+ >
)}
@@ -159,9 +164,14 @@ export default async function MyInvoicesPage() {
{inv.pdfUrl && !inv.pdfUrl.startsWith('data:') ? (
-
- Download
-
+
) : (
โ
)}
diff --git a/apps/web/app/(portal)/mypage/projects/page.tsx b/apps/web/app/(portal)/mypage/projects/page.tsx
index c0132b9..7e10082 100644
--- a/apps/web/app/(portal)/mypage/projects/page.tsx
+++ b/apps/web/app/(portal)/mypage/projects/page.tsx
@@ -145,18 +145,26 @@ export default async function MyProjectsPage() {
{/* Contract PDFs */}
-
+ {(proj.contractPdfUrl || proj.signedContractPdfUrl) && (
+
+ {(proj.contractPdfUrl && !proj.contractPdfUrl.startsWith('data:')) ||
+ (proj.signedContractPdfUrl && !proj.signedContractPdfUrl.startsWith('data:')) ? (
+
+ ๐ View Contract
+
+ ) : null}
+ {proj.contractPdfUrl && !proj.contractPdfUrl.startsWith('data:') && (
+
+ Download PDF
+
+ )}
+ {proj.signedContractPdfUrl && !proj.signedContractPdfUrl.startsWith('data:') && (
+
+ โ
Signed PDF
+
+ )}
+
+ )}
{/* Invoices */}
{proj.invoices.length > 0 && (
@@ -179,9 +187,14 @@ export default async function MyProjectsPage() {
)}
{inv.pdfUrl && !inv.pdfUrl.startsWith('data:') && (
-
- PDF
-
+ <>
+
+ View
+
+
+ PDF
+
+ >
)}
diff --git a/apps/web/app/(portal)/mypage/quotes/page.tsx b/apps/web/app/(portal)/mypage/quotes/page.tsx
index f988c20..9e252af 100644
--- a/apps/web/app/(portal)/mypage/quotes/page.tsx
+++ b/apps/web/app/(portal)/mypage/quotes/page.tsx
@@ -84,9 +84,14 @@ export default async function MyQuotesPage() {
)}
-
- Download Estimate PDF
-
+
)}
diff --git a/apps/web/app/admin/projects/[id]/GenerateContractButton.tsx b/apps/web/app/admin/projects/[id]/GenerateContractButton.tsx
index eb5dcd5..4f8a75b 100644
--- a/apps/web/app/admin/projects/[id]/GenerateContractButton.tsx
+++ b/apps/web/app/admin/projects/[id]/GenerateContractButton.tsx
@@ -54,6 +54,9 @@ export default function GenerateContractButton({ projectId, contractPdfUrl: init
{pdfUrl && !pdfUrl.startsWith('data:') && (
<>
+
+ ๐ Public Link
+
๐ View PDF
diff --git a/apps/web/app/admin/projects/[id]/InvoiceIssueForm.tsx b/apps/web/app/admin/projects/[id]/InvoiceIssueForm.tsx
index 50edfcd..5f5ffcf 100644
--- a/apps/web/app/admin/projects/[id]/InvoiceIssueForm.tsx
+++ b/apps/web/app/admin/projects/[id]/InvoiceIssueForm.tsx
@@ -118,9 +118,14 @@ export default function InvoiceIssueForm({
);
@@ -131,9 +136,14 @@ export default function InvoiceIssueForm({
{/* View PDF */}
{invoice.pdfUrl && (
-
- PDF
-
+ <>
+
+ ๐ Public
+
+
+ PDF
+
+ >
)}
{/* DRAFT: Issue */}
diff --git a/apps/web/app/admin/quotes/[id]/EstimateBuilder.tsx b/apps/web/app/admin/quotes/[id]/EstimateBuilder.tsx
index 6866edb..0cee31f 100644
--- a/apps/web/app/admin/quotes/[id]/EstimateBuilder.tsx
+++ b/apps/web/app/admin/quotes/[id]/EstimateBuilder.tsx
@@ -116,9 +116,14 @@ export default function EstimateBuilder({
{quotePdfUrl && !quotePdfUrl.startsWith('data:') && (
-
- ๐ View PDF
-
+ <>
+
+ ๐ Public Link
+
+
+ ๐ View PDF
+
+ >
)}
{!isEditing && existingAmount && (
+
@@ -173,7 +179,7 @@ export async function sendEstimateEmail(quoteId: string) {
`,
- text: `Hi ${quote.name},\n\nYour Ecowoods estimate is ready.\nTotal: ${totalFormatted} CAD\n\nDownload PDF: ${pdfUrl}\n\nTo proceed, reply to this email or call ${settings?.companyPhone ?? '(416) 249-1276'}.`,
+ text: `Hi ${quote.name},\n\nYour Ecowoods estimate is ready.\nTotal: ${totalFormatted} CAD\n\nView online: ${viewUrl}\nDownload PDF: ${pdfUrl}\n\nTo proceed, reply to this email or call ${settings?.companyPhone ?? '(416) 249-1276'}.`,
});
await db.quoteRequest.update({
diff --git a/apps/web/lib/email/index.ts b/apps/web/lib/email/index.ts
index 05bb875..cfa8cf1 100644
--- a/apps/web/lib/email/index.ts
+++ b/apps/web/lib/email/index.ts
@@ -198,6 +198,7 @@ export async function sendInvoiceEmail({
const baseUrl = (process.env.NEXTAUTH_URL ?? 'https://ecowoods.ca').replace(/\/$/, '');
const payUrl = `${baseUrl}/mypage/invoices/${invoiceId}/pay`;
+ const viewUrl = `${baseUrl}/docs/invoice/${invoiceId}`;
await sendEmail({
to,
@@ -221,12 +222,15 @@ export async function sendInvoiceEmail({
Pay Now โ Card / Apple Pay / Google Pay
- ${pdfUrl ? `
-
Prefer to pay by e-transfer? Send to accounting@ecowoods.ca with #${invoiceNumber} as the memo.
Questions? Call (416) 249-1276.
@@ -237,7 +241,7 @@ export async function sendInvoiceEmail({
`,
- text: `Invoice #${invoiceNumber}\nAmount: ${totalStr}\n${dueDateStr}\n\nPay online: ${payUrl}${pdfUrl ? `\nDownload PDF: ${pdfUrl}` : ''}`,
+ text: `Invoice #${invoiceNumber}\nAmount: ${totalStr}\n${dueDateStr}\n\nView invoice: ${viewUrl}\nPay online: ${payUrl}${pdfUrl ? `\nDownload PDF: ${pdfUrl}` : ''}`,
});
}
@@ -362,12 +366,14 @@ export async function sendContractEmail({
projectTitle,
contractPdfUrl,
portalProjectUrl,
+ viewUrl,
}: {
to: string;
name: string;
projectTitle: string;
contractPdfUrl: string;
portalProjectUrl: string;
+ viewUrl?: string;
}) {
await sendEmail({
to,
@@ -385,15 +391,22 @@ export async function sendContractEmail({
Project
${projectTitle}
-
+ ${viewUrl ? `
+ ` : ''}
+
-
+
@@ -407,7 +420,7 @@ export async function sendContractEmail({
`,
- text: `Hi ${name},\n\nYour contract for "${projectTitle}" is ready.\n\nDownload PDF: ${contractPdfUrl}\nView in portal: ${portalProjectUrl}\n\nQuestions? Call (416) 249-1276.\n\nEcowoods Hardwood Flooring Inc.`,
+ text: `Hi ${name},\n\nYour contract for "${projectTitle}" is ready.\n\n${viewUrl ? `View online: ${viewUrl}\n` : ''}Download PDF: ${contractPdfUrl}\nView in portal: ${portalProjectUrl}\n\nQuestions? Call (416) 249-1276.\n\nEcowoods Hardwood Flooring Inc.`,
});
}
|