- @if($account && !$account->isPaid())
+ @if($passed_account && !$passed_account->isPaid())
- @elseif(isset($company) && !is_null($company))
+ @elseif(isset($passed_company) && !is_null($passed_company))
diff --git a/resources/views/portal/ninja2020/invoices/includes/terms.blade.php b/resources/views/portal/ninja2020/invoices/includes/terms.blade.php
index c66af59f992c..1757f0389cbf 100644
--- a/resources/views/portal/ninja2020/invoices/includes/terms.blade.php
+++ b/resources/views/portal/ninja2020/invoices/includes/terms.blade.php
@@ -14,7 +14,7 @@
{{ $entity_type }} {{ $entity->number }}:
@if($variables && $entity->terms)
-
parseHtmlVariables('terms', $variables) !!}
+
{!! $entity->parseHtmlVariables('terms', $variables) !!}
@elseif($entity->terms)
{!! $entity->terms !!}
@else
diff --git a/resources/views/templates/delivery_notes/td12.html b/resources/views/templates/delivery_notes/td12.html
new file mode 100644
index 000000000000..92058f24ad36
--- /dev/null
+++ b/resources/views/templates/delivery_notes/td12.html
@@ -0,0 +1,219 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Delivery Note |
+ {{ img('$company.logo') }} |
+
+
+
+
+
+
+
+
+
+
+
+ $client.shipping_address
+
+
+ |
+
+
+
+
+
+
+ $client.shipping_address
+
+
+ |
+
+
+
+
+
+
+
+ Order # $invoice.po_number
+
+ |
+
+
+ Order Date: $invoice.date
+
+ |
+
+
+
+
+ {% set invoice = invoices|first %}
+
+
+
+ {% for item in invoice.line_items|filter(item => item.type_id == 1) %}
+
+ {{ item.product_key }} |
+ {{ item.notes }} |
+ {{ item.quantity }} |
+ {{ item.quantity }} |
+ {{ item.quantity - item.quantity }} |
+
+ {% endfor %}
+
+
+
+
+
+
+
Notes:
+
+ $invoice.public_notes
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/delivery_notes/td4.html b/resources/views/templates/delivery_notes/td4.html
new file mode 100644
index 000000000000..8470cddf0c20
--- /dev/null
+++ b/resources/views/templates/delivery_notes/td4.html
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $delivery_note_label |
+  |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $order_number_label #
+
+ {%set invoice = invoices|first|e %}
+ {% if invoice.po_number %} {{
+ invoice.po_number }} {% else %} {{ invoice.number}} {% endif %}
+
+ $date_label
+ $invoice.date
+ $client_label #
+ $client.number
+
+
+
+
+ |
+
+
+
+
+ {% set invoice = invoices|first %}
+
+
+
+ {% for item in invoice.line_items|filter(item => item.type_id == 1) %}
+
+ {{ item.product_key }} |
+ {{ item.notes }} |
+ {{ item.quantity }} |
+
+
+ {% endfor %}
+
+
+
+
+
+
+
$notes_label:
+
+ $invoice.public_notes
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/delivery_notes/td5.html b/resources/views/templates/delivery_notes/td5.html
new file mode 100644
index 000000000000..54a168d3e2a3
--- /dev/null
+++ b/resources/views/templates/delivery_notes/td5.html
@@ -0,0 +1,267 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $delivery_note_label |
+  |
+
+
+
+
+
+
+
+
+ |
+
+
+ $date_label: $invoice.date
+
+ |
+
+
+
+
+ {% set invoice = invoices|first %}
+
+
+
+ {% for item in invoice.line_items|filter(item => item.type_id == 1) %}
+
+ {{ item.product_key }} |
+ {{ item.notes }} |
+ {{ item.quantity }} |
+
+
+ {% endfor %}
+
+
+
+
+
+
+ $notes_label:
+ $invoice.public_notes
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/payments/tp6.html b/resources/views/templates/payments/tp6.html
new file mode 100644
index 000000000000..0c762d869bb5
--- /dev/null
+++ b/resources/views/templates/payments/tp6.html
@@ -0,0 +1,444 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ $receipt_label $from_label $company.name
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ $receipt_label #$number
+ |
+
+ |
+
+
+
+ {%set payment = payments|first %}
+ {%if payment.transaction_reference %}
+
+
+ |
+
+ Reference: {{ payment.transaction_reference }}
+ |
+
+ |
+
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ $amount_paid_label
+ |
+
+
+
+ $amount
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+
+ $date_label
+ |
+
+
+
+ $payment.date
+ |
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+ $method_label
+ |
+
+
+
+
+
+ {% set payment = payments|first %}
+ {% if payment %}
+ {{ payment.method }}
+ {% endif %}
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+
+ Summary
+ |
+
+ |
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+ {% set totalPrice = 0 %}
+ {% for payment in payments %}
+ {% for pivot in payment.paymentables|filter(pivot =>
+ pivot.is_credit == '0') %}
+
+
+ {{ pivot.date }}
+ |
+
+ |
+
+ |
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+ $invoice_label #{{ pivot.invoice }}
+
+
+
+
+ |
+
+ |
+
+ {{ pivot.amount }}
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+ {% set totalPrice = totalPrice + pivot.amount_raw %}
+
+ {% endfor %}
+ {% endfor %}
+
+
+
+ |
+
+
+
+ $amount_paid_label
+ |
+
+ |
+
+
+ ${{ totalPrice|number_format(2, '.', ',') }}
+ |
+
+ |
+
+
+ |
+
+
+
+ |
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/payments/tp7.html b/resources/views/templates/payments/tp7.html
new file mode 100644
index 000000000000..dfcc377401d8
--- /dev/null
+++ b/resources/views/templates/payments/tp7.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$receipt_label {%if payments|length ==
+ 1%}#$number{% endif %}
+
+
+
+
+
+
+
+
$to_label
+
$client.name
+
+ {% set payment = payments|first %}
+ {% if payment.client.vat_number %}
+ $vat_number_label: $vat_number
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
$number_label
+
$date_label
+
$method_label
+
$amount_label
+
+
+
+ {% if payments|e %}
+ {% for payment in payments %}
+
+
+
#{{ payment.number }}
+
+
+
+
+
+ {% endfor %}
+ {% endif %}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/payments/tr8.html b/resources/views/templates/payments/tr8.html
new file mode 100644
index 000000000000..acfacb995a20
--- /dev/null
+++ b/resources/views/templates/payments/tr8.html
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $refund_label {% if
+ payments|length == 1%}#$number {% endif %}
+
+
+
+
+
+
+
+
$to_label
+
$client.name
+
+ {% set payment = payments|first %}
+ {% if payment.client.vat_number %}
+ $vat_number_label: $vat_number
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+ {% if payments|e %}
+ {% set totalInvoices = 0 %}
+ {% set totalRefunds = 0 %}
+ {% for payment in payments %}
+ {% for pivot in payment.paymentables|filter((pivot) => (pivot.is_credit == '0'
+ and pivot.refunded_raw > 0)) %}
+
+
+
+
$invoice_label #{{ pivot.invoice }}
+
({{ pivot.amount }})
+
+
+
{{ pivot.refunded }}
+
($refund_label)
+
+
+
+
+
+
+
+ {% set totalInvoices = totalInvoices + pivot.amount_raw %}
+ {% set totalRefunds = totalRefunds + pivot.refunded_raw %}
+ {% endfor %}
+ {% endfor %}
+
+
+
+
+
{{ totalInvoices|format_currency(currency_code) }}
+
+
+
+
{{ totalRefunds|format_currency(currency_code) }}
+
+
+
+ {% endif %}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/payments/tr9.html b/resources/views/templates/payments/tr9.html
new file mode 100644
index 000000000000..2a77d0b38150
--- /dev/null
+++ b/resources/views/templates/payments/tr9.html
@@ -0,0 +1,528 @@
+
+
+
+
+
+
$refund_label #$number
+
+
+
+
+ {%set payment = payments|first %}
+ {%set pivot = payment.paymentables|filter(pivot => pivot.refunded_raw > 0)|first %}
+
+
+
+
+
+
+
+
+ $refund_label{{ pivot.refunded
+ }}
+ $date_label {{ pivot.updated_at }}
+ |
+
+
+
+
+
+
+
+
+ {{ img('$company.logo','') }}
+ |
+
+
+
+
+
+
+
+
+
+ $refund_label #$number
+ |
+
+
+
+
+ |
+
+
+
+
+
+ {%set payment = payments|first %}
+ {%if payment.transaction_reference %}
+
+
+
+
+ |
+
+ $reference_label: {{ payment.transaction_reference
+ }}
+ |
+
+ |
+
+
+
+ {% endif %}
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+ |
+
+
+
+
+
+ $refunded_label
+ |
+
+
+
+ {{ payment.refunded }}
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+
+ $refund_label $date_label
+ |
+
+
+
+ {{ payment.updated_at}}
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+
+ $method_label
+ |
+
+
+
+ {% if payment.method %}
+
+ {{ payment.method }}
+
+ {% else %}
+
+ -
+
+ {% endif %}
+ |
+
+
+
+ |
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+ {% set totalInvoices = 0 %}
+ {% set totalRefunds = 0 %}
+ {% for pivot in
+ payment.paymentables|filter((pivot) =>
+ (pivot.is_credit == '0'
+ and pivot.refunded_raw > 0)) %}
+
+
+ Invoice: #{{ pivot.invoice }}
+ ({{ pivot.amount }})
+ |
+
+ |
+
+ $refunded_label {{
+ pivot.refunded }}
+ |
+
+ {% set totalInvoices = totalInvoices +
+ pivot.amount_raw %}
+ {% set totalRefunds = totalRefunds +
+ pivot.refunded_raw %}
+ {% endfor %}
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ $total_label $invoices_label
+ |
+
+ |
+
+ {{
+ totalInvoices|format_currency(currency_code)
+ }}
+ |
+
+
+
+ |
+
+
+
+ $total_label $refunded_label
+ |
+
+ |
+
+ {{ payment.refunded }}
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ {% if payment.refund_activity %}
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+ History
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+ |
+
+ {% for activity in
+ payment.refund_activity %}
+
+
+ {{ activity }}
+ |
+
+ |
+
+
+ |
+
+ {% endfor %}
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
+ {% endif %}
+
+
+ |
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/projects/tp11.html b/resources/views/templates/projects/tp11.html
new file mode 100644
index 000000000000..757b22769e46
--- /dev/null
+++ b/resources/views/templates/projects/tp11.html
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+ {% if projects|e %}
+ {% for project in projects %}
+
+ {{ project.name }}
+ Due: {{ project.due_date }}
+ {{ project.current_hours }} / {{ project.budgeted_hours }}: (Hours / Budgeted Hours @ {{ project.task_rate }}) - Report generated on {{ "now"|date('Y-m-d') }}
+
+
+
+ Date |
+ Description |
+ Duration |
+
+
+
+ {% for task in project.tasks %}
+
+ {% for log in task.time_log%}
+
+
+ {{ log.start_date }} |
+
+
+
+ - {{ log.description }}
+ - {{ task.user.name }}
+
+
+
+ |
+ {{ log.duration|date('h:i:s')}} |
+
+ {% endfor %}
+ {% endfor %}
+
+
+ {% endfor %}
+ {% endif %}
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/samples/stacks.html b/resources/views/templates/samples/stacks.html
new file mode 100644
index 000000000000..354ec11f2cfa
--- /dev/null
+++ b/resources/views/templates/samples/stacks.html
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
Standard Invoice Ninja Blocks
+

+
+
+
+
+
+
+
+ {% set invoice = invoices|first %}
+ {% set total = 0 %}
+
+
+
+ Item |
+ Notes |
+ Cost |
+
+
+
+
+
+ {% for item in invoice.line_items|filter(item => item.type_id == 1) %}
+
+ {{ item.product_key }} |
+ {{ item.notes }} |
+ {{ item.cost_raw|format_currency('GBP') }} |
+
+ {% set total = total + item.cost_raw %}
+ {% endfor %}
+
+
+ |
+ Total |
+ {{ total|format_currency(currency_code) }} |
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/samples/table.html b/resources/views/templates/samples/table.html
new file mode 100644
index 000000000000..49af58b25fd0
--- /dev/null
+++ b/resources/views/templates/samples/table.html
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {% set invoice = invoices|first %}
+
+
+
+ {% for item in invoice.line_items|filter(item => item.type_id == 1) %}
+
+ {{ item.product_key }} |
+ {{ item.notes }} |
+ {{ item.quantity }} |
+ {{ item.quantity }} |
+
+ {% endfor %}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/samples/twig.html b/resources/views/templates/samples/twig.html
new file mode 100644
index 000000000000..05c896b9c94f
--- /dev/null
+++ b/resources/views/templates/samples/twig.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/templates/statements/ts1.html b/resources/views/templates/statements/ts1.html
new file mode 100644
index 000000000000..86e0992ac07c
--- /dev/null
+++ b/resources/views/templates/statements/ts1.html
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Statement
+
$start_date - $end_date
+
+
+
+ {% if invoices|e %}
+
+
Invoices
+
+
+
+ Invoice # |
+ Invoice Date |
+ Invoice Due Date |
+ Total |
+ Balance |
+
+
+
+ {% for invoice in invoices %}
+
+ {{ invoice.number }} |
+ {{ invoice.date }} |
+ {{ invoice.due_date }} |
+ {{ invoice.amount }} |
+ {{ invoice.balance }} |
+
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
+
+ {% if payments|e %}
+
+
Payments
+
+
+
+ Invoice # |
+ Payment Date |
+ Method |
+ Amount |
+
+
+
+ {% for payment in payments %}
+
+ {{ payment.number }} |
+ {{ payment.date }} |
+ {%if payment.is_credit %}
+ Credit {{ payment.number }} |
+ {%else%}
+ {{ payment.method }} |
+ {%endif%}
+ {{ payment.amount }} |
+
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
+
+ {% if credits|e %}
+
+
Credits
+
+
+
+ Credit # |
+ Credit Date |
+ Total |
+ Balance |
+
+
+
+ {% for credit in credits %}
+
+ {{ credit.number }} |
+ {{ credit.date }} |
+ {{ credit.amount }} |
+ {{ credit.balance }} |
+
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
+
+ {% if aging %}
+
+
Aging
+
+
+
+ {% for key, age in aging %}
+ {{ key }} |
+ {% endfor %}
+
+
+
+
+ {% for key, age in aging %}
+ {{ age }} |
+ {% endfor %}
+
+
+
+
+ {% endif %}
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/statements/ts2.html b/resources/views/templates/statements/ts2.html
new file mode 100644
index 000000000000..1ccbd455678e
--- /dev/null
+++ b/resources/views/templates/statements/ts2.html
@@ -0,0 +1,325 @@
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
$statement_label
+
$start_date - $end_date
+
+
+
+
+ {% if invoices|e %}
+
+
{{ t('invoices') }}
+
+
+
+ {{ t('invoice') }} # |
+ {{ t('invoice_date') }} |
+ {{ t('invoice_due_date') }} |
+ {{ t('total') }} |
+ {{ t('balance') }} |
+
+
+
+ {% for invoice in invoices %}
+
+ {{ invoice.number }} |
+ {{ invoice.date }} |
+ {{ invoice.due_date }} |
+ {{ invoice.amount }} |
+ {{ invoice.balance }} |
+
+ {% endfor %}
+
+ {% set sum_balance = invoices|sum('balance_raw') %}
+ {% if sum_balance > 0 %}
+
+ |
+ |
+ |
+ $balance_label |
+ {{ sum_balance|format_currency(currency_code) }} |
+
+ {% endif %}
+
+
+
+ {% endif %}
+
+
+
+ {% if invoices|e and show_payments %}
+
+
{{ t('payments') }}
+
+
+
+ {{ t('invoice') }} # |
+ {{ t('payment_date') }} |
+ |
+ {{ t('method') }} |
+ {{ t('amount') }} |
+
+
+
+ {% set net_refunds = 0 %}
+ {% set total_payments = 0%}
+ {% for invoice in invoices %}
+ {% if invoice.payments|e %}
+ {% set parent_payment = invoice.payments|first %}
+
+ {% for payment in invoice.payments %}
+ {% set currency_code = payment.currency %}
+
+ {% for pivot in payment.paymentables %}
+
+ {{ pivot.invoice }} |
+ {{ pivot.created_at }} |
+ |
+ {%if pivot.is_credit %}
+ $credit_label {{ pivot.number }} |
+ {%else%}
+ {{ payment.method }} |
+ {%endif%}
+ {{ pivot.amount }} |
+
+ {% if pivot.refunded_raw > 0 %}
+
+ {{ pivot.invoice }} |
+ {{ pivot.updated_at }} |
+ |
+ $refund_label |
+ ({{ pivot.refunded }}) |
+
+ {% set net_refunds = net_refunds + pivot.refunded_raw %}
+ {% endif %}
+ {% set total_payments = total_payments + pivot.amount_raw %}
+ {% endfor %}
+ {% endfor %}
+ {% endif %}
+ {% endfor %}
+
+ {{ currency_code }} |
+ |
+ |
+ $payments_label |
+ {{ total_payments|format_currency(currency_code) }} |
+
+
+ {% if net_refunds > 0 %}
+
+ |
+ |
+ |
+ $refunded_label |
+ ({{ net_refunds|format_currency(currency_code) }}) |
+
+
+ |
+ |
+ |
+ $net_label |
+ {{ (total_payments-net_refunds)|format_currency(currency_code) }} |
+
+ {% endif %}
+
+
+
+ {% endif %}
+
+
+
+ {% if credits|e and show_credits %}
+
+
{{ t('credits') }}
+
+
+
+ {{ t('credit') }} # |
+ {{ t('credit_date') }} |
+ {{ t('total') }} |
+ {{ t('balance') }} |
+
+
+
+ {% for credit in credits %}
+
+ {{ credit.number }} |
+ {{ credit.date }} |
+ {{ credit.amount }} |
+ {{ credit.balance }} |
+
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
+
+ {% if aging and show_aging %}
+
+
{{ t('aging') }}
+
+
+
+ {% for key, age in aging %}
+ {{ key }} |
+ {% endfor %}
+
+
+
+
+ {% for key, age in aging %}
+ {{ age }} |
+ {% endfor %}
+
+
+
+
+ {% endif %}
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/statements/ts3.html b/resources/views/templates/statements/ts3.html
new file mode 100644
index 000000000000..943e32418faf
--- /dev/null
+++ b/resources/views/templates/statements/ts3.html
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
$company.name
+
+
+

+
+
+
+
+
+
+
+
$start_date - $end_date
+
+
+
+
+
+ {% if invoices|e %}
+
+
+
+ $date_label |
+ $invoice_label # |
+ {{ t('charges') }} |
+ {{ t('credits') }} |
+ {{ t('line_total') }} |
+
+
+
+ {% set running_total = 0%}
+ {% for invoice in invoices %}
+
+ {{ invoice.date }} |
+ {{ invoice.number }} |
+ {{ invoice.amount }} |
+ {%set running_total = running_total + invoice.amount_raw %} |
+ {{ running_total|format_currency(currency_code) }} |
+
+ {% for payment in invoice.payments %}
+ {% for pivot in payment.paymentables %}
+
+ {{ invoice.date }} |
+ {{ invoice.number }} |
+ {%set running_total = running_total - pivot.amount_raw %} |
+ {{ pivot.amount }} |
+ {{ running_total|format_currency(currency_code) }} |
+
+ {% if pivot.refunded_raw > 0%}
+
+ {{ invoice.date }} |
+ {{ invoice.number }} $refund_label |
+ {%set running_total = running_total + pivot.refunded_raw %} |
+ ({{ pivot.refunded }}) |
+ {{ running_total|format_currency(currency_code) }} |
+
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
+
+ {% if aging and show_aging %}
+
+
+
+
+ {% for key, age in aging %}
+ {{ key }} |
+ {% endfor %}
+
+
+
+
+ {% for key, age in aging %}
+ {{ age }} |
+ {% endfor %}
+
+
+
+
+ {% endif %}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/templates/tasks/tt10.html b/resources/views/templates/tasks/tt10.html
new file mode 100644
index 000000000000..f4d8f99ac97f
--- /dev/null
+++ b/resources/views/templates/tasks/tt10.html
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+ {% if tasks %}
+
+
+
+ Date |
+ Description |
+ Duration |
+
+
+
+ {% for task in tasks %}
+ {% for log in task.time_log %}
+
+ {{ log.start_date }} |
+ {{ log.description }} |
+ {{ log.duration|date('H:i:s') }} |
+
+ {% endfor %}
+ {% endfor %}
+
+
+
+ {% endif %}
+
+
+
+
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index 4f60662b7e68..68878ac6869e 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -16,10 +16,7 @@ use App\Http\Controllers\UserController;
use App\Http\Controllers\WePayController;
use Illuminate\Support\Facades\Route;
-//Auth::routes(['password.reset' => false]);
-
Route::get('/', [BaseController::class, 'flutterRoute'])->middleware('guest');
-// Route::get('self-update', [SelfUpdateController::class, 'update'])->middleware('guest');
Route::get('setup', [SetupController::class, 'index'])->middleware('guest');
Route::post('setup', [SetupController::class, 'doSetup'])->middleware('guest');
@@ -37,15 +34,8 @@ Route::post('password/reset', [ResetPasswordController::class, 'reset'])->middle
Route::get('wepay/signup/{token}', [WePayController::class, 'signup'])->name('wepay.signup');
Route::get('wepay/finished', [WePayController::class, 'finished'])->name('wepay.finished');
-/*
- * Social authentication
- */
-
Route::get('auth/{provider}', [LoginController::class, 'redirectToProvider']);
-/*
- * Inbound routes requiring DB Lookup
- */
Route::middleware('url_db')->group(function () {
Route::get('/user/confirm/{confirmation_code}', [UserController::class, 'confirm']);
Route::post('/user/confirm/{confirmation_code}', [UserController::class, 'confirmWithPassword']);
diff --git a/tests/Feature/ProjectApiTest.php b/tests/Feature/ProjectApiTest.php
index 3f2b6a5ad797..11e38a57cc20 100644
--- a/tests/Feature/ProjectApiTest.php
+++ b/tests/Feature/ProjectApiTest.php
@@ -11,13 +11,16 @@
namespace Tests\Feature;
+use App\Models\Expense;
+use Tests\TestCase;
+use App\Models\Invoice;
+use App\Models\Quote;
+use Tests\MockAccountData;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Session;
use Illuminate\Validation\ValidationException;
-use Tests\MockAccountData;
-use Tests\TestCase;
+use Illuminate\Foundation\Testing\DatabaseTransactions;
/**
* @test
@@ -44,6 +47,65 @@ class ProjectApiTest extends TestCase
Model::reguard();
}
+ public function testProjectIncludesZeroCount()
+ {
+
+ $response = $this->withHeaders([
+ 'X-API-SECRET' => config('ninja.api_secret'),
+ 'X-API-TOKEN' => $this->token,
+ ])->putJson("/api/v1/projects/{$this->project->hashed_id}?include=expenses,invoices,quotes");
+
+ $response->assertStatus(200);
+
+ $arr = $response->json();
+
+ $this->assertEquals(0, count($arr['data']['invoices']));
+ $this->assertEquals(0, count($arr['data']['expenses']));
+ $this->assertEquals(0, count($arr['data']['quotes']));
+
+ }
+
+ public function testProjectIncludes()
+ {
+ $i = Invoice::factory()->create([
+ 'user_id' => $this->user->id,
+ 'company_id' => $this->company->id,
+ 'client_id' => $this->project->client_id,
+ 'project_id' => $this->project->id,
+ ]);
+
+
+ $e = Expense::factory()->create([
+ 'user_id' => $this->user->id,
+ 'company_id' => $this->company->id,
+ 'client_id' => $this->project->client_id,
+ 'project_id' => $this->project->id,
+ ]);
+
+
+ $q = Quote::factory()->create([
+ 'user_id' => $this->user->id,
+ 'company_id' => $this->company->id,
+ 'client_id' => $this->project->client_id,
+ 'project_id' => $this->project->id,
+ ]);
+
+
+ $response = $this->withHeaders([
+ 'X-API-SECRET' => config('ninja.api_secret'),
+ 'X-API-TOKEN' => $this->token,
+ ])->putJson("/api/v1/projects/{$this->project->hashed_id}?include=expenses,invoices,quotes");
+
+ $response->assertStatus(200);
+
+ $arr = $response->json();
+
+ $this->assertEquals(1, count($arr['data']['invoices']));
+ $this->assertEquals(1, count($arr['data']['expenses']));
+ $this->assertEquals(1, count($arr['data']['quotes']));
+
+ }
+
public function testProjectValidationForBudgetedHoursPut()
{
diff --git a/tests/Feature/PurchaseOrderTest.php b/tests/Feature/PurchaseOrderTest.php
index b855933fdae3..7b48a45c64e4 100644
--- a/tests/Feature/PurchaseOrderTest.php
+++ b/tests/Feature/PurchaseOrderTest.php
@@ -46,6 +46,24 @@ class PurchaseOrderTest extends TestCase
$this->makeTestData();
}
+ public function testExpensePurchaseOrderConversion()
+ {
+
+ $p = PurchaseOrder::factory()->create([
+ 'user_id' => $this->user->id,
+ 'company_id' => $this->company->id,
+ 'vendor_id' => $this->vendor->id,
+ 'project_id' => $this->project->id,
+ ]);
+
+ $expense = $p->service()->expense();
+
+ $this->assertEquals($expense->project_id, $this->project->id);
+ $this->assertEquals($expense->client_id, $p->project->client_id);
+
+ }
+
+
public function testPurchaseOrderHistory()
{
event(new PurchaseOrderWasUpdated($this->purchase_order, $this->company, Ninja::eventVars($this->company, $this->user)));