add subtotal and payment date to invoices (#2450)

This commit is contained in:
Philipp
2021-03-29 00:51:34 +02:00
committed by GitHub
parent 7029bde555
commit d84beb957c
11 changed files with 222 additions and 5 deletions

View File

@@ -0,0 +1,50 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Form;
use App\Entity\Invoice;
use App\Form\Type\DatePickerType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class InvoicePaymentDateForm extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$dateTimeOptions = [
'model_timezone' => $options['timezone'],
'view_timezone' => $options['timezone'],
];
$builder
->add('paymentDate', DatePickerType::class, array_merge($dateTimeOptions, [
'label' => 'invoice.payment_date',
'required' => true,
]));
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Invoice::class,
'timezone' => date_default_timezone_get(),
'attr' => [
'data-form-event' => 'kimai.invoiceUpdate'
],
]);
}
}