Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/template-1-after.pdf
Binary file not shown.
Binary file added .github/template-1-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-1-before.pdf
Binary file not shown.
Binary file added .github/template-1-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-1-comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-1-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-2-after.pdf
Binary file not shown.
Binary file added .github/template-2-after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-2-before.pdf
Binary file not shown.
Binary file added .github/template-2-before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-2-comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/template-2-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/api/invoice/generate/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const runtime = "nodejs";
export const maxDuration = 60;
export const maxDuration = 10;

import { NextRequest } from "next/server";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const DynamicInvoiceTemplateSkeleton = () => {
};

const DynamicInvoiceTemplate = (props: InvoiceType) => {
// Dynamic template component name
const templateName = `InvoiceTemplate${props.details.pdfTemplate}`;

const DynamicInvoice = useMemo(
Expand Down
75 changes: 75 additions & 0 deletions app/components/templates/invoice-pdf/InvoiceTemplate1.data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"sender": {
"name": "John Doe",
"address": "123 Main St",
"zipCode": "12345",
"city": "Anytown",
"country": "USA",
"email": "johndoe@example.com",
"phone": "123-456-7890"
},
"receiver": {
"name": "Jane Smith",
"address": "456 Elm St",
"zipCode": "54321",
"city": "Other Town",
"country": "Canada",
"email": "jane@example.com",
"phone": "555-987-6543"
},
"details": {
"invoiceLogo": "",
"invoiceNumber": "INV0001",
"invoiceDate": "March 24, 2026",
"dueDate": "March 24, 2026",
"currency": "USD",
"language": "English",
"items": [
{
"name": "Product 1",
"description": "Description of product 1",
"quantity": 4,
"unitPrice": 50,
"total": 200
},
{
"name": "Product 2",
"description": "Description of product 2",
"quantity": 5,
"unitPrice": 50,
"total": 250
},
{
"name": "Product 3",
"description": "Description of product 3",
"quantity": 5,
"unitPrice": 80,
"total": 400
}
],
"paymentInformation": {
"bankName": "Bank Inc.",
"accountName": "John Doe",
"accountNumber": "445566998877"
},
"taxDetails": {
"amount": 15,
"taxID": "TAX-123",
"amountType": "percentage"
},
"discountDetails": {
"amount": 5,
"amountType": "percentage"
},
"shippingDetails": {
"cost": 5,
"costType": "amount"
},
"subTotal": 850,
"totalAmount": 975.06,
"totalAmountInWords": "Nine hundred seventy-five Dollar and six Cents",
"additionalNotes": "Thank you for your business",
"paymentTerms": "Net 30",
"pdfTemplate": 1
}
}
Loading