Skip to content

Commit

Permalink
added signals for taxes, removed some documents from view
Browse files Browse the repository at this point in the history
  • Loading branch information
qr committed Sep 15, 2020
1 parent ba6831d commit 04c5f0e
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/Entity/Dossier.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,12 @@ public function getDocumentenByOnderwerp($onderwerp)
*
* @return \GemeenteAmsterdam\FixxxSchuldhulp\Entity\DossierDocument[]|\Doctrine\Common\Collections\ArrayCollection
*/
public function getNietVerwijderdeDocumentenByOnderwerp($onderwerp)
public function getNietVerwijderdeDocumentenByOnderwerp($onderwerp, $zonderSchulditem = false)
{
return $this->documenten->filter(function (DossierDocument $dossierDocument) use ($onderwerp) {
return $this->documenten->filter(function (DossierDocument $dossierDocument) use ($onderwerp, $zonderSchulditem) {
if ($zonderSchulditem && null !== $dossierDocument->getSchuldItem()) {
return false;
}
return $dossierDocument->getOnderwerp() === $onderwerp && $dossierDocument->getDocument()->isInPrullenbak() === false;
});
}
Expand Down
80 changes: 80 additions & 0 deletions src/Entity/Voorlegger.php
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,24 @@ class Voorlegger
*/
private $aangifteBelastingdienst;

/**
* @var integer|null
* @ORM\Column(type="smallint", nullable=true)
*/
private $aangifteBelastingdienstMadi;

/**
* @var integer|null
* @ORM\Column(type="smallint", nullable=true)
*/
private $aangifteBelastingdienstGka;

/**
* @var boolean|null
* @ORM\Column(type="boolean", nullable=true)
*/
private $aangifteBelastingdienstNvt;

// ---

public function __construct()
Expand Down Expand Up @@ -1063,6 +1081,9 @@ public function __construct()
$this->toeslagenKinderopvang = false;
$this->toeslagenKindgebondenBudget = false;
$this->aangifteBelastingdienst = false;
$this->aangifteBelastingdienstMadi = self::STATUS_MADI_OPEN;
$this->aangifteBelastingdienstGka = false;
$this->aangifteBelastingdienstNvt = false;
}

public function getId()
Expand Down Expand Up @@ -2490,4 +2511,63 @@ public function setAangifteBelastingdienst(?bool $aangifteBelastingdienst): Voor

return $this;
}

/**
* @return int|null
*/
public function getAangifteBelastingdienstMadi(): ?int
{
return $this->aangifteBelastingdienstMadi;
}

/**
* @param int|null $aangifteBelastingdienstMadi
* @return Voorlegger
*/
public function setAangifteBelastingdienstMadi(?int $aangifteBelastingdienstMadi): Voorlegger
{
$this->aangifteBelastingdienstMadi = $aangifteBelastingdienstMadi;

return $this;
}

/**
* @return int|null
*/
public function getAangifteBelastingdienstGka(): ?int
{
return $this->aangifteBelastingdienstGka;
}

/**
* @param int|null $aangifteBelastingdienstGka
* @return Voorlegger
*/
public function setAangifteBelastingdienstGka(?int $aangifteBelastingdienstGka): Voorlegger
{
$this->aangifteBelastingdienstGka = $aangifteBelastingdienstGka;

return $this;
}

/**
* @return bool|null
*/
public function getAangifteBelastingdienstNvt(): ?bool
{
return $this->aangifteBelastingdienstNvt;
}

/**
* @param bool|null $aangifteBelastingdienstNvt
* @return Voorlegger
*/
public function setAangifteBelastingdienstNvt(?bool $aangifteBelastingdienstNvt): Voorlegger
{
$this->aangifteBelastingdienstNvt = $aangifteBelastingdienstNvt;

return $this;
}


}
11 changes: 11 additions & 0 deletions src/Form/Type/VoorleggerBelastingFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ class VoorleggerBelastingFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('aangifteBelastingdienstMadi', MadiStatusFormType::class, [
'required' => true,
'disabled' => $options['disable_group'] === 'gka'
]);
$builder->add('aangifteBelastingdienstGka', GkaStatusFormType::class, [
'required' => true,
'disabled' => $options['disable_group'] === 'madi'
]);
$builder->add('aangifteBelastingdienstNvt', CheckboxType::class, [
'required' => false
]);
$builder->add('aangifteBelastingdienst', CheckboxType::class, [
'required' => false,
'label' => 'Aangifte ingediend'
Expand Down
4 changes: 4 additions & 0 deletions src/Migrations/Version20200818095526.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public function up(Schema $schema) : void
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('UPDATE gebruiker SET email = \'[email protected]\' WHERE username = \'gka1\'');
$this->addSql('UPDATE gebruiker SET email = \'[email protected]\' WHERE username = \'madi1\'');
$this->addSql('UPDATE gebruiker SET email = \'[email protected]\' WHERE username = \'admin1\'');

$this->addSql('CREATE UNIQUE INDEX uq_email ON gebruiker (email)');
}

Expand Down
31 changes: 31 additions & 0 deletions src/Migrations/Version20200915083734.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200915083734 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_ontvangen_madi SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_ontvangen_gka SMALLINT DEFAULT NULL');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_ontvangen_madi');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_ontvangen_gka');
}
}
37 changes: 37 additions & 0 deletions src/Migrations/Version20200915084350.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200915084350 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_madi SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_gka SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_nvt BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_ontvangen_madi');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_ontvangen_gka');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_ontvangen_madi SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE voorlegger ADD aangifte_belastingdienst_ontvangen_gka SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_madi');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_gka');
$this->addSql('ALTER TABLE voorlegger DROP aangifte_belastingdienst_nvt');
}
}
2 changes: 1 addition & 1 deletion templates/Dossier/detailVoorlegger.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
{% include 'Dossier/partial.voorleggerMeterstandenEnergie.html.twig' with {'form': voorleggerForm.meterstandenEnergie, 'dossier': dossier, 'title': 'Meterstanden energie'} only %}
{% include 'Dossier/partial.voorleggerWaternet.html.twig' with {'form': voorleggerForm.waternet, 'dossier': dossier, 'title': 'Waternet'} only %}
{% include 'Dossier/partial.voorleggerRetourbewijsModem.html.twig' with {'form': voorleggerForm.retourbewijsModem, 'dossier': dossier, 'title': 'Retourbewijs modem'} only %}
{% include 'Dossier/partial.voorleggerAangifteBelasting.html.twig' with {'form': voorleggerForm.belasting, 'dossier': dossier, 'title': 'Aangifte belastingdienst'} only %}
<h2>Onderbewindstelling of budgetbeheer</h2>
{% include 'Dossier/partial.voorleggerBeschikkingOnderBewindstelling.html.twig' with {'form': voorleggerForm.beschikkingOnderBewindstelling, 'dossier': dossier, 'title': 'Beschikking onderbewindstelling'} only %}
{% include 'Dossier/partial.voorleggerBudgetbeheer.html.twig' with {'form': voorleggerForm.budgetbeheer, 'dossier': dossier, 'title': 'Budgetbeheer'} only %}
{% include 'Dossier/partial.voorleggerGereserveerdeGelden.html.twig' with {'form': voorleggerForm.gereserveerdeGelden, 'dossier': dossier, 'title': 'Gereserveerde gelden'} only %}
<h2>Overige</h2>
{% include 'Dossier/partial.voorleggerOverigeDocumenten.html.twig' with {'form': voorleggerForm.overigeDocumenten, 'dossier': dossier, 'title': 'Overige documenten'} only %}
{% include 'Dossier/partial.voorleggerAangifteBelasting.html.twig' with {'form': voorleggerForm.belasting, 'dossier': dossier, 'title': 'Aangifte belastingdienst'} only %}
{% include 'Dossier/partial.voorleggerCorrespondentie.html.twig' with {'form': voorleggerForm.correspondentie, 'dossier': dossier, 'title': 'Correspondentie van GKA'} only %}


Expand Down
4 changes: 2 additions & 2 deletions templates/Dossier/partial.dossierDashboard.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,5 @@

</div>
</div>
<input id="allegro_validate_url" value="{{ path('gemeenteamsterdam_fixxxschuldhulp_allegro_validatesendtoallegro',{'dossierId': dossier.id}) }}">
<input id="allegro_send_url" value="{{ path('gemeenteamsterdam_fixxxschuldhulp_allegro_send',{'dossierId': dossier.id}) }}">
<input type="hidden" id="allegro_validate_url" value="{{ path('gemeenteamsterdam_fixxxschuldhulp_allegro_validatesendtoallegro',{'dossierId': dossier.id}) }}">
<input type="hidden" id="allegro_send_url" value="{{ path('gemeenteamsterdam_fixxxschuldhulp_allegro_send',{'dossierId': dossier.id}) }}">
17 changes: 16 additions & 1 deletion templates/Dossier/partial.voorleggerAangifteBelasting.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{% import 'partial.macros.html.twig' as tools %}
{% set dossierDocumenten = dossier.getNietVerwijderdeDocumentenByOnderwerpen(['belasting']) %}

<div class="dossier__item {{ app.request.isXmlHttpRequest ? 'active' }}" id="voorlegger-belasting-documenten" data-hashevent="activate-section" data-keyupper="section-document-nav">
<div class="dossier__item {{ dossier.voorlegger.aangifteBelastingdienstNvt ? ' status-nvt' }}
{% if app.user.type == 'madi' or app.user.type == 'madi_keyuser' %}
status-madi-{{ dossier.voorlegger.aangifteBelastingdienstMadi }}
{% elseif app.user.type == 'gka' or app.user.type == 'gka_appbeheerder' %}
status-gka-{{ dossier.voorlegger.aangifteBelastingdienstGka }}
{% endif %}
{{ app.request.isXmlHttpRequest ? 'active' }}" id="voorlegger-belasting-documenten" data-hashevent="activate-section" data-keyupper="section-document-nav">
<div class="dossier__voorlegger__header">

<div class="voorlegger-header">
Expand All @@ -13,13 +19,22 @@
<span>{{ dossierDocumenten|length }}</span>
</div>
{% endif %}
{% include 'Dossier/partial.statusChanger.html.twig' with {'show_nvt': true} %}
</div>

</div>
<div class="dossier__voorlegger__body">
<div class="dossier__voorlegger__sectie">
<div class="dossier__voorlegger__sectie__header">
<a class="dossier__voorlegger__sectie__close" href="#_"></a>
<div class="status-container hide"><span>Status:</span>
{{ form_row(form.aangifteBelastingdienstMadi) }}
{{ form_row(form.aangifteBelastingdienstGka) }}
</div>
<div class="nvt-input hide">
{{ form_row(form.aangifteBelastingdienstNvt) }}
</div>
{% include 'Dossier/partial.statusChanger.html.twig' with {'show_nvt': true} %}
<h3>{{ title }}</h3>
<hr>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% import 'partial.macros.html.twig' as tools %}
{% set dossierDocumenten = dossier.getNietVerwijderdeDocumentenByOnderwerp('schuldenoverzicht') %}
{% set dossierDocumenten = dossier.getNietVerwijderdeDocumentenByOnderwerp('schuldenoverzicht', true) %}

<div class="dossier__item
{% if app.user.type == 'madi' or app.user.type == 'madi_keyuser' %}
Expand Down

0 comments on commit 04c5f0e

Please sign in to comment.