phonepe #62
@ -99,19 +99,19 @@ export class InvoiceService {
|
||||
doc.setFontSize(12);
|
||||
const receiptToBoxX = 13;
|
||||
const receiptToBoxY = 55;
|
||||
const receiptToBoxWidth = 140;
|
||||
const receiptToBoxWidth = 100;
|
||||
const receiptToBoxHeight = 40;
|
||||
|
||||
doc.setDrawColor(0, 0, 0);
|
||||
doc.setLineWidth(0.5);
|
||||
doc.rect(receiptToBoxX, receiptToBoxY, receiptToBoxWidth, receiptToBoxHeight);
|
||||
doc.setFont('helvetica', 'bold');
|
||||
doc.text('Receipt To:', 20, 60);
|
||||
doc.text('Receipt To:', 18, 60);
|
||||
|
||||
doc.setFont('helvetica', 'normal');
|
||||
doc.text(data.customerName, 20, 70);
|
||||
doc.text(`Phone: ${data.phoneNumber}`, 20, 80);
|
||||
doc.text(`Email: ${data.email}`, 20, 90);
|
||||
doc.text(data.customerName, 18, 70);
|
||||
doc.text(`Phone: ${data.phoneNumber}`, 18, 80);
|
||||
doc.text(`Email: ${data.email}`, 18, 90);
|
||||
|
||||
autoTable(doc, {
|
||||
startY: 110,
|
||||
@ -155,10 +155,13 @@ export class InvoiceService {
|
||||
doc.text('CGST (9%):', 150, finalY + 20, { align: 'right' });
|
||||
doc.text(`${cgst.toFixed(2)} INR`, 190, finalY + 20, { align: 'right' });
|
||||
|
||||
doc.line(120, finalY + 25, 190, finalY + 25);
|
||||
|
||||
doc.setFont('helvetica', 'bold');
|
||||
doc.text('Total Amount:', 150, finalY + 30, { align: 'right' });
|
||||
doc.text(`${data.amount.toFixed(2)} INR`, 190, finalY + 30, { align: 'right' });
|
||||
} else {
|
||||
doc.line(120, finalY - 5, 190, finalY - 5);
|
||||
doc.setFont('helvetica', 'bold');
|
||||
doc.text('Total Amount:', 150, finalY, { align: 'right' });
|
||||
doc.text(`${data.amount.toFixed(2)} INR`, 190, finalY, { align: 'right' });
|
||||
@ -166,11 +169,9 @@ export class InvoiceService {
|
||||
|
||||
const paymentY = hasGst ? finalY + 50 : finalY + 20;
|
||||
|
||||
doc.line(13, 45, 190, 45);
|
||||
|
||||
const boxX = 13;
|
||||
const boxY = paymentY - 5;
|
||||
const boxWidth = 140;
|
||||
const boxWidth = 100;
|
||||
const boxHeight = 40;
|
||||
|
||||
doc.setDrawColor(0, 0, 0);
|
||||
@ -178,12 +179,12 @@ export class InvoiceService {
|
||||
doc.rect(boxX, boxY, boxWidth, boxHeight);
|
||||
|
||||
doc.setFont('helvetica', 'bold');
|
||||
doc.text('Payment Information:', 20, paymentY);
|
||||
doc.text('Payment Information:', 18, paymentY);
|
||||
|
||||
doc.setFont('helvetica', 'normal');
|
||||
doc.text(`Transaction ID: ${data.transactionId}`, 18, paymentY + 10);
|
||||
doc.text(`Payment Method: ${data.paymentMethod}`, 18, paymentY + 20);
|
||||
doc.text(`Payment Date: ${formattedDate}`, 20, paymentY + 30);
|
||||
doc.text(`Payment Date: ${formattedDate}`, 18, paymentY + 30);
|
||||
|
||||
doc.setFontSize(12);
|
||||
doc.setFont('helvetica', 'italic');
|
||||
|
||||
@ -197,7 +197,7 @@ export const phonePeWebhook = onRequest({
|
||||
const gymData = gymDoc.data();
|
||||
gymName = gymData?.name || 'Fitlien';
|
||||
gymAddress = gymData?.address || '';
|
||||
subscriptionName = gymData?.subscriptions?.name || '';
|
||||
subscriptionName = membershipData?.subscription?.normalizedName || '';
|
||||
|
||||
if (gymData?.userId) {
|
||||
const gymOwnerDoc = await admin.firestore()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user