-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure if a deduction time should use normal or negative rates
- Loading branch information
1 parent
3aa42d9
commit ffdfc17
Showing
9 changed files
with
150 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the "Enhanced invoicing bundle" for Kimai. | ||
* All rights reserved by Kevin Papst (www.kevinpapst.de). | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace KimaiPlugin\DeductionTimeBundle\EventSubscriber; | ||
|
||
use App\Event\SystemConfigurationEvent; | ||
use App\Form\Model\Configuration; | ||
use App\Form\Model\SystemConfiguration; | ||
use App\Form\Type\LanguageType; | ||
use KimaiPlugin\DeductionTimeBundle\Form\DeductionRateChoiceType; | ||
use KimaiPlugin\InvoiceBundle\Form\Type\ExportPdfChoiceType; | ||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; | ||
use Symfony\Component\Form\Extension\Core\Type\TextType; | ||
|
||
final class SystemConfigurationSubscriber implements EventSubscriberInterface | ||
{ | ||
public static function getSubscribedEvents(): array | ||
{ | ||
return [ | ||
SystemConfigurationEvent::class => ['onSystemConfiguration', 100], | ||
]; | ||
} | ||
|
||
public function onSystemConfiguration(SystemConfigurationEvent $event): void | ||
{ | ||
$event->addConfiguration( | ||
(new SystemConfiguration('deduction_time')) | ||
//->setTranslationDomain('messages') | ||
->setConfiguration([ | ||
(new Configuration('deduction.rate_config')) | ||
//->setTranslationDomain('messages') | ||
->setType(DeductionRateChoiceType::class), | ||
]) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the "Enhanced invoicing bundle" for Kimai. | ||
* All rights reserved by Kevin Papst (www.kevinpapst.de). | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace KimaiPlugin\DeductionTimeBundle\Form; | ||
|
||
use App\Export\Renderer\PDFRenderer; | ||
use App\Export\ServiceExport; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class DeductionRateChoiceType extends AbstractType | ||
{ | ||
public function configureOptions(OptionsResolver $resolver): void | ||
{ | ||
$resolver->setDefaults([ | ||
'choices' => [ | ||
'deduction.rate_default' => 'default', | ||
'deduction.rate_negative' => 'negative', | ||
], | ||
]); | ||
} | ||
|
||
public function getParent(): string | ||
{ | ||
return ChoiceType::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters