Quellcode durchsuchen

Calendrier : couleur du jour sélectionnée plus prononcée #1087

feature/souke
Guillaume Bourgeois vor 1 Jahr
Ursprung
Commit
db2d1d49df
2 geänderte Dateien mit 30 neuen und 1 gelöschten Zeilen
  1. +29
    -0
      backend/web/js/vuejs/distribution-index.js
  2. +1
    -1
      common/logic/Distribution/Distribution/Service/DistributionBuilder.php

+ 29
- 0
backend/web/js/vuejs/distribution-index.js Datei anzeigen

@@ -155,6 +155,7 @@ var app = new Vue({
axios.get("ajax-infos",{params: {date : this.getDate()}})
.then(function(response) {
app.calendar.attrs = [];
app.distribution = response.data.distribution ;
app.producer = response.data.producer ;
app.products = response.data.products ;
@@ -202,13 +203,25 @@ var app = new Vue({
app.calendar.attrs = [] ;
var distributions = response.data.distributions ;
var dayCurrentIsDistributionActive = false;
var dateFormatCompare = false;
if(app.date) {
dateFormatCompare = app.date.getFullYear() + '-'
+ ('0' + (app.date.getMonth() +1)).slice(-2) + '-'
+ ('0' + app.date.getDate()).slice(-2);
}

if(distributions.length) {
for(var i= 0; i < distributions.length; i++) {
app.calendar.attrs.push({
key: distributions[i].date,
highlight: true,
dates: distributions[i].date
}) ;

if(distributions[i].date == dateFormatCompare) {
dayCurrentIsDistributionActive = true;
}
}
}
@@ -226,6 +239,22 @@ var app = new Vue({
}

setTimeout("opendistrib_popover();", 500);

var highlightStyle = {
color: 'orange',
fillMode: 'light'
}
if(dayCurrentIsDistributionActive) {
highlightStyle = {
color: 'orange',
fillMode: 'solid'
}
}
app.calendar.attrs.push({
key: 'current',
highlight: highlightStyle,
dates: app.date
});
}) ;
},
initCountActiveProducts: function() {

+ 1
- 1
common/logic/Distribution/Distribution/Service/DistributionBuilder.php Datei anzeigen

@@ -152,7 +152,7 @@ class DistributionBuilder extends AbstractBuilder

public function updateOrderProductPrices(Distribution $distribution, Product $product): void
{
$ordersArray = $this->orderRepository->findOrdersByDistribution($distribution, 'AND origin != "user"');
$ordersArray = $this->orderRepository->findOrdersByDistribution($distribution, 'origin != "user"');

if ($ordersArray) {
foreach ($ordersArray as $order) {

Laden…
Abbrechen
Speichern