From 7894b656e3c184ee5bbb610e31b27d0a4f530c30 Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Fri, 5 Jun 2026 17:31:25 +0530 Subject: [PATCH] resolve merge conflicts and verify mail functionality --- send-label-test.js | 6 ---- shipping-label-test.pdf | Bin 57604 -> 57610 bytes shippingLabelGenerator.js | 59 -------------------------------------- 3 files changed, 65 deletions(-) diff --git a/send-label-test.js b/send-label-test.js index 3a625f2..ea46d8a 100644 --- a/send-label-test.js +++ b/send-label-test.js @@ -29,15 +29,9 @@ async function sendTestShippingLabelEmail() { }, email: process.env.SMTP_USER, line_items: [ -<<<<<<< HEAD - { name: 'Flat Bangle 4 Cut - Each Box', quantity: 1, price: '130.00' }, - { name: 'Glue Stick pencil - 1 piece', quantity: 3, price: '35.00' }, - { name: 'E-8000 - 50ML - 1 Piece', quantity: 2, price: '60.00' } -======= { name: 'Flat Bangle 4 Cut - Each Box', quantity: 1, price: '130.00', image_url: 'https://picsum.photos/200' }, { name: 'Glue Stick pencil - 1 piece', quantity: 3, price: '35.00', image_url: 'https://picsum.photos/200' }, { name: 'E-8000 - 50ML - 1 Piece', quantity: 2, price: '60.00', image_url: 'https://picsum.photos/200' } ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 ] }; diff --git a/shipping-label-test.pdf b/shipping-label-test.pdf index 5aa05783dfb48d12ac598a11cde23426fed3e1ca..7041d1cda744aef1e8aaf983daa8105d0cc32858 100644 GIT binary patch delta 1495 zcmZoU#N2g=d4oD5ley_+O-8l)+hII+Uu(bPf6|s8$Hc5ZX^ZP_jR|RGu40YH*|v_v9cG>nUTMfR>dx_x=A`Z#Ap`n{94ezxDU; z?Qh>rmyetB_Bf|^ef^z(hHuri!%nQ_a5P`?>3s6z>G^6aI`SSZSSzUAn$XzAcCWr= z;@l9X6%I=uoA=a(ot{12-ao&u{6bmp6Ye?sAMAbnrY=s@5#bQovgnp&#Xsd~;q`v& z?Ir)VbFS~GF5EA7L@0`72~+0IdVAad^SFYp7V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Zy6Z(fF@KU}uaA&f;_&ML`0t;Nw%kQY`c&qOx{+h!{^DU@;L zFR4#voN|Au1PYmW-AwrE!WTuEE%Hr>&+*v2pS^h{hYS`@>! zy$}}rY z;xPgEt%*}-qXAl+Bo zVboCy(NrJJpLd>X83^M4M zU6z-0Xf7fWpI&~Z6H=%$k&Ws|GjkUqiS-GLXofA_L_&V7Y8-mNn_><1V~akG(vGaS zIA55Ms}Cu-n)JHxpI&N5U0qJL_gXk#ahqOH(>QNyX`iu2Or5$-rnCA3gBAm?j)e`| zoE^TLmRNGvkIizbd-yz+4L_LFf*xrHHYp1Q?^p>ZFd#P|tvx*BX?xFd{oXG&ZWm=% zbIx@TuLc6;i7%CBnR=mNY&fduNB<~H@%_rMU()*2WgqWiaVZbxnh%?rG~#+s<&et< zAOsk4QXQ*bz5S4C@rj+`jD1uT5{vP!8{k*?LN!z#&mA28Jvv1`C)oIltZA)X3}Lnl-PoDn)TC~S3+8q$S{M|)@pDx zJa$5zd7-3d|8aMM`Ooh{6mhSm(QUS^K4pB26nVuARRka?k@b2UP(ic_C3L2}6q^DU zRhyWFRYL}a(ipu6fteg)``F6Ifd?JMh?3hQJFJdvZQ?(oqWW3X6c!MBA1Z-Cdz)$_ zjeJztuhAU`ADf>nxW!^RXtuTqg9Tu8`C3Yvh)9Kv;Zt!`iA4kb+_1ozyfWCp)*H{G*%w3=7B3iG}9x??t6006&%;em~*c$64D4ke*C z+Bnw@z0f%P1`mV6784&6hr`DbG0a$OJkgbjXU3pNaQFXJ dqQE2)_-INDHzl1L7Z3jDMFcPsxhv2I{5Mg2gj4_k diff --git a/shippingLabelGenerator.js b/shippingLabelGenerator.js index 386529a..553edaa 100644 --- a/shippingLabelGenerator.js +++ b/shippingLabelGenerator.js @@ -23,11 +23,7 @@ function drawBarcode(doc, x, y, width, height, text) { currentX += lineWidth + spacing; } -<<<<<<< HEAD - // Barcode number text below bars -======= // Barcode number text below bars (with extra vertical gap and letter spacing) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 doc.fontSize(8.5) .font('Helvetica-Bold') .fillColor('#000000') @@ -74,22 +70,14 @@ const generateShippingLabelPDF = async (orderData) => { // --- BACKGROUND --- doc.rect(0, 0, W, H).fill('#ffffff'); -<<<<<<< HEAD - // --- OUTER BORDER --- -======= // --- OUTER BORDER (Thicker, professional frame) --- ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 doc.rect(6, 6, W - 12, H - 12) .lineWidth(2) .strokeColor('#1e293b') .stroke(); // ============================================================ -<<<<<<< HEAD - // SECTION 1: HEADER STRIP -======= // SECTION 1: HEADER STRIP (FROM shop info) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 // ============================================================ const headerY = 6; const headerH = 58; @@ -105,11 +93,7 @@ const generateShippingLabelPDF = async (orderData) => { } catch (e) { /* silent fail */ } } -<<<<<<< HEAD - // Shop name text -======= // Shop name text (right side of header) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 doc.fontSize(12.5) .font('Helvetica-Bold') .fillColor('#ffffff') @@ -122,11 +106,7 @@ const generateShippingLabelPDF = async (orderData) => { .text('Madurai 625016, Tamil Nadu, India | Ph: 9994333548', logoLoaded ? 95 : PAD, headerY + 38, { width: W - (logoLoaded ? 111 : PAD * 2) }); // ============================================================ -<<<<<<< HEAD - // SECTION 2: ORDER INFO STRIP -======= // SECTION 2: ORDER INFO STRIP (Left-Right Aligned) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 // ============================================================ const orderStripY = headerY + headerH; const orderStripH = 30; @@ -136,32 +116,20 @@ const generateShippingLabelPDF = async (orderData) => { const orderDate = new Date(orderData.created_at || Date.now()).toLocaleDateString('en-GB'); const shippingMethod = orderData.shipping_lines?.[0]?.title || 'Standard Courier'; -<<<<<<< HEAD - // Order Number -======= // Order Number on Left ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 doc.fontSize(9.5) .font('Helvetica-Bold') .fillColor('#0f172a') .text(`ORDER: #${orderNumber}`, PAD, orderStripY + 10); -<<<<<<< HEAD - // Date | Courier Method -======= // Date | Courier Method on Right ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 doc.fontSize(8) .font('Helvetica-Bold') .fillColor('#475569') .text(`${orderDate} | ${shippingMethod}`, PAD, orderStripY + 11, { width: W - PAD * 2, align: 'right' }); // ============================================================ -<<<<<<< HEAD - // SECTION 3: SHIP TO SECTION HEADER -======= // SECTION 3: SHIP TO SECTION ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 // ============================================================ const shipToLabelY = orderStripY + orderStripH; const shipToLabelH = 18; @@ -173,11 +141,7 @@ const generateShippingLabelPDF = async (orderData) => { .text('SHIP TO', PAD, shipToLabelY + 5, { width: W - PAD * 2, align: 'center' }); // ============================================================ -<<<<<<< HEAD - // SECTION 4: CUSTOMER ADDRESS -======= // SECTION 4: CUSTOMER ADDRESS (Clean typesetting) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 // ============================================================ const addressStartY = shipToLabelY + shipToLabelH + 12; const shipping = orderData.shipping_address || orderData.billing_address || {}; @@ -191,10 +155,7 @@ const generateShippingLabelPDF = async (orderData) => { const toZip = shipping.zip || ''; const toCountry = shipping.country || 'India'; -<<<<<<< HEAD -======= // Customer Name ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 doc.fontSize(14) .font('Helvetica-Bold') .fillColor('#0f172a') @@ -202,10 +163,7 @@ const generateShippingLabelPDF = async (orderData) => { let currentY = addressStartY + 18; -<<<<<<< HEAD -======= // Customer Phone (Clean phone icon fallback) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 if (toPhone) { doc.fontSize(9.5) .font('Helvetica-Bold') @@ -214,10 +172,7 @@ const generateShippingLabelPDF = async (orderData) => { currentY += 14; } -<<<<<<< HEAD -======= // Customer Address lines combined with consistent spacing ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 const addressParts = []; if (toAddr1) addressParts.push(toAddr1); if (toAddr2) addressParts.push(toAddr2); @@ -238,17 +193,11 @@ const generateShippingLabelPDF = async (orderData) => { .fillColor('#334155') .text(addressText, PAD, currentY, { width: W - PAD * 2, lineGap: 3.5 }); -<<<<<<< HEAD - const addressHeight = doc.heightOfString(addressText, { width: W - PAD * 2, lineGap: 3.5 }); - currentY += addressHeight + 10; - -======= // Calculate height of the address block to dynamically place the separator const addressHeight = doc.heightOfString(addressText, { width: W - PAD * 2, lineGap: 3.5 }); currentY += addressHeight + 10; // Ensure the separator doesn't overflow if address is short or long ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 const minSeparatorY = 250; const sepY = Math.max(currentY, minSeparatorY); @@ -262,11 +211,7 @@ const generateShippingLabelPDF = async (orderData) => { .stroke(); // ============================================================ -<<<<<<< HEAD - // SECTION 6: FROM ADDRESS (Return address) -======= // SECTION 6: FROM ADDRESS (Ray Aari Shop - Return address) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 // ============================================================ const fromY = sepY + 10; @@ -291,11 +236,7 @@ const generateShippingLabelPDF = async (orderData) => { .text(shopAddressText, PAD, fromY + 24, { width: W - PAD * 2, lineGap: 2 }); // ============================================================ -<<<<<<< HEAD - // SECTION 7: BARCODE STRIP -======= // SECTION 7: BARCODE STRIP (Locked to Bottom) ->>>>>>> a15558d565f56829553c2991c516ac93d4428ff5 // ============================================================ const barcodeAreaY = H - 75; doc.rect(6, barcodeAreaY, W - 12, 1).fill('#cbd5e1');