Automatically getting biller.name and biller.email into invoice
  • richardrichard February 2009

    I had installed the paid modification that seesaw has splendidly outlined for us all - should be a main feature in my humble opinion :)

    I was just wanting the template to automatically grab the Name & Email address from the biller record, without it having to be hardcoded. Make it more of a true template.

    Here is the original code :-
    {if $invoice.owing == 0.00 }--- paid with thanks ---

    {else}

    align="center" style="font-family: arial; font-size: 11pt; color: blue">Please make cheques payable to
    align="center" style="font-family: arial; font-size: 12pt; color: red">Your Name

    colspan=6>



    Code worked great, but when I tried to put the biller name in - it still worked. Changed the Paypal link to AUD and AU where it mattered, still working !

    So I thought I would try inserting the biller email directly in the correct spot, but no matter how I formatted it, would either bomb out the page, or just insert the fieldname as text. Examining the code a little more, I realised the {php} and {/php} tags may have been causing my issues - not that I really understand PHP at all, I can program BASIC lol

    I set about removing the tags and converting the field names slighty so each field was a bit of php, instead of trying to format the field inside php in-line code.

    Here is my modified code :-

    {if $invoice.owing == 0.00 }--- paid with thanks ---

    {else}
    align="center" style="font-family: arial; font-size: 11pt; color: blue">Please make cheques payable to
    align="center" style="font-family: arial; font-size: 12pt; color: red">{$biller.name}

    colspan=6>
    Secure Online Payment via PayPal



    image





    I really do like SimpleInvoices, so I am trying to help out where I can :)

  • seesawseesaw February 2009

    Hi Richard

    Thanks for the comments - glad someone else is using it...

    This should do it


    {php} print '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$biller[email].'&item_name='.$customer[name].' -

    Invoice No: ' . $invoice[id].'&amount='.$ppamount.'&no_shipping=0&no_note=1&currency_code=GBP&lc=GB&bn=PP%2dBuyNowBF&charset=UTF%2d8"

    target="_blank"><img src="http://www.it-repairs.com/pppay.gif" border=0></a>'; {/php}


    You may also need to update the following at the start of your template
    after
    global $customer;
    add
    global $biller;

    Chris

  • richardrichard February 2009

    Chris

    That is how I tried to do it the first time. But would get a strange syntax error.

    With the php removed and just the variables in place like I did, works a treat.

    Regards
    Richard

  • seesawseesaw February 2009

    The above code works fine for me, have you tried copying it all and pasting to replace your whole section?

    Does your current workaround work from PDF?

    Did you add the global $biller;

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories