Skip to content

Commit

Permalink
Made resolution date optional for adminstrative departments
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtronics committed Feb 13, 2025
1 parent 01b3045 commit 94d670f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Entity/PaymentOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ class PaymentOrder implements DBElementInterface, TimestampedElementInterface, \
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
#[Assert\LessThanOrEqual(value: 'today', message: 'validator.resolution_must_not_be_in_future')]
#[Assert\GreaterThan(value: '-3 years', message: 'validator.resolution_too_old', groups: ['frontend'])]
#[Assert\NotNull(groups: ['frontend'])]
#[Assert\Expression("value !== null || (this.getDepartment() !== null && this.getDepartment().getType() != 'fsr' && this.isFsrKomResolution() === false)", message: 'validator.resolution_date.needed_for_fsr_fsrkom')]
#[Assert\AtLeastOneOf([
new Assert\NotNull(),
new Assert\Expression("(this.getDepartment() !== null and this.getDepartment().getType().value === 'misc')"),
], groups: ['frontend'], message: 'FSRe und Referate müssen ein Beschlussdatum angeben!', includeInternalMessages: false)]
#[Groups('csv_export')]
#[SerializedName("Beschlussdatum")]
private ?\DateTime $resolution_date = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/PaymentOrderType.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void

$builder->add('resolution_date', DateType::class, [
'label' => 'payment_order.resolution_date.label',
'required' => true,
'required' => false, //Administrative structures does not require a resolution date
'html5' => true,
'widget' => 'single_text',
]);
Expand Down

0 comments on commit 94d670f

Please sign in to comment.