Skip to content

Commit

Permalink
JE-400: Minor UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Dec 5, 2023
1 parent 748d382 commit e4fd359
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/Controller/InvoiceEntryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public function new(Request $request, Invoice $invoice, InvoiceEntryTypeEnum $ty
// TODO: Handle this with a doctrine event listener instead.
$billingService->updateInvoiceEntryTotalPrice($invoiceEntry);

if (InvoiceEntryTypeEnum::MANUAL == $invoiceEntry->getEntryType()) {
return $this->redirectToRoute('app_invoices_edit', ['id' => $invoice->getId()], Response::HTTP_SEE_OTHER);
}

return $this->redirectToRoute('app_invoice_entry_edit', ['id' => $invoiceEntry->getId(), 'invoice' => $invoice->getId()], Response::HTTP_SEE_OTHER);
}

Expand Down
20 changes: 14 additions & 6 deletions templates/invoices/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,20 @@
</ul>
{% endif %}
<div class="actions-right">
<a type="button" href="{{ path('app_invoices_show_export', {'id': invoice.id}) }}" class="button button-green">{{ 'invoices.action_show_export'|trans }}</a>
{% if not invoice.recorded and invoice.projectBilling is null %}
<a type="button" href="{{ path('app_invoices_record', {'id': invoice.id}) }}" class="button button-warning">{{ 'invoices.action_record'|trans }}</a>
{% endif %}
{% if invoice.recorded and invoice.projectBilling is null %}
<a type="button" href="{{ path('app_invoices_export', {'id': invoice.id}) }}" class="button">{{ 'invoices.action_export'|trans }}</a>
{% if invoice.client is not null %}
<a type="button" href="{{ path('app_invoices_show_export', {'id': invoice.id}) }}" class="button button-green">{{ 'invoices.action_show_export'|trans }}</a>
{% if not invoice.recorded and invoice.projectBilling is null %}
<a type="button" href="{{ path('app_invoices_record', {'id': invoice.id}) }}" class="button button-warning">{{ 'invoices.action_record'|trans }}</a>
{% endif %}
{% if invoice.recorded and invoice.projectBilling is null %}
<a type="button" href="{{ path('app_invoices_export', {'id': invoice.id}) }}" class="button">{{ 'invoices.action_export'|trans }}</a>
{% endif %}
{% else %}
<div class="alert-info" role="alert">
<svg class="flex-shrink-0 inline w-4 h-4 mr-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"></path>
</svg> {{ 'invoices.export_only_available_when_mandatory_fields_are_set'|trans }}
</div>
{% endif %}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions templates/invoices/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block title %}{{ 'invoices.title'|trans }}{% endblock %}

{% block content %}
<a class="link" href="{{ path('app_invoices_new') }}" style="float: right">{{ 'invoices.action_create_new'|trans }}</a>
<h1 class="page-title">{{ 'invoices.title'|trans }}</h1>

{{ form_start(form) }}
Expand Down
1 change: 1 addition & 0 deletions templates/project_billing/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block title %}{{ 'project_billing.title'|trans }}{% endblock %}

{% block content %}
<a class="link" href="{{ path('app_project_billing_new') }}" style="float: right">{{ 'project_billing.action_create_new'|trans }}</a>
<h1 class="page-title">{{ 'project_billing.title'|trans }}</h1>

{{ form_start(form) }}
Expand Down
1 change: 1 addition & 0 deletions translations/messages.da.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ invoices:
without_project_billing: 'Udelad'
only_project_billing: 'Kun PF'
list_recorded: 'Bogført'
export_only_available_when_mandatory_fields_are_set: 'Eksport kun muligt når der er sat en kundekonto'

material_number_enum:
internal: "Interne: 103361"
Expand Down

0 comments on commit e4fd359

Please sign in to comment.