diff --git a/modules/event-participants/Controllers/class-ajaxrouter.php b/modules/event-participants/Controllers/class-ajaxrouter.php index 623529c..b2714e7 100644 --- a/modules/event-participants/Controllers/class-ajaxrouter.php +++ b/modules/event-participants/Controllers/class-ajaxrouter.php @@ -38,6 +38,10 @@ class AjaxRouterController { new PrintParticipantListPhotoPdfController(); break; + case 'print_invoice_data': + new PrintParticipantListInvoicePdfController(); + die(); + default: echo 'No "method" specified.'; } diff --git a/modules/event-participants/Controllers/class-printparticipantlistinvoicepdf.php b/modules/event-participants/Controllers/class-printparticipantlistinvoicepdf.php new file mode 100644 index 0000000..27d1e68 --- /dev/null +++ b/modules/event-participants/Controllers/class-printparticipantlistinvoicepdf.php @@ -0,0 +1,65 @@ +Teili-Liste für ' . $event_name . '



' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + ''; + } + + public function __construct() { + global $_POST, $_REQUEST, $dbHandler; + + $group_name = ['participant' => 'Teili', 'volunteer' => 'Teami', 'other' => 'Sonstige']; + + $event = Event::loadById( $_REQUEST['event-id'] ); + $output = ''; + + $i = 0; + foreach ( $event->tribes as $tribe => $participants ) { + if ( count( $participants ) == 0 ) { + continue; + } + foreach ( $participants as $participant ) { + if ($participant->beitrag == 0) { + continue; + } + + if ( $i == 0 ) { + $output .= $this->get_table_header( $event->event_name ); + } + $i ++; + + $output .= '' . + '' . + '' . + '' . + '' . + '' . + '' . + '' . + ''; + if ( $i == 12 ) { + $output .= '
VornameNachnameTeili-GruppeStammGeburtsdatumBeitragTageNotizen
' . $participant->vorname . + ('' != $participant->pfadiname ? '
(' . $participant->pfadiname . ')' : '') . '
' . $participant->nachname . '' . $group_name[$participant->teilnahme] . '' . $tribe . '' . \DateTime::createFromFormat( 'Y-m-d', $participant->geburtsdatum )->format( 'd.m.Y' ) . '' . str_replace('.', ',', $participant->beitrag) . ' Euro' . AnwesenheitRequest::send($participant) . '
'; + $i = 0; + } + } + } + $output .= ''; + kompass_create_pdf($output,$event->event_name . ' Beitragsliste.pdf', 'landscape'); + } +} \ No newline at end of file diff --git a/modules/event-participants/Templates/Partials/admin/tab-control.php b/modules/event-participants/Templates/Partials/admin/tab-control.php index 8ed32d3..26d2b45 100644 --- a/modules/event-participants/Templates/Partials/admin/tab-control.php +++ b/modules/event-participants/Templates/Partials/admin/tab-control.php @@ -72,6 +72,7 @@ Küchenliste Küchenliste (Allergien) Sani-Liste + Beitrags-Liste Rundmail an alle