Compare commits

..

16 Commits

Author SHA1 Message Date
philipp lang 306fef3e07 Add Verhaltenskodex prevention
continuous-integration/drone/push Build is passing Details
2024-07-18 13:58:21 +02:00
philipp lang ca0dd11336 Check for APP_KEY in every PHP Container
continuous-integration/drone/push Build is passing Details
2024-07-18 01:41:35 +02:00
philipp lang 89a8feb278 Clear node_modules in drone 2024-07-18 01:41:12 +02:00
philipp lang 8f7edadb99 Remove invoice volume 2024-07-18 01:40:55 +02:00
philipp lang eee0c64106 Install adrema-form dependencies in docker 2024-07-18 01:40:37 +02:00
philipp lang e50269d031 Move tex templates to invoice folder 2024-07-18 01:38:41 +02:00
philipp lang dc40728fca Mod helps
continuous-integration/drone/push Build is failing Details
2024-07-18 01:16:02 +02:00
philipp lang dfa17ed3db Update node version
continuous-integration/drone/push Build is failing Details
2024-07-18 00:59:15 +02:00
philipp lang 77c57794e1 Remove silvaletter dir
continuous-integration/drone/push Build is failing Details
2024-07-17 23:49:03 +02:00
philipp lang 1347347324 Add compose invoice dir
continuous-integration/drone/push Build is failing Details
2024-07-17 23:29:00 +02:00
philipp lang cd9cc607f4 Add silvaletter template
continuous-integration/drone/push Build is failing Details
2024-07-17 23:18:25 +02:00
philipp lang 6f1efb7470 Update silvaletter package 2024-07-17 22:54:50 +02:00
philipp lang 5fd050e116 Move template dir from default to invoice 2024-07-17 22:51:53 +02:00
philipp lang 3a53777dbd Update README 2024-07-17 22:45:16 +02:00
philipp lang 1ad2e6a978 Fix typo 2024-07-17 22:38:16 +02:00
philipp lang ac76d23941 Move template files of bill and remember invoice 2024-07-17 22:35:06 +02:00
20 changed files with 120 additions and 40 deletions

View File

@ -5,10 +5,11 @@ RUN composer install --ignore-platform-reqs --no-dev
RUN php artisan telescope:publish
RUN php artisan horizon:publish
FROM node:18.13.0-slim as node
FROM node:20.15.0-slim as node
WORKDIR /app
COPY . /app
RUN npm install && npm run prod && npm run img && rm -R node_modules
RUN cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../
RUN npm ci && npm run prod && npm run img && rm -R node_modules
FROM nginx:1.21.6-alpine as nginx
WORKDIR /app

View File

@ -3,10 +3,11 @@ WORKDIR /app
COPY . /app
RUN composer install --ignore-platform-reqs --no-dev
FROM node:17.9.0-slim as node
FROM node:20.15.0-slim as node
WORKDIR /app
COPY . /app
RUN npm install && npm run prod && npm run img && rm -R node_modules
RUN cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../
RUN npm ci && npm run prod && npm run img && rm -R node_modules
FROM zoomyboy/adrema-base:latest as php
COPY --chown=www-data:www-data . /app
@ -20,7 +21,7 @@ RUN php artisan horizon:publish
USER root
COPY ./.docker/php /bin
VOLUME ["/app/packages/laravel-nami/.cookies", "/app/storage/app"]
VOLUME ["/app/packages/laravel-nami/.cookies", "/app/storage/app", "/app/resources/views/tex/invoice"]
EXPOSE 9000

View File

@ -15,6 +15,11 @@ mkdir -p /app/storage/app/public || true
chown -R www-data:www-data /app/packages/laravel-nami/.cookies
chown -R www-data:www-data /app/storage/app
if [ $APP_KEY = "YOUR_APP_KEY" ]; then
echo "----------------------- Keinen APP KEY gefunden. Key wird generiert: $(su www-data -c 'php artisan key:generate --show') ----------------------- Füge diesen Key als APP_KEY ein ---------------------"
exit 1
fi
if [ $1 == "horizon" ]; then
wait_for_db
su www-data -c 'php artisan horizon'
@ -22,10 +27,6 @@ fi
if [ $1 == "app" ]; then
# --------------------------- ensure appkey is set ----------------------------
if [ $APP_KEY = "YOUR_APP_KEY" ]; then
echo "----------------------- Keinen APP KEY gefunden. Key wird generiert: $(su www-data -c 'php artisan key:generate --show') ----------------------- Füge diesen Key als APP_KEY ein ---------------------"
exit 1
fi
wait_for_db
php -r '$connection = new PDO("mysql:host='$DB_HOST';dbname='$DB_DATABASE'", "'$DB_USERNAME'", "'$DB_PASSWORD'"); $connection->query("DESCRIBE migrations");' > /dev/null || php artisan migrate --seed --force
su www-data -c 'php artisan migrate --force'

View File

@ -32,9 +32,9 @@ steps:
- while ! curl --silent 'http://owncloudserver:8080/ocs/v1.php/cloud/capabilities?format=json' -u admin:admin | grep '"status":"ok"'; do sleep 1; done
- name: node
image: node:18.13.0-slim
image: node:20.15.0-slim
commands:
- npm ci && cd packages/adrema-form && npm ci && npm run build && cd ../../ && npm run img && npm run prod && rm -R node_modules
- npm ci && cd packages/adrema-form && npm ci && npm run build && rm -R node_modules && cd ../../ && npm run img && npm run prod && rm -R node_modules
- name: tests
image: zoomyboy/adrema-base:latest

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "packages/silvaletter"]
path = packages/silvaletter
url = https://git.zoomyboy.de/silva/silvaletter.git
[submodule "packages/laravel-nami"]
path = packages/laravel-nami
url = https://git.zoomyboy.de/silva/laravel-nami-api

View File

@ -85,6 +85,12 @@ Außerdem ist AdReMa auch problemlos auf Handys und Tablets bedienbar ("mobiles
7. Nach kurzer Zeit ist AdReMa über <http://localhost:8000> erreichbar und es kann sich mit dem zuvor festgelegten Login eingeloggt werden
### Individuelle anpassungen
#### Rechnungswesen
Bei dem Setup wird im Daten-Verzeichniss ein Ordner `./data/setup` angelegt. Hier kann das Logo des Stammes in den Briefkopf eingefügt werden. Zusätzlich kann der Text der Rechnung und der Zahlungserinnerung angepasst werden, dafür ist ein grundlegendes Verständnis für `.tex` Datein erforderlich.
## Nutzen des Entwicklungssystmes
1. Klonen des Reposetories

View File

@ -15,6 +15,6 @@ class BillDocument extends InvoiceDocument
public function view(): string
{
return 'tex.bill';
return 'tex.invoice.bill';
}
}

View File

@ -64,7 +64,7 @@ abstract class InvoiceDocument extends Document
public function template(): Template
{
return Template::make('tex.templates.default');
return Template::make('tex.templates.invoice');
}
public function setFilename(string $filename): self

View File

@ -15,6 +15,6 @@ class RememberDocument extends InvoiceDocument
public function view(): string
{
return 'tex.remember';
return 'tex.invoice.remember';
}
}

View File

@ -355,6 +355,10 @@ class Member extends Model implements Geolocatable
$preventions[] = Prevention::EFZ;
}
if (!$this->has_vk) {
$preventions[] = Prevention::VK;
}
if ($this->more_ps_at === null) {
if ($this->ps_at === null || $this->ps_at->diffInYears($date) >= 5) {
$preventions[] = Prevention::PS;

View File

@ -7,6 +7,7 @@ enum Prevention
case EFZ;
case PS;
case MOREPS;
case VK;
public function text(): string
{
@ -14,6 +15,7 @@ enum Prevention
static::EFZ => 'erweitertes Führungszeugnis',
static::PS => 'Präventionsschulung Basis Plus',
static::MOREPS => 'Präventionsschulung (Auffrischung)',
static::VK => 'Verhaltenskodex',
};
}
}

View File

@ -34,6 +34,7 @@ services:
- ./data/storage:/app/storage/app
- ./data/plugins:/app/plugins
- ./data/cookies:/app/packages/laravel-nami/.cookies
- ./data/invoice:/app/resources/views/tex/invoice
horizon:
image: zoomyboy/adrema-app:latest
@ -57,6 +58,7 @@ services:
- ./data/storage:/app/storage/app
- ./data/plugins:/app/plugins
- ./data/cookies:/app/packages/laravel-nami/.cookies
- ./data/invoice:/app/resources/views/tex/invoice
schedule:
image: zoomyboy/adrema-app:latest
@ -80,6 +82,7 @@ services:
- ./data/storage:/app/storage/app
- ./data/plugins:/app/plugins
- ./data/cookies:/app/packages/laravel-nami/.cookies
- ./data/invoice:/app/resources/views/tex/invoice
db:
image: mariadb:10.6.5

@ -1 +0,0 @@
Subproject commit 409cbaf4639d20aea52caa8e2136ffbcf9d4c7cc

View File

@ -67,7 +67,7 @@
v-model="values.params.inGrp"
label="In Gruppierung suchen"
name="inGrp"
hint="Mitglieder finden, die direktes Mitglied in der kleinsten befüllten Gruppierung sind."
hint="Mitglieder finden, die direktes Mitglied in der kleinsten ausgewählten Gruppierung sind."
size="sm"
@update:modelValue="search"
></f-switch>
@ -76,7 +76,7 @@
v-model="values.params.unterhalbGrp"
label="Unterhalb Gruppierung suchen"
name="unterhalbGrp"
hint="Mitglieder finden, die direktes Mitglied in einer Untergruppe der kleinsten befüllten Gruppierung sind."
hint="Mitglieder finden, die direktes Mitglied in einer Untergruppe der kleinsten ausgewählten Gruppierung sind."
size="sm"
@update:modelValue="search"
></f-switch>
@ -141,7 +141,6 @@ import hasFlash from '../../mixins/hasFlash.js';
import debounce from 'lodash/debounce';
export default {
mixins: [hasFlash],
layout: FullLayout,

View File

@ -1,14 +1,24 @@
\documentclass[silvaletter,12pt]{scrlttr2}
\documentclass[dpsgletter,12pt]{scrlttr2}
\setkomavar{subject}{<<< $getSubject >>>}
\setkomavar{fromname}[<<<$settings->from>>>]{<<<$settings->from_long>>>}
@if($settings->mobile)
\KOMAoptions{frommobilephone}
\setkomavar{frommobilephone}[Mobiltelefon: ]{<<<$settings->mobile>>>}
@endif
@if($settings->email)
\KOMAoptions{fromemail}
\setkomavar{fromemail}[E-Mail: ]{<<<$settings->email>>>}
@endif
@if($settings->website)
\KOMAoptions{fromurl}
\setkomavar{fromurl}[Website: ]{<<<$settings->website>>>}
\setkomavar{fromaddress}{<<<$settings->address>>>}
@endif
@if($settings->address && $settings->zip && $settings->place)
\setkomavar{fromaddress}{<<<$settings->address>>>\\<<<$settings->zip>>> <<<$settings->place>>>}
\setkomavar{place}{<<<$settings->place>>>}
\setkomavar{fromzipcode}{<<<$settings->zip>>>}
\setkomavar{fromlogo}{\includegraphics[width=2cm]{logo.png}} % stammeslogo
@endif
\begin{document}
\begin{letter}{<<< $toName >>>\\<<< $toAddress >>>\\<<< $toZip >>> <<< $toLocation >>>}
@ -16,7 +26,7 @@
\gdef\TotalHT{0}
\opening{<<< $greeting >>>,}
Hiermit stellen wir Ihnen den aktuellen Mitgliedsbeitrag für den \usekomavar*{fromname} und die DPSG in Rechnung. Dieser setzt sich wie folgt zusammen:
hiermit stellen wir Ihnen den aktuellen Mitgliedsbeitrag für den \usekomavar*{fromname} und die DPSG in Rechnung. Dieser setzt sich wie folgt zusammen:
\begin{center}
\begin{tabular}{@{}p{0.8\textwidth}|r}
@ -33,7 +43,7 @@
\begin{tabular}{ll}
Kontoinhaber: & <<<$settings->from_long>>> \\
IBAN: & <<<$settings->iban>>> \\
Bic: & <<<$settings->bic>>> \\
BIC: & <<<$settings->bic>>> \\
Verwendungszweck: & <<<$usage>>>
\end{tabular}

View File

@ -1,14 +1,24 @@
\documentclass[silvaletter,12pt]{scrlttr2}
\documentclass[dpsgletter,12pt]{scrlttr2}
\setkomavar{subject}{<<< $getSubject >>>}
\setkomavar{fromname}[<<<$settings->from>>>]{<<<$settings->from_long>>>}
@if($settings->mobile)
\KOMAoptions{frommobilephone}
\setkomavar{frommobilephone}[Mobiltelefon: ]{<<<$settings->mobile>>>}
@endif
@if($settings->email)
\KOMAoptions{fromemail}
\setkomavar{fromemail}[E-Mail: ]{<<<$settings->email>>>}
@endif
@if($settings->website)
\KOMAoptions{fromurl}
\setkomavar{fromurl}[Website: ]{<<<$settings->website>>>}
\setkomavar{fromaddress}{<<<$settings->address>>>}
@endif
@if($settings->address && $settings->zip && $settings->place)
\setkomavar{fromaddress}{<<<$settings->address>>>\\<<<$settings->zip>>> <<<$settings->place>>>}
\setkomavar{place}{<<<$settings->place>>>}
\setkomavar{fromzipcode}{<<<$settings->zip>>>}
\setkomavar{fromlogo}{\includegraphics[width=2cm]{logo.png}} % stammeslogo
@endif
\begin{document}
\begin{letter}{<<< $toName >>>\\<<< $toAddress >>>\\<<< $toZip >>> <<< $toLocation >>>}
@ -16,7 +26,7 @@
\gdef\TotalHT{0}
\opening{<<< $greeting >>>,}
Ihr Mitgliedbeitrag ist noch ausstehend. Dieser setzt sich wie folgt zusammen:
ihr Mitgliedbeitrag ist noch ausstehend. Dieser setzt sich wie folgt zusammen:
\begin{center}
\begin{tabular}{@{}p{0.8\textwidth}|r}
@ -33,7 +43,7 @@
\begin{tabular}{ll}
Kontoinhaber: & <<<$settings->from_long>>> \\
IBAN: & <<<$settings->iban>>> \\
Bic: & <<<$settings->bic>>> \\
BIC: & <<<$settings->bic>>> \\
Verwendungszweck: & <<<$usage>>>
\end{tabular}

View File

@ -1 +0,0 @@
../../../../packages/silvaletter/template

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,43 @@
\ProvidesFile{dpsgletter.lco}
% ---------------------------- Require packages ----------------------------
\RequirePackage{xcolor}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[ngerman]{babel}
\RequirePackage{fp}
\RequirePackage{booktabs}
\RequirePackage{ragged2e}
\RequirePackage{graphicx}
\RequirePackage{numprint}
\RequirePackage[gen]{eurosym}
\RequirePackage[condensed,math]{kurier}
% ---------------------------- Color definition ----------------------------
\definecolor{dpsgblue}{HTML}{003056}
% ----------------------------- font settings ------------------------------
\addtokomafont{subject}{\large\color{dpsgblue}}
% -------------------------- Calculation of table --------------------------
\gdef\TotalHT{0}
\newcommand{\product}[2]{%
#1 & \FPmul\temp{#2}{1}\FPround\temp{\temp}{2}\numprint[\euro]{\temp}
%% Totalize
\FPadd\total{\TotalHT}{\temp}%
\FPround\total{\total}{2}%
\global\let\TotalHT\total%
\\ }
\newcommand{\totalttc}{\numprint[\euro]{\TotalHT}
}
% ---------------------------- Global variables ----------------------------
\KOMAoptions{DIV=15, pagenumber=no, enlargefirstpage, firstfoot=false, foldmarks, fromlogo, fromalign=right}
\setlength{\parindent}{0pt}
\setlength{\parskip}{10pt}
\setkomavar{backaddressseparator}{ $\cdot$ }
\setkomavar{fromlogo}{\includegraphics[height=3cm]{assets/logo.png}} % stammeslogo
\renewcommand*{\raggedsignature}{\raggedright} % Signatur links ausrichten
\setkomavar{signature}{} % Kein From unter Unterschriften-Feld

View File

@ -111,44 +111,49 @@ class PreventionTest extends TestCase
protected function attributes(): Generator
{
yield [
'attrs' => ['efz' => null, 'ps_at' => now()],
'attrs' => ['has_vk' => true, 'efz' => null, 'ps_at' => now()],
'preventions' => [Prevention::EFZ]
];
yield [
'attrs' => ['efz' => now(), 'ps_at' => null],
'attrs' => ['has_vk' => true, 'efz' => now(), 'ps_at' => null],
'preventions' => [Prevention::PS]
];
yield [
'attrs' => ['efz' => now()->subDay(), 'ps_at' => now()],
'attrs' => ['has_vk' => true, 'efz' => now()->subDay(), 'ps_at' => now()],
'preventions' => []
];
yield [
'attrs' => ['efz' => now(), 'ps_at' => now()->subDay()],
'attrs' => ['has_vk' => true, 'efz' => now(), 'ps_at' => now()->subDay()],
'preventions' => []
];
yield [
'attrs' => ['efz' => now()->subYears(5)->subDay(), 'ps_at' => now()],
'attrs' => ['has_vk' => true, 'efz' => now()->subYears(5)->subDay(), 'ps_at' => now()],
'preventions' => [Prevention::EFZ]
];
yield [
'attrs' => ['efz' => now(), 'ps_at' => now()->subYears(5)->subDay()],
'attrs' => ['has_vk' => true, 'efz' => now(), 'ps_at' => now()->subYears(5)->subDay()],
'preventions' => [Prevention::PS]
];
yield [
'attrs' => ['efz' => now(), 'ps_at' => now()->subYears(5)->subDay(), 'more_ps_at' => now()],
'attrs' => ['has_vk' => true, 'efz' => now(), 'ps_at' => now()->subYears(5)->subDay(), 'more_ps_at' => now()],
'preventions' => []
];
yield [
'attrs' => ['efz' => now(), 'ps_at' => now()->subYears(15), 'more_ps_at' => now()->subYears(5)->subDay()],
'attrs' => ['has_vk' => true, 'efz' => now(), 'ps_at' => now()->subYears(15), 'more_ps_at' => now()->subYears(5)->subDay()],
'preventions' => [Prevention::MOREPS],
];
yield [
'attrs' => ['has_vk' => false, 'efz' => now(), 'ps_at' => now()],
'preventions' => [Prevention::VK],
];
}
/**