🎨 styling enabled product being sold

This commit is contained in:
ty kayn 2019-07-04 18:58:17 +02:00
parent aaf0cb53b8
commit 887e67c83e
10 changed files with 87 additions and 53 deletions

View File

@ -0,0 +1,26 @@
{% verbatim %}
<div id="choice-categories" class="choice-categories well" ng-if="categories.length">
<h2>
<i class="fa-eye fa"></i>
Visibilité des
{{ categories.length - categoriesVisibleCount() }} /
{{ categories.length }} catégories
</h2>
<div ng-repeat="c in categories">
<div class="btn btn-block"
ng-class="{'btn-success': !c.hidden}"
ng-click="c.hidden = !c.hidden">
{{ c.name }}
<span ng-if="c.hidden">(caché)</span>
</div>
</div>
</div>
<div class="well" ng-if="!categories.length">
<i class="fa fa-info"></i>
Aucune catégorie enregistrée
</div>
{% endverbatim %}

View File

@ -3,12 +3,10 @@
<hr> <hr>
<form> <form>
</div>
<div class="new-display"> <div class="new-display">
<div class="row">
<div class="row">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<button class="btn btn-warning btn-remove-all" ng-click="removeAll()" ng-disable="!CurrentSellingTotal()"> <button class="btn btn-warning btn-remove-all marged-v" ng-click="removeAll()" ng-disable="!CurrentSellingTotal()">
<i class="fa fa-trash"></i> enlever tout <i class="fa fa-trash"></i> enlever tout
</button> </button>
</div> </div>
@ -17,27 +15,33 @@
<div ng-repeat="group in activeSellingFiltered track by $index"> <div ng-repeat="group in activeSellingFiltered track by $index">
<div class="row"> <div class="row">
<div class="col-xs-4"> <div class="col-xs-2">
<div class="input-group">
<input type="text" ng-model="group.name">
</div>
</div>
<div class="col-xs-4 text-right">
<strong>
{{group.unitPrice}}
€ </strong>
<span class="badge badge-default" ng-if="group.count">
<i class="fa fa-times"></i> {{group.count}}
</span>
</div>
<div class="col-xs-4 text-right">
<strong>
{{group.totalPrice}}
€ </strong>
<span class="btn btn-warning remove-item" <span class="btn btn-warning remove-item"
ng-click="removeGroupeProducts(group.groupId)"> ng-click="removeGroupeProducts(group.groupId)">
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
</span> </span>
</div>
<div class="col-xs-10">
<input class="group-name" type="text" ng-model="group.name">
</div>
</div>
<div class="row">
<div class="col-xs-7 col-xs-offset-2 ">
<span ng-if="group.count > 1">
<strong>
{{group.unitPrice}}
€ </strong>
</span>
<span class="badge badge-default" ng-if="group.count">
<i class="fa fa-times"></i> {{group.count}}
</span>
</div>
<div class="col-xs-3 text-right">
<strong>
{{group.totalPrice}}
€ </strong>
</div> </div>
</div> </div>
</div> </div>
@ -48,8 +52,10 @@
{% include 'logged/angular/totals.html.twig' %} {% include 'logged/angular/totals.html.twig' %}
{% include 'logged/angular/validate-button.html.twig' %} {% include 'logged/angular/validate-button.html.twig' %}
{% include 'logged/angular/pause-selling.html.twig' %} {% include 'logged/angular/pause-selling.html.twig' %}
{% verbatim %}
</form> </form>
</div>
</div> </div>
{% endverbatim %}

View File

@ -10,9 +10,9 @@
<div class="product-listing" > <div class="product-listing" >
<span ng-repeat="p in c.products track by p.id" <span ng-repeat="p in c.products track by p.id"
class="product-box" class="product-box"
ng-class="{ 'btn-primary' : activeItemsSold.indexOf(p.id) !==-1}"
> >
<button class="product-button text-left" ng-click="addProduct( p )"> <button class="product-button text-left" ng-class="{ 'active' : p.enabled}" ng-click="addProduct( p )">
<img class="product-image" src="{{p.image}}" alt="image" ng-if="p.image.length"> <img class="product-image" src="{{p.image}}" alt="image" ng-if="p.image.length">
<span class="product-name"> <span class="product-name">
{{ p.name }} {{ p.name }}

View File

@ -5,13 +5,13 @@
<!--caisse IHM--> <!--caisse IHM-->
<div id="load_ok"> <div id="load_ok">
<div id="listing-products" class="listing-products col-xs-12 col-sm-12"> <div id="listing-products" class="listing-products col-xs-12 col-md-8">
{% include 'logged/angular/messages.html.twig' %} {% include 'logged/angular/messages.html.twig' %}
{% include 'logged/angular/listing-products.html.twig' %} {% include 'logged/angular/listing-products.html.twig' %}
</div> </div>
<div id="sellings" class="sellings col-xs-12 col-sm-12"> <div id="sellings" class="sellings col-xs-12 col-md-4">
<div class="well" ng-class="{'bg-success text-success': sellingOk }"> <div class="list-sell" ng-class="{'bg-success text-success': sellingOk }">
{% include 'logged/angular/validate-button.html.twig' %} {% include 'logged/angular/validate-button.html.twig' %}
{% if app.user.products |length %} {% if app.user.products |length %}
@ -25,4 +25,8 @@
<div id="other_time"> <div id="other_time">
{% include 'logged/angular/recent.html.twig' %} {% include 'logged/angular/recent.html.twig' %}
</div> </div>
<div class="col-xs-12 col-md-4 col-md-offset-8">
{% include 'logged/angular/categ-options.html.twig' %}
</div>
</div> </div>

View File

@ -1,10 +1,10 @@
{% verbatim %} {% verbatim %}
<div class="text-right"> <div class="">
<div class="row clickable" > <div class="row clickable" >
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6 text-right">
<h3 ng-click="setRightAmountPaid()">Total: </h3> <h3 ng-click="setRightAmountPaid()">Total: </h3>
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6 text-right">
<h3 ng-click="setRightAmountPaid()"> <h3 ng-click="setRightAmountPaid()">
<strong> <strong>
{{ CurrentSellingTotal() }} {{ CurrentSellingTotal() }}
@ -13,13 +13,16 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12">
<div >
Le client paie: Le client paie:
</div> </div>
<div class="col-xs-12 col-sm-6"> <div >
<input class="text-right" type="number" id="paid_amount" ng-model="paidAmount"> <input class="text-right" type="number" id="paid_amount" ng-model="paidAmount">
</div> </div>
</div> </div>
</div>
<div class="alert alert-success" ng-if="paidAmount && CurrentSellingTotal() - paidAmount <=0"> <div class="alert alert-success" ng-if="paidAmount && CurrentSellingTotal() - paidAmount <=0">
<h3>Rendu: {{ -1*(CurrentSellingTotal() - paidAmount) }} €</h3> <h3>Rendu: {{ -1*(CurrentSellingTotal() - paidAmount) }} €</h3>
</div> </div>

View File

@ -14,28 +14,5 @@
{% endverbatim %} {% endverbatim %}
{% include 'logged/angular/loaded-caisse.html.twig' %} {% include 'logged/angular/loaded-caisse.html.twig' %}
{% verbatim %} {% verbatim %}
<div id="choice-categories" class="choice-categories well" ng-if="categories.length">
<h2>
<i class="fa-eye fa"></i>
Visibilité des
{{categories.length - categoriesVisibleCount() }} /
{{ categories.length }} catégories
</h2>
<div ng-repeat="c in categories"
>
<div class="btn btn-block"
ng-class="{'btn-success': !c.hidden}"
ng-click="c.hidden = !c.hidden">
{{ c.name }}
<span ng-if="c.hidden">(caché)</span>
</div>
</div>
</div>
<div class="well" ng-if="!categories.length">
<i class="fa fa-info"></i>
Aucune catégorie enregistrée
</div>
{% endverbatim %} {% endverbatim %}

View File

@ -14,9 +14,11 @@
.listing-products { .listing-products {
button.active{
background: yellowgreen;
}
.btn, button { .btn, button {
font-size: 1.6rem; font-size: 1.6rem;
background: white;
padding: 1.5rem; padding: 1.5rem;
-webkit-border-radius: 1rem; -webkit-border-radius: 1rem;
-moz-border-radius: 1rem; -moz-border-radius: 1rem;
@ -69,6 +71,12 @@
//vertical-align: top; //vertical-align: top;
white-space: nowrap; white-space: nowrap;
//float: left; //float: left;
h2{
font-weight: bold;
&:first-letter{
text-transform: capitalize;
}
}
} }
.category-listing { .category-listing {

View File

@ -27,6 +27,11 @@
#caisse-now { #caisse-now {
.product-box { .product-box {
width: 100%; width: 100%;
&.active{
.product-button{
background: greenyellow;
}
}
} }
.product-button { .product-button {

View File

@ -1 +0,0 @@
console.log('hi from caisse ctrl')

View File

@ -8,7 +8,6 @@ require('bootstrap-sass');
// require('bootstrap-sass/javascripts/bootstrap/popover'); // require('bootstrap-sass/javascripts/bootstrap/popover');
require('./globalActions'); require('./globalActions');
require('./caisseCtrl');
require('./dashboard'); require('./dashboard');
var PrevisionnelCtrl = require('./previsionnel'); var PrevisionnelCtrl = require('./previsionnel');
@ -86,6 +85,7 @@ angular
} }
}); });
$scope.activeSellingFiltered = soldObjectsIdsCount; $scope.activeSellingFiltered = soldObjectsIdsCount;
$scope.setRightAmountPaid();
} }
/** /**
@ -137,6 +137,7 @@ angular
*/ */
$scope.addProduct = function (product) { $scope.addProduct = function (product) {
product.stockCount--; product.stockCount--;
product.enabled = true;
$scope.activeSelling.push(product); $scope.activeSelling.push(product);
$scope.activeItemsSold.push(product.id); $scope.activeItemsSold.push(product.id);
$scope.regenActiveSellingIds(); $scope.regenActiveSellingIds();
@ -167,7 +168,12 @@ angular
$scope.refreshDeduplicateSellings(); $scope.refreshDeduplicateSellings();
} }
$scope.removeAll = function () { $scope.removeAll = function () {
$scope.categories.forEach(category => {
category.products.forEach(product => {
product.enabled = false
})
});
$scope.activeSelling = []; $scope.activeSelling = [];
$scope.regenActiveSellingIds(); $scope.regenActiveSellingIds();
$scope.refreshDeduplicateSellings(); $scope.refreshDeduplicateSellings();