CartThrob Invoice Version 1.013

CartThrob invoice makes it possible to create and send invoices for payment directly from the backend of your EE installation. When you send invoices to customers, they simply click the "pay now" link and the invoice is added directly to their cart. No additional template set up is required. Paid invoices are marked as "paid" in the backend. You can also send updates, cancellations, and reminders for payment. You can filter by invoice status, view paid and created dates, related member and order ids, hours and costs. Each invoice includes line items, overall cost, hours, notes, customer address information and ability to assign an additional reference number (to simplify reference to other third party systems.)

Features

  • Create and send invoices from the backend
  • Includes sample email templates with easy installation
  • Works with guests and members alike
  • Easy setup. No channels required
  • Allows you to create line items, add customer information, notes and more

Requirements

  • ExpressionEngine 2.5+
  • CartThrob 2.2+
  • PHP 5.3+

Installation

  • Upload the /system/expressionengine/third_party/cartthrob_invoice/ folder to /system/expressionengine/third_party/
  • Make sure Extensions are enabled on your system
  • Install the CartThrob Invoice module and extension (through EE's add-ons/modules panel)

Upgrading

  • Upload the /system/expressionengine/third_party/cartthrob_invoice/ folder to /system/expressionengine/third_party/ Overwriting existing files.
  • Go to [EE] settings » addons » and click "Run Module Updates"

Tags

invoice

Outputs invoice information.

Variables

inv_description

Invoice description as set in the backend entry for this invoice

inv_date

Date the invoice was created

{inv_date format="%M %d, %Y"}

inv_paid_date

Date the invoice was paid

{inv_paid_date format="%M %d, %Y"}

inv_status

Status of the invoice

invoice_number

Id of the invoice. You can also use {invoice_id}

inv_total_hours

Total hours for the invoice

inv_cost

Cost of the invoice. This is not a total of the line items in the invoice, but a total for the overall invoice as set in the backend entry for this invoice. It may be that you've assigned a different cost for the overall invoice than the cost of each line item totaled together.

inv_first_name

inv_last_name

inv_address

inv_address2

inv_city

inv_state

inv_zip

inv_country_code

inv_email_address

inv_phone

inv_order_id

Order id related to this invoice if it's been paid (or assigned manually)

inv_member_id

If the invoice has been purchased, this is the member id related to this purchase (it can also be assigned manually)

inv_company

inv_title

Name of the invoice/project

inv_reference_number

Reference number / link. Basically this is a free textfield. It's useful if you send invoices related to payments against a third party website, help center, or other system that needs to be referenced.

Parameters
invoice_number

Invoice ID number you wish to display. Either use a hard coded ID, or use {invoice_id}. The variable {invoice_id} is automatically filled when templates are sent from the backend. For testing purposes, use a hard coded invoice ID.

Example
{exp:cartthrob:invoice invoice_number = "{invoice_number}"}

    Project {inv_title}
    ID {invoice_number}
    Invoice Cost {inv_cost}

    {if inv_total_hours}
    Total Hours {inv_total_hours} 
    {/if}

    {inv_first_name} {inv_last_name}<br>
    {inv_address}<br>
    {if inv_address2}{inv_address2}<br>{/if}
    {inv_city}, {inv_state} {inv_zip}<br>
    {if inv_country_code}{inv_country_code}<br>{/if}
    {inv_email_address}<br>
    {inv_phone}

{/exp:cartthrob:invoice}

invoice_items

Line items associated with an invoice.

Variables

item_title

item_description

hours

item_cost

invoice_count

Row number for this line item.

invoice_total_results

Total number of line items

Parameters
invoice_number

Invoice ID number containing the line items you wish to display.

Example
{exp:cartthrob:invoice_items invoice_number = "{invoice_number}"}
        <tr>
            <td><span style="font-size:12px;">{item_title}</span></td>
            <td align="left"><span style="font-size:12px;">{item_description}</span></td>
            <td align="right"><span style="font-size:12px;">{hours}</span></td>
            <td align="right"><span style="font-size:12px;">{item_cost}</span></td>
        </tr>
{/exp:cartthrob:invoice_items}

purchase_invoice_form

Outputs a form that can be used to purchase an invoice (to add it to the customer's cart).

Parameters
invoice_number

Invoice ID number of the invoice that should be added to the cart.

Example
{exp:cartthrob:purchase_invoice_form invoice_number="{invoice_number}"}
    <h3>Add Invoice to Cart</h3>
    <input type="submit" value="Add" />

{/exp:cartthrob:purchase_invoice_form}

Outputs a link that can be used to add an invoice (to add it to the customer's cart).

Parameters
invoice_number

Invoice ID number of the invoice that should be added to the cart.

Example
<a href='{exp:cartthrob:purchase_invoice_link invoice_number="{invoice_number}" return="store/view_cart"}'>Add Invoice to Cart</a>