{% if invoice.isEstimate %} {{business.labels.CB_Estimate}} {% else %} {{business.labels.CB_Invoice}} {% /if %} {% if invoice.isPaid %}
{% /if %}
{% if invoice.isEstimate %}

{{ business.labels.CB_Estimate | capitalized }}

{% if invoice.sentDate %}

{{invoice.sentDateUsingFormatter.escapedForHTML}}

{% /if %} {% else %}

{{ business.labels.CB_Invoice | capitalized }}

{% if invoice.sentDate %}

{{invoice.sentDateUsingFormatter.escapedForHTML}}

{% else %}

{{business.labels.CB_NotYetSent}}

{% /if %} {% /if %}
{% if invoice.business.hasLogo %}

{{invoice.business.displayName}}

{% else %}

{{business.displayName.escapedForHTML}}

{% /if %}
{% if invoice.isEstimate %} {% else %}

{{ business.labels.CB_InvoiceNumber | capitalized }}: {{invoice.invoiceNumber.escapedForHTML}}

{% /if %} {% if invoice.message.length > 0 %}
{{invoice.messageAsHTML}}
{% /if %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% if invoice.shouldShowHourAndRateColumns == YES %} {% /if %} {% if invoice.shouldShowQuantityAndCountColumns == YES %} {% /if %} {% if invoice.allLineItemsAreTaxableForTaxesWeAreUsing == NO %} {% if invoice.usingTax1 %}{% /if %} {% if invoice.usingTax2 %}{% /if %} {% /if %} {% for lineItem in invoice.lineItemsOrderedByDateAndDescription %} {% if lineItem.isExpense == NO %} {% if invoice.shouldShowHourAndRateColumns == YES %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% if lineItem.costTypeIsTime == YES %} {% else %} {% /if %} {% else %} {% if invoice.shouldShowQuantityAndCountColumns == YES %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% if lineItem.costTypeIsProduct == YES %} {% else %} {% /if %} {% else %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% /if %} {% if invoice.allLineItemsAreTaxableForTaxesWeAreUsing == NO %} {% if invoice.usingTax1 %}{% /if %} {% if invoice.usingTax2 %}{% /if %} {% /if %} {% /if %} {% /for %}
{{business.labels.CB_Date}}{{business.labels.CB_Description}}{{business.labels.CB_Hours}} {{business.labels.CB_Rate}}{{business.labels.CB_Quantity}} {{business.labels.CB_UnitCost}}{{invoice.tax1Label.escapedForHTML}}{{invoice.tax2Label.escapedForHTML}}{{business.labels.CB_Cost}}
{{lineItem.datePerformedUsingFormatter}}{{lineItem.lineItemDescription.escapedForHTML}}{% if lineItem.noteAsHTML.length > 0 %}

{{lineItem.noteAsHTML}}{% /if %}
{{lineItem.timeAsHoursInDecimalFormat}} {{lineItem.hourlyRateUsingFormatter}}{{business.labels.CB_NA}} {{business.labels.CB_NA}}{{lineItem.datePerformedUsingFormatter}}{{lineItem.lineItemDescription.escapedForHTML}}{% if lineItem.noteAsHTML.length > 0 %}

{{lineItem.noteAsHTML}}{% /if %}
{{lineItem.quantityOfProductUsingFormatter}} {{lineItem.productCostUsingFormatter}}{{business.labels.CB_NA}} {{business.labels.CB_NA}}{{lineItem.datePerformedUsingFormatter}}{{lineItem.lineItemDescription.escapedForHTML}} {{lineItem.lineItemDescriptionExtras.escapedForHTML}} {% if lineItem.noteAsHTML.length > 0 %}

{{lineItem.noteAsHTML}} {% /if %} {% /if %}
{% if lineItem.taxableForTax1 %}✔{% else %} {% /if %}{% if lineItem.taxableForTax2 %}✔{% else %} {% /if %}{{lineItem.costUsingFormatter}}
{% comment %} If the invoice contains line items that are considered expenses we repeat the table code above to show them. Yes this is a bad (repeating code) but I can't think of an easy way around it just yet.{% /comment %} {% if invoice.containsExpenses %}

{{business.labels.CB_Expenses}}:

{% if invoice.shouldShowDateColumn == YES %} {% /if %} {% if invoice.shouldShowHourAndRateColumns == YES %} {% /if %} {% if invoice.shouldShowQuantityAndCountColumns == YES %} {% /if %} {% if invoice.allLineItemsAreTaxableForTaxesWeAreUsing == NO %} {% if invoice.usingTax1 %}{% /if %} {% if invoice.usingTax2 %}{% /if %} {% /if %} {% for lineItem in invoice.lineItemsOrderedByDateAndDescription %} {% if lineItem.isExpense == YES %} {% if invoice.shouldShowHourAndRateColumns == YES %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% if lineItem.costTypeIsTime == YES %} {% else %} {% /if %} {% else %} {% if invoice.shouldShowQuantityAndCountColumns == YES %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% if lineItem.costTypeIsProduct == YES %} {% else %} {% /if %} {% else %} {% if invoice.shouldShowDateColumn == YES %} {% /if %} {% /if %} {% if invoice.allLineItemsAreTaxableForTaxesWeAreUsing == NO %} {% if invoice.usingTax1 %}{% /if %} {% if invoice.usingTax2 %}{% /if %} {% /if %} {% /if %} {% /for %}
{{business.labels.CB_Date}}{{business.labels.CB_Description}}{{business.labels.CB_Hours}} {{business.labels.CB_Rate}}{{business.labels.CB_Quantity}} {{business.labels.CB_UnitCost}}{{invoice.tax1Label.escapedForHTML}}{{invoice.tax2Label.escapedForHTML}}{{business.labels.CB_Cost}}
{{lineItem.datePerformedUsingFormatter}}{{lineItem.lineItemDescription.escapedForHTML}}{% if lineItem.noteAsHTML.length > 0 %}

{{lineItem.noteAsHTML}}{% /if %}
{{lineItem.timeAsHoursInDecimalFormat}} {{lineItem.hourlyRateUsingFormatter}}{{business.labels.CB_NA}} {{business.labels.CB_NA}}{{lineItem.datePerformedUsingFormatter}}{{lineItem.lineItemDescription.escapedForHTML}}{% if lineItem.noteAsHTML.length > 0 %}

{{lineItem.noteAsHTML}}{% /if %}
{{lineItem.quantityOfProductUsingFormatter}} {{lineItem.productCostUsingFormatter}}{{business.labels.CB_NA}} {{business.labels.CB_NA}}{{lineItem.datePerformedUsingFormatter}}{{lineItem.lineItemDescription.escapedForHTML}} {{lineItem.lineItemDescriptionExtras.escapedForHTML}} {% if lineItem.noteAsHTML.length > 0 %}

{{lineItem.noteAsHTML}} {% /if %} {% /if %}
{% if lineItem.taxableForTax1 %}✔{% else %} {% /if %}{% if lineItem.taxableForTax2 %}✔{% else %} {% /if %}{{lineItem.costUsingFormatter}}

{{business.labels.CB_Totals}}:

{% /if %} {% if invoice.usingTax1 || invoice.usingTax2 %} {% /if %} {% if invoice.usingTax1 %} {% /if %} {% if invoice.usingTax2 %} {% /if %} {% if invoice.totalPaid > 0 %} {% /if %}
{{business.labels.CB_Subtotal}}: {{invoice.subtotalCostUsingFormatter}}
{{invoice.taxLabel1WithRate}}: {{invoice.tax1CostUsingFormatter}}
{{invoice.taxLabel2WithRate}}: {{invoice.tax2CostUsingFormatter}}
{{business.labels.CB_TotalCost}}: {{invoice.totalCostUsingFormatter}}
{{business.labels.CB_TotalPaid}}: {{invoice.totalPaidUsingFormatter}}
{{business.labels.CB_TotalDue}}: {{invoice.totalDueUsingFormatter}}
{% if invoice.isEstimate %} {% else %} {% if invoice.dueOnReceiptBoolValue %}
{{business.labels.CB_PaymentDueOnReceipt}}
{% else %}
{{business.labels.CB_PaymentDueBy}}: {{invoice.dueDateUsingFormatter}}
{% /if %} {% /if %}

 

{{business.labels.CB_InvoicedCustomer}}

{% if invoice.client.companyName.length > 0 %}{{invoice.client.companyName}}
{% /if %} {% if invoice.client.fullName.length > 0 %}{{invoice.client.fullName}}
{% /if %} {{invoice.client.mailingAddressAsHTML}} {{invoice.client.otherContactInfoAsHTML}}

{{business.labels.CB_MailPaymentTo}}

{% if business.companyName.length > 0 %}{{business.companyName}}
{% /if %} {% if business.fullName.length > 0 %}{{business.fullName}}
{% /if %} {{business.mailingAddressAsHTML}} {{business.otherContactInfoAsHTML}}