From 2ab15ea8ebd78889c6f7020a488420367abd6214 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 20 Feb 2025 17:11:52 +1100 Subject: [PATCH] Project Reports --- app/Services/Report/ProjectReport.php | 3 +- lang/en/texts.php | 1 + .../templates/reports/project_report.html | 290 ++++++++++++++++++ 3 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 resources/views/templates/reports/project_report.html diff --git a/app/Services/Report/ProjectReport.php b/app/Services/Report/ProjectReport.php index e22273e3e3..88ad723c71 100644 --- a/app/Services/Report/ProjectReport.php +++ b/app/Services/Report/ProjectReport.php @@ -74,7 +74,8 @@ class ProjectReport extends BaseExport 'company_name' => $this->company->present()->name(), 'created_on' => $this->translateDate(now()->format('Y-m-d'), $this->company->date_format(), $this->company->locale()), 'created_by' => $user_name, - 'charts' => $this->getCharts($projects), + + // 'charts' => $this->getCharts($projects), ]; $ts = new TemplateService(); diff --git a/lang/en/texts.php b/lang/en/texts.php index 5504f86861..465291eb8a 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5503,6 +5503,7 @@ $lang = array( 'enable_client_profile_update_help' => 'Allow clients to update their profile information from the client portal', 'preference_product_notes_for_html_view' => 'Use Item Notes for HTML View', 'preference_product_notes_for_html_view_help' => 'Preference the item Description over the item title if displaying the invoice in HTML.', + 'project_report' => 'Project Report', ); return $lang; diff --git a/resources/views/templates/reports/project_report.html b/resources/views/templates/reports/project_report.html new file mode 100644 index 0000000000..2772fdd478 --- /dev/null +++ b/resources/views/templates/reports/project_report.html @@ -0,0 +1,290 @@ + + + + + + Project Report + + + + + + {% 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')}}
+ + {% if project.invoices %} + + + + + + + + + + + {% set total_amount = 0 %} + {% set total_balance = 0 %} + {% for invoice in project.invoices %} + + + + + + + {% set total_amount = total_amount + invoice.amount_raw %} + {% set total_balance = total_balance + invoice.balance_raw %} + {% endfor%} + + + + + + + + + +
{{ t('date')}}{{ t('invoice_number')}}{{ t('amount') }}{{ t('balance') }}
{{ invoice.date }}{{ invoice.number }}{{ invoice.amount }}{{ invoice.balance }}
{{ total_amount }}{{ total_balance }}
+ {% endif %} + + {% if project.expenses %} + + + + + + + + + + {% set total_expense_amount = 0 %} + {% for expense in project.expenses %} + + + + + + {% set total_amount = total_amount + expense.amount_raw %} + {% endfor%} + + + + + + + + +
{{ t('date')}}{{ t('number')}}{{ t('amount') }}
{{ expense.date }}{{ expense.number }}{{ expense.amount }}
{{ total_expense_amount }}
+ {% endif %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Summary
{{ t('expenses') }}{{ total_expense_amount }}
{{ t('invoices') }}{{ total_amount }}
{{ t('budgeted') }}{{ project.budgeted_hours * project.task_rate_raw }}
{{ t('budgeted') }}{{ project.budgeted_hours * project.task_rate_raw }}
Budget - Expenses{{ (project.budgeted_hours * project.task_rate_raw) - total_expense_amount }}
Invoices - Expenses{{ total_amount - total_expense_amount }}
+ {% endfor %} + {% endif %} +
+ + + \ No newline at end of file