descriptions in js, start to test record

This commit is contained in:
Kayn Ty 2018-04-06 15:54:59 +02:00
parent 15cc66ab79
commit 3642e128f9
7 changed files with 46 additions and 35 deletions

View File

@ -1,10 +1,15 @@
{% verbatim %}
<div class="current-selling">
<form action="#">
Festival: {{ activeFestival.name }}
<input type="text" ng-model="activeFestival.commentaire">
Festival:
<input type="text" ng-model="activeFestival.name" placeholder="nom du festival">
<input type="text" ng-model="activeFestival.commentaire" placeholder="commentaire">
<hr>
Client actuel:
{{ activeSelling.length }} produits
<input type="text" ng-model="commentaire" placeholder="commentaire">
<hr>
<ul>
<li ng-repeat="p in activeSelling track by $index">
<div class="row">

View File

@ -12,24 +12,10 @@
<div class="sellings col-xs-5">
{% include 'logged/angular/current.html.twig' %}
{% include 'logged/angular/paused.html.twig' %}
{% include 'logged/angular/recent.html.twig' %}
<div class="selling-history">
<h4>
Ventes récentes
</h4>
{% if recentSells %}
<ul>
{% for s in recentSells %}
<li>{{ s.date|date('Y/m/d H:i:s') }} {{ s.amount }}€</li>
{% endfor %}
</ul>
{% else %}
aucune
{% endif %}
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,14 @@
<div class="selling-history">
<h4>
Ventes récentes
</h4>
{% if recentSells %}
<ul>
{% for s in recentSells %}
<li>{{ s.date|date('Y/m/d H:i:s') }} {{ s.amount }}€</li>
{% endfor %}
</ul>
{% else %}
aucune
{% endif %}
</div>

View File

@ -7,7 +7,7 @@
<div id="not_loaded" ng-if="!initLoadDone">
<div class="well">
<i class="fa fa-refresh fa-3x"></i> Chargement en cours de vos produits
<i class="fa fa-refresh fa-spin fa-3x"></i> Chargement en cours de vos produits
</div>
</div>
{% endverbatim %}

View File

@ -9,6 +9,6 @@
filter: alpha(opacity=20);
width: 100vw;
height: 100vh;
position: absolute;
position: fixed;
overflow: hidden;
}

View File

@ -3,18 +3,14 @@ var stuff = ['initialstuff'];
angular
.module('caisse', [])
.controller('CaisseCtrl', ['$scope', '$http', function ($scope, $http, stuff) {
$scope.productsFromDB = [
{id: 1, name: "truc 1", price: 8, category: 1},
{id: 2, name: "truc 2", price: 2, category: 1},
{id: 3, name: "truc 3", price: 4, category: 2},
{id: 4, name: "truc 4", price: 1, category: 2},
];
$scope.categories = [];
$scope.initLoadDone = false;
$scope.productsFromDB = []; // loaded products
$scope.categories = []; // product categories
$scope.commentaire = []; // comment about the client or the current selling
$scope.initLoadDone = false; // becames true after first init of product loading
$scope.recentSellings = [];
$scope.pausedSelling = [];
$scope.activeSelling = [];
$scope.activeFestival = {
$scope.activeSelling = []; // list of products to sell
$scope.activeFestival = { // an event where selling take place
name : "le festival",
dateCreation: new Date(),
commentaire : ""
@ -71,8 +67,13 @@ angular
$scope.activeSelling = angular.copy(sellingList);
$scope.pausedSelling.splice(index, 1);
};
$scope.clearCurrentSelling = function () {
$scope.commentaire = "";
$scope.activeSelling = [];
};
$scope.sendForm = function () {
let lesParams = {
sellingComment: $scope.commentaire,
activeSelling : $scope.activeSelling,
activeFestival: $scope.activeFestival
};

View File

@ -11,11 +11,6 @@ use Doctrine\ORM\Mapping as ORM;
class SellRecord {
use Commentable;
/**
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="sellRecords")
*/
private $productsSold;
/**
* @ORM\Id
* @ORM\GeneratedValue
@ -23,11 +18,20 @@ class SellRecord {
*/
private $id;
/**
* liste des produits de la vente
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="sellRecords")
*/
private $productsSold;
/**
* creation date
* @ORM\Column(type="datetime")
*/
private $date;
/**
* total
* @ORM\Column(type="decimal", scale=2, nullable=true)
*/
private $amount;
@ -39,6 +43,7 @@ class SellRecord {
private $festival;
/**
* owner of the selling account
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="sellRecords")
*/
private $user;