People assigned to companies

Vikk Shayen Wong's Avatar

Vikk Shayen Wong

15 Jan, 2014 05:22 PM

Hi there,

I am needing to invoice a person (lets call him Tom from the finance department) from Company X in the invoice.
Right now under contacts I have a company called CompanyX at an address: 123 Big loop Rd.
Under CompanyX I have Tom assigned as one of the people and he only has an email field filled out.
Tom works in the finance department and I need to direct the invoice to him so I need to show:

Invoice Prepared For
Tom Ginsberg
Finance Department
Company X
123 Big Loop Rd
[email blocked]

In the Invoice I have set the Client as " Tom Ginsberg" instead of "Company X" since it is addressed to him.
How do I pull the company information Tom is assigned to?
Tom Ginsberg --> client.name
Finance Department --> invoice.client.custom1
Company X --> Company Name (HAVE TROUBLE WITH THIS)
123 Big Loop Rd --> Company Address (HAVE TROUBLE WITH THIS)
[email blocked] --> client.email

I have tried a few variations to no avail. Any assistance would be appreciated.

  1. 1 Posted by Vikk Shayen Won... on 15 Jan, 2014 05:28 PM

    Vikk Shayen Wong's Avatar

    Having Trouble with pulling Tom's email as well by the way

  2. Support Staff 2 Posted by Seth B on 15 Jan, 2014 06:34 PM

    Seth B's Avatar

    Vikk,

    Your easiest bet would be to modify the text inside the invoice's "address"
    field while editing the invoice itself. This way you wouldn't have to mess
    with templating and variables at all.

    However, if you want to do this at the template level (and it seems you
    do), you'd need a lot more modifications. Keep in mind that these
    modifications would apply to ALL INVOICES in your system, and would format
    the address the same way for each of them.

    I'd recommend option 1, simply for the ease of use, but if you want to go
    with option 2 let me know and I'll type out an explanation.

  3. 3 Posted by Vikk Shayen Won... on 16 Jan, 2014 08:12 AM

    Vikk Shayen Wong's Avatar

    Hi Seth,

    Having to manual add the address every time is not something I want to do.
    Happy to have them apply to all invoices.
    At this stage I have figured out everything else apart from the 2 items. I
    have a person linked to a company but as I am invoicing to that person in
    the company I have to add their Company name and also company address to
    the invoice.

    Thanks Seth.

    Cheers,

    Vikk

  4. Support Staff 4 Posted by Seth B on 16 Jan, 2014 08:36 PM

    Seth B's Avatar

    Vikk,

    There's a couple of issues here.

    The first is that if you issue an invoice to a company, you can't access who the invoice is generated for when sending. This would prevent you from referencing specific people within that company in the "address" block.

    The second issue, is that by default our templates use the variable "invoice.address", which is auto-generated by the system using the defaults that most of our customers want.

    To get around this you'll have to use the system in a smart way and also modify your templates somewhat.

    Using the system in a smart manner

    If you must include "invoice prepared for X" for a company, you'll need to do the following:

    • Assign that invoice to a company, not a person
    • Use one of the "custom" fields to place that person's name on the company
    • Modify your invoice template to use a special "include" that shows the client's address how you want it.

    Modifying your invoice template

    You'll need to modify your invoice template, and remove the bit that says...

    {{ invoice.address | format_text }}
    

    ...instead replacing it with:

    {{ include 'client' for invoice.client }}
    

    Then, modify the 'client' template, replacing everything within with the following:

    Invoice Prepared For<br/>
    {{ client.custom_1 }}<br/>
    {{ client.custom_2 }}<br/>
    <b>{{ client.name }}</b><br/>
    {% if client.address != blank %}
      {{ client.address }}<br/>
    {% endif %}
    {% if client.address2 != blank %}
      {{ client.address2 }}<br/>
    {% endif %}
    
    {% if client.city != blank || client.state != blank || client.zip != blank %}
      {{ client.city }}{% if client.state != blank || client.zip != blank %},{% endif %} {{ client.state }} {{ client.zip }}<br/>
    {% endif %}
    
    {% if client.country_name %}
      {{ client.country_name }}
    {% endif %}
    

    This assumes you're storing your contact's name in custom_1, and "finance department" in custom_2.

    Keep in mind that this would print out the same for ALL your invoices, regardless of who you are sending it to. You can get around this by creating additional invoice templates, as you've done with html_invoice_2, 3, etc.

    I know that's a bit convoluted, but hopefully it sheds some light into the process. Let me know if you need further clarification.

  5. 5 Posted by Vikk Shayen Won... on 19 Jan, 2014 06:06 AM

    Vikk Shayen Wong's Avatar

    Hi Seth,

    Thanks for taking the time to help with the code. It seems that I have
    assumed that fact that you can assign companies to people meant that we
    could pull that information in the template when invoicing the individual.
    Perhaps this could be my suggestion for the suggestion box!

    On another issue which I couldn't fix was that I couldn't get the logo to
    show up in the PDFed
    invoice.

    This is the code I have for it:

    <div class="right_aligned">
    <div style="padding 10px;" class="subheader">
      <img src="{{
    'https://vikk.cashboardapp.com/system/account/21315/header_image/vikkshayen-logo-design4.png'<http://bl-1.com/click/load/BDIKP1YxVGZQMVI3BjA-b0231>|
    image_path }}" width="80" />
      </div>
    </div>
    

    Using <img src="{{ 'vikkshayen-logo-design4.png' | image_path }}" width="80" /> didn't work. Am I doing something wrong? I've added a screen
    shot as well.

    Thanks Seth.

    Cheers,

    Vikk

  6. Support Staff 6 Posted by Seth B on 19 Jan, 2014 06:52 AM

    Seth B's Avatar

    Thanks for taking the time to help with the code. It seems that I have assumed that fact that you can assign companies to people meant that we could pull that information in the template when invoicing the individual. Perhaps this could be my suggestion for the suggestion box!

    There are some technical issues here that I won't go into which prevent that from happening currently. We haven't had enough requests to solve that particular problem yet, but I understand where you're coming from.

    On another issue which I couldn't fix was that I couldn't get the logo to show up in the PDFed invoice.

    The issue here is again (a stupid) technical problem which we need to solve. For the PDF process to work properly, we have to have the images local on our server. This is the reason we have you upload em.

    I went ahead and uploaded / linked your PNG file, so you should be good to go.

    My apologies for the rough edges. The templating features need a lot of work and will get some of these things smoothed down fairly soon.

    In particular, uploading a logo needs to be way more simple, and we will soon have a variety of pre-planned templates that people can choose from.

    Have a good weekend,

    • Seth
  7. 7 Posted by Vikk Shayen Won... on 19 Jan, 2014 07:06 AM

    Vikk Shayen Wong's Avatar

    Hi Seth,

    Thanks for the reply, when you said "I went ahead and uploaded / linked
    your PNG file, so you should be good to go." does that mean that <img
    src="{{ 'vikkshayen-logo-design4.png' | image_path }}" width="80" /> will
    be the code and that it would work when printing PDFs? (It currently
    doesn't work btw).

    I moved to Cashboard from quoterobot - I loved their invoice and proposal /
    estimate templates and system because you could add cover pages, timelines
    and additional pages etc . But unfortunately the software was too buggy to
    continue using and stuff just didn't work and didn't get fixed. Cashboard
    has so much potential I do hope that you'd be able to get some of the
    technical quirks smoothed out!

  8. Support Staff 8 Posted by Seth B on 19 Jan, 2014 08:25 AM

    Seth B's Avatar

    No, that's not the right code. Look at the "html_invoice" document I edited. It has the correct code.

    Cashboard is continually a work in progress, and we're always trying to improve it. Thanks for the support and your comments.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac