Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PDF maker outputs variable name when empty
#3
Hi Omar,

Well this sounds viable, but the behaviour used to be different, and this 'old' behaviour is what we need. When you create say a quote and you want to offer a product and the time needed to install that product on site, you need to be able to quote both products and services on one quote.

Keep in mind this used to work, and I have not changed my PDF maker version or anything in the PDF templates. I just updated coreBOS.

In the old behaviour, maybe the variable name for products would not exist on a line for a service, but that would result in a service description and leave the product variables blank. This way I could list products and services in one quote. Now I cannot, because any service would have the product variable name and vice versa. In the mixed dropdown, I can only choose the description, not the names. And I can't use any custom fields for products this way (we use a custom field for the brand name).

EDIT
Yes we are using the variables between the productblocks, as I said these templates used to work fine and nothing has changed in them. I've been using PDF maker for years and built all templates myself.

Let me be more specific about my problem by posting an example from one of my templates:

Code:
<div>#PRODUCTBLOC_START#</div>

<table align="left" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse; font-family:arial; font-size:10pt; width:100%">
    <tbody>
        <tr>
            <td style="text-align:left; vertical-align:top; width:35%">
            <p><strong>$PRODUCTS_CF_543$ $PRODUCTS_PRODUCTNAME$</strong></p>

            <p><span style="font-size:10px"><span style="font-family:arial,helvetica,sans-serif">$PRODUCTS_DESCRIPTION$</span></span></p>

            <p><strong>$SERVICES_SERVICENAME$</strong></p>

            <p><span style="font-family:verdana; font-size:x-small">$SERVICES_DESCRIPTION$</span></p>
            </td>
            <td style="width:30%">$PRODUCTS_IMAGENAME$</td>
            <td style="text-align:center; width:10%">$PRODUCTQUANTITY$ Stuk(s)</td>
            <td style="text-align:right; width:25%">
            <table border="0" cellpadding="0" cellspacing="0" style="font-size:12px; width:100%" summary="">
                <tbody>
                    <tr>
                        <td style="height:25px; width:50%">Bruto:</td>
                        <td style="width:10%">$CURRENCYSYMBOL$</td>
                        <td style="text-align:right; width:40%">$PRODUCTTOTAL$</td>
                    </tr>
                    <tr>
                        <td style="height:25px; width:50%">Korting:</td>
                        <td style="width:10%">$CURRENCYSYMBOL$</td>
                        <td style="text-align:right; width:40%">$PRODUCTDISCOUNT$</td>
                    </tr>
                    <tr>
                        <td style="height:25px; width:50%"><strong>Netto:</strong></td>
                        <td style="text-align:right; width:10%"><strong>$CURRENCYSYMBOL$</strong></td>
                        <td style="text-align:right; width:40%"><strong>$PRODUCTSTOTALAFTERDISCOUNT$</strong></td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>

<hr />
<div>#PRODUCTBLOC_END#</div>

In the above (note that I wrapped the productblocs in DIV's because else the WYSIWYG editor will wrap them in P tags that create unwanted line spaces) example look at the first table cell.

It starts with the Product brand name (The customfield 543) and the product name. Next line is the product description. After that the same for services, in the same table cell. Now in the old behaviour, let's say we are quoting a product. There will be nothing for service name and service description. The template would output the product brand name, product name and product description and leave the service part blank because there was no service.

The other way around also worked. When the template would reach a service, the product stuff would be left blank and the line would output as if there were no product variables in place. This way, the template would be flexible and would self-decide, no matter what was thrown at it.

In the new behaviour, let's say we have a product quoted, this would work fine but also the variable names for services would be printed, as in the attached image from post 1.

This also poses a problem for the image tag. If we output a template that has multiple products, some of which have no image, or no image was chosen when generating the PDF, the template will output the variable name "$PRODUCTS_IMAGENAME$" in stead of just leaving the table cell empty.

I hope this clears up what I mean.
Reply


Messages In This Thread
RE: PDF maker outputs variable name when empty - Guido1982 - 11-09-2015, 11:06 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)