/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $formMapper->with($this->getFieldLabel('title'))->add('mode_de_facturation', null, array('label' => $this->getFieldLabel('mode_de_facturation'), 'empty_value' => '', 'required' => false, 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('u')->orderBy('u.name', 'ASC'); }))->add('value', 'money', array('label' => $this->getFieldLabel('value')))->add('value_percentage', 'percent', array('label' => $this->getFieldLabel('value_percentage'))); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $id = $this->request->get($this->getIdParameter()); $raison_sociale_societe = array('label' => $this->getFieldLabel('raison_sociale_societe')); //, 'data' => !$id ? $this->getClient()->getRaisonSociale() : ''); if (!$id && $this->getClient()) { $raison_sociale_societe['data'] = $this->getClient()->getRaisonSociale(); } $formMapper->with($this->getFieldLabel('title'))->add('civilite', null, array('label' => $this->getFieldLabel('civilite')))->add('nom', null, array('label' => $this->getFieldLabel('nom')))->add('prenom', null, array('label' => $this->getFieldLabel('prenom')))->add('telephone_1', null, array('label' => $this->getFieldLabel('telephone_1')))->add('telephone_2', null, array('label' => $this->getFieldLabel('telephone_2')))->add('fax', null, array('label' => $this->getFieldLabel('fax')))->add('email', 'email', array('label' => $this->getFieldLabel('email')))->add('raison_sociale_societe', null, $raison_sociale_societe)->add('affichage_facture_id', 'choice', array('label' => $this->getFieldLabel('affichage_facture_id'), 'empty_value' => '', 'required' => false, 'choices' => array(1 => 1, 2 => 2)))->add('commentaire', null, array('label' => $this->getFieldLabel('commentaire'))); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $id = $this->getRequest()->get($this->getIdParameter()); $doctrine = \AppKernel::getStaticContainer()->get('doctrine'); /* @var $em \Doctrine\ORM\EntityManager */ $em = $doctrine->getManager(); if ($id && ($garantie = $em->getRepository('ApplicationSonataClientBundle:Garantie')->find($id))) { //$typeDocumentId = $document->getTypeDocument()->getId(); $formMapper->with(' ')->add('nom_de_la_banques_id_old', 'hidden', array('data' => $garantie->getNomDeLaBanquesId(), 'mapped' => false)); } $formMapper->with($this->getFieldLabel('title'))->add('type_garantie', null, array('label' => $this->getFieldLabel('type_garantie'), 'disabled' => !!$id))->add('montant', new AmountType(), array('data_class' => 'Application\\Sonata\\ClientBundle\\Entity\\Garantie', 'label' => $this->getFieldLabel('montant')))->add('nom_de_lemeteur', null, array('label' => $this->getFieldLabel('nom_de_lemeteur')))->add('nom_de_la_banques_id', 'choice', array('label' => $this->getFieldLabel('nom_de_la_banques_id'), 'data' => $id ? null : 1, 'choices' => Garantie::getNomDeLaBanques()))->add('num_de_ganrantie', null, array('label' => $this->getFieldLabel('num_de_ganrantie'), 'data' => $id ? null : 'sans référence'))->add('date_demission', null, array('label' => $this->getFieldLabel('date_demission'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime))->add('date_decheance', null, array('label' => $this->getFieldLabel('date_decheance'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime))->add('expire', null, array('label' => $this->getFieldLabel('expire')))->add('note', null, array('label' => $this->getFieldLabel('note'))); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $id = $this->getRequest()->get($this->getIdParameter()); $client = $this->getClient(); $typeDocumentId = 0; $typeDocDisabled = false; $dateNotaire = null; $dateApostille = null; if ($id && ($document = $this->getObject($id))) { if ($document->getTypeDocument()) { $typeDocumentId = $document->getTypeDocument()->getId(); } $dateNotaire = $document->getDateNotaire(); $dateApostille = $document->getDateApostille(); } // 2 = Pouvoir || 3 = Accord if ($typeDocumentId == 2 || $typeDocumentId == 3) { $typeDocDisabled = true; } $formMapper->with($this->getFieldLabel('title'))->add('local_file_path', 'hidden')->add('file', 'file', array('label' => $this->getFieldLabel('document'), 'required' => false))->add('type_document', null, array('label' => $this->getFieldLabel('type_document'), 'disabled' => $typeDocDisabled, 'query_builder' => function (EntityRepository $er) use($client) { $builder = $er->createQueryBuilder('t'); $filter = array(); if ($client) { /** @var $client \Application\Sonata\ClientBundle\Entity\Client */ switch ($client->getNatureDuClient()->getId()) { case ListNatureDuClients::sixE: if ($client->getPaysPostal()->getEU()) { $filter = array(ListTypeDocuments::Mandat, ListTypeDocuments::Attestation_de_TVA, ListTypeDocuments::Mandat_Specifique); } else { $filter = array(ListTypeDocuments::Pouvoir, ListTypeDocuments::Accord, ListTypeDocuments::Lettre_de_designation); } break; case ListNatureDuClients::DEB: $filter = array(ListTypeDocuments::Mandat, ListTypeDocuments::Attestation_de_TVA); break; case ListNatureDuClients::DES: $filter = array(ListTypeDocuments::Mandat); break; } } if (!empty($filter)) { $builder->andWhere('t.id IN (' . implode(',', $filter) . ')'); } return $builder; }))->add('date_document', null, array('label' => $this->getFieldLabel('date_document'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime))->add('preavis', null, array('label' => $this->getFieldLabel('preavis')))->add('particularite', null, array('label' => $this->getFieldLabel('particularite')))->add('date_notaire', null, array('label' => $this->getFieldLabel('date_notaire'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime, 'disabled' => $dateNotaire ? true : false))->add('statut_document_notaire', null, array('label' => $this->getFieldLabel('statut_document_notaire'), 'empty_value' => '', 'required' => false, 'disabled' => $dateNotaire ? true : false))->add('date_apostille', null, array('label' => $this->getFieldLabel('date_apostille'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime, 'disabled' => $dateApostille ? true : false))->add('statut_document_apostille', null, array('label' => $this->getFieldLabel('statut_document_apostille'), 'empty_value' => '', 'required' => false, 'disabled' => $dateApostille ? true : false)); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $formMapper->with($this->getFieldLabel('title'))->add('date', null, array('attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime, 'label' => $this->getFieldLabel('date')))->add('operation', null, array('label' => $this->getFieldLabel('operation')))->add('montant', 'money', array('label' => $this->getFieldLabel('montant')))->add('commentaire', null, array('label' => $this->getFieldLabel('commentaire')))->add('statut', null, array('label' => $this->getFieldLabel('statut'), 'required' => true)); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $formMapper->with($this->getFieldLabel('title'))->add('code', null, array('label' => $this->getFieldLabel('code')))->add('n_de_TVA', null, array('label' => $this->getFieldLabel('n_de_TVA')))->add('date_de_verification', null, array('label' => $this->getFieldLabel('date_de_verification'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime, 'required' => true, 'help' => 'Si site VIES non disponible : indiquer la date du 01/01/2000')); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $formMapper->with($this->getFieldLabel('title'))->add('orders', 'hidden', array('data' => null, 'label' => $this->getFieldLabel('orders')))->add('nom', null, array('label' => $this->getFieldLabel('nom')))->add('location', new LocationType(array('pays' => array('required' => false))), array('data_class' => 'Application\\Sonata\\ClientBundle\\Entity\\Coordonnees', 'adresse_1' => array('required' => false), 'code_postal' => array('required' => false), 'ville' => array('required' => false)), array('type' => 'location'))->add('no_de_compte', null, array('label' => $this->getFieldLabel('no_de_compte')))->add('code_swift', null, array('label' => $this->getFieldLabel('code_swift')))->add('IBAN', null, array('label' => $this->getFieldLabel('IBAN'))); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $label = 'form.' . $this->_prefix_label . '.'; $formMapper->with($label . 'title')->add('tabs', null, array('label' => $label . 'tabs', 'empty_value' => '', 'required' => false))->add('text', null, array('label' => $label . 'text'))->add('is_blocked', null, array('label' => $label . 'is_blocked')); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $label = 'form.' . $this->_prefix_label . '.'; $formMapper->with($label . 'title')->add('date', null, array('label' => $label . 'date', 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime))->add('categorie', null, array('label' => $label . 'categorie'))->add('note', null, array('label' => $label . 'note')); }