fix formatting
This commit is contained in:
parent
f31ac53f39
commit
2f16a34aa4
|
@ -1,10 +1,12 @@
|
||||||
<!--ok loading done-->
|
<!--ok loading done-->
|
||||||
<div id="loaded" ng-if="initLoadDone">
|
<div id="loaded" ng-if="initLoadDone">
|
||||||
{% include 'logged/angular/messages.html.twig' %}
|
|
||||||
|
|
||||||
<!--caisse IHM-->
|
<!--caisse IHM-->
|
||||||
<div id="load_ok">
|
<div id="load_ok">
|
||||||
|
|
||||||
<div class="listing-products col-xs-7">
|
<div class="listing-products col-xs-7">
|
||||||
|
{% include 'logged/angular/messages.html.twig' %}
|
||||||
{% include 'logged/angular/listing-products.html.twig' %}
|
{% include 'logged/angular/listing-products.html.twig' %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,15 +15,18 @@
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
|
||||||
{% include 'logged/angular/validate-button.html.twig' %}
|
{% include 'logged/angular/validate-button.html.twig' %}
|
||||||
{% include 'logged/angular/current.html.twig' %}
|
{% if app.user.products |length %}
|
||||||
|
|
||||||
|
{% include 'logged/angular/current.html.twig' %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{#{% include 'logged/angular/paused.html.twig' %}#}
|
{#{% include 'logged/angular/paused.html.twig' %}#}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="other_time">
|
<div id="other_time">
|
||||||
|
|
||||||
Festival choisi par l'utilsateur:
|
|
||||||
{{ app.user.activeFestival.name }}
|
|
||||||
{% include 'logged/angular/recent.html.twig' %}
|
{% include 'logged/angular/recent.html.twig' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,9 +8,29 @@
|
||||||
<i class="fa fa-info"></i>
|
<i class="fa fa-info"></i>
|
||||||
Vous n'avez pas encore enregistré de <strong>produit</strong>, ajoutez-en donc.
|
Vous n'avez pas encore enregistré de <strong>produit</strong>, ajoutez-en donc.
|
||||||
</div>
|
</div>
|
||||||
Créez facilement vos catégories de produits et vos produits juste en écrivant un nom par ligne dans
|
|
||||||
{% endverbatim %}
|
{% endverbatim %}
|
||||||
<a class="btn btn-success" href="{{ path('import') }}">l'interface d'importation simplifiée</a>
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
{% if app.user.activeFestival is null %}
|
||||||
|
<div id="no-products" class="alert alert-info" ng-if="!productsFromDB.length">
|
||||||
|
<i class="fa fa-info"></i>
|
||||||
|
Sélectionnez un <strong>festival</strong> pour grouper vos ventes clients par évènement.
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if not app.user.products |length %}
|
||||||
|
<div>
|
||||||
|
|
||||||
|
Créez facilement vos catégories de produits et vos produits juste en écrivant un nom par ligne dans
|
||||||
|
|
||||||
|
<a class="btn btn-success" href="{{ path('import') }}">l'interface d'importation simplifiée</a>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% verbatim %}
|
{% verbatim %}
|
||||||
<!--end messages warning-->
|
<!--end messages warning-->
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<i class="fa fa-shopping-cart"></i>
|
<i class="fa fa-shopping-cart"></i>
|
||||||
panier moyen
|
panier moyen
|
||||||
<div class="chiffre">
|
<div class="chiffre">
|
||||||
{{ chiffreAffaires / (recentSells |length) }} €
|
{{ chiffreAffaires / ((recentSells |length) or 1) }} €
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h2>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -9,14 +9,16 @@
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<strong>Vous pouvez copier et adapter cet exemple: </strong>
|
<strong>Vous pouvez copier et adapter cet exemple: </strong>
|
||||||
<pre>
|
<pre>
|
||||||
catégorie: livre
|
catégorie: livre
|
||||||
mon livre 1;5€
|
les moutaines;5€
|
||||||
mon livre 2;6€
|
la laine des moutons;6€
|
||||||
mon livre 2;7€
|
star wars spécial noël;7€
|
||||||
catégorie: poster
|
catégorie: poster
|
||||||
super bannière A2;10€
|
super bannière A2;10€
|
||||||
catégorie: dessin à la demande
|
Sébastien Chabal sexy;10€
|
||||||
dessin;20€
|
catégorie: dessin à la demande
|
||||||
|
dessin A4 crayon;20€
|
||||||
|
dessin A4 aquarelle;150€
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<label for="produits">
|
<label for="produits">
|
||||||
|
|
|
@ -86,23 +86,26 @@ class DefaultController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
$activeFestival = $currentUser->getActiveFestival();
|
$activeFestival = $currentUser->getActiveFestival();
|
||||||
// if ( ! $activeFestival ) {
|
if ( ! $activeFestival ) {
|
||||||
// $activeFestival = $m->getRepository( 'AppBundle:Festival' )
|
$activeFestival = $m->getRepository( 'AppBundle:Festival' )
|
||||||
// ->findOneBy( [ 'user' => $this->getUser()->getId() ],
|
->findOneBy( [ 'user' => $this->getUser()->getId() ],
|
||||||
// [ 'id' => 'desc' ],
|
[ 'id' => 'desc' ],
|
||||||
// 0,
|
0,
|
||||||
// 1 );
|
1 );
|
||||||
// if ( ! $activeFestival ) {
|
if ( ! $activeFestival ) {
|
||||||
// $activeFestival = new Festival();
|
$activeFestival = new Festival();
|
||||||
// $activeFestival->setDateCreation( new \DateTime() );
|
$activeFestival->setDateCreation( new \DateTime() )
|
||||||
// $activeFestival->setName( 'default festival' );
|
->setName( 'default festival' )
|
||||||
// $activeFestival->setUser( $currentUser );
|
->setChiffreAffaire( 0 )
|
||||||
// }
|
->setFondDeCaisseAvant( 0 )
|
||||||
// $currentUser->setActiveFestival( $activeFestival );
|
->setFondDeCaisseApres( 0 )
|
||||||
// $m->persist( $activeFestival );
|
->setUser( $currentUser );
|
||||||
// $m->persist( $currentUser );
|
}
|
||||||
// $m->flush();
|
$currentUser->setActiveFestival( $activeFestival );
|
||||||
// }
|
$m->persist( $activeFestival );
|
||||||
|
$m->persist( $currentUser );
|
||||||
|
$m->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$categRepo = $m->getRepository( 'AppBundle:ProductCategory' );
|
$categRepo = $m->getRepository( 'AppBundle:ProductCategory' );
|
||||||
|
@ -396,7 +399,7 @@ class DefaultController extends Controller {
|
||||||
->setName( 'default category' );
|
->setName( 'default category' );
|
||||||
|
|
||||||
foreach ( $myCategories as $my_category ) {
|
foreach ( $myCategories as $my_category ) {
|
||||||
$myCategoriesByName [$my_category->getName()] = $my_category;
|
$myCategoriesByName [ $my_category->getName() ] = $my_category;
|
||||||
foreach ( $my_category->getProducts() as $product ) {
|
foreach ( $my_category->getProducts() as $product ) {
|
||||||
$myProductsByName[ $product->getName() ] = $product;
|
$myProductsByName[ $product->getName() ] = $product;
|
||||||
}
|
}
|
||||||
|
@ -404,12 +407,10 @@ class DefaultController extends Controller {
|
||||||
}
|
}
|
||||||
$massLines = $request->request->get( 'produits' );
|
$massLines = $request->request->get( 'produits' );
|
||||||
if ( $request->getMethod() == 'POST' ) {
|
if ( $request->getMethod() == 'POST' ) {
|
||||||
var_dump( '<pre>' . nl2br( $massLines . '</pre>' ) );
|
|
||||||
$lines = preg_split( '/$\R?^/m', trim( $massLines ) );
|
$lines = preg_split( '/$\R?^/m', trim( $massLines ) );
|
||||||
var_dump( count( $lines ) );
|
|
||||||
foreach ( $lines as $line ) {
|
foreach ( $lines as $line ) {
|
||||||
|
|
||||||
if ( strpos( $line,':' ) ) {
|
if ( strpos( $line, ':' ) ) {
|
||||||
// manage catgegories
|
// manage catgegories
|
||||||
$boom = explode( ':', trim( $line ) );
|
$boom = explode( ':', trim( $line ) );
|
||||||
$firstPart = $boom[ 0 ];
|
$firstPart = $boom[ 0 ];
|
||||||
|
@ -425,7 +426,7 @@ class DefaultController extends Controller {
|
||||||
$currentUser->addCategory( $newCateg );
|
$currentUser->addCategory( $newCateg );
|
||||||
$m->persist( $newCateg );
|
$m->persist( $newCateg );
|
||||||
$currentCategory = $newCateg; // associate further categories with the newly created one
|
$currentCategory = $newCateg; // associate further categories with the newly created one
|
||||||
}else{
|
} else {
|
||||||
echo " la catégorie existe déjà";
|
echo " la catégorie existe déjà";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,8 +435,10 @@ class DefaultController extends Controller {
|
||||||
echo "<br/> $line";
|
echo "<br/> $line";
|
||||||
$boom = explode( ';', $line );
|
$boom = explode( ';', $line );
|
||||||
$productName = $boom[ 0 ];
|
$productName = $boom[ 0 ];
|
||||||
$price = intval( str_replace( '€', '', $boom[ 0 ] ) );
|
$price = 0;
|
||||||
var_dump( $productName );
|
if ( $boom[ 1 ] ) {
|
||||||
|
$price = intval( str_replace( '€', '', $boom[ 1 ] ) );
|
||||||
|
}
|
||||||
// or create new product
|
// or create new product
|
||||||
if ( $productName && ! isset( $myProductsByName[ $productName ] ) ) {
|
if ( $productName && ! isset( $myProductsByName[ $productName ] ) ) {
|
||||||
$newProduct = new Product();
|
$newProduct = new Product();
|
||||||
|
@ -457,8 +460,6 @@ class DefaultController extends Controller {
|
||||||
// check with existing categories and products, sort them by name.
|
// check with existing categories and products, sort them by name.
|
||||||
// save all
|
// save all
|
||||||
$m->flush();
|
$m->flush();
|
||||||
} else {
|
|
||||||
var_dump( "not post" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render( 'logged/import.html.twig',
|
return $this->render( 'logged/import.html.twig',
|
||||||
|
|
Loading…
Reference in New Issue