Browse Source

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

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
db2d1d49df
2 changed files with 30 additions and 1 deletions
  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 View File

axios.get("ajax-infos",{params: {date : this.getDate()}}) axios.get("ajax-infos",{params: {date : this.getDate()}})
.then(function(response) { .then(function(response) {
app.calendar.attrs = [];
app.distribution = response.data.distribution ; app.distribution = response.data.distribution ;
app.producer = response.data.producer ; app.producer = response.data.producer ;
app.products = response.data.products ; app.products = response.data.products ;
app.calendar.attrs = [] ; app.calendar.attrs = [] ;
var distributions = response.data.distributions ; 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) { if(distributions.length) {
for(var i= 0; i < distributions.length; i++) { for(var i= 0; i < distributions.length; i++) {
app.calendar.attrs.push({ app.calendar.attrs.push({
key: distributions[i].date,
highlight: true, highlight: true,
dates: distributions[i].date dates: distributions[i].date
}) ; }) ;

if(distributions[i].date == dateFormatCompare) {
dayCurrentIsDistributionActive = true;
}
} }
} }
} }


setTimeout("opendistrib_popover();", 500); 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() { initCountActiveProducts: function() {

+ 1
- 1
common/logic/Distribution/Distribution/Service/DistributionBuilder.php View File



public function updateOrderProductPrices(Distribution $distribution, Product $product): void 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) { if ($ordersArray) {
foreach ($ordersArray as $order) { foreach ($ordersArray as $order) {

Loading…
Cancel
Save