Ver código fonte

Repas du midi : correctifs

feature/module_traiteur_v1
Guillaume 3 anos atrás
pai
commit
b2e7b812f8
6 arquivos alterados com 56 adições e 4 exclusões
  1. +3
    -0
      ShopBundle/Repository/ProductCategoryRepository.php
  2. +4
    -0
      ShopBundle/Resources/public/js/backend/script/merchant/vuejs-merchant.js
  3. +9
    -1
      ShopBundle/Resources/translations/lcshop.fr.yaml
  4. +3
    -1
      ShopBundle/Resources/views/backend/merchant/form.html.twig
  5. +18
    -0
      ShopBundle/Resources/views/backend/merchant/panel_lunch.html.twig
  6. +19
    -2
      ShopBundle/Services/Order/OrderUtilsStockTrait.php

+ 3
- 0
ShopBundle/Repository/ProductCategoryRepository.php Ver arquivo

$query->andWhere('pf.status = 1') ; $query->andWhere('pf.status = 1') ;
} }


$query->andWhere('e.displaySpecificDay IS NULL OR e.displaySpecificDay = :dayToday') ;
$query->setParameter('dayToday', date('N')) ;

$query->addOrderBy('e.position', 'ASC') ; $query->addOrderBy('e.position', 'ASC') ;


return $query->getQuery()->getResult(); return $query->getQuery()->getResult();

+ 4
- 0
ShopBundle/Resources/public/js/backend/script/merchant/vuejs-merchant.js Ver arquivo

{ {
name: 'maintenance', name: 'maintenance',
nameDisplay: 'Maintenance' nameDisplay: 'Maintenance'
},
{
name: 'lunch',
nameDisplay: 'Repas du midi'
} }
] ]
}, window.addressValues, window.merchantPanelOrderValues); }, window.addressValues, window.merchantPanelOrderValues);

+ 9
- 1
ShopBundle/Resources/translations/lcshop.fr.yaml Ver arquivo

email: Email email: Email
delivery: Livraison delivery: Livraison
maintenance: Maintenance maintenance: Maintenance
lunch: Repas du midi
Address: Address:
listLoopBesancon: Adresses de Besançon à spécifier (lat / long) listLoopBesancon: Adresses de Besançon à spécifier (lat / long)


purchaseOrderEmailContent: "Contenu par défaut de l'email envoyé aux producteurs" purchaseOrderEmailContent: "Contenu par défaut de l'email envoyé aux producteurs"
dateStart: Date de début dateStart: Date de début
dateEnd: Date de fin dateEnd: Date de fin
messageLunchOpen: Message (section ouverte)
messageLunchClosed: Message (section fermée)
displaySpecificDay: Disponible un jour spécifique
groupUsers: Groupes
ticketTypesNotification: Catégorie ticket


PointSale: PointSale:
code: Code code: Code
days: Par jour days: Par jour
week: Par semaine week: Par semaine
month: Par mois month: Par mois

User:
isSaleAlwaysOpen: Commandes toujours ouvertes
action: action:
apply: Appliquer apply: Appliquer
new: Créer %entity_label% new: Créer %entity_label%
logout: Me déconnecter logout: Me déconnecter
address: Adresse utilisateur address: Adresse utilisateur
switch: Prendre la main switch: Prendre la main

order: order:
addOrderProduct: Ajouter un produit addOrderProduct: Ajouter un produit
addReductionCart: Ajouter une réduction addReductionCart: Ajouter une réduction

+ 3
- 1
ShopBundle/Resources/views/backend/merchant/form.html.twig Ver arquivo

<div v-show="currentSection == 'maintenance'" class="panel panel-default"> <div v-show="currentSection == 'maintenance'" class="panel panel-default">
{% include '@LcShop/backend/merchant/panel_maintenance.html.twig' %} {% include '@LcShop/backend/merchant/panel_maintenance.html.twig' %}
</div> </div>

<div v-show="currentSection == 'lunch'" class="panel panel-default">
{% include '@LcShop/backend/merchant/panel_lunch.html.twig' %}
</div>
</div> </div>


</div> </div>

+ 18
- 0
ShopBundle/Resources/views/backend/merchant/panel_lunch.html.twig Ver arquivo

{% import '@LcShop/backend/default/block/macros.html.twig' as macros %}

<div class="row">
<div class="col-8">
{{ macros.card_start('Merchant.lunch','light') }}
{% if form.merchantConfigs['message-lunch-open'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['message-lunch-open']) }}
</div>
{% endif %}
{% if form.merchantConfigs['message-lunch-closed'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['message-lunch-closed']) }}
</div>
{% endif %}
{{ macros.card_end() }}
</div>
</div>

+ 19
- 2
ShopBundle/Services/Order/OrderUtilsStockTrait.php Ver arquivo

} }


$allCategoriesSalesOff = true; $allCategoriesSalesOff = true;
$unavailableSpecificDay = false;

foreach ($product->getProductFamily()->getProductCategories() as $category){ foreach ($product->getProductFamily()->getProductCategories() as $category){
if($category->getParent()) { if($category->getParent()) {
if($category->getSaleStatus() && $category->getParent()->getSaleStatus()) if($category->getSaleStatus() && $category->getParent()->getSaleStatus())
$allCategoriesSalesOff = false; $allCategoriesSalesOff = false;
} }
else { else {
if($category->getSaleStatus()) $allCategoriesSalesOff = false;
if($category->getSaleStatus()) {
$allCategoriesSalesOff = false;
}
} }

// specific day
$displaySpecificDay = $category->getDisplaySpecificDay() ;
if($displaySpecificDay && $displaySpecificDay != date('N')) {
$unavailableSpecificDay = true;
}
}

if($allCategoriesSalesOff) {
return false;
}

if($unavailableSpecificDay) {
return false;
} }
if($allCategoriesSalesOff) return false;


return true ; return true ;
} }

Carregando…
Cancelar
Salvar