/** * @param \Sonata\AdminBundle\Form\FormMapper $formMapper * @return \Sonata\AdminBundle\Form\FormMapper|void */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $id = $this->getRequest()->get($this->getIdParameter()); $formMapper->add('tiers', null, array('label' => $this->getFieldLabel('tiers')))->add('date_piece', null, array('label' => $this->getFieldLabel('date_piece'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime))->add('numero_piece', null, array('label' => $this->getFieldLabel('numero_piece')))->add('devise', null, array('label' => $this->getFieldLabel('devise_id'), 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('d')->orderBy('d.alias', 'ASC'); }))->add('montant_HT_en_devise', null, array('attr' => array('class' => 'money'), 'label' => $this->getFieldLabel('montant_HT_en_devise')))->add('mois', 'mois', array('label' => $this->getFieldLabel('mois'), 'disabled' => !$id && $this->getLocking() || $this->isObjectLocked() ? true : false))->add('taux_de_change', null, array('label' => $this->getFieldLabel('taux_de_change'), 'required' => false))->add('HT', 'money', array('label' => $this->getFieldLabel('HT'), 'required' => false))->add('commentaires', null, array('label' => $this->getFieldLabel('commentaires'))); }
/** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $id = $this->getRequest()->get($this->getIdParameter()); if ($id) { $formMapper->add('mois', null, array('label' => $this->getFieldLabel('mois'), 'disabled' => true)); } $formMapper->add('n_ligne', null, array('label' => $this->getFieldLabel('n_ligne')))->add('nomenclature', null, array('label' => $this->getFieldLabel('nomenclature')))->add('pays_destination', null, array('label' => $this->getFieldLabel('pays_id_destination'), 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('p')->andWhere('p.destination=1')->orderBy('p.code'); }, 'property' => 'code'))->add('valeur_fiscale', 'money', array('label' => $this->getFieldLabel('valeur_fiscale'), 'required' => false))->add('regime', 'choice', array('label' => $this->getFieldLabel('regime'), 'choices' => array(21 => 21, 25 => 25, 26 => 26, 29 => 29, 31 => 31), 'empty_value' => ''))->add('valeur_statistique', 'money', array('label' => $this->getFieldLabel('valeur_statistique'), 'required' => false))->add('masse_mette', null, array('label' => $this->getFieldLabel('masse_mette'), 'attr' => array('min' => 0)))->add('unites_supplementaires', null, array('label' => $this->getFieldLabel('unites_supplementaires'), 'attr' => array('min' => 0)))->add('nature_transaction', 'choice', array('label' => $this->getFieldLabel('nature_transaction'), 'choices' => $this->_nature_transaction_source, 'empty_value' => null, 'data' => !$id ? 0 : null))->add('conditions_livraison', null, array('label' => $this->getFieldLabel('conditions_livraison')))->add('mode_transport', null, array('label' => $this->getFieldLabel('mode_transport')))->add('departement', null, array('label' => $this->getFieldLabel('departement')))->add('CEE', null, array('label' => $this->getFieldLabel('CEE'))); }
/** * @param \Sonata\AdminBundle\Form\FormMapper $formMapper * @return \Sonata\AdminBundle\Form\FormMapper|void */ protected function configureFormFields(FormMapper $formMapper) { parent::configureFormFields($formMapper); $id = $this->getRequest()->get($this->getIdParameter()); $formMapper->add('tiers', null, array('label' => $this->getFieldLabel('tiers')))->add('date_piece', null, array('label' => $this->getFieldLabel('date_piece'), 'attr' => array('class' => 'datepicker'), 'widget' => 'single_text', 'input' => 'datetime', 'format' => $this->date_format_datetime))->add('numero_piece', null, array('label' => $this->getFieldLabel('numero_piece')))->add('taux_de_TVA', 'choice', array('label' => $this->getFieldLabel('taux_de_TVA'), 'choices' => $this->_taux_de_TVA_rates, 'empty_value' => ''))->add('TVA', 'money', array('label' => $this->getFieldLabel('TVA'), 'required' => false))->add('mois', 'mois', array('label' => $this->getFieldLabel('mois'), 'disabled' => !$id && $this->getLocking() || $this->isObjectLocked() ? true : false))->add('commentaires', null, array('label' => $this->getFieldLabel('commentaires'))); }