From 34aaf9aec7fe189f19f9be5b2a31fc91e4f6d603 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 27 Mar 2024 16:11:22 +1100 Subject: [PATCH 01/12] Updates --- app/Export/CSV/TaskExport.php | 4 +- app/Services/Template/TemplateService.php | 2 +- lang/fr_CA/texts.php | 2 + .../views/templates/delivery_notes/td12.html | 219 ++++++++ .../views/templates/delivery_notes/td4.html | 243 ++++++++ .../views/templates/delivery_notes/td5.html | 267 +++++++++ resources/views/templates/payments/tp6.html | 444 +++++++++++++++ resources/views/templates/payments/tp7.html | 166 ++++++ resources/views/templates/payments/tr8.html | 185 ++++++ resources/views/templates/payments/tr9.html | 528 ++++++++++++++++++ resources/views/templates/projects/tp11.html | 95 ++++ resources/views/templates/samples/stacks.html | 170 ++++++ resources/views/templates/samples/table.html | 90 +++ resources/views/templates/samples/twig.html | 13 + resources/views/templates/statements/ts1.html | 249 +++++++++ resources/views/templates/statements/ts2.html | 325 +++++++++++ resources/views/templates/statements/ts3.html | 288 ++++++++++ resources/views/templates/tasks/tt10.html | 72 +++ routes/web.php | 10 - 19 files changed, 3359 insertions(+), 13 deletions(-) create mode 100644 resources/views/templates/delivery_notes/td12.html create mode 100644 resources/views/templates/delivery_notes/td4.html create mode 100644 resources/views/templates/delivery_notes/td5.html create mode 100644 resources/views/templates/payments/tp6.html create mode 100644 resources/views/templates/payments/tp7.html create mode 100644 resources/views/templates/payments/tr8.html create mode 100644 resources/views/templates/payments/tr9.html create mode 100644 resources/views/templates/projects/tp11.html create mode 100644 resources/views/templates/samples/stacks.html create mode 100644 resources/views/templates/samples/table.html create mode 100644 resources/views/templates/samples/twig.html create mode 100644 resources/views/templates/statements/ts1.html create mode 100644 resources/views/templates/statements/ts2.html create mode 100644 resources/views/templates/statements/ts3.html create mode 100644 resources/views/templates/tasks/tt10.html diff --git a/app/Export/CSV/TaskExport.php b/app/Export/CSV/TaskExport.php index f4f677197887..452b806ffaaa 100644 --- a/app/Export/CSV/TaskExport.php +++ b/app/Export/CSV/TaskExport.php @@ -138,9 +138,9 @@ class TaskExport extends BaseExport { $entity = []; $transformed_entity = $this->entity_transformer->transform($task); -nlog($this->input['report_keys']); + foreach (array_values($this->input['report_keys']) as $key) { -nlog($key); + $parts = explode('.', $key); if (is_array($parts) && $parts[0] == 'task' && array_key_exists($parts[1], $transformed_entity)) { diff --git a/app/Services/Template/TemplateService.php b/app/Services/Template/TemplateService.php index d36e464efd89..4dcf064c63c6 100644 --- a/app/Services/Template/TemplateService.php +++ b/app/Services/Template/TemplateService.php @@ -271,7 +271,7 @@ class TemplateService { $this->data = $this->preProcessDataBlocks($data); - // nlog($this->data); + // nlog(json_encode($this->data)); return $this; } diff --git a/lang/fr_CA/texts.php b/lang/fr_CA/texts.php index def9b39677a1..303dcbd6a473 100644 --- a/lang/fr_CA/texts.php +++ b/lang/fr_CA/texts.php @@ -5265,6 +5265,8 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette 'enable_rappen_rounding_help' => 'Arrondir les totaux au 5 le plus proche', 'duration_words' => 'Durée en mots', 'upcoming_recurring_invoices' => 'Factures récurrentes à venir', + 'show_table_footer' => 'Afficher le pied du tableau', + 'show_table_footer_help' => 'Afficher les totaux dans le pied du tableau', 'total_invoices' => 'Total factures', ); 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') }}
+
+ + + + + + + +
+
+
+

Bill To:

+
+
+

$client.name

+
+
+

$client.shipping_address

+
+
+
+
+
+

Ship To:

+
+
+

$client.name

+
+
+

$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) %} + + + + + + + + {% endfor %} + +
Item #DescriptionQuantityDeliveredBackorder
{{ item.product_key }}{{ item.notes }}{{ item.quantity }}{{ item.quantity }}{{ item.quantity - item.quantity }}
+
+ + +
+

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
+ + + + + +
+
+ +
+
+

$to_label:

+
+
+
+ +
+
+

$ship_to_label:

+
+
+
+ + +
+
+

$details_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) %} + + + + + + + {% endfor %} + +
$item_label #$description_label$quantity_label
{{ item.product_key }}{{ item.notes }}{{ item.quantity }}
+
+ + +
+

$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
+ + + + + + + +
+
+
+

$to_label:

+
+
+
+
+
+
+

$ship_to_label:

+
+
+
+
+ + + + + +
+
+

# $invoice.po_number

+
+
+
+

$date_label: $invoice.date

+
+
+ + + {% set invoice = invoices|first %} + + + + + + + + + + + {% for item in invoice.line_items|filter(item => item.type_id == 1) %} + + + + + + + {% endfor %} + +
$item_label #$description_label$quantity_label
{{ item.product_key }}{{ item.notes }}{{ item.quantity }}
+
+ + +
+

$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 + +  
+ + + + + + + +
+  
+ + + + + + + +
+  
+ + + + + + + + + + + {%set payment = payments|first %} + {%if payment.transaction_reference %} + + + + + + {% endif %} + + + +
+   + $receipt_label #$number + +  
+   + Reference: {{ payment.transaction_reference }} + +  
+ + + + + + + +
+  
+ + + + + + + + + +
+   + + + + + + + + + + + +
+ + + + + + + + + +
+ $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') %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% set totalPrice = totalPrice + pivot.amount_raw %} + + {% endfor %} + {% endfor %} + + + + + + + + + + + + + +
+  
+  
+ {{ pivot.date }} + +   +  
+  
+  
+
+ $invoice_label #{{ pivot.invoice }} + + + +
+
+   + {{ pivot.amount }} +
+  
+  
+  
+  
+  
+ $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 }}

+
+
+

{{ payment.date }}

+
+
+

{{ payment.method }}

+
+
+

{{ payment.amount }}

+
+
+ {% endfor %} + {% endif %} +
+ +
+ +
+
+ +
+
+

$public_notes

+
+
+ + + + \ 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 %} + +
+
+

$invoices_label:

+
+
+

{{ totalInvoices|format_currency(currency_code) }}

+
+
+

$refund_label:

+
+
+

{{ totalRefunds|format_currency(currency_code) }}

+
+
+ + {% endif %} +
+ +
+ +
+
+ +
+
+

$public_notes

+
+
+ + + + \ 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)) %} + + + + + + {% set totalInvoices = totalInvoices + + pivot.amount_raw %} + {% set totalRefunds = totalRefunds + + pivot.refunded_raw %} + {% endfor %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Invoice: #{{ pivot.invoice }} + ({{ pivot.amount }}) + +   + $refunded_label {{ + pivot.refunded }} +
+  
+  
+  
+  
+ $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 %} + + + + + + {% endfor %} + + +
+ {{ activity }} + +   + +
+
+
 
+
+
 
+
+
+
+
 
+
+
 
+
+ {% 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') }}
+ + + + + + + + + + {% for task in project.tasks %} + + {% for log in task.time_log%} + + + + + + + {% endfor %} + {% endfor %} + +
DateDescriptionDuration
{{ log.start_date }} +
+
    +
  • {{ log.description }}
  • +
  • {{ task.user.name }}
  • +
+
+ +
{{ log.duration|date('h:i:s')}}
+ {% 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

+ +
+ +
+ +
+

Client Details

+
+
+ +
+

Company Details

+
+
+ +
+

Company Address

+
+
+ +
+ +
+ +
+

Vendor Details

+
+
+ +
+

Shipping Address

+
+
+ +
+ + + {% set invoice = invoices|first %} + {% set total = 0 %} + + + + + + + + + + + + {% for item in invoice.line_items|filter(item => item.type_id == 1) %} + + + + + + {% set total = total + item.cost_raw %} + {% endfor %} + + + + + + + +
ItemNotesCost
{{ item.product_key }}{{ item.notes }}{{ item.cost_raw|format_currency('GBP') }}
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) %} + + + + + + + {% endfor %} + +
Item #DescriptionQuantityDelivered
{{ item.product_key }}{{ item.notes }}{{ item.quantity }}{{ item.quantity }}
+
+ + + \ 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

+ + + + + + + + + + + + {% for invoice in invoices %} + + + + + + + + {% endfor %} + +
Invoice #Invoice DateInvoice Due DateTotalBalance
{{ invoice.number }}{{ invoice.date }}{{ invoice.due_date }}{{ invoice.amount }}{{ invoice.balance }}
+

+ {% endif %} +
+ + + {% if payments|e %} +
+

Payments

+ + + + + + + + + + + {% for payment in payments %} + + + + {%if payment.is_credit %} + + {%else%} + + {%endif%} + + + {% endfor %} + +
Invoice #Payment DateMethodAmount
{{ payment.number }}{{ payment.date }}Credit {{ payment.number }}{{ payment.method }}{{ payment.amount }}
+

+ {% endif %} +
+ + + {% if credits|e %} +
+

Credits

+ + + + + + + + + + + {% for credit in credits %} + + + + + + + {% endfor %} + +
Credit #Credit DateTotalBalance
{{ credit.number }}{{ credit.date }}{{ credit.amount }}{{ credit.balance }}
+

+ {% endif %} +
+ + + {% if aging %} +
+

Aging

+ + + + {% for key, age in aging %} + + {% endfor %} + + + + + {% for key, age in aging %} + + {% endfor %} + + +
{{ key }}
{{ age }}
+

+ {% 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') }}

+ + + + + + + + + + + + {% for invoice in invoices %} + + + + + + + + {% endfor %} + + {% set sum_balance = invoices|sum('balance_raw') %} + {% if sum_balance > 0 %} + + + + + + + + {% endif %} + +
{{ t('invoice') }} #{{ t('invoice_date') }}{{ t('invoice_due_date') }}{{ t('total') }}{{ t('balance') }}
{{ invoice.number }}{{ invoice.date }}{{ invoice.due_date }}{{ invoice.amount }}{{ invoice.balance }}
$balance_label{{ sum_balance|format_currency(currency_code) }}
+

+ {% endif %} +
+ + + {% if invoices|e and show_payments %} +
+

{{ t('payments') }}

+ + + + + + + + + + + + {% 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 %} + + + + + {%if pivot.is_credit %} + + {%else%} + + {%endif%} + + + {% if pivot.refunded_raw > 0 %} + + + + + + + + {% set net_refunds = net_refunds + pivot.refunded_raw %} + {% endif %} + {% set total_payments = total_payments + pivot.amount_raw %} + {% endfor %} + {% endfor %} + {% endif %} + {% endfor %} + + + + + + + + + {% if net_refunds > 0 %} + + + + + + + + + + + + + + + {% endif %} + +
{{ t('invoice') }} #{{ t('payment_date') }}{{ t('method') }}{{ t('amount') }}
{{ pivot.invoice }}{{ pivot.created_at }}$credit_label {{ pivot.number }}{{ payment.method }}{{ pivot.amount }}
{{ pivot.invoice }}{{ pivot.updated_at }}$refund_label({{ pivot.refunded }})
{{ currency_code }}$payments_label{{ total_payments|format_currency(currency_code) }}
$refunded_label({{ net_refunds|format_currency(currency_code) }})
$net_label{{ (total_payments-net_refunds)|format_currency(currency_code) }}
+

+ {% endif %} +
+ + + {% if credits|e and show_credits %} +
+

{{ t('credits') }}

+ + + + + + + + + + + {% for credit in credits %} + + + + + + + {% endfor %} + +
{{ t('credit') }} #{{ t('credit_date') }}{{ t('total') }}{{ t('balance') }}
{{ credit.number }}{{ credit.date }}{{ credit.amount }}{{ credit.balance }}
+

+ {% endif %} +
+ + + {% if aging and show_aging %} +
+

{{ t('aging') }}

+ + + + {% for key, age in aging %} + + {% endfor %} + + + + + {% for key, age in aging %} + + {% endfor %} + + +
{{ key }}
{{ age }}
+

+ {% 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 @@ + + + + + + + + + + +
+
+

$statement_label

+
+
+
+
+

$company.name

+
+
+ +
+
+
+
+
+
+
+

$start_date - $end_date

+
+
+ +
+ + {% if invoices|e %} + + + + + + + + + + + + {% set running_total = 0%} + {% for invoice in invoices %} + + + + + + + + {% for payment in invoice.payments %} + {% for pivot in payment.paymentables %} + + + + + + + + {% if pivot.refunded_raw > 0%} + + + + + + + + {% endif %} + {% endfor %} + {% endfor %} + {% endfor %} + + +
$date_label$invoice_label #{{ t('charges') }}{{ t('credits') }}{{ t('line_total') }}
{{ invoice.date }}{{ invoice.number }}{{ invoice.amount }}{%set running_total = running_total + invoice.amount_raw %}{{ running_total|format_currency(currency_code) }}
{{ invoice.date }}{{ invoice.number }}{%set running_total = running_total - pivot.amount_raw %}{{ pivot.amount }}{{ running_total|format_currency(currency_code) }}
{{ invoice.date }}{{ invoice.number }} $refund_label{%set running_total = running_total + pivot.refunded_raw %}({{ pivot.refunded }}){{ running_total|format_currency(currency_code) }}
+ {% endif %} +
+ + + {% if aging and show_aging %} +
+ + + + {% for key, age in aging %} + + {% endfor %} + + + + + {% for key, age in aging %} + + {% endfor %} + + +
{{ key }}
{{ age }}
+
+ {% 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 %} + + + + + + + + + + {% for task in tasks %} + {% for log in task.time_log %} + + + + + + {% endfor %} + {% endfor %} + +
DateDescriptionDuration
{{ log.start_date }}{{ log.description }}{{ log.duration|date('H:i:s') }}
+ + {% 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']); From 7ae477faf306c7417a5ee2ce23baf954e1e110ea Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 27 Mar 2024 20:08:55 +1100 Subject: [PATCH 02/12] Catch edge case when displaying document not available --- .../Controllers/ClientPortal/InvitationController.php | 5 ++--- .../ClientPortal/SubscriptionPurchaseController.php | 2 +- .../portal/ninja2020/generic/not_available.blade.php | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/InvitationController.php b/app/Http/Controllers/ClientPortal/InvitationController.php index 7b5de6d26771..15efa85a4f4d 100644 --- a/app/Http/Controllers/ClientPortal/InvitationController.php +++ b/app/Http/Controllers/ClientPortal/InvitationController.php @@ -87,7 +87,7 @@ class InvitationController extends Controller ->firstOrFail(); if ($invitation->trashed() || $invitation->{$entity}->is_deleted) { - return $this->render('generic.not_available', ['account' => $invitation->company->account, 'company' => $invitation->company]); + return $this->render('generic.not_available', ['passed_account' => $invitation->company->account, 'passed_company' => $invitation->company]); } if ($invitation->contact->trashed()) { @@ -138,11 +138,10 @@ class InvitationController extends Controller return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key}), 'silent' => $is_silent]); - return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key}), 'silent' => $is_silent])->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); } + return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})]); - return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})])->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); } private function fireEntityViewedEvent($invitation, $entity_string) diff --git a/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php b/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php index ad0e0f212fb7..ffc5e517eeaf 100644 --- a/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php +++ b/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php @@ -26,7 +26,7 @@ class SubscriptionPurchaseController extends Controller App::setLocale($subscription->company->locale()); if ($subscription->trashed()) { - return $this->render('generic.not_available', ['account' => $subscription->company->account, 'company' => $subscription->company]); + return $this->render('generic.not_available', ['passed_account' => $subscription->company->account, 'passed_company' => $subscription->company]); } /* Make sure the contact is logged into the correct company for this subscription */ diff --git a/resources/views/portal/ninja2020/generic/not_available.blade.php b/resources/views/portal/ninja2020/generic/not_available.blade.php index 1deda7c06152..82170016538a 100644 --- a/resources/views/portal/ninja2020/generic/not_available.blade.php +++ b/resources/views/portal/ninja2020/generic/not_available.blade.php @@ -7,15 +7,15 @@
- @if($account && !$account->isPaid()) + @if($passed_account && !$passed_account->isPaid())
Invoice Ninja logo
- @elseif(isset($company) && !is_null($company)) + @elseif(isset($passed_company) && !is_null($passed_company))
- {{ $company->present()->name() }} logo + {{ $passed_company->present()->name() }} logo
@endif

{{ ctrans("texts.entity_removed_title") }}

From db50774b0068e9401575954e334d23d7c3511c93 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 28 Mar 2024 07:31:57 +1100 Subject: [PATCH 03/12] minor fixes --- app/Jobs/Util/Import.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 1326262ec297..d1281ebe1ee8 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -1525,10 +1525,11 @@ class Import implements ShouldQueue } } - // throw new Exception("Resource invoice/quote document not available."); } + $entity = false; + if (array_key_exists('expense_id', $resource) && $resource['expense_id'] && array_key_exists('expenses', $this->ids)) { $expense_id = $this->transformId('expenses', $resource['expense_id']); $entity = Expense::query()->where('id', $expense_id)->withTrashed()->first(); From 53d1c55acf8524c0d8d351a9c2acb0f49d0938c3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 28 Mar 2024 07:40:56 +1100 Subject: [PATCH 04/12] Fixes for missing download actions for e-docs --- app/Http/Controllers/QuoteController.php | 2 +- app/Livewire/PdfSlot.php | 2 +- .../ninja2020/components/livewire/pdf-slot.blade.php | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 1ac67895f009..2f5f01bb3cb4 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -914,7 +914,7 @@ class QuoteController extends BaseController $contact = $invitation->contact; $quote = $invitation->quote; - $file = $quote->service()->getEInvoice($contact); + $file = $quote->service()->getEQuote($contact); $file_name = $quote->getFileName("xml"); $headers = ['Content-Type' => 'application/xml']; diff --git a/app/Livewire/PdfSlot.php b/app/Livewire/PdfSlot.php index 81ad1fab61c1..59fb9bf9625d 100644 --- a/app/Livewire/PdfSlot.php +++ b/app/Livewire/PdfSlot.php @@ -108,7 +108,7 @@ class PdfSlot extends Component } - public function downloadEInvoice() + public function downloadEDocument() { $file_name = $this->entity->numberFormatter().'.xml'; diff --git a/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php b/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php index 314f69cca8ee..9284c748cb94 100644 --- a/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/pdf-slot.blade.php @@ -10,9 +10,9 @@
@if($entity_type == 'invoice' && $settings->enable_e_invoice) - @endif @if($entity_type == 'credit' && $settings->enable_e_invoice) - @endif @if($entity_type == 'quote' && $settings->enable_e_invoice) -