Commit 989e9560 by Julien Jorry

Fix all cascade + fix fixtures + debugs divers

parent 2b4b5cc4
App\Entity\Siege: App\Entity\Siege:
siege: siege_1:
name: 'Siege MLC' name: 'Siege MLC'
content: 'MLC' content: 'MLC'
App\Entity\Groupe: App\Entity\Groupe:
groupe{1..10}: groupe{1..10}:
name: <text(10)> name: '<text(10)>'
content: <text(10)> content: '<text(200)>'
siege: '@siege' siege: '@siege_1'
App\Entity\Geoloc: App\Entity\Geoloc:
geoloc{1..70}: geoloc{1..70}:
adresse: <address()> adresse: '<address()>'
# cpostal: <postcode()> # cpostal: <postcode()>
ville: <city()> ville: '<city()>'
lat: <randomFloat(6, 45, 46)> lat: '<randomFloat(6, 45, 46)>'
lon: <randomFloat(6, 2, 5)> lon: '<randomFloat(6, 2, 5)>'
enabled: true enabled: true
App\Entity\Comptoir: App\Entity\Comptoir:
comptoir{1..50}: comptoir{1..50}:
name: <text(10)> name: '<text(10)>'
enabled: true enabled: true
tel: '<phoneNumber()>' tel: '<phoneNumber()>'
email: <email()> email: '<email()>'
groupe: '@groupe*' groupe: '@groupe<numberBetween(1,10)>'
geoloc (unique): '@geoloc*' geoloc (unique): '@geoloc<numberBetween(1,70)>'
App\Entity\Groupeprestataire: App\Entity\Groupeprestataire:
grppresta1: grppresta1:
name: 'AMAP de test' name: 'AMAP de test'
horaires: Tous les Jeudis de 12h à 14h horaires: 'Tous les Jeudis de 12h à 14h'
grppresta2: grppresta2:
name: 'AMAP de test 2' name: 'AMAP de test 2'
horaires: Tous les Mercredis de 12h à 14h horaires: 'Tous les Mercredis de 12h à 14h'
grppresta3: grppresta3:
name: 'Marché de test' name: 'Marché de test'
horaires: Tous les Dimanches de 8h à 12h horaires: 'Tous les Dimanches de 8h à 12h'
grppresta4: grppresta4:
name: 'Marché de test 2' name: 'Marché de test 2'
horaires: Tous les 1er Dimanches du mois de 8h à 12h et de 18h à 20h horaires: 'Tous les 1er Dimanches du mois de 8h à 12h et de 18h à 20h'
App\Entity\TypePrestataire: App\Entity\TypePrestataire:
typepresta_prestataire: typepresta_prestataire:
...@@ -81,20 +81,22 @@ App\Entity\Usergroup: ...@@ -81,20 +81,22 @@ App\Entity\Usergroup:
App\Entity\Adherent: App\Entity\Adherent:
adherent{1..11}: adherent{1..11}:
ecompte: <randomFloat(2, 0, 50)> ecompte: '<randomFloat(2, 0, 50)>'
# user (unique): '@user<numberBetween(1,10)>' # user (unique): '@user<numberBetween(1,10)>'
App\Entity\Prestataire: App\Entity\Prestataire:
prestataire{1..21}: prestataire{1..21}:
raison: <text(10)> raison: '<text(10)>'
responsable: <text(10)> responsable: '<text(10)>'
metier: <text(10)> metier: '<text(10)>'
iban: <text(10)> iban: '<text(10)>'
statut: <text(10)> statut: '<text(10)>'
siret: <text(10)> siret: '<text(10)>'
geoloc (unique): '@geoloc*' geoloc (unique): '@geoloc<numberBetween(1,70)>'
# user (unique): '@user<numberBetween(11,30)>' # user (unique): '@user<numberBetween(11,30)>'
typeprestataire: '@typepresta_prestataire*' typeprestataire: '@typepresta_prestataire'
prestataireGroup: '@groupe<numberBetween(1, 10)>'
horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h"
prestataire{22..32}: prestataire{22..32}:
raison: <text(10)> raison: <text(10)>
responsable: <text(10)> responsable: <text(10)>
...@@ -102,10 +104,11 @@ App\Entity\Prestataire: ...@@ -102,10 +104,11 @@ App\Entity\Prestataire:
iban: <text(10)> iban: <text(10)>
statut: <text(10)> statut: <text(10)>
siret: <text(10)> siret: <text(10)>
geoloc (unique): '@geoloc*' geoloc (unique): '@geoloc<numberBetween(1,70)>'
# user (unique): '@user<numberBetween(11,30)>' # user (unique): '@user<numberBetween(11,30)>'
typeprestataire: '@typepresta_prestataire*' typeprestataire: '@typepresta_prestataire'
groupeprestataires: ['@grppresta<numberBetween(1, 4)>'] groupeprestataires: '2x @grppresta<numberBetween(1, 4)>'
prestataireGroup: '@groupe<numberBetween(1, 4)>'
horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h" horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h"
App\Entity\User: App\Entity\User:
...@@ -189,14 +192,14 @@ App\Entity\User: ...@@ -189,14 +192,14 @@ App\Entity\User:
groups: ['@usergroup_adherent'] groups: ['@usergroup_adherent']
roles: ['ROLE_ADHERENT'] roles: ['ROLE_ADHERENT']
adherent: '@adherent<current()>' adherent: '@adherent<current()>'
userp{1..32}: userp{2..32}:
username: 'p<userName()>' username: 'p<userName()>'
email: <email()> email: <email()>
plainPassword: 'test' plainPassword: 'test'
enabled: true enabled: true
# groups: ['@usergroup_prestataire'] # groups: ['@usergroup_prestataire']
roles: ['ROLE_PRESTATAIRE'] roles: ['ROLE_PRESTATAIRE']
prestataire (unique): '@prestataire<current()>' prestataire: '@prestataire<current()>'
# TEST DE TRANSACTIONS / TRANSFERTS ! # TEST DE TRANSACTIONS / TRANSFERTS !
App\Entity\TransactionAdherentPrestataire: App\Entity\TransactionAdherentPrestataire:
...@@ -206,57 +209,57 @@ App\Entity\TransactionAdherentPrestataire: ...@@ -206,57 +209,57 @@ App\Entity\TransactionAdherentPrestataire:
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@adherent<current()>' expediteur: '@adherent<current()>'
destinataire: '@prestataire*' destinataire: '@prestataire<current()>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transaction' parenttype: 'transaction'
App\Entity\TransactionPrestataireAdherent: App\Entity\TransactionPrestataireAdherent:
tro_pre_adh{1..10}: tro_pre_adh{2..11}:
operateur: '@userp<current()>' operateur: '@userp<current()>'
type: 'prestataire_adherent' type: 'prestataire_adherent'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@prestataire*' expediteur: '@prestataire<current()>'
destinataire: '@adherent<current()>' destinataire: '@adherent<current()>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transaction' parenttype: 'transaction'
App\Entity\TransactionPrestatairePrestataire: App\Entity\TransactionPrestatairePrestataire:
tro_pre_pre{1..10}: tro_pre_pre{2..11}:
operateur: '@userp<current()>' operateur: '@userp<current()>'
type: 'prestataire_prestataire' type: 'prestataire_prestataire'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@prestataire*' expediteur: '@prestataire<numberBetween(1, 10)>'
destinataire: '@prestataire*' destinataire: '@prestataire<numberBetween(11, 21)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transaction' parenttype: 'transaction'
App\Entity\TransfertComptoirAdherent: App\Entity\TransfertComptoirAdherent:
tre_cpt_adh{1..10}: tre_cpt_adh{2..11}:
operateur: '@usercomptoir' operateur: '@usercomptoir'
type: 'comptoir_adherent' type: 'comptoir_adherent'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@comptoir*' expediteur: '@comptoir<numberBetween(1,50)>'
destinataire: '@adherent<current()>' destinataire: '@adherent<current()>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
App\Entity\TransfertComptoirGroupe: App\Entity\TransfertComptoirGroupe:
tre_cpt_grp{1..10}: tre_cpt_grp{2..11}:
operateur: '@usercomptoir' operateur: '@usercomptoir'
type: 'comptoir_groupe' type: 'comptoir_groupe'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@comptoir*' expediteur: '@comptoir<numberBetween(1,50)>'
destinataire: '@groupe*' destinataire: '@groupe<numberBetween(1,10)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
App\Entity\TransfertComptoirPrestataire: App\Entity\TransfertComptoirPrestataire:
tre_cpt_pre{1..10}: tre_cpt_pre{2..11}:
operateur: '@usercomptoir' operateur: '@usercomptoir'
type: 'comptoir_prestataire' type: 'comptoir_prestataire'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@comptoir*' expediteur: '@comptoir<numberBetween(1,50)>'
destinataire: '@prestataire*' destinataire: '@prestataire<numberBetween(1,32)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
App\Entity\TransfertGroupeComptoir: App\Entity\TransfertGroupeComptoir:
...@@ -265,18 +268,18 @@ App\Entity\TransfertGroupeComptoir: ...@@ -265,18 +268,18 @@ App\Entity\TransfertGroupeComptoir:
type: 'groupe_comptoir' type: 'groupe_comptoir'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@groupe*' expediteur: '@groupe<numberBetween(1,10)>'
destinataire: '@comptoir*' destinataire: '@comptoir<numberBetween(1,50)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
App\Entity\TransfertPrestataireComptoir: App\Entity\TransfertPrestataireComptoir:
tre_pre_cpt{1..10}: tre_pre_cpt{2..11}:
operateur: '@userp<current()>' operateur: '@userp<current()>'
type: 'prestataire_comptoir' type: 'prestataire_comptoir'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@prestataire*' expediteur: '@prestataire<numberBetween(1,30)>'
destinataire: '@comptoir*' destinataire: '@comptoir<numberBetween(1,50)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
App\Entity\TransfertSiegeGroupe: App\Entity\TransfertSiegeGroupe:
...@@ -285,7 +288,7 @@ App\Entity\TransfertSiegeGroupe: ...@@ -285,7 +288,7 @@ App\Entity\TransfertSiegeGroupe:
type: 'siege_groupe' type: 'siege_groupe'
reference: 'test' reference: 'test'
montant: '<numberBetween(1,50)>' montant: '<numberBetween(1,50)>'
expediteur: '@siege' expediteur: '@siege_1'
destinataire: '@groupe*' destinataire: '@groupe<numberBetween(1,10)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
...@@ -41,7 +41,7 @@ class CotisationAdherentAdmin extends CotisationAdmin ...@@ -41,7 +41,7 @@ class CotisationAdherentAdmin extends CotisationAdmin
{ {
$formMapper $formMapper
->with('Cotisation', ['class' => 'col-md-8']) ->with('Cotisation', ['class' => 'col-md-8'])
->add('user', null, array('label' => 'Utilisateur'), array('admin_code' => 'admin.adherent.gerer')) ->add('user', null, array('label' => 'Adhérent'), array('admin_code' => 'admin.adherent.gerer'))
->end() ->end()
; ;
parent::configureFormFields($formMapper); parent::configureFormFields($formMapper);
......
...@@ -42,7 +42,7 @@ class CotisationAdmin extends AbstractAdmin ...@@ -42,7 +42,7 @@ class CotisationAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice); return MoyenEnum::getTypeName($choice);
}, },
)) ))
->add('user.cotisations.first.recu', CheckboxType::class, array('label' => 'Reçu')) ->add('recu', CheckboxType::class, array('label' => 'Reçu'))
->end() ->end()
->with('Date', ['class' => 'col-md-4']) ->with('Date', ['class' => 'col-md-4'])
->add('debut', null, array( ->add('debut', null, array(
......
...@@ -37,7 +37,7 @@ class CotisationPrestataireAdmin extends CotisationAdmin ...@@ -37,7 +37,7 @@ class CotisationPrestataireAdmin extends CotisationAdmin
{ {
$formMapper $formMapper
->with('Cotisation', ['class' => 'col-md-8']) ->with('Cotisation', ['class' => 'col-md-8'])
->add('user', null, array('label' => 'Utilisateur'), array('admin_code' => 'admin.prestataire.gerer')) ->add('user', null, array('label' => 'Prestataire'), array('admin_code' => 'admin.prestataire.gerer'))
->end() ->end()
; ;
parent::configureFormFields($formMapper); parent::configureFormFields($formMapper);
......
...@@ -11,14 +11,21 @@ use Sonata\AdminBundle\Form\Type\Filter\ChoiceType; ...@@ -11,14 +11,21 @@ use Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
use Sonata\AdminBundle\Route\RouteCollection; use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper; use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType as SChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType as SChoiceType;
use Symfony\Component\Translation\TranslatorInterface;
class FluxAdmin extends AbstractAdmin class FluxAdmin extends AbstractAdmin
{ {
protected $translator;
protected $datagridValues = [ protected $datagridValues = [
'_sort_order' => 'DESC', '_sort_order' => 'DESC',
'_sort_by' => 'createdAt', '_sort_by' => 'createdAt',
]; ];
public function setTranslator(TranslatorInterface $translator)
{
$this->translator = $translator;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
...@@ -70,13 +77,18 @@ class FluxAdmin extends AbstractAdmin ...@@ -70,13 +77,18 @@ class FluxAdmin extends AbstractAdmin
public function getTemplate($name) public function getTemplate($name)
{ {
if ($name == 'list') { if ($name == 'list') {
return 'block/fluxlist.html.twig'; return 'block/base_list_with_total.html.twig';
} }
return parent::getTemplate($name); return parent::getTemplate($name);
} }
public function getTotalTransaction() public function getTotalLabel()
{
return $this->translator->trans('Total des transactions :');
}
public function getTotal()
{ {
$datagrid = $this->getDatagrid(); $datagrid = $this->getDatagrid();
$datagrid->buildPager(); $datagrid->buildPager();
......
...@@ -4,6 +4,7 @@ namespace App\Admin; ...@@ -4,6 +4,7 @@ namespace App\Admin;
use App\Entity\Comptoir; use App\Entity\Comptoir;
use App\Entity\Siege; use App\Entity\Siege;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\ListMapper;
...@@ -48,6 +49,10 @@ class GroupeAdmin extends AbstractAdmin ...@@ -48,6 +49,10 @@ class GroupeAdmin extends AbstractAdmin
'label' => 'Nom du groupe :', 'label' => 'Nom du groupe :',
'required' => true 'required' => true
)) ))
->add('content', CKEditorType::class, array(
'label' => 'Description :',
'required' => false,
))
->add('comptoirs', CollectionType::class, array( ->add('comptoirs', CollectionType::class, array(
'label' => 'Comptoirs', 'label' => 'Comptoirs',
'entry_type' => EntityType::class, 'entry_type' => EntityType::class,
...@@ -94,6 +99,7 @@ class GroupeAdmin extends AbstractAdmin ...@@ -94,6 +99,7 @@ class GroupeAdmin extends AbstractAdmin
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
$listMapper $listMapper
->addIdentifier('name', null, array('label' => 'Nom du groupe')) ->addIdentifier('name', null, array('label' => 'Nom du groupe'))
->addIdentifier('content', 'html', array('truncate' => array('length' => 80), 'label' => 'Description'))
->add( ->add(
'getPrestatairesCount', 'getPrestatairesCount',
null, null,
......
...@@ -44,14 +44,14 @@ class Groupe ...@@ -44,14 +44,14 @@ class Groupe
/** /**
* @var ArrayCollection|Comptoir[] * @var ArrayCollection|Comptoir[]
* @ORM\OneToMany(targetEntity="Comptoir", mappedBy="groupe", cascade={"persist"}, fetch="EXTRA_LAZY") * @ORM\OneToMany(targetEntity="Comptoir", mappedBy="groupe", fetch="EXTRA_LAZY")
* @ORM\OrderBy({"name": "ASC"}) * @ORM\OrderBy({"name": "ASC"})
*/ */
private $comptoirs; private $comptoirs;
/** /**
* @var ArrayCollection|Prestataire[] * @var ArrayCollection|Prestataire[]
* @ORM\OneToMany(targetEntity="Prestataire", mappedBy="prestataireGroup", cascade={"persist"}, fetch="EXTRA_LAZY") * @ORM\OneToMany(targetEntity="Prestataire", mappedBy="prestataireGroup", fetch="EXTRA_LAZY")
* @ORM\OrderBy({"raison": "ASC"}) * @ORM\OrderBy({"raison": "ASC"})
*/ */
private $prestataires; private $prestataires;
......
...@@ -137,13 +137,13 @@ class Prestataire ...@@ -137,13 +137,13 @@ class Prestataire
/** /**
* @var Groupe $prestataireGroup * @var Groupe $prestataireGroup
* *
* @ORM\ManyToOne(targetEntity="App\Entity\Groupe", cascade={"persist", "remove"}, inversedBy="prestataires") * @ORM\ManyToOne(targetEntity="App\Entity\Groupe", inversedBy="prestataires")
*/ */
private $prestataireGroup; private $prestataireGroup;
/** /**
* @var ArrayCollection|Amap[] * @var ArrayCollection|Amap/Marché[]
* @ORM\ManyToMany(targetEntity="Groupeprestataire", mappedBy="prestataires", cascade={"persist"}, fetch="EXTRA_LAZY") * @ORM\ManyToMany(targetEntity="Groupeprestataire", mappedBy="prestataires", fetch="EXTRA_LAZY")
* @ORM\JoinTable(name="groupes_prestataires") * @ORM\JoinTable(name="groupes_prestataires")
*/ */
private $groupeprestataires; private $groupeprestataires;
......
...@@ -29,7 +29,7 @@ class Siege ...@@ -29,7 +29,7 @@ class Siege
/** /**
* @var ArrayCollection|Groupe[] * @var ArrayCollection|Groupe[]
* @ORM\OneToMany(targetEntity="Groupe", mappedBy="siege", cascade={"persist"}) * @ORM\OneToMany(targetEntity="Groupe", mappedBy="siege")
*/ */
private $groupes; private $groupes;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransactionAdherentPrestataire extends Transaction class TransactionAdherentPrestataire extends Transaction
{ {
/** /**
* @ORM\OneToOne(targetEntity="Adherent", cascade={"all"}) * @ORM\OneToOne(targetEntity="Adherent")
* @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Prestataire", cascade={"all"}) * @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransactionPrestataireAdherent extends Transaction class TransactionPrestataireAdherent extends Transaction
{ {
/** /**
* @ORM\OneToOne(targetEntity="Prestataire", cascade={"all"}) * @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Adherent", cascade={"all"}) * @ORM\OneToOne(targetEntity="Adherent")
* @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransactionPrestatairePrestataire extends Transaction class TransactionPrestatairePrestataire extends Transaction
{ {
/** /**
* @ORM\OneToOne(targetEntity="Prestataire", cascade={"all"}) * @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Prestataire", cascade={"all"}) * @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_dest_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="prestataire_dest_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransfertComptoirAdherent extends Transfert class TransfertComptoirAdherent extends Transfert
{ {
/** /**
* @ORM\OneToOne(targetEntity="Comptoir", cascade={"all"}) * @ORM\OneToOne(targetEntity="Comptoir")
* @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Adherent", cascade={"all"}) * @ORM\OneToOne(targetEntity="Adherent")
* @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransfertComptoirGroupe extends Transfert class TransfertComptoirGroupe extends Transfert
{ {
/** /**
* @ORM\OneToOne(targetEntity="Comptoir", cascade={"all"}) * @ORM\OneToOne(targetEntity="Comptoir")
* @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Groupe", cascade={"all"}) * @ORM\OneToOne(targetEntity="Groupe")
* @ORM\JoinColumn(name="groupe_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="groupe_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransfertComptoirPrestataire extends Transfert class TransfertComptoirPrestataire extends Transfert
{ {
/** /**
* @ORM\OneToOne(targetEntity="Comptoir", cascade={"all"}) * @ORM\OneToOne(targetEntity="Comptoir")
* @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Prestataire", cascade={"all"}) * @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransfertGroupeComptoir extends Transfert class TransfertGroupeComptoir extends Transfert
{ {
/** /**
* @ORM\OneToOne(targetEntity="Groupe", cascade={"all"}) * @ORM\OneToOne(targetEntity="Groupe")
* @ORM\JoinColumn(name="groupe_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="groupe_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Comptoir", cascade={"all"}) * @ORM\OneToOne(targetEntity="Comptoir")
* @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransfertPrestataireComptoir extends Transfert class TransfertPrestataireComptoir extends Transfert
{ {
/** /**
* @ORM\OneToOne(targetEntity="Prestataire", cascade={"all"}) * @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Comptoir", cascade={"all"}) * @ORM\OneToOne(targetEntity="Comptoir")
* @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="comptoir_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -16,13 +16,13 @@ use Doctrine\ORM\Mapping as ORM;
class TransfertSiegeGroupe extends Transfert class TransfertSiegeGroupe extends Transfert
{ {
/** /**
* @ORM\OneToOne(targetEntity="Siege", cascade={"all"}) * @ORM\OneToOne(targetEntity="Siege")
* @ORM\JoinColumn(name="siege_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="siege_id", referencedColumnName="id", nullable=true)
*/ */
protected $expediteur; protected $expediteur;
/** /**
* @ORM\OneToOne(targetEntity="Groupe", cascade={"all"}) * @ORM\OneToOne(targetEntity="Groupe")
* @ORM\JoinColumn(name="groupe_id", referencedColumnName="id", nullable=true) * @ORM\JoinColumn(name="groupe_id", referencedColumnName="id", nullable=true)
*/ */
protected $destinataire; protected $destinataire;
......
...@@ -59,12 +59,12 @@ class User extends BaseUser ...@@ -59,12 +59,12 @@ class User extends BaseUser
/** /**
* @var ArrayCollection|Cotisation[] * @var ArrayCollection|Cotisation[]
* *
* @ORM\OneToMany(targetEntity="Cotisation", mappedBy="user", cascade={"all"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="Cotisation", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/ */
private $cotisations; private $cotisations;
/** /**
* @ORM\OneToMany(targetEntity="Flux", mappedBy="operateur", cascade={"all"}) * @ORM\OneToMany(targetEntity="Flux", mappedBy="operateur")
*/ */
protected $flux; protected $flux;
......
<?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 Version20190124180511 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE cotisation CHANGE moyen moyen VARCHAR(100) NOT 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() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE cotisation CHANGE moyen moyen VARCHAR(20) NOT NULL COLLATE utf8mb4_unicode_ci');
}
}
{% extends '@SonataAdmin/CRUD/base_list.html.twig' %} {% extends '@SonataAdmin/CRUD/base_list.html.twig' %}
{% block list_header %} {% block list_header %}
<div class="pull-left" style="margin: 10px 5px;"> {% if admin.total is defined %}
<label for="{{ admin.uniqid }}_sum_of_orders" class="control-label">Total des transactions : </label> <div class="pull-left" style="margin: 10px 5px;">
<label class="control-label">{{ admin.getTotalTransaction() }}</label> <label for="{{ admin.uniqid }}_sum_of_orders" class="control-label">{{ admin.totalLabel is defined ? admin.totalLabel : 'Total : '}}</label>
</div> <label class="control-label">{{ admin.total }}</label>
</div>
{% endif %}
{% endblock %} {% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment