This topic contains 2 replies, has 0 voices, and was last updated by jprice 8 years, 3 months ago.

  • Author
    Posts
  • #1972

    jprice

    receiving the following error

    Parse exception during template merging.com.netledger.templates.TemplateServiceException: Parse exception during template merging.
    freemarker.core.ParseException: Found unexpected directive: on line 159, column 4 Check whether you have a well-formed if-else block.

    I took the exact code from a pre-existing PDF template by NS, what am I doing wrong?

    HTML Code:


    9240 Mira Este Court
    San Diego, CA 92126
    United States

    Tel: (800) 696-7614 | Fax: (866) 587-9793

    Bill To:
    ${record.billaddress}

    of ${record@title}

    Customer #: 123456789 Date: 02/25/2016 Invoice #: #${record.tranid}

    Remit To:

    Flexible Assembly Systems Inc.
    9240 Mira Este Court
    San Diego, CA 92126

    Ship To:

    ${record.shipaddress}

    Sales Rep Customer PO # Ship Date Shipping Method ${record.terms@label}
    ${record.salesrep} 123456789 02/30/2016 ${record.shipmethod} ${record.terms}
    Sales Order # Tracking # INCO Terms
    ${record.otherrefnum} 123456789 INCO Terms



    #if>

    #list>

    #if>

    ${item.item@label} ${item.description@label} ${item.quantity@label} ${item.rate@label} ${item.amount@label}
    ${item.item} ${item.description} ${item.quantity} ${item.rate} ${item.amount}
    ${record.subtotal@label} ${record.subtotal}
    S & H $9,999.99
    ${record.taxtotal@label} (${record.taxrate}%) ${record.taxtotal}
    ${record.total@label} ${record.total}
    Amount Paid $0.00
    Total Due $9,999.99
    Due Date ${record.duedate}

    Thank you for your business!

    Billing Questions? Contact your Sales Rep: SALES REP NAME

    Phone: 800-696-7614 / Fax: 619-287-7001

    GOODS COVERED BY THIS INVOICE WERE PRODUCED ACCORDING TO THE CONDITIONS REQUIRED BY THE WAGE AND HOUR LAW AND THE FAIR LABOR
    STANDARDS ACT OF 1938, AS AMENDED



    This is a cached copy. Click here to see the original post.

  • #1973

    david.smith

    You have an extra in your code.

    Code:

    ${item.item} ${item.description} ${item.quantity} ${item.rate} ${item.amount}
  • #1974

    jprice

    I just tried it, here’s the updated code

    Code:

    9240 Mira Este Court
    San Diego, CA 92126
    United States

    Tel: (800) 696-7614 | Fax: (866) 587-9793

    Bill To:
    ${record.billaddress}

    of ${record@title}

    Customer #: 123456789 Date: ${record.trandate} Invoice #: #${record.tranid}

    Remit To:

    Flexible Assembly Systems Inc.
    9240 Mira Este Court
    San Diego, CA 92126

    Ship To:

    ${record.shipaddress}

    Sales Rep Customer PO # Ship Date Shipping Method ${record.terms@label}
    ${record.salesrep} 123456789 02/30/2016 ${record.shipmethod} ${record.terms}
    Sales Order # Tracking # INCO Terms
    ${record.otherrefnum} 123456789 INCO Terms

    pdf, body, * {
    font-family: arial, verdana, tahoma, tahunga;
    font-size: 8pt;
    }

    body { padding: 0.5in; }
    div.topheader { width: 100%; }
    div.topheader table { width: 100%; }
    div.topheader table td { width: 50%; padding: 10px; vertical-align: top; }
    div.topheader table td img { margin: -10px 0; position: relative; left: -25px; height: 60px; float: left; }

    h1.right { display: block; font-size: 36px; width: 100%; text-align: right; border-bottom: 1px solid #000; }
    h1.right span.page { font-size: 12px; font-weight: normal; float: left; clear: left; margin-top: 20px; }

    table.custinfo { width: 100%; padding: 0; margin: 5px 0; }
    table.custinfo td { text-align: center; width: 32%!important; border: 1px solid #000; border-right: none; }
    table.custinfo td.bright { border-right: 1px solid #000; }
    table.custinfo td b { display: block; border-bottom: 1px solid #000; margin-bottom: 10px;}
    table.custinfo tr.remit { display: block; width: 100%; }

    table.remit, table.ship { border: 1px solid #000; margin: 5px 0; }
    table.remit td p b, table.ship td p b { display: block; border-bottom: 1px solid #ccc; }

    table.firsttable { border-bottom: 2px solid #000; }

    table.breakdown { width: 100%; text-align: center; margin: 30px 0; }
    table.breakdown th { background: #000; color: #fff; padding: 10px 0; }
    table.breakdown td { width: 20%!important; border: 1px solid #000; border-right: none; }
    table.breakdown td.bright { border-right: 1px solid #000; }

    table.itmdetails { width: 100%; text-align: center; margin: 30px 0; border: 1px solid #000; }
    table.itmdetails th { background: #000; color: #fff; padding: 10px 0; }
    table.itmdetails td.qty { width: 10px; }
    table.itmdetails tbody td { padding: 2px; border-bottom: 1px solid #000; }
    table.itmdetails tbody tr:nth-child(even) { background: #eee; }

    table.itmdetails tfoot td { border-bottom: 1px solid #000; border-bottom: none; text-align: right; padding: 5px 0; }
    table.itmdetails tfoot td.label { text-align: left; border-left: 1px solid #000; border-bottom: 1px solid #000; }
    table.itmdetails tfoot td.color { background: #ddd; }
    table.itmdetails tfoot td.price { text-align: center; border-bottom: 1px solid #000; }
    table.itmdetails tfoot td.nobottom { border-bottom: none; }

    div.thanks { text-align: center; }
    div.amend p { text-transform: lowercase; text-align: center; color: #555; }

    ${item.item@label} ${item.description@label} ${item.quantity@label} ${item.rate@label} ${item.amount@label}
    ${item.item} ${item.description} ${item.quantity} ${item.rate} ${item.amount}
    ${record.subtotal@label} ${record.subtotal}
    S & H $9,999.99
    ${record.taxtotal@label} (${record.taxrate}%) ${record.taxtotal}
    ${record.total@label} ${record.total}
    Amount Paid $0.00
    Total Due $9,999.99
    Due Date ${record.duedate}

    Thank you for your business!

    Billing Questions? Contact your Sales Rep: SALES REP NAME

    Phone: 800-696-7614 / Fax: 619-287-7001

    GOODS COVERED BY THIS INVOICE WERE PRODUCED ACCORDING TO THE CONDITIONS REQUIRED BY THE WAGE AND HOUR LAW AND THE FAIR LABOR
    STANDARDS ACT OF 1938, AS AMENDED

    Now when I view the code I get an error: An unexpected error has occurred. Please click here to notify support and provide your contact information.

You must be logged in to reply to this topic.