*/ final class InvoiceCrudController extends AbstractCrudController { public static function getEntityFqcn(): string { return Invoice::class; } public function configureCrud(Crud $crud): Crud { return $crud ->setEntityLabelInSingular(new TranslatableMessage('crud.invoice.singular', [], 'admin')) ->setEntityLabelInPlural(new TranslatableMessage('crud.invoice.plural', [], 'admin')) ->setDefaultSort(['createdAt' => 'DESC']) ->showEntityActionsInlined(); } public function configureActions(Actions $actions): Actions { return $actions ->disable(Action::NEW, Action::EDIT, Action::DELETE) ->add(Crud::PAGE_INDEX, Action::DETAIL); } public function configureFields(string $pageName): iterable { yield IdField::new('id')->hideOnForm(); yield TextField::new('frappeInvoiceId', 'Frappe-Rechnungsnr.'); yield AssociationField::new('order', 'Bestellung'); yield DateTimeField::new('createdAt', 'Erstellt am'); yield DateTimeField::new('emailedAt', 'Per E-Mail versendet'); yield TextField::new('filename', 'PDF-Datei')->onlyOnDetail(); } }