This topic contains 1 reply, has 0 voices, and was last updated by jordan.pes 7 years, 11 months ago.

  • Author
    Posts
  • #1919

    jordan.pes

    Hi all,

    I;m currently working on an advanced pdf for customer statements, the goal is to group some of the statement lines together on a single line using a custom field that exists on the invoice record. The code is provided below.

    #if>

    #if>

    #function>

    #if>

    #function>

    #if>

    #function>

    #if>

    #if>
    ${record.billaddress@label}
    ${record.billaddress} ${record@title} Date ${record.trandate}

    ${record.amountDue@label}
    ${record.amountDue}

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #if>

    #list>

    ${record.lines.datecol@label} Invoice # ${record.lines.charge@label} ${record.lines.payment@label} ${record.lines.balance@label}
    ${dateCol} ${prevGrpName} ${toCurrency(transCharge)} ${toCurrency(transPayment)} ${toCurrency(transBalance)}
    ${dateCol} ${transGrpName} ${toCurrency(transCharge)} ${toCurrency(transPayment)} ${toCurrency(transBalance)}

    (i cut off the remaining code to save space in this post)

    This advanced pdf is able to perform most of this functionality (e.g. the ‘transBalance’ variable is grouping together successfully) however i am experiencing issues when writing the ‘lline.charge’ and ‘line.payment’ values to the form. I have tried using the same code as i have used for transBalance but unfortunately it results in error. This is because the ‘line.charge’ and l’ine.payment’ values include blank/empty values whereas balance does not.

    i need to try to test for whether ‘line.charge’ is blank, and if so assign my ‘transchargeTemp’ variable to 0, otherwise store the actual line.charge value.bu t for some reason it appears to be very difficult to test for the line.charge value being empty.

    I have tried several approaches including the one in my code above,including but not limited to:

    #if>

    AND

    #if>

    Unfortunately both these always assign 0 as the transChargeTemp….

    Has anyone have any experience of dealing with this issue on customer statement advanced pdfs and having overcome it?

    thank you in advance, i hope my code can help some of you working on similar solutions in the future.

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

  • #1920

    jordan.pes

    Hi all,

    In the end i was able to resolve this issue.

    It stems from the fact that even when ‘line.charge’ and ‘line.payment’ appear to be blank they actually not, therefore when the ?number operation is run it is firing an error.

    I still don’t know what character these fields are assigned as ?trim didnt remove it. In the end the following code was able to resolve the error.

You must be logged in to reply to this topic.