Przeglądaj źródła

[Backend] Distribution : poids par point de vente #458

refactoring
Guillaume Bourgeois 2 lat temu
rodzic
commit
f4f6ed894d
5 zmienionych plików z 454 dodań i 405 usunięć
  1. +1
    -0
      backend/controllers/DistributionController.php
  2. +7
    -2
      backend/views/distribution/index.php
  3. +51
    -34
      backend/web/css/screen.css
  4. +11
    -2
      backend/web/js/vuejs/distribution-index.js
  5. +384
    -367
      backend/web/sass/distribution/_index.scss

+ 1
- 0
backend/controllers/DistributionController.php Wyświetl plik

@@ -288,6 +288,7 @@ class DistributionController extends BackendController

$order = array_merge($order->getAttributes(), [
'selected' => false,
'weight' => $order->weight,
'amount' => Price::numberTwoDecimals($order->getAmountWithTax(Order::AMOUNT_TOTAL)),
'amount_paid' => Price::numberTwoDecimals($order->getAmount(Order::AMOUNT_PAID)),
'amount_remaining' => Price::numberTwoDecimals($order->getAmount(Order::AMOUNT_REMAINING)),

+ 7
- 2
backend/views/distribution/index.php Wyświetl plik

@@ -301,6 +301,11 @@ $this->setPageTitle('Distributions') ;
Attention, ce jour de distribution n'est pas activé et vous avez quand même des commandes enregistrées.
</div>

<div v-if="idActivePointSale > 0 && (totalActivePointSale() > 0 || weightActivePointSale() > 0)" class="point-sale-totals">
<span class="title">Totaux</span>
CA TTC : <strong>{{ totalActivePointSale() }} €</strong> / Poids : <strong>{{ weightActivePointSale() }} kg</strong>
</div>

<table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)">
<thead>
<tr>
@@ -547,11 +552,11 @@ $this->setPageTitle('Distributions') ;
</td>
</tr>
</template>
<tr v-if="idActivePointSale > 0">
<!--<tr v-if="idActivePointSale > 0">
<td colspan="4"><strong>Total (TTC)</strong></td>
<td><strong>{{ totalActivePointSale() }}</strong></td>
<td colspan="3"></td>
</tr>
</tr>-->
</tbody>
</table>
<div class="alert alert-warning" v-else>

+ 51
- 34
backend/web/css/screen.css Wyświetl plik

@@ -2075,11 +2075,28 @@ termes.
.distribution-index #orders #buttons-top-orders .dropdown {
display: inline-block;
}
/* line 242, ../sass/distribution/_index.scss */
/* line 240, ../sass/distribution/_index.scss */
.distribution-index #orders .point-sale-totals {
background-color: white;
padding: 10px 20px;
border: solid 1px #e0e0e0;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
margin-bottom: 20px;
}
/* line 247, ../sass/distribution/_index.scss */
.distribution-index #orders .point-sale-totals .title {
color: gray;
font-size: 13px;
margin-right: 13px;
text-transform: uppercase;
}
/* line 257, ../sass/distribution/_index.scss */
.distribution-index #orders table td.tiller {
width: 60px;
}
/* line 245, ../sass/distribution/_index.scss */
/* line 260, ../sass/distribution/_index.scss */
.distribution-index #orders table td.tiller label {
font-size: 12px;
cursor: pointer;
@@ -2087,68 +2104,68 @@ termes.
top: -2px;
font-weight: normal;
}
/* line 254, ../sass/distribution/_index.scss */
/* line 269, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions {
position: relative;
text-align: right;
}
/* line 258, ../sass/distribution/_index.scss */
/* line 273, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .dropdown-menu {
top: 0px;
right: 0px;
}
/* line 263, ../sass/distribution/_index.scss */
/* line 278, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .modal-form-order,
.distribution-index #orders table td.column-actions .modal-payment {
text-align: left;
}
/* line 268, ../sass/distribution/_index.scss */
/* line 283, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .add-subscription {
position: relative;
}
/* line 271, ../sass/distribution/_index.scss */
/* line 286, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-actions .add-subscription .glyphicon-plus {
position: absolute;
top: 4px;
right: 4px;
font-size: 7px;
}
/* line 280, ../sass/distribution/_index.scss */
/* line 295, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-state-payment {
width: 120px;
}
/* line 285, ../sass/distribution/_index.scss */
/* line 300, ../sass/distribution/_index.scss */
.distribution-index #orders table td.column-payment div.btn-group {
width: 125px;
}
/* line 291, ../sass/distribution/_index.scss */
/* line 306, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view ul {
list-style-type: none;
margin-left: 0px;
padding-left: 15px;
}
/* line 301, ../sass/distribution/_index.scss */
/* line 316, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view .comment {
margin-top: 20px;
}
/* line 305, ../sass/distribution/_index.scss */
/* line 320, ../sass/distribution/_index.scss */
.distribution-index #orders table tr.view .delivery {
margin-top: 20px;
}
/* line 314, ../sass/distribution/_index.scss */
/* line 329, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container {
width: 100%;
padding: 0px;
}
/* line 318, ../sass/distribution/_index.scss */
/* line 333, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-body {
padding-right: 15px;
}
/* line 320, ../sass/distribution/_index.scss */
/* line 336, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-body table {
margin-bottom: 150px;
}
/* line 325, ../sass/distribution/_index.scss */
/* line 341, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-footer {
border-top-color: #f4f4f4;
position: fixed;
@@ -2160,46 +2177,46 @@ termes.
text-align: center;
border-top: solid 1px #e0e0e0;
}
/* line 337, ../sass/distribution/_index.scss */
/* line 353, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form button {
float: none;
}
/* line 344, ../sass/distribution/_index.scss */
/* line 360, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .btn-credit {
float: right;
}
/* line 350, ../sass/distribution/_index.scss */
/* line 366, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered td {
background-color: #e9e9e9;
}
/* line 354, ../sass/distribution/_index.scss */
/* line 370, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products .product-ordered input {
font-size: 16px;
font-weight: bold;
}
/* line 360, ../sass/distribution/_index.scss */
/* line 376, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price {
width: 150px;
}
/* line 362, ../sass/distribution/_index.scss */
/* line 379, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.price input {
text-align: center;
}
/* line 367, ../sass/distribution/_index.scss */
/* line 384, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity {
width: 165px;
}
/* line 370, ../sass/distribution/_index.scss */
/* line 387, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity input {
text-align: center;
color: black;
}
/* line 375, ../sass/distribution/_index.scss */
/* line 392, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .form-control {
border-right: 0px none;
padding-right: 4px;
}
/* line 380, ../sass/distribution/_index.scss */
/* line 397, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon {
padding: 5px;
padding-left: 0px;
@@ -2207,35 +2224,35 @@ termes.
border-left: 0px none;
border-right: 0px none;
}
/* line 389, ../sass/distribution/_index.scss */
/* line 406, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining {
text-align: right;
}
/* line 392, ../sass/distribution/_index.scss */
/* line 409, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite {
color: #00A65A;
}
/* line 396, ../sass/distribution/_index.scss */
/* line 413, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative {
color: #DD4B39;
}
/* line 400, ../sass/distribution/_index.scss */
/* line 417, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty {
font-size: 18px;
}
/* line 407, ../sass/distribution/_index.scss */
/* line 424, ../sass/distribution/_index.scss */
.distribution-index .modal-form-order .actions-form button {
margin-left: 15px;
}
/* line 415, ../sass/distribution/_index.scss */
/* line 432, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon {
width: 50px;
}
/* line 418, ../sass/distribution/_index.scss */
/* line 435, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-icon i {
font-size: 30px;
}
/* line 423, ../sass/distribution/_index.scss */
/* line 440, ../sass/distribution/_index.scss */
.distribution-index .modal-payment .info-box .info-box-content {
margin-left: 50px;
}

+ 11
- 2
backend/web/js/vuejs/distribution-index.js Wyświetl plik

@@ -458,10 +458,19 @@ var app = new Vue({
var total = 0 ;
for(var i = 0; i < this.orders.length ; i++) {
if(this.orders[i].id_point_sale == this.idActivePointSale) {
total += this.orders[i].amount ;
total += parseFloat(this.orders[i].amount) ;
}
}
return formatPrice(total) ;
return total.toFixed(2);
},
weightActivePointSale: function() {
var weight = 0 ;
for(var i = 0; i < this.orders.length ; i++) {
if(this.orders[i].id_point_sale == this.idActivePointSale) {
weight += parseFloat(this.orders[i].weight) ;
}
}
return weight.toFixed(2) ;
},
changeSynchroTiller: function(event) {
var app = this ;

+ 384
- 367
backend/web/sass/distribution/_index.scss Wyświetl plik

@@ -36,394 +36,411 @@ termes.

.distribution-index {

.content-header {
.date {
font-weight: bold;
}
.content-header {
.date {
font-weight: bold;
}
}

#wrapper-app-distribution-index {
display: none;

&.loaded {
display: block;
}
}

#app-distribution-index {
position: relative;
}

#distribution-date {
display: none;
}

#calendar {
margin-bottom: 15px;

.c-header .c-title-layout .c-title-popover .c-title-anchor .c-title[data-v-2083cb72] {
font-size: 2rem;
}

.c-day-background {
//background-color: #F39C12;
//background-color: white ;
padding: 16px;
//border: solid 1px black !important ;
//opacity: 1 ;
}

.c-day-popover-content {
font-size: 1.3rem;
}

.c-title {
text-transform: uppercase;
font-family: 'capsuularegular';
}
}

#products {
td.quantities {
width: 100px;
text-align: right;
}

input.quantity-max {
width: 50px;
text-align: center;
display: inline;
}
}

#infos-top {
.col-md-4 {
padding: 0px;
}

$height-info-box: 96px ;

.info-box {
min-height: $height-info-box;
height: $height-info-box;

.info-box-icon {
height: $height-info-box;
width: 50px;
line-height: $height-info-box;

i.fa {
font-size: 30px;
}
}

#wrapper-app-distribution-index {
display: none;
.info-box-content {
margin-left: 55px;

&.loaded {
display: block;
}
.info-box-text {
font-size: 12px;

.btn {
font-size: 12px;
text-transform: uppercase;
}
}

#app-distribution-index {
position: relative;
.info-box-number {
font-size: 14px;
}
}
}

#info-box-distribution {
.btn-active-week {
float: right;
}
}

#summary-ca-weight {
.normal {
font-weight: normal;
}
}
}

#modal-products {
table.table {
thead {
tr {
td {
font-weight: bold;
}
}
}

td.quantity-ordered,
td.quantity-max {
text-align: center;
}

#distribution-date {
display: none;
td.quantity-ordered {
width: 50px;
}

td.quantity-max {
width: 120px;

input {
text-align: center;
min-width: 50px;
}
}
}
}

#orders {
position: relative;

.panel-heading {
.buttons {
.btn {
position: relative;
top: -19px;
float: right;
margin-left: 10px;
}
}
}

#wrapper-nav-points-sale {
margin-bottom: 10px;

ul#nav-points-sale {
margin: 0px;
padding: 0px;
list-style-type: none;

li {
float: left;
margin-right: 10px;
margin-bottom: 10px;

a {
.label {
background-color: white;
border: solid 1px #e0e0e0;
@include border-radius(10px) ;
}
}

#calendar {
margin-bottom: 15px;

.c-header .c-title-layout .c-title-popover .c-title-anchor .c-title[data-v-2083cb72] {
font-size: 2rem;
}

.c-day-background {
//background-color: #F39C12;
//background-color: white ;
padding: 16px;
//border: solid 1px black !important ;
//opacity: 1 ;
}

.c-day-popover-content {
font-size: 1.3rem;
}

.c-title {
text-transform: uppercase;
font-family: 'capsuularegular';
}
}
}
}

#buttons-top-orders {
background-color: #F5F5F5;
padding: 10px 20px;
border: solid 1px #e0e0e0;
@include border-radius(5px) ;
margin-bottom: 20px;

.left {

}

.right {
float: right;
}

.dropdown {
display: inline-block;
}
}

.point-sale-totals {
background-color: white;
padding: 10px 20px;
border: solid 1px #e0e0e0;
@include border-radius(5px) ;
margin-bottom: 20px;

.title {
color: gray;
font-size: 13px;
margin-right: 13px;
text-transform: uppercase;
}
}

table {

td.tiller {
width: 60px;

label {
font-size: 12px;
cursor: pointer;
position: relative;
top: -2px;
font-weight: normal;
}
}

td.column-actions {
position: relative;
text-align: right;

#products {
td.quantities {
width: 100px;
text-align: right;
}

input.quantity-max {
width: 50px;
text-align: center;
display: inline;
}
.dropdown-menu {
top: 0px;
right: 0px;
}

#infos-top {
.col-md-4 {
padding: 0px;
}

$height-info-box: 96px ;

.info-box {
min-height: $height-info-box;
height: $height-info-box;

.info-box-icon {
height: $height-info-box;
width: 50px;
line-height: $height-info-box;

i.fa {
font-size: 30px;
}
}

.info-box-content {
margin-left: 55px;

.info-box-text {
font-size: 12px;

.btn {
font-size: 12px;
text-transform: uppercase;
}
}

.info-box-number {
font-size: 14px;
}
}
}

#info-box-distribution {
.btn-active-week {
float: right;
}
}

#summary-ca-weight {
.normal {
font-weight: normal;
}
}
.modal-form-order,
.modal-payment {
text-align: left;
}

#modal-products {
table.table {
thead {
tr {
td {
font-weight: bold;
}
}
}

td.quantity-ordered,
td.quantity-max {
text-align: center;
}

td.quantity-ordered {
width: 50px;
}

td.quantity-max {
width: 120px;

input {
text-align: center;
min-width: 50px;
}
}
}
.add-subscription {
position: relative;

.glyphicon-plus {
position: absolute;
top: 4px;
right: 4px;
font-size: 7px;
}
}
}

td.column-state-payment {
width: 120px;
}

#orders {
position: relative;

.panel-heading {
.buttons {
.btn {
position: relative;
top: -19px;
float: right;
margin-left: 10px;
}
}
}

#wrapper-nav-points-sale {
margin-bottom: 10px;

ul#nav-points-sale {
margin: 0px;
padding: 0px;
list-style-type: none;

li {
float: left;
margin-right: 10px;
margin-bottom: 10px;

a {
.label {
background-color: white;
border: solid 1px #e0e0e0;
@include border-radius(10px) ;
}
}

}
}
}

#buttons-top-orders {
background-color: #F5F5F5;
padding: 10px 20px;
border: solid 1px #e0e0e0;
@include border-radius(5px) ;
margin-bottom: 20px;

.left {

}

.right {
float: right;
}

.dropdown {
display: inline-block ;
}
}

table {

td.tiller {
width: 60px;

label {
font-size: 12px;
cursor: pointer;
position: relative;
top: -2px;
font-weight: normal;
}
}

td.column-actions {
position: relative;
text-align: right;

.dropdown-menu {
top: 0px;
right: 0px;
}

.modal-form-order,
.modal-payment {
text-align: left;
}

.add-subscription {
position: relative;

.glyphicon-plus {
position: absolute;
top: 4px;
right: 4px;
font-size: 7px;
}
}
}

td.column-state-payment {
width: 120px;
}

td.column-payment {
div.btn-group {
width: 125px;
}
}

tr.view {
ul {
list-style-type: none;
margin-left: 0px;
padding-left: 15px;

li {

}
}

.comment {
margin-top: 20px;
}

.delivery {
margin-top: 20px;
}
}
}
td.column-payment {
div.btn-group {
width: 125px;
}
}

tr.view {
ul {
list-style-type: none;
margin-left: 0px;
padding-left: 15px;

.modal-form-order {

.modal-container {
width: 100%;
padding: 0px;

.modal-body {
padding-right: 15px;
table {
margin-bottom: 150px;
}
}

.modal-footer {
border-top-color: #f4f4f4;
position: fixed;
bottom: 0;
right: 0;
z-index: 99999;
background-color: white;
width: 100%;
text-align: center;
border-top: solid 1px #e0e0e0;

.actions-form {
button {
float: none;
}
}
}
}

.btn-credit {
float: right;
}

table.table-products {
.product-ordered {
td {
background-color: #e9e9e9;
}

input {
font-size: 16px;
font-weight: bold;
}
}

td.price {
width: 150px ;
input {
text-align: center ;
}
}

td.quantity {
width: 165px;

input {
text-align: center;
color: black;
}

.form-control {
border-right: 0px none;
padding-right: 4px;
}

.input-group-addon {
padding: 5px;
padding-left: 0px;
margin: 0px;
border-left: 0px none;
border-right: 0px none;
}
}

td.quantity-remaining {
text-align: right;

&.quantity-remaining, &.infinite {
color: #00A65A;
}

&.negative {
color: #DD4B39;
}

&.infinite, &.empty {
font-size: 18px;
}
}
}

.actions-form {
button {
margin-left: 15px;
}
}
li {

}
}

.modal-payment {
.info-box {
.info-box-icon {
width: 50px;

i {
font-size: 30px;
}
}

.info-box-content {
margin-left: 50px;
}
}
.comment {
margin-top: 20px;
}

.delivery {
margin-top: 20px;
}
}
}
}

.modal-form-order {

.modal-container {
width: 100%;
padding: 0px;

.modal-body {
padding-right: 15px;

table {
margin-bottom: 150px;
}
}

.modal-footer {
border-top-color: #f4f4f4;
position: fixed;
bottom: 0;
right: 0;
z-index: 99999;
background-color: white;
width: 100%;
text-align: center;
border-top: solid 1px #e0e0e0;

.actions-form {
button {
float: none;
}
}
}
}

.btn-credit {
float: right;
}

table.table-products {
.product-ordered {
td {
background-color: #e9e9e9;
}

input {
font-size: 16px;
font-weight: bold;
}
}

td.price {
width: 150px;

input {
text-align: center;
}
}

td.quantity {
width: 165px;

input {
text-align: center;
color: black;
}

.form-control {
border-right: 0px none;
padding-right: 4px;
}

.input-group-addon {
padding: 5px;
padding-left: 0px;
margin: 0px;
border-left: 0px none;
border-right: 0px none;
}
}

td.quantity-remaining {
text-align: right;

&.quantity-remaining, &.infinite {
color: #00A65A;
}

&.negative {
color: #DD4B39;
}

&.infinite, &.empty {
font-size: 18px;
}
}
}

.actions-form {
button {
margin-left: 15px;
}
}
}

.modal-payment {
.info-box {
.info-box-icon {
width: 50px;

i {
font-size: 30px;
}
}

.info-box-content {
margin-left: 50px;
}
}
}
}


Ładowanie…
Anuluj
Zapisz