Commit 0ea93479 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

DDL & modif trigger pour accepter les missions

parent d71b15dd
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ return [
            'scale'       => '0',
            'precision'   => 1,
            'nullable'    => FALSE,
            'default'     => NULL,
            'default'     => '1',
            'position'    => 4,
            'commentaire' => NULL,
        ],
@@ -177,6 +177,18 @@ return [
            'position'    => 3,
            'commentaire' => NULL,
        ],
        'MISSION'               => [
            'name'        => 'MISSION',
            'type'        => 'bool',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => '0',
            'precision'   => 1,
            'nullable'    => FALSE,
            'default'     => '1',
            'position'    => 16,
            'commentaire' => NULL,
        ],
        'REFERENTIEL'           => [
            'name'        => 'REFERENTIEL',
            'type'        => 'bool',
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ BEGIN
  END IF;

  /* Mise en place des contraintes */
  IF :NEW.formule_res_service_id IS NULL AND :NEW.formule_res_service_ref_id IS NULL THEN
    raise_application_error(-20101, 'La mise en paiement ne correspond à aucun service ou service référentiel.');
  IF :NEW.formule_res_service_id IS NULL AND :NEW.formule_res_service_ref_id IS NULL AND :NEW.mission_id IS NULL THEN
    raise_application_error(-20101, 'La mise en paiement ne correspond à aucun service.');
  END IF;

  IF 1 = has_validation AND :NEW.date_validation IS NULL THEN
+1 −0
Original line number Diff line number Diff line
@@ -1834,6 +1834,7 @@ return [
        'HISTO_DESTRUCTION',
        'HISTO_DESTRUCTEUR_ID',
        'ETABLISSEMENT',
        'MISSION',
    ],
    'TYPE_VALIDATION'                => [
        'ID',
+11 −0
Original line number Diff line number Diff line
@@ -52,6 +52,17 @@
        <one-to-many field="volumesHoraires" target-entity="Mission\Entity\Db\VolumeHoraireMission" mapped-by="mission">
        </one-to-many>

        <many-to-many field="centreCout" target-entity="Paiement\Entity\Db\CentreCout">
            <join-table name="V_MISSION_CENTRE_COUT">
                <join-columns>
                    <join-column name="MISSION_ID" referenced-column-name="ID" unique="true"/>
                </join-columns>
                <inverse-join-columns>
                    <join-column name="CENTRE_COUT_ID" referenced-column-name="ID"/>
                </inverse-join-columns>
            </join-table>
        </many-to-many>

        <field name="histoCreation" type="datetime" column="HISTO_CREATION" nullable="false"/>
        <many-to-one field="histoCreateur" target-entity="Application\Entity\Db\Utilisateur">
            <join-column name="HISTO_CREATEUR_ID" referenced-column-name="ID"/>
+1 −6
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ trait ServiceAPayerTrait

    private Collection $miseEnPaiement;

    protected ?Collection $centreCout = null;
    protected Collection $centreCout;



@@ -68,11 +68,6 @@ trait ServiceAPayerTrait
            }
        };

        // Hack pour éviter un problème d'initialisation
        if (null === $this->centreCout){
            $this->centreCout = new ArrayCollection();
        }

        return $this->centreCout->filter($filter);
    }