diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
diff --git a/app/.htaccess b/app/.htaccess
old mode 100644
new mode 100755
diff --git a/app/AppCache.php b/app/AppCache.php
old mode 100644
new mode 100755
diff --git a/app/AppKernel.php b/app/AppKernel.php
old mode 100644
new mode 100755
diff --git a/app/Resources/FOSUserBundle/views/layout.html.twig b/app/Resources/FOSUserBundle/views/layout.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/HWIOAuthBundle/Controller/ConnectController.php b/app/Resources/HWIOAuthBundle/Controller/ConnectController.php
old mode 100644
new mode 100755
diff --git a/app/Resources/HWIOAuthBundle/views/Connect/login.html.twig b/app/Resources/HWIOAuthBundle/views/Connect/login.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/HWIOAuthBundle/views/layout.html.twig b/app/Resources/HWIOAuthBundle/views/layout.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/default/footer.html.twig b/app/Resources/views/default/footer.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/default/header.html.twig b/app/Resources/views/default/header.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/default/login-choices.html.twig b/app/Resources/views/default/login-choices.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/default/main-screen.html.twig b/app/Resources/views/default/main-screen.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/festival/edit.html.twig b/app/Resources/views/festival/edit.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/festival/index.html.twig b/app/Resources/views/festival/index.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/festival/new.html.twig b/app/Resources/views/festival/new.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/festival/show.html.twig b/app/Resources/views/festival/show.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/logged/angular/current.html.twig b/app/Resources/views/logged/angular/current.html.twig
old mode 100644
new mode 100755
index 545b7cfd..cdf5d195
--- a/app/Resources/views/logged/angular/current.html.twig
+++ b/app/Resources/views/logged/angular/current.html.twig
@@ -1,5 +1,16 @@
{% verbatim %}
+
+
+
+
+{{lesParams|json}}
+
+
{% endverbatim %}
diff --git a/app/Resources/views/logged/angular/loaded-caisse.html.twig b/app/Resources/views/logged/angular/loaded-caisse.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/logged/angular/messages.html.twig b/app/Resources/views/logged/angular/messages.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/logged/angular/paused.html.twig b/app/Resources/views/logged/angular/paused.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/logged/angular/recent.html.twig b/app/Resources/views/logged/angular/recent.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/logged/caisse-main.html.twig b/app/Resources/views/logged/caisse-main.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/logged/dashboard.html.twig b/app/Resources/views/logged/dashboard.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/product/edit.html.twig b/app/Resources/views/product/edit.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/product/new.html.twig b/app/Resources/views/product/new.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/product/show.html.twig b/app/Resources/views/product/show.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/productcategory/edit.html.twig b/app/Resources/views/productcategory/edit.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/productcategory/index.html.twig b/app/Resources/views/productcategory/index.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/productcategory/new.html.twig b/app/Resources/views/productcategory/new.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/productcategory/show.html.twig b/app/Resources/views/productcategory/show.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/sellrecord/edit.html.twig b/app/Resources/views/sellrecord/edit.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/sellrecord/index.html.twig b/app/Resources/views/sellrecord/index.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/sellrecord/new.html.twig b/app/Resources/views/sellrecord/new.html.twig
old mode 100644
new mode 100755
diff --git a/app/Resources/views/sellrecord/show.html.twig b/app/Resources/views/sellrecord/show.html.twig
old mode 100644
new mode 100755
diff --git a/app/config/config.yml b/app/config/config.yml
old mode 100644
new mode 100755
diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml
old mode 100644
new mode 100755
diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml
old mode 100644
new mode 100755
diff --git a/app/config/config_test.yml b/app/config/config_test.yml
old mode 100644
new mode 100755
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist
old mode 100644
new mode 100755
diff --git a/app/config/routing.yml b/app/config/routing.yml
old mode 100644
new mode 100755
diff --git a/app/config/routing_dev.yml b/app/config/routing_dev.yml
old mode 100644
new mode 100755
diff --git a/app/config/security.yml b/app/config/security.yml
old mode 100644
new mode 100755
diff --git a/app/config/services.yml b/app/config/services.yml
old mode 100644
new mode 100755
diff --git a/assets/css/app.scss b/assets/css/app.scss
old mode 100644
new mode 100755
diff --git a/assets/css/pages/demo.scss b/assets/css/pages/demo.scss
old mode 100644
new mode 100755
diff --git a/assets/css/pages/global.scss b/assets/css/pages/global.scss
old mode 100644
new mode 100755
index 407957e0..c24db39f
--- a/assets/css/pages/global.scss
+++ b/assets/css/pages/global.scss
@@ -11,4 +11,5 @@
height: 100vh;
position: fixed;
overflow: hidden;
+ z-index: -1;
}
diff --git a/assets/css/pages/libs.scss b/assets/css/pages/libs.scss
old mode 100644
new mode 100755
diff --git a/assets/css/pages/responsive.scss b/assets/css/pages/responsive.scss
old mode 100644
new mode 100755
diff --git a/assets/css/pages/special.scss b/assets/css/pages/special.scss
old mode 100644
new mode 100755
diff --git a/assets/css/split/custom_vars.scss b/assets/css/split/custom_vars.scss
old mode 100644
new mode 100755
diff --git a/assets/css/split/formulaires.scss b/assets/css/split/formulaires.scss
old mode 100644
new mode 100755
diff --git a/assets/js/app.js b/assets/js/app.js
old mode 100644
new mode 100755
diff --git a/assets/js/parts/main.js b/assets/js/parts/main.js
old mode 100644
new mode 100755
index a9e067c1..c6c10293
--- a/assets/js/parts/main.js
+++ b/assets/js/parts/main.js
@@ -5,15 +5,17 @@ angular
.controller('CaisseCtrl', ['$scope', '$http', function ($scope, $http, stuff) {
$scope.productsFromDB = []; // loaded products
$scope.categories = []; // product categories
- $scope.commentaire = []; // comment about the client or the current selling
+ $scope.sellingComment = "sellingComment"; // comment about the client or the current selling
$scope.initLoadDone = false; // becames true after first init of product loading
$scope.recentSellings = [];
+ $scope.lesParams = {};
+ $scope.paidAmount = 20;
$scope.pausedSelling = [];
$scope.activeSelling = []; // list of products to sell
$scope.activeFestival = { // an event where selling take place
name : "le festival",
dateCreation: new Date(),
- commentaire : ""
+ commentaire : "le com de festival"
};
/**
* get the sum of products prices
@@ -54,6 +56,7 @@ angular
$scope.categories = rep.data.categories;
$scope.recentSellings = rep.data.history;
$scope.initLoadDone = true;
+ $scope.addProduct($scope.categories[0].products[0])
}, (err) => {
console.log(err);
$scope.initLoadDone = true;
@@ -69,16 +72,17 @@ angular
};
$scope.clearCurrentSelling = function () {
$scope.paidAmount = 0;
- $scope.commentaire = "";
+ $scope.sellingComment = "";
$scope.activeSelling = [];
};
$scope.sendForm = function () {
let lesParams = {
paidByClient : $scope.paidAmount,
- sellingComment: $scope.commentaire,
+ sellingComment: $scope.sellingComment,
activeSelling : $scope.activeSelling,
activeFestival: $scope.activeFestival
};
+ $scope.lesParams = lesParams;
$http({
method : 'POST',
url : 'add-selling',
@@ -87,6 +91,7 @@ angular
},
data : lesParams // pass in data as strings
}).then(function (rep) {
+ $scope.clearCurrentSelling();
console.log(rep);
if (!rep.success) {
// if not successful, bind errors to error variables
diff --git a/composer.json b/composer.json
old mode 100644
new mode 100755
diff --git a/composer.lock b/composer.lock
old mode 100644
new mode 100755
diff --git a/install.sh b/install.sh
old mode 100644
new mode 100755
diff --git a/package.json b/package.json
old mode 100644
new mode 100755
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
old mode 100644
new mode 100755
diff --git a/src/.htaccess b/src/.htaccess
old mode 100644
new mode 100755
diff --git a/src/AppBundle/AppBundle.php b/src/AppBundle/AppBundle.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php
old mode 100644
new mode 100755
index 67505b19..bf318304
--- a/src/AppBundle/Controller/DefaultController.php
+++ b/src/AppBundle/Controller/DefaultController.php
@@ -120,11 +120,7 @@ class DefaultController extends Controller {
* @return JsonResponse
*/
public function addSellingAction( Request $request ) {
-// var_dump( $request->request );
-// die();
- $json = json_decode( $request->getContent(), true );
-// var_dump( $json );
-// die();
+ $json = json_decode( $request->getContent(), true );
$currentUser = $this->getUser();
$m = $this->getDoctrine()->getManager();
$newSellRecord = new SellRecord();
@@ -141,24 +137,29 @@ class DefaultController extends Controller {
$productsModelsByID[ $product->getId() ] = $product;
}
+ $sumAmount = 0;
foreach ( $json[ 'activeSelling' ] as $record ) {
- var_dump( $categoriesByID[ $record[ 'category' ] ] );
+ var_dump( $record[ 'category' ] );
+ var_dump( $categoriesByID[ $record[ 'category' ] ]->getName() );
+ $productModel = $productsModelsByID[ $record[ 'id' ] ];
$newProductSold = new ProductSold();
-// $newProductSold->setCategory( $categoriesByID[ $record[ 'category' ] ] );
+// $newProductSold->setCategory( $productModel->getCategory() );
+// $newProductSold->setCategory( 1 );
$newProductSold->setName( $record[ 'name' ] );
$newProductSold->setPrice( $record[ 'price' ] );
- $newProductSold->setProduct( $productsModelsByID[ $record[ 'id' ] ] );
- $newProductSold->setUser( $currentUser );
+ $sumAmount += $record[ 'price' ];
+// $newProductSold->setProduct( $productsModelsByID[ $record[ 'id' ] ] );
+ $newProductSold->setUser( $currentUser->getId() );
$newProductSold->setSellRecords( $newSellRecord );
// link selling record with user, festival
- $currentUser->addProductsSold( $newProductSold );
+// $currentUser->addProductsSold( $newProductSold );
// persist all
$m->persist( $newProductSold );
}
- $newSellRecord->setPaidByClient( 0 );
- $newSellRecord->setAmount( 42 );
+// $newSellRecord->setPaidByClient( 0 );
+ $newSellRecord->setAmount( $sumAmount );
$newSellRecord->setDate( new \DateTime() );
-// $newSellRecord->setPaidByClient( $json[ 'paidByClient' ] );
+ $newSellRecord->setPaidByClient( $json[ 'paidByClient' ] );
$currentUser->addSellRecords( $newSellRecord );
diff --git a/src/AppBundle/Controller/FestivalController.php b/src/AppBundle/Controller/FestivalController.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Controller/ProductCategoryController.php b/src/AppBundle/Controller/ProductCategoryController.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Controller/ProductController.php b/src/AppBundle/Controller/ProductController.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Controller/SellRecordController.php b/src/AppBundle/Controller/SellRecordController.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Entity/Festival.php b/src/AppBundle/Entity/Festival.php
old mode 100644
new mode 100755
index c15a7832..4e69058a
--- a/src/AppBundle/Entity/Festival.php
+++ b/src/AppBundle/Entity/Festival.php
@@ -116,5 +116,35 @@ class Festival {
public function getSellRecords() {
return $this->sellRecords;
}
-}
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->sellRecords = new \Doctrine\Common\Collections\ArrayCollection();
+ }
+ /**
+ * Add sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ *
+ * @return Festival
+ */
+ public function addSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords[] = $sellRecord;
+
+ return $this;
+ }
+
+ /**
+ * Remove sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ */
+ public function removeSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords->removeElement($sellRecord);
+ }
+}
diff --git a/src/AppBundle/Entity/Festival.php~ b/src/AppBundle/Entity/Festival.php~
new file mode 100755
index 00000000..4e69058a
--- /dev/null
+++ b/src/AppBundle/Entity/Festival.php~
@@ -0,0 +1,150 @@
+id;
+ }
+
+ /**
+ * Set name
+ *
+ * @param string $name
+ *
+ * @return Festival
+ */
+ public function setName( $name ) {
+ $this->name = $name;
+
+ return $this;
+ }
+
+ /**
+ * Get name
+ *
+ * @return string
+ */
+ public function getName() {
+ return $this->name;
+ }
+
+ /**
+ * Set dateCreation
+ *
+ * @param \DateTime $dateCreation
+ *
+ * @return Festival
+ */
+ public function setDateCreation( $dateCreation ) {
+ $this->dateCreation = $dateCreation;
+
+ return $this;
+ }
+
+ /**
+ * Get dateCreation
+ *
+ * @return \DateTime
+ */
+ public function getDateCreation() {
+ return $this->dateCreation;
+ }
+
+ /**
+ * Set sellRecords
+ *
+ * @param \stdClass $sellRecords
+ *
+ * @return Festival
+ */
+ public function setSellRecords( $sellRecords ) {
+ $this->sellRecords = $sellRecords;
+
+ return $this;
+ }
+
+ /**
+ * Get sellRecords
+ *
+ * @return \stdClass
+ */
+ public function getSellRecords() {
+ return $this->sellRecords;
+ }
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->sellRecords = new \Doctrine\Common\Collections\ArrayCollection();
+ }
+
+ /**
+ * Add sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ *
+ * @return Festival
+ */
+ public function addSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords[] = $sellRecord;
+
+ return $this;
+ }
+
+ /**
+ * Remove sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ */
+ public function removeSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords->removeElement($sellRecord);
+ }
+}
diff --git a/src/AppBundle/Entity/Product.php b/src/AppBundle/Entity/Product.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Entity/Product.php~ b/src/AppBundle/Entity/Product.php~
old mode 100644
new mode 100755
index 89ccaf3e..652ea05e
--- a/src/AppBundle/Entity/Product.php~
+++ b/src/AppBundle/Entity/Product.php~
@@ -2,6 +2,8 @@
namespace AppBundle\Entity;
+use AppBundle\Traits\Commentable;
+use AppBundle\Traits\Sellable;
use Doctrine\ORM\Mapping as ORM;
/**
@@ -20,18 +22,51 @@ class Product {
*/
private $name;
+
/**
- * @ORM\Column(type="decimal", scale=2, nullable=true)
+ * @ORM\Column(type="string", length=256)
*/
- private $price;
+ private $image;
+
/**
* @ORM\ManyToOne(targetEntity="ProductCategory", inversedBy="products")
*/
private $category;
/**
- * @ORM\OneToMany(targetEntity="SellRecord", mappedBy="products")
+ * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="products")
*/
- private $sellRecords;
+ private $user;
+
+ use Sellable;
+ use Commentable;
+
+ /**
+ * @return mixed
+ */
+ public function getImage() {
+ return $this->image;
+ }
+
+ /**
+ * @param mixed $image
+ */
+ public function setImage( $image ) {
+ $this->image = $image;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getUser() {
+ return $this->user;
+ }
+
+ /**
+ * @param mixed $user
+ */
+ public function setUser( $user ) {
+ $this->user = $user;
+ }
/**
* @return mixed
@@ -88,45 +123,24 @@ class Product {
public function setCategory( ProductCategory $category ) {
$this->category = $category;
}
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->sellRecords = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Add sellRecord
- *
- * @param \AppBundle\Entity\SellRecord $sellRecord
- *
- * @return Product
- */
- public function addSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
- {
- $this->sellRecords[] = $sellRecord;
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ $this->sellRecords = new \Doctrine\Common\Collections\ArrayCollection();
+ }
- return $this;
- }
+ /**
+ * Add sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ *
+ * @return Product
+ */
+ public function addSellRecord( \AppBundle\Entity\SellRecord $sellRecord ) {
+ $this->sellRecords[] = $sellRecord;
- /**
- * Remove sellRecord
- *
- * @param \AppBundle\Entity\SellRecord $sellRecord
- */
- public function removeSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
- {
- $this->sellRecords->removeElement($sellRecord);
- }
-
- /**
- * Get sellRecords
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getSellRecords()
- {
- return $this->sellRecords;
- }
+ return $this;
+ }
}
diff --git a/src/AppBundle/Entity/ProductCategory.php b/src/AppBundle/Entity/ProductCategory.php
old mode 100644
new mode 100755
index 4100d8f4..1ad83588
--- a/src/AppBundle/Entity/ProductCategory.php
+++ b/src/AppBundle/Entity/ProductCategory.php
@@ -118,4 +118,28 @@ class ProductCategory {
public function removeProduct( \AppBundle\Entity\Product $product ) {
$this->products->removeElement( $product );
}
+
+ /**
+ * Add user
+ *
+ * @param \AppBundle\Entity\User $user
+ *
+ * @return ProductCategory
+ */
+ public function addUser(\AppBundle\Entity\User $user)
+ {
+ $this->users[] = $user;
+
+ return $this;
+ }
+
+ /**
+ * Remove user
+ *
+ * @param \AppBundle\Entity\User $user
+ */
+ public function removeUser(\AppBundle\Entity\User $user)
+ {
+ $this->users->removeElement($user);
+ }
}
diff --git a/src/AppBundle/Entity/ProductCategory.php~ b/src/AppBundle/Entity/ProductCategory.php~
old mode 100644
new mode 100755
index f3deb0d2..1ad83588
--- a/src/AppBundle/Entity/ProductCategory.php~
+++ b/src/AppBundle/Entity/ProductCategory.php~
@@ -25,6 +25,29 @@ class ProductCategory {
*/
private $products;
+ /**
+ * @ORM\ManyToMany(targetEntity="AppBundle\Entity\User", mappedBy="categories")
+ */
+ private $users;
+
+ public function __toString() {
+ return $this->getName() . ' (' . count( $this->getProducts() ) . ' produits)';
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getUsers() {
+ return $this->users;
+ }
+
+ /**
+ * @param mixed $users
+ */
+ public function setUsers( $users ) {
+ $this->users = $users;
+ }
+
/**
* @return mixed
*/
@@ -95,4 +118,28 @@ class ProductCategory {
public function removeProduct( \AppBundle\Entity\Product $product ) {
$this->products->removeElement( $product );
}
+
+ /**
+ * Add user
+ *
+ * @param \AppBundle\Entity\User $user
+ *
+ * @return ProductCategory
+ */
+ public function addUser(\AppBundle\Entity\User $user)
+ {
+ $this->users[] = $user;
+
+ return $this;
+ }
+
+ /**
+ * Remove user
+ *
+ * @param \AppBundle\Entity\User $user
+ */
+ public function removeUser(\AppBundle\Entity\User $user)
+ {
+ $this->users->removeElement($user);
+ }
}
diff --git a/src/AppBundle/Entity/ProductSold.php b/src/AppBundle/Entity/ProductSold.php
old mode 100644
new mode 100755
index a459f086..5788de6f
--- a/src/AppBundle/Entity/ProductSold.php
+++ b/src/AppBundle/Entity/ProductSold.php
@@ -8,6 +8,13 @@ use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
*/
class ProductSold extends Product {
+ /**
+ * @ORM\Id
+ * @ORM\GeneratedValue
+ * @ORM\Column(type="integer")
+ */
+ private $id;
+
/**
* the stack of products for one client at one time
@@ -21,6 +28,7 @@ class ProductSold extends Product {
*/
private $user;
+
/**
* references the product from whom this line is inspired
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Product", inversedBy="productsSold")
@@ -34,29 +42,15 @@ class ProductSold extends Product {
/**
* @return mixed
*/
- public function getCategory() {
- return $this->category;
+ public function getId() {
+ return $this->id;
}
/**
- * @param mixed $category
+ * @param mixed $id
*/
- public function setCategory( $category ) {
- $this->category = $category;
- }
-
- /**
- * @return mixed
- */
- public function getSellRecords() {
- return $this->sellRecords;
- }
-
- /**
- * @param mixed $sellRecords
- */
- public function setSellRecords( $sellRecords ) {
- $this->sellRecords = $sellRecords;
+ public function setId( $id ) {
+ $this->id = $id;
}
/**
@@ -76,15 +70,58 @@ class ProductSold extends Product {
/**
* @return mixed
*/
- public function getProduct() {
- return $this->product;
+ public function getCategory() {
+ return $this->category;
}
/**
- * @param mixed $product
+ * @param mixed $category
*/
- public function setProduct( $product ) {
- $this->product = $product;
+ public function setCategory( ProductCategory $category ) {
+ $this->category = $category;
}
+ /**
+ * Set sellRecords
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecords
+ *
+ * @return ProductSold
+ */
+ public function setSellRecords( SellRecord $sellRecords = null ) {
+ $this->sellRecords = $sellRecords;
+
+ return $this;
+ }
+
+ /**
+ * Get sellRecords
+ *
+ * @return \AppBundle\Entity\SellRecord
+ */
+ public function getSellRecords() {
+ return $this->sellRecords;
+ }
+
+ /**
+ * Set product
+ *
+ * @param \AppBundle\Entity\Product $product
+ *
+ * @return ProductSold
+ */
+ public function setProduct( Product $product = null ) {
+ $this->product = $product;
+
+ return $this;
+ }
+
+ /**
+ * Get product
+ *
+ * @return \AppBundle\Entity\Product
+ */
+ public function getProduct() {
+ return $this->product;
+ }
}
diff --git a/src/AppBundle/Entity/ProductSold.php~ b/src/AppBundle/Entity/ProductSold.php~
new file mode 100755
index 00000000..474df410
--- /dev/null
+++ b/src/AppBundle/Entity/ProductSold.php~
@@ -0,0 +1,112 @@
+user;
+ }
+
+ /**
+ * @param mixed $user
+ */
+ public function setUser( $user ) {
+ $this->user = $user;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getCategory() {
+ return $this->category;
+ }
+
+ /**
+ * @param mixed $category
+ */
+ public function setCategory( $category ) {
+ $this->category = $category;
+ }
+
+ /**
+ * Set sellRecords
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecords
+ *
+ * @return ProductSold
+ */
+ public function setSellRecords( \AppBundle\Entity\SellRecord $sellRecords = null ) {
+ $this->sellRecords = $sellRecords;
+
+ return $this;
+ }
+
+ /**
+ * Get sellRecords
+ *
+ * @return \AppBundle\Entity\SellRecord
+ */
+ public function getSellRecords() {
+ return $this->sellRecords;
+ }
+
+ /**
+ * Set product
+ *
+ * @param \AppBundle\Entity\Product $product
+ *
+ * @return ProductSold
+ */
+ public function setProduct( \AppBundle\Entity\Product $product = null ) {
+ $this->product = $product;
+
+ return $this;
+ }
+
+ /**
+ * Get product
+ *
+ * @return \AppBundle\Entity\Product
+ */
+ public function getProduct() {
+ return $this->product;
+ }
+}
diff --git a/src/AppBundle/Entity/SellRecord.php b/src/AppBundle/Entity/SellRecord.php
old mode 100644
new mode 100755
index 166681d7..09347ab4
--- a/src/AppBundle/Entity/SellRecord.php
+++ b/src/AppBundle/Entity/SellRecord.php
@@ -14,7 +14,7 @@ class SellRecord {
/**
* @ORM\Id
* @ORM\GeneratedValue
- * @ORM\Column(name="id")
+ * @ORM\Column(type="integer")
*/
private $id;
/**
@@ -181,4 +181,32 @@ class SellRecord {
$this->date = $date;
}
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ $this->productsSold = new \Doctrine\Common\Collections\ArrayCollection();
+ }
+
+ /**
+ * Add productsSold
+ *
+ * @param \AppBundle\Entity\ProductSold $productsSold
+ *
+ * @return SellRecord
+ */
+ public function addProductsSold( \AppBundle\Entity\ProductSold $productsSold ) {
+ $this->productsSold[] = $productsSold;
+
+ return $this;
+ }
+
+ /**
+ * Remove productsSold
+ *
+ * @param \AppBundle\Entity\ProductSold $productsSold
+ */
+ public function removeProductsSold( \AppBundle\Entity\ProductSold $productsSold ) {
+ $this->productsSold->removeElement( $productsSold );
+ }
}
diff --git a/src/AppBundle/Entity/SellRecord.php~ b/src/AppBundle/Entity/SellRecord.php~
old mode 100644
new mode 100755
index fe09da75..09347ab4
--- a/src/AppBundle/Entity/SellRecord.php~
+++ b/src/AppBundle/Entity/SellRecord.php~
@@ -2,26 +2,142 @@
namespace AppBundle\Entity;
+use AppBundle\Traits\Commentable;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="AppBundle\Repository\SellRecordRepository")
*/
class SellRecord {
- /**
- * @ORM\ManyToOne(targetEntity="Product", inversedBy="sellRecords")
- */
- private $products;
-
+ use Commentable;
/**
* @ORM\Id
* @ORM\GeneratedValue
+ * @ORM\Column(type="integer")
+ */
+ 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=false)
+ */
private $amount;
+ /**
+ * amount paid by client
+ * @ORM\Column(type="decimal", scale=2, nullable=true)
+ */
+ private $paidByClient;
+
+ /**
+ * @var
+ * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Festival",inversedBy="sellRecords")
+ */
+ private $festival;
+
+ /**
+ * owner of the selling account
+ * @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="sellRecords")
+ */
+ private $user;
+
+
+ /**
+ * @return mixed
+ */
+ public function getPaidByClient() {
+ return $this->paidByClient;
+ }
+
+ /**
+ * @param mixed $paidByClient
+ */
+ public function setPaidByClient( $paidByClient ) {
+ $this->paidByClient = $paidByClient;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getComment() {
+ return $this->comment;
+ }
+
+ /**
+ * @param mixed $comment
+ */
+ public function setComment( $comment ) {
+ $this->comment = $comment;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getProductsSold() {
+ return $this->productsSold;
+ }
+
+ /**
+ * @param mixed $productsSold
+ */
+ public function setProductsSold( $productsSold ) {
+ $this->productsSold = $productsSold;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getFestival() {
+ return $this->festival;
+ }
+
+ /**
+ * @param mixed $festival
+ */
+ public function setFestival( $festival ) {
+ $this->festival = $festival;
+ }
+
+
+ /**
+ * @return mixed
+ */
+ public function getUser() {
+ return $this->user;
+ }
+
+ /**
+ * @param mixed $user
+ */
+ public function setUser( $user ) {
+ $this->user = $user;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getAmount() {
+ return $this->amount;
+ }
+
+ /**
+ * @param mixed $amount
+ */
+ public function setAmount( $amount ) {
+ $this->amount = $amount;
+ }
/**
* @return mixed
@@ -59,10 +175,38 @@ class SellRecord {
}
/**
- * @param mixed $date
+ * @param \DateTime $date
*/
- public function setDate( $date ) {
+ public function setDate( \DateTime $date ) {
$this->date = $date;
}
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ $this->productsSold = new \Doctrine\Common\Collections\ArrayCollection();
+ }
+
+ /**
+ * Add productsSold
+ *
+ * @param \AppBundle\Entity\ProductSold $productsSold
+ *
+ * @return SellRecord
+ */
+ public function addProductsSold( \AppBundle\Entity\ProductSold $productsSold ) {
+ $this->productsSold[] = $productsSold;
+
+ return $this;
+ }
+
+ /**
+ * Remove productsSold
+ *
+ * @param \AppBundle\Entity\ProductSold $productsSold
+ */
+ public function removeProductsSold( \AppBundle\Entity\ProductSold $productsSold ) {
+ $this->productsSold->removeElement( $productsSold );
+ }
}
diff --git a/src/AppBundle/Entity/Stuff.php b/src/AppBundle/Entity/Stuff.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Entity/Stuff.php~ b/src/AppBundle/Entity/Stuff.php~
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Entity/User.php b/src/AppBundle/Entity/User.php
old mode 100644
new mode 100755
index ba27724c..cbd88690
--- a/src/AppBundle/Entity/User.php
+++ b/src/AppBundle/Entity/User.php
@@ -164,4 +164,86 @@ class User extends BaseUser {
public function getGoogleId() {
return $this->googleId;
}
+
+ /**
+ * Add product
+ *
+ * @param \AppBundle\Entity\Product $product
+ *
+ * @return User
+ */
+ public function addProduct(\AppBundle\Entity\Product $product)
+ {
+ $this->products[] = $product;
+
+ return $this;
+ }
+
+ /**
+ * Remove product
+ *
+ * @param \AppBundle\Entity\Product $product
+ */
+ public function removeProduct(\AppBundle\Entity\Product $product)
+ {
+ $this->products->removeElement($product);
+ }
+
+ /**
+ * Remove productsSold
+ *
+ * @param \AppBundle\Entity\ProductSold $productsSold
+ */
+ public function removeProductsSold(\AppBundle\Entity\ProductSold $productsSold)
+ {
+ $this->productsSold->removeElement($productsSold);
+ }
+
+ /**
+ * Add category
+ *
+ * @param \AppBundle\Entity\ProductCategory $category
+ *
+ * @return User
+ */
+ public function addCategory(\AppBundle\Entity\ProductCategory $category)
+ {
+ $this->categories[] = $category;
+
+ return $this;
+ }
+
+ /**
+ * Remove category
+ *
+ * @param \AppBundle\Entity\ProductCategory $category
+ */
+ public function removeCategory(\AppBundle\Entity\ProductCategory $category)
+ {
+ $this->categories->removeElement($category);
+ }
+
+ /**
+ * Add sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ *
+ * @return User
+ */
+ public function addSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords[] = $sellRecord;
+
+ return $this;
+ }
+
+ /**
+ * Remove sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ */
+ public function removeSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords->removeElement($sellRecord);
+ }
}
diff --git a/src/AppBundle/Entity/User.php~ b/src/AppBundle/Entity/User.php~
old mode 100644
new mode 100755
index bf42a330..cbd88690
--- a/src/AppBundle/Entity/User.php~
+++ b/src/AppBundle/Entity/User.php~
@@ -28,6 +28,112 @@ class User extends BaseUser {
private $googleAccessToken;
+ /**
+ * templates products
+ * @ORM\OneToMany(targetEntity="AppBundle\Entity\Product", mappedBy="user")
+ */
+ private $products;
+
+ /**
+ * variabilised products sold
+ * @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="user")
+ */
+ private $productsSold;
+
+ /**
+ * @ORM\ManyToMany(targetEntity="AppBundle\Entity\ProductCategory", inversedBy="users")
+ */
+ private $categories;
+
+ /**
+ * @return mixed
+ */
+ public function getProductsSold() {
+ return $this->productsSold;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function addProductsSold( $product ) {
+ return $this->productsSold[] = $product;
+ }
+
+ /**
+ * @param mixed $productsSold
+ */
+ public function setProductsSold( $productsSold ) {
+ $this->productsSold = $productsSold;
+ }
+
+ /**
+ * @ORM\OneToMany(targetEntity="AppBundle\Entity\SellRecord", mappedBy="user")
+ */
+ private $sellRecords;
+
+ /**
+ * @return mixed
+ */
+ public function getSellRecords() {
+ return $this->sellRecords;
+ }
+
+ /**
+ * @param mixed $sellRecords
+ */
+ public function setSellRecords( $sellRecords ) {
+ $this->sellRecords = $sellRecords;
+ }
+
+ /**
+ * @param mixed $sellRecords
+ */
+ public function addSellRecords( $sellRecords ) {
+ $this->sellRecords[] = $sellRecords;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getGoogleAccessToken() {
+ return $this->googleAccessToken;
+ }
+
+ /**
+ * @param mixed $googleAccessToken
+ */
+ public function setGoogleAccessToken( $googleAccessToken ) {
+ $this->googleAccessToken = $googleAccessToken;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getProducts() {
+ return $this->products;
+ }
+
+ /**
+ * @param mixed $products
+ */
+ public function setProducts( $products ) {
+ $this->products = $products;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getCategories() {
+ return $this->categories;
+ }
+
+ /**
+ * @param mixed $categories
+ */
+ public function setCategories( $categories ) {
+ $this->categories = $categories;
+ }
+
/**
* Get id
*
@@ -37,27 +143,107 @@ class User extends BaseUser {
return $this->id;
}
+ /**
+ * Set googleId
+ *
+ * @param string $googleId
+ *
+ * @return User
+ */
+ public function setGoogleId( $googleId ) {
+ $this->googleId = $googleId;
+
+ return $this;
+ }
+
+ /**
+ * Get googleId
+ *
+ * @return string
+ */
+ public function getGoogleId() {
+ return $this->googleId;
+ }
+
/**
- * Set googleId
+ * Add product
*
- * @param string $googleId
+ * @param \AppBundle\Entity\Product $product
*
* @return User
*/
- public function setGoogleId($googleId)
+ public function addProduct(\AppBundle\Entity\Product $product)
{
- $this->googleId = $googleId;
+ $this->products[] = $product;
return $this;
}
/**
- * Get googleId
+ * Remove product
*
- * @return string
+ * @param \AppBundle\Entity\Product $product
*/
- public function getGoogleId()
+ public function removeProduct(\AppBundle\Entity\Product $product)
{
- return $this->googleId;
+ $this->products->removeElement($product);
+ }
+
+ /**
+ * Remove productsSold
+ *
+ * @param \AppBundle\Entity\ProductSold $productsSold
+ */
+ public function removeProductsSold(\AppBundle\Entity\ProductSold $productsSold)
+ {
+ $this->productsSold->removeElement($productsSold);
+ }
+
+ /**
+ * Add category
+ *
+ * @param \AppBundle\Entity\ProductCategory $category
+ *
+ * @return User
+ */
+ public function addCategory(\AppBundle\Entity\ProductCategory $category)
+ {
+ $this->categories[] = $category;
+
+ return $this;
+ }
+
+ /**
+ * Remove category
+ *
+ * @param \AppBundle\Entity\ProductCategory $category
+ */
+ public function removeCategory(\AppBundle\Entity\ProductCategory $category)
+ {
+ $this->categories->removeElement($category);
+ }
+
+ /**
+ * Add sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ *
+ * @return User
+ */
+ public function addSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords[] = $sellRecord;
+
+ return $this;
+ }
+
+ /**
+ * Remove sellRecord
+ *
+ * @param \AppBundle\Entity\SellRecord $sellRecord
+ */
+ public function removeSellRecord(\AppBundle\Entity\SellRecord $sellRecord)
+ {
+ $this->sellRecords->removeElement($sellRecord);
}
}
diff --git a/src/AppBundle/Form/FestivalType.php b/src/AppBundle/Form/FestivalType.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Form/ProductCategoryType.php b/src/AppBundle/Form/ProductCategoryType.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Form/ProductType.php b/src/AppBundle/Form/ProductType.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Form/SellRecordType.php b/src/AppBundle/Form/SellRecordType.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Repository/FestivalRepository.php b/src/AppBundle/Repository/FestivalRepository.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Repository/ProductCategoryRepository.php b/src/AppBundle/Repository/ProductCategoryRepository.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Repository/ProductRepository.php b/src/AppBundle/Repository/ProductRepository.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Repository/SellRecordRepository.php b/src/AppBundle/Repository/SellRecordRepository.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Repository/StuffRepository.php b/src/AppBundle/Repository/StuffRepository.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Repository/UserRepository.php b/src/AppBundle/Repository/UserRepository.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Tests/Controller/FestivalControllerTest.php b/src/AppBundle/Tests/Controller/FestivalControllerTest.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Tests/Controller/ProductCategoryControllerTest.php b/src/AppBundle/Tests/Controller/ProductCategoryControllerTest.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Tests/Controller/ProductControllerTest.php b/src/AppBundle/Tests/Controller/ProductControllerTest.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Tests/Controller/SellRecordControllerTest.php b/src/AppBundle/Tests/Controller/SellRecordControllerTest.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Traits/Commentable.php b/src/AppBundle/Traits/Commentable.php
old mode 100644
new mode 100755
diff --git a/src/AppBundle/Traits/Sellable.php b/src/AppBundle/Traits/Sellable.php
old mode 100644
new mode 100755
diff --git a/src/Entity/User/User.php b/src/Entity/User/User.php
old mode 100644
new mode 100755
diff --git a/tests/AppBundle/Controller/DefaultControllerTest.php b/tests/AppBundle/Controller/DefaultControllerTest.php
old mode 100644
new mode 100755
diff --git a/var/SymfonyRequirements.php b/var/SymfonyRequirements.php
old mode 100644
new mode 100755
diff --git a/var/logs/.gitkeep b/var/logs/.gitkeep
old mode 100644
new mode 100755
diff --git a/web/.htaccess b/web/.htaccess
old mode 100644
new mode 100755
diff --git a/web/app.php b/web/app.php
old mode 100644
new mode 100755
diff --git a/web/app_dev.php b/web/app_dev.php
old mode 100644
new mode 100755
diff --git a/web/apple-touch-icon.png b/web/apple-touch-icon.png
old mode 100644
new mode 100755
diff --git a/web/bg.jpg b/web/bg.jpg
old mode 100644
new mode 100755
diff --git a/web/config.php b/web/config.php
old mode 100644
new mode 100755
diff --git a/web/favicon.ico b/web/favicon.ico
old mode 100644
new mode 100755
diff --git a/web/robots.txt b/web/robots.txt
old mode 100644
new mode 100755
diff --git a/webpack.config.js b/webpack.config.js
old mode 100644
new mode 100755
diff --git a/yarn.lock b/yarn.lock
old mode 100644
new mode 100755