Skip to content

Commit

Permalink
Added link to generate a current stura form for a finished payment order
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtronics committed Nov 17, 2024
1 parent fdc6d19 commit dd09ce3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Controller/Admin/PaymentOrderCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,13 @@ public function configureActions(Actions $actions): Actions
->displayIf(fn(PaymentOrder $paymentOrder): bool => $this->isGranted('ROLE_MANUAL_CONFIRMATION')
&& !$paymentOrder->isConfirmed());

$pdf_form_action = Action::new('pdf_form', 'payment_order.action.pdf_form', 'fas fa-file-invoice')
->linkToRoute('payment_order_pdf_stura', fn(PaymentOrder $paymentOrder): array => [
'id' => $paymentOrder->getId(),
])
->displayIf(fn(PaymentOrder $paymentOrder): bool => $paymentOrder->isFactuallyCorrectChecked() && $paymentOrder->isMathematicallyCorrectChecked())
->setCssClass('btn btn-success');

$actions->add(Crud::PAGE_EDIT, $emailAction);
$actions->add(Crud::PAGE_DETAIL, $emailAction);

Expand All @@ -343,7 +350,12 @@ public function configureActions(Actions $actions): Actions
$actions->add(Crud::PAGE_DETAIL, $manual_confirmation);
$actions->add(Crud::PAGE_EDIT, $manual_confirmation);

return $actions->add(Crud::PAGE_INDEX, Action::DETAIL);
$actions->add(Crud::PAGE_DETAIL, $pdf_form_action);
$actions->add(Crud::PAGE_EDIT, $pdf_form_action);

$actions->add(Crud::PAGE_INDEX, Action::DETAIL);

return $actions;
}

public function configureFields(string $pageName): iterable
Expand Down
6 changes: 6 additions & 0 deletions translations/messages.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2615,5 +2615,11 @@ Wenn du diese überschreiben möchtest, lösche die bestehende Vorlage und speic
<target>Zahlungsauftrag wurde erfolgreich geprüft</target>
</segment>
</unit>
<unit id="g0PNLqP" name="payment_order.action.pdf_form">
<segment>
<source>payment_order.action.pdf_form</source>
<target>Prüfformular anzeigen</target>
</segment>
</unit>
</file>
</xliff>

0 comments on commit dd09ce3

Please sign in to comment.