frais de festival

This commit is contained in:
Kayn Ty 2018-04-20 10:39:44 +02:00
parent d555484769
commit a6193371e5
8 changed files with 158 additions and 28 deletions

View File

@ -16,3 +16,10 @@ table {
margin-right: 0.5em; margin-right: 0.5em;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
label[required] {
&:after {
content: "*";
color: red;
}
}

View File

@ -86,6 +86,7 @@ class ProductCategoryController extends Controller {
*/ */
public function editAction( Request $request, ProductCategory $productCategory ) { public function editAction( Request $request, ProductCategory $productCategory ) {
$deleteForm = $this->createDeleteForm( $productCategory ); $deleteForm = $this->createDeleteForm( $productCategory );
$productCategory->setUsers( [ $currentUser ] );
$editForm = $this->createForm( 'AppBundle\Form\ProductCategoryType', $productCategory ); $editForm = $this->createForm( 'AppBundle\Form\ProductCategoryType', $productCategory );
$editForm->handleRequest( $request ); $editForm->handleRequest( $request );

View File

@ -65,6 +65,22 @@ class Festival {
* @ORM\Column(name="chiffre_affaire", type="float") * @ORM\Column(name="chiffre_affaire", type="float")
*/ */
private $chiffreAffaire; private $chiffreAffaire;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisInscription;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisHebergement;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisTransport;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisRepas;
public function recalculateChiffreAffaire() { public function recalculateChiffreAffaire() {
@ -270,4 +286,92 @@ class Festival {
public function getChiffreAffaire() { public function getChiffreAffaire() {
return $this->chiffreAffaire; return $this->chiffreAffaire;
} }
/**
* Set fraisInscription.
*
* @param string|null $fraisInscription
*
* @return Festival
*/
public function setFraisInscription( $fraisInscription = null ) {
$this->fraisInscription = $fraisInscription;
return $this;
}
/**
* Get fraisInscription.
*
* @return string|null
*/
public function getFraisInscription() {
return $this->fraisInscription;
}
/**
* Set fraisHebergement.
*
* @param string|null $fraisHebergement
*
* @return Festival
*/
public function setFraisHebergement( $fraisHebergement = null ) {
$this->fraisHebergement = $fraisHebergement;
return $this;
}
/**
* Get fraisHebergement.
*
* @return string|null
*/
public function getFraisHebergement() {
return $this->fraisHebergement;
}
/**
* Set fraisTransport.
*
* @param string|null $fraisTransport
*
* @return Festival
*/
public function setFraisTransport( $fraisTransport = null ) {
$this->fraisTransport = $fraisTransport;
return $this;
}
/**
* Get fraisTransport.
*
* @return string|null
*/
public function getFraisTransport() {
return $this->fraisTransport;
}
/**
* Set fraisRepas.
*
* @param string|null $fraisRepas
*
* @return Festival
*/
public function setFraisRepas( $fraisRepas = null ) {
$this->fraisRepas = $fraisRepas;
return $this;
}
/**
* Get fraisRepas.
*
* @return string|null
*/
public function getFraisRepas() {
return $this->fraisRepas;
}
} }

View File

@ -65,6 +65,22 @@ class Festival {
* @ORM\Column(name="chiffre_affaire", type="float") * @ORM\Column(name="chiffre_affaire", type="float")
*/ */
private $chiffreAffaire; private $chiffreAffaire;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisInscription;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisHebergement;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisTransport;
/**
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $fraisRepas;
public function recalculateChiffreAffaire() { public function recalculateChiffreAffaire() {

View File

@ -13,6 +13,10 @@ class FestivalType extends AbstractType {
public function buildForm( FormBuilderInterface $builder, array $options ) { public function buildForm( FormBuilderInterface $builder, array $options ) {
$builder $builder
->add( 'name' ) ->add( 'name' )
->add( 'fraisInscription' )
->add( 'fraisTransport' )
->add( 'fraisHebergement' )
->add( 'fraisRepas' )
->add( 'chiffreAffaire' ) ->add( 'chiffreAffaire' )
->add( 'fondDeCaisseAvant' ) ->add( 'fondDeCaisseAvant' )
->add( 'fondDeCaisseApres' ) ->add( 'fondDeCaisseApres' )

View File

@ -18,8 +18,8 @@ class ProductType extends AbstractType {
->add( 'stockCount' ) ->add( 'stockCount' )
->add( 'price' ) ->add( 'price' )
->add( 'comment' ) ->add( 'comment' )
->add( 'category' ) ->add( 'category' )// ->add( 'user' )
->add( 'user' ); ;
} }
/** /**

View File

@ -6,29 +6,27 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
class SellRecordType extends AbstractType class SellRecordType extends AbstractType {
{
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm( FormBuilderInterface $builder, array $options ) {
{
$builder->add( 'products' ); $builder->add( 'products' );
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\SellRecord'
));
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getBlockPrefix() public function configureOptions( OptionsResolver $resolver ) {
{ $resolver->setDefaults( [
'data_class' => 'AppBundle\Entity\SellRecord',
] );
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix() {
return 'appbundle_sellrecord'; return 'appbundle_sellrecord';
} }