Browse Source

Merge branch 'develop'

master
Guillaume 4 years ago
parent
commit
79a3e7a8a0
31 changed files with 448 additions and 129 deletions
  1. +1
    -0
      ShopBundle/Controller/Backend/OrderController.php
  2. +10
    -0
      ShopBundle/Model/OrderShop.php
  3. +2
    -0
      ShopBundle/Model/OrderStatus.php
  4. +17
    -0
      ShopBundle/Model/ProductFamily.php
  5. +14
    -0
      ShopBundle/Repository/CreditHistoryRepository.php
  6. +3
    -1
      ShopBundle/Repository/ProductFamilyRepository.php
  7. +24
    -1
      ShopBundle/Resources/public/css/backend/custom.css
  8. +0
    -1
      ShopBundle/Resources/public/js/backend/script/default/vuejs-mixins.js
  9. +13
    -7
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js
  10. +6
    -2
      ShopBundle/Resources/public/sass/backend/custom.scss
  11. +14
    -2
      ShopBundle/Resources/translations/lcshop.fr.yaml
  12. +9
    -2
      ShopBundle/Resources/views/backend/default/block/action.html.twig
  13. +22
    -0
      ShopBundle/Resources/views/backend/default/block/list_addressloopinbesancon.html.twig
  14. +27
    -0
      ShopBundle/Resources/views/backend/default/block/list_orderswaitingbankreturn.html.twig
  15. +21
    -15
      ShopBundle/Resources/views/backend/default/layout/layout.html.twig
  16. +17
    -6
      ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig
  17. +37
    -0
      ShopBundle/Resources/views/backend/order/form/modal_orderstatushistories.html.twig
  18. +1
    -0
      ShopBundle/Resources/views/backend/order/macros.html.twig
  19. +1
    -0
      ShopBundle/Resources/views/backend/order/show-cart.html.twig
  20. +1
    -0
      ShopBundle/Resources/views/backend/order/show-order.html.twig
  21. +2
    -0
      ShopBundle/Resources/views/backend/order/show.html.twig
  22. +1
    -0
      ShopBundle/Resources/views/backend/productfamily/form.html.twig
  23. +1
    -1
      ShopBundle/Resources/views/backend/productfamily/macros.html.twig
  24. +59
    -23
      ShopBundle/Resources/views/backend/productfamily/panel_products.html.twig
  25. +19
    -13
      ShopBundle/Resources/views/backend/user/block/user-switch.html.twig
  26. +10
    -0
      ShopBundle/Resources/views/backend/user/list-fields/field-countordershops.html.twig
  27. +1
    -1
      ShopBundle/Services/CsvGenerator.php
  28. +32
    -30
      ShopBundle/Services/Order/OrderUtilsStockTrait.php
  29. +76
    -22
      ShopBundle/Services/Price/OrderShopPriceUtils.php
  30. +2
    -2
      ShopBundle/Services/Price/PriceUtils.php
  31. +5
    -0
      ShopBundle/Services/ProductFamilyUtils.php

+ 1
- 0
ShopBundle/Controller/Backend/OrderController.php View File

case OrderStatus::ALIAS_PAID_BY_CREDIT : case OrderStatus::ALIAS_PAID_BY_CREDIT :
case OrderStatus::ALIAS_PAID_ONLINE : case OrderStatus::ALIAS_PAID_ONLINE :
case OrderStatus::ALIAS_WAITING_DELIVERY : case OrderStatus::ALIAS_WAITING_DELIVERY :
case OrderStatus::ALIAS_WAITING_BANK_RETURN :
$parameters['form_order_payment'] = $this->createCustomForm(OrderPaymentType::class, 'orderPayment', $parameters, false)->createView(); $parameters['form_order_payment'] = $this->createCustomForm(OrderPaymentType::class, 'orderPayment', $parameters, false)->createView();
$parameters['form_order_status'] = $this->createCustomForm(OrderStatusType::class, 'orderStatus', $parameters)->createView(); $parameters['form_order_status'] = $this->createCustomForm(OrderStatusType::class, 'orderStatus', $parameters)->createView();
$parameters['form_delete_order_payment'] = $this->createCustomForm(DeleteOrderPaymentType::class, 'deleteOrderPayment', $parameters)->createView(); $parameters['form_delete_order_payment'] = $this->createCustomForm(DeleteOrderPaymentType::class, 'deleteOrderPayment', $parameters)->createView();

+ 10
- 0
ShopBundle/Model/OrderShop.php View File

return $this; return $this;
} }


public function getDocumentInvoice(): Document
{
foreach($this->getDocuments() as $document) {
if($document->getType() == Document::TYPE_INVOICE) {
return $document ;
}
}

return false ;
}


/** /**
* @return Collection|Ticket[] * @return Collection|Ticket[]

+ 2
- 0
ShopBundle/Model/OrderStatus.php View File

const ALIAS_CART_CANCELED = 'cart-canceled' ; const ALIAS_CART_CANCELED = 'cart-canceled' ;
const ALIAS_WAITING_PAYMENT_ONLINE = 'waiting-payment-online' ; const ALIAS_WAITING_PAYMENT_ONLINE = 'waiting-payment-online' ;
const ALIAS_WAITING_PAYMENT_CREDIT = 'waiting-payment-credit' ; const ALIAS_WAITING_PAYMENT_CREDIT = 'waiting-payment-credit' ;
const ALIAS_WAITING_BANK_RETURN = 'waiting-bank-return' ;
const ALIAS_PAID_ONLINE = 'paid-online' ; const ALIAS_PAID_ONLINE = 'paid-online' ;
const ALIAS_ERROR_PAYMENT_ONLINE = 'error-payment-online' ; const ALIAS_ERROR_PAYMENT_ONLINE = 'error-payment-online' ;
const ALIAS_PAID_BY_CREDIT = 'paid-by-credit' ; const ALIAS_PAID_BY_CREDIT = 'paid-by-credit' ;
self::ALIAS_PAID_ONLINE, self::ALIAS_PAID_ONLINE,
self::ALIAS_PAID_BY_CREDIT, self::ALIAS_PAID_BY_CREDIT,
self::ALIAS_WAITING_DELIVERY, self::ALIAS_WAITING_DELIVERY,
self::ALIAS_WAITING_BANK_RETURN,
self::ALIAS_WAITING_DELIVERY_WITH_PAYMENT, self::ALIAS_WAITING_DELIVERY_WITH_PAYMENT,
self::ALIAS_DELIVERED_WITHOUT_PAYMENT, self::ALIAS_DELIVERED_WITHOUT_PAYMENT,
self::ALIAS_DONE self::ALIAS_DONE

+ 17
- 0
ShopBundle/Model/ProductFamily.php View File

*/ */
protected $productsType; protected $productsType;


/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $productsQuantityAsTitle;

/** /**
* @ORM\Column(type="string", length=255, nullable=true) * @ORM\Column(type="string", length=255, nullable=true)
*/ */
return $this; return $this;
} }


public function getProductsQuantityAsTitle(): ?bool
{
return $this->productsQuantityAsTitle;
}

public function setProductsQuantityAsTitle(bool $productsQuantityAsTitle): self
{
$this->productsQuantityAsTitle = $productsQuantityAsTitle;

return $this;
}

public function getProductsType(): ?string public function getProductsType(): ?string
{ {
return $this->productsType; return $this->productsType;

+ 14
- 0
ShopBundle/Repository/CreditHistoryRepository.php View File

return CreditHistoryInterface::class; return CreditHistoryInterface::class;
} }


public function findAllByDateStartEnd($merchant, $dateStart, $dateEnd)
{
return $this->createQueryBuilder('e')
->innerJoin('e.userMerchant', 'user_merchant')
->andWhere('user_merchant.merchant = :merchant')
->setParameter(':merchant', $merchant)
->andWhere('e.createdAt >= :dateStart')
->andWhere('e.createdAt <= :dateEnd')
->setParameter(':dateStart', $dateStart)
->setParameter(':dateEnd', $dateEnd)
->addOrderBy('e.createdAt', 'ASC')
->getQuery()->getResult();
}

public function findAllByUserMerchant($userMerchant) public function findAllByUserMerchant($userMerchant)
{ {
return $this->createQueryBuilder('e') return $this->createQueryBuilder('e')

+ 3
- 1
ShopBundle/Repository/ProductFamilyRepository.php View File

$query = $this->joinRelations($query) ; $query = $this->joinRelations($query) ;


$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
$query->andWhere('e.title LIKE :terms');
$query->andWhere('e.title LIKE :terms OR cat.title LIKE :terms');
$query->setParameter(':terms', '%'.$terms.'%') ; $query->setParameter(':terms', '%'.$terms.'%') ;


$query->groupBy('e.id') ;

if($maxResults) { if($maxResults) {
$query->setMaxResults($maxResults) ; $query->setMaxResults($maxResults) ;
} }

+ 24
- 1
ShopBundle/Resources/public/css/backend/custom.css View File

border-top: 1px solid #dee2e6; border-top: 1px solid #dee2e6;
text-align: center; text-align: center;
border-bottom: 2px solid #dee2e6; border-bottom: 2px solid #dee2e6;
position: relative;
} }


/* line 252, ../../sass/backend/custom.scss */ /* line 252, ../../sass/backend/custom.scss */
display: block; display: block;
} }


/* line 292, ../../sass/backend/custom.scss */
#dashboard #range_date_interval {
margin-bottom: 20px;
}

/* line 293, ../../sass/backend/custom.scss */
#dashboard #range_date_interval label {
float: left;
margin-right: 20px;
}

/* line 294, ../../sass/backend/custom.scss */
#dashboard #range_date_interval .form-check {
float: left;
margin-right: 10px;
}

/* line 295, ../../sass/backend/custom.scss */
#dashboard .table-condensed .btn, #dashboard .table-condensed .btn-sm {
white-space: nowrap;
}

/* Tickets */ /* Tickets */
/* line 296, ../../sass/backend/custom.scss */
/* line 301, ../../sass/backend/custom.scss */
#ticket-list .btn-sm { #ticket-list .btn-sm {
display: block; display: block;
} }

+ 0
- 1
ShopBundle/Resources/public/js/backend/script/default/vuejs-mixins.js View File

if (this.behaviorPriceValue == 'by-piece') { if (this.behaviorPriceValue == 'by-piece') {
this.setBuyingPriceByRefUnit(); this.setBuyingPriceByRefUnit();
this.setBuyingPriceByRefUnitWithTax(); this.setBuyingPriceByRefUnitWithTax();
log('ncihe');
this.setPriceByRefUnit(); this.setPriceByRefUnit();
this.setPriceByRefUnitWithTax(); this.setPriceByRefUnitWithTax();
} else if (this.behaviorPriceValue == 'by-reference-unit') { } else if (this.behaviorPriceValue == 'by-reference-unit') {

+ 13
- 7
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js View File



this.$nextTick(function () { this.$nextTick(function () {


log(this.status);
if (this.status == 0) { if (this.status == 0) {
$(this.$el).addClass('disabled'); $(this.$el).addClass('disabled');
} }
if (field == 'unitInherited') { if (field == 'unitInherited') {
$('select[data-ref="' + field + '"]').eq(y).focus(); $('select[data-ref="' + field + '"]').eq(y).focus();
} else { } else {
$('input[data-ref="' + field + '"]').eq(y).focus();
log('blop');
$('input[data-ref="' + field + '"]').eq(y).focus().select();
} }
}); });


var app = this; var app = this;
$(this.$el).find('input, select').off('keydown'); $(this.$el).find('input, select').off('keydown');
$(this.$el).find('input, select').on('keydown', function (e) { $(this.$el).find('input, select').on('keydown', function (e) {
if (e.keyCode == 13 || e.keyCode == 9) e.preventDefault();
if (e.keyCode == 13 || e.keyCode == 9 || e.keyCode ==40 || e.keyCode==38) e.preventDefault();


//ENTRER //ENTRER
if (e.keyCode == 13) { if (e.keyCode == 13) {
if (e.shiftKey && e.keyCode == 9) { if (e.shiftKey && e.keyCode == 9) {
e.preventDefault(); e.preventDefault();
$prevField = $(this).parents('td').prevAll('td:visible').first().find('input, select'); $prevField = $(this).parents('td').prevAll('td:visible').first().find('input, select');
log($prevField);
if($prevField.length == 0){ if($prevField.length == 0){
$prevField = $(this).parents('td').prevAll('td:visible').first().prevAll('td:visible').first().find('input, select'); $prevField = $(this).parents('td').prevAll('td:visible').first().prevAll('td:visible').first().find('input, select');


'supplierTaxRateValue': this.$refs.productUnitPrice.supplierTaxRateValue, 'supplierTaxRateValue': this.$refs.productUnitPrice.supplierTaxRateValue,
'marginProfit': this.$refs.productUnitPrice.marginProfit, 'marginProfit': this.$refs.productUnitPrice.marginProfit,
'marginProfitPercent': this.$refs.productUnitPrice.marginProfitPercent, 'marginProfitPercent': this.$refs.productUnitPrice.marginProfitPercent,
'productsQuantityAsTitle': this.productsQuantityAsTitle,
/*'taxRate': this.$refs.productUnitPrice.taxRate, /*'taxRate': this.$refs.productUnitPrice.taxRate,
'supplierTaxRate': this.$refs.productUnitPrice.supplierTaxRate, 'supplierTaxRate': this.$refs.productUnitPrice.supplierTaxRate,
*/ */
'supplierTaxRate': null, 'supplierTaxRate': null,
'multiplyingFactor': null, 'multiplyingFactor': null,
'taxRateValue': null, 'taxRateValue': null,
'productsQuantityAsTitle': null,
'propertyExpirationDate': this.propertyExpirationDate, 'propertyExpirationDate': this.propertyExpirationDate,
'behaviorExpirationDate': this.behaviorExpirationDate 'behaviorExpirationDate': this.behaviorExpirationDate
}; };
propertyNoveltyExpirationDateActive: false, propertyNoveltyExpirationDateActive: false,
propertyNoveltyExpirationDate:null, propertyNoveltyExpirationDate:null,
activeProducts: false, activeProducts: false,
productsQuantityAsTitle: false,
formProducts: {}, formProducts: {},
currentSection: 'general', currentSection: 'general',
sectionsArray: [ sectionsArray: [
} }
} }
}, },
emptyProductsField: function (fieldName){
if (confirm('Êtes-vous sur de cette action ?')) {
for (i = 0; i < this.$refs.productForm.length; i++) {
this.$refs.productForm[i][fieldName] = null;
}
}
},
getUnitReference: function () { getUnitReference: function () {
if (typeof this.$refs.productUnitPrice !== 'undefined') { if (typeof this.$refs.productUnitPrice !== 'undefined') {
return this.$refs.productUnitPrice.unitReference; return this.$refs.productUnitPrice.unitReference;

+ 6
- 2
ShopBundle/Resources/public/sass/backend/custom.scss View File

.card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type{padding-left: 0.35rem;} .card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type{padding-left: 0.35rem;}
.products-collection-table .btn-empty-field{position: absolute; right: 3px; font-size: 0.7rem; top: 5px; padding: 0px;} .products-collection-table .btn-empty-field{position: absolute; right: 3px; font-size: 0.7rem; top: 5px; padding: 0px;}
#lc-product-family-edit .products-collection-table {table-layout:fixed;/* background-clip: padding-box;*/ border-collapse: collapse;} #lc-product-family-edit .products-collection-table {table-layout:fixed;/* background-clip: padding-box;*/ border-collapse: collapse;}
#lc-product-family-edit .products-collection-table th{font-size:13px; border-left: 1px solid #dee2e6; border-top: 1px solid #dee2e6; text-align: center; border-bottom: 2px solid #dee2e6;}
#lc-product-family-edit .products-collection-table th{font-size:13px; border-left: 1px solid #dee2e6; border-top: 1px solid #dee2e6; text-align: center; border-bottom: 2px solid #dee2e6; position: relative;}
#lc-product-family-edit .products-collection-table tfoot th{border-top: 2px solid #dee2e6;} #lc-product-family-edit .products-collection-table tfoot th{border-top: 2px solid #dee2e6;}
#lc-product-family-edit .products-collection-table th span {white-space: initial;} #lc-product-family-edit .products-collection-table th span {white-space: initial;}
#lc-product-family-edit .products-collection-table th:last-child{border-right: 1px solid #dee2e6;} #lc-product-family-edit .products-collection-table th:last-child{border-right: 1px solid #dee2e6;}
#dashboard .btn-statistic{ width: 120px; height: 70px; text-align: center; border: 1px solid black; line-height: 1rem; } #dashboard .btn-statistic{ width: 120px; height: 70px; text-align: center; border: 1px solid black; line-height: 1rem; }
#dashboard .btn-statistic small{margin-bottom: 10px; display: block;} #dashboard .btn-statistic small{margin-bottom: 10px; display: block;}
#dashboard .btn-statistic .value{display: block;} #dashboard .btn-statistic .value{display: block;}
#dashboard .btn-statistic.active{display: block;}

#dashboard #range_date_interval {margin-bottom: 20px;}
#dashboard #range_date_interval label{float: left; margin-right: 20px;}
#dashboard #range_date_interval .form-check{float: left; margin-right: 10px;}
#dashboard .table-condensed .btn, #dashboard .table-condensed .btn-sm{white-space: nowrap;}




/* Tickets */ /* Tickets */

+ 14
- 2
ShopBundle/Resources/translations/lcshop.fr.yaml View File

delete: Supprimer delete: Supprimer
send: Envoyer send: Envoyer
duplicate: Dupliquer duplicate: Dupliquer
duplicateOtherHub: Dupliquer sur un autre hub
duplicateOtherHub: Dupliquer sur %title%
sortProductFamily: Trier les produits de cette catégorie sortProductFamily: Trier les produits de cette catégorie
group: group:
main: Général main: Général
deliveryAddress: Adresse de livraison deliveryAddress: Adresse de livraison
complementary: Commandes complémentaires complementary: Commandes complémentaires
tickets: Tickets relatif à la commande tickets: Tickets relatif à la commande
orderStatusHistories: Historique de changement de statut
waitingBankReturn: Commandes en attente de retour banque
Ticket: Ticket:
listMessages: Liste des messages listMessages: Liste des messages
list: Tickets ouverts list: Tickets ouverts
total: Total total: Total
products: Produits products: Produits
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
dateEnd: Date de fin


PointSale: PointSale:
code: Code code: Code
propertyAlcoholLevel: Degré d'alcool propertyAlcoholLevel: Degré d'alcool
displayPriceUnitRef: Afficher le prix par unité de référence displayPriceUnitRef: Afficher le prix par unité de référence
behaviorPrice: Travailler avec des tarifs behaviorPrice: Travailler avec des tarifs
productsQuantityAsTitle: Titre équivalent à quantité
behaviorPriceOptions: behaviorPriceOptions:
by-piece: À la pièce by-piece: À la pièce
by-reference-unit: Par unité de référence by-reference-unit: Par unité de référence
quotation: Devis quotation: Devis
purchase-order: Bon de commande purchase-order: Bon de commande
delivery-note: Bon de livraison delivery-note: Bon de livraison

Statistic:
interval: Affichage des résultats
intervalOptions:
days: Par jour
week: Par semaine
month: Par mois


action: action:
apply: Appliquer apply: Appliquer
form.empty_value: Aucun(e) form.empty_value: Aucun(e)
add: Ajouter add: Ajouter
valid: Valider valid: Valider
close: Fermer
history: Historique
product: product:
editStock: Gérer les stocks editStock: Gérer les stocks
editProductFamily: Éditer le produit editProductFamily: Éditer le produit

+ 9
- 2
ShopBundle/Resources/views/backend/default/block/action.html.twig View File


{% set title = "" %}
{% if merchant is defined %}
{% set title = merchant.title %}
{% endif %}
{% if is_dropdown %} {% if is_dropdown %}

<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" <a class="btn dropdown-item {{ action.css_class|default('btn-default') }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}"> href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id, '%title%': title }), domain = translation_domain) }}
</a> </a>

{% else %} {% else %}
{% if action.hub is defined %} {% if action.hub is defined %}
{% set trad = action.label~action.hub|uc_first %} {% set trad = action.label~action.hub|uc_first %}
{% endif %} {% endif %}
<a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}" <a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id, '%title%': title }), domain = translation_domain) }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}"> href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a> </a>

+ 22
- 0
ShopBundle/Resources/views/backend/default/block/list_addressloopinbesancon.html.twig View File

<table class="table table-condensed" id="address-list">
<thead>
<tr>
<th>Adresse</th>
<th></th>
</tr>
</thead>
<tbody>
{% for address in addressesLoopBesancon %}
<tr>
<td>{{ address }}</td>
<td><a class="btn-sm btn-success"
href="{{ path('easyadmin', {id: address.user.id, entity: 'User', action: 'show'}) }}">
<i class="fas fa-eye"></i>
</a></td>
</tr>
{% else %}
<tr>
<td colspan="2"><i>Aucune adresse pour le moment</i></td>
{% endfor %}
</tbody>
</table>

+ 27
- 0
ShopBundle/Resources/views/backend/default/block/list_orderswaitingbankreturn.html.twig View File

<table class="table table-condensed" id="address-list">
<thead>
<tr>
<th>Id</th>
<th>Utilisateurs</th>
<th>Date</th>
<th></th>
</tr>
</thead>
<tbody>
{% for order in ordersWaitingBankReturn %}
<tr>
<td>{{ order.id }}</td>
<td>{{ order.user }}</td>
<td>{{ order.updatedAt|date('d-m H:i') }}</td>
<td><a class="btn-sm btn-success"
href="{{ path('easyadmin', {id: order.id, entity: 'OrderShop', action: 'show'}) }}">
<i class="fas fa-eye"></i>
</a></td>
</tr>
{% else %}
<tr>
<td colspan="4"><i>Aucune commande pour le moment</i></td>
{% endfor %}
</tbody>
</table>


+ 21
- 15
ShopBundle/Resources/views/backend/default/layout/layout.html.twig View File

<!-- Google Font: Source Sans Pro --> <!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">


{#<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">#}
{# <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}"> #}
{% endblock %} {% endblock %}


{% block head_custom_stylesheets %} {% block head_custom_stylesheets %}
{% endblock head_custom_stylesheets %} {% endblock head_custom_stylesheets %}


{# {#
{% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
<style>
:root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
</style>
{% endif %}
{% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
<style>
:root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
</style>
{% endif %}
#} #}


{% block head_favicon %} {% block head_favicon %}
</head> </head>


{% block body %} {% block body %}
<body id="pdl-body" class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %} {% block body_class_extend %}{% endblock %}">
<body id="pdl-body"
class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %} {% block body_class_extend %}{% endblock %}">
{# <script> {# <script>
document.body.classList.add( document.body.classList.add(
'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'), 'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'),
'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal') 'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal')
); );
</script>#}
</script> #}


{% block wrapper_wrapper %} {% block wrapper_wrapper %}
<div class="wrapper"> <div class="wrapper">
{% endif %} {% endif %}
</li> </li>
<li> <li>
<a target="_blank" class="btn btn-outline-success"
href="{{ merchantUtils.getMerchantUser.getMerchantConfig('url') }}">Afficher le
site</a>
{% if 'localhost' in app.request.getSchemeAndHttpHost() %}
<a target="_blank" class="btn btn-outline-success"
href="{{ app.request.getSchemeAndHttpHost() }}">Afficher le site</a>
{% else %}
<a target="_blank" class="btn btn-outline-success"
href="{{ merchantUtils.getMerchantUser.getMerchantConfig('url') }}">Afficher le
site</a>
{% endif %}
</li> </li>
</ul> </ul>
{% endblock navbar %} {% endblock navbar %}
{% block global_actions_wrapper %} {% block global_actions_wrapper %}
<div class="global-actions"> <div class="global-actions">
{% block global_actions %}{% endblock %} {% block global_actions %}{% endblock %}
{#{{ dump(_request_parameters) }}#}
{# {{ dump(_request_parameters) }} #}
<button type="button" class="btn-sm btn-primary btn-add-reminder " <button type="button" class="btn-sm btn-primary btn-add-reminder "
data-url="{{ path('easyadmin', { action: 'new', entity: 'Reminder' }) }}"> data-url="{{ path('easyadmin', { action: 'new', entity: 'Reminder' }) }}">
+ Ajouter pense bête + Ajouter pense bête
</div> </div>


{% block content_reminders %} {% block content_reminders %}
{% if reminders|length >0 %}
{% if reminders is defined and reminders|length >0 %}
<div class="head-reminders card card-outline card-danger"> <div class="head-reminders card card-outline card-danger">
{% include '@LcShop/backend/default/block/list_reminders.html.twig' %} {% include '@LcShop/backend/default/block/list_reminders.html.twig' %}
</div> </div>
{% endblock wrapper_wrapper %} {% endblock wrapper_wrapper %}




{#Initilisation des varibles requis dans le JS #}
{# Initilisation des varibles requis dans le JS #}
<script> <script>
const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}"; const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}";
</script> </script>
<!-- Bootstrap 4 --> <!-- Bootstrap 4 -->
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap.bundle.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap.bundle.min.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/toastr/toastr.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/toastr/toastr.min.js') }}"></script>
{#<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script>#}
{# <script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script> #}
<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.full.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.full.min.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap-switch.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap-switch.min.js') }}"></script>
<!-- AdminLTE App --> <!-- AdminLTE App -->

+ 17
- 6
ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig View File

</div> </div>
{% endif %}#} {% endif %}#}


{% set labelHelp = 'field.'~easyadmin['entity']['name']~'.'~name~'Help' %}
{% if labelHelp|trans({}, 'lcshop') == labelHelp %}{% set labelHelp = 'form.field.default.'~name~'Help' %}{% endif %}
{% if labelHelp|trans({}, 'lcshop') != labelHelp %}
<small class="form-text text-muted">{{ labelHelp|trans({}, 'lcshop')|raw }}</small>

{% if easyadmin is defined %}
{% set labelHelp = 'field.'~easyadmin['entity']['name']~'.'~name~'Help' %}
{% if labelHelp|trans({}, 'lcshop') == labelHelp %}{% set labelHelp = 'form.field.default.'~name~'Help' %}{% endif %}
{% if labelHelp|trans({}, 'lcshop') != labelHelp %}
<small class="form-text text-muted">{{ labelHelp|trans({}, 'lcshop')|raw }}</small>
{% endif %}
{% endif %} {% endif %}


{{- form_errors(form) -}} {{- form_errors(form) -}}
{% if 'field.MerchantConfig.' in label %} {% if 'field.MerchantConfig.' in label %}
{% set name_trad = label|replace({'field.MerchantConfig.': ''}) %} {% set name_trad = label|replace({'field.MerchantConfig.': ''}) %}
{% set trad = name_trad|lc_trad(easyadmin['entity']['name'], 'field') %} {% set trad = name_trad|lc_trad(easyadmin['entity']['name'], 'field') %}

{% else %} {% else %}
{% set trad = name|lc_trad(easyadmin['entity']['name'], 'field') %}
{% if easyadmin is defined %}
{% set trad = name|lc_trad(easyadmin['entity']['name'], 'field') %}
{% else %}
{% set trad = name|lc_trad('', 'field') %}
{% endif %}

{% endif %} {% endif %}


{%- endif -%} {%- endif -%}
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ trad }}</{{ element|default('label') }}>
{% if trad is defined %}
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ trad }}</{{ element|default('label') }}>
{% endif %}
{%- endif -%} {%- endif -%}
{%- endblock form_label %} {%- endblock form_label %}



+ 37
- 0
ShopBundle/Resources/views/backend/order/form/modal_orderstatushistories.html.twig View File

{% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %}
{% block size %}modal-lg{% endblock %}
{% block id %}modal-order-status-histories{% endblock %}
{% block title %}{{ "group.OrderShop.orderStatusHistories"|trans }}{% endblock %}

{% block content %}
<div class="col">
<table class="table table-bordered">
<thead>
<th>Id</th>
<th>Date</th>
<th>Statut</th>
<th>Utilisateur</th>
<th>Origin</th>
</thead>
<tbody>
<template v-for="(orderStatusHistory, i) in order.orderStatusHistories">
<tr>
<td>${orderStatusHistory.id}</td>
<td>${orderStatusHistory.createdAt}</td>
<td>${orderStatusHistory.orderStatus}</td>
<td>${orderStatusHistory.createdBy}</td>
<td>${orderStatusHistory.origin}</td>
</tr>
</template>
</tbody>
</table>
</div>
{% endblock %}

{% block footer %}
<button type="button" class="btn btn-default float-right"
data-dismiss="modal">{{ 'action.close'|trans }}</button>
{% endblock %}

{% endembed %}

+ 1
- 0
ShopBundle/Resources/views/backend/order/macros.html.twig View File

<strong> ${order.orderStatus}</strong> <strong> ${order.orderStatus}</strong>
{% endblock %} {% endblock %}
{% block button %} {% block button %}
{{ order_macros.order_modal_button('#modal-order-status-histories', 'btn-secondary', 'action.history') }}
{{ order_macros.order_modal_button('#modal-order-status') }} {{ order_macros.order_modal_button('#modal-order-status') }}
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}

+ 1
- 0
ShopBundle/Resources/views/backend/order/show-cart.html.twig View File

{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}
{% endif %} {% endif %}


{% include '@LcShop/backend/order/form/modal_orderstatushistories.html.twig' %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

+ 1
- 0
ShopBundle/Resources/views/backend/order/show-order.html.twig View File

{% if form_order_send_payment_link is defined %} {% if form_order_send_payment_link is defined %}
{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}
{% endif %} {% endif %}
{% include '@LcShop/backend/order/form/modal_orderstatushistories.html.twig' %}


</div> </div>
</div> </div>

+ 2
- 0
ShopBundle/Resources/views/backend/order/show.html.twig View File

{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}
{% endif %} {% endif %}


{% include '@LcShop/backend/order/form/modal_orderstatushistories.html.twig' %}

</div> </div>
</div> </div>
{% endblock %} {% endblock %}

+ 1
- 0
ShopBundle/Resources/views/backend/productfamily/form.html.twig View File

{% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %} {% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %}
{% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %} {% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %}
{% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %} {% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %}
{% if formValues.productsQuantityAsTitle %}productsQuantityAsTitle: {{ formValues.productsQuantityAsTitle }},{% endif %}


}; };
multiplyingFactor = "{{ form.multiplyingFactor.vars.value }}" multiplyingFactor = "{{ form.multiplyingFactor.vars.value }}"

+ 1
- 1
ShopBundle/Resources/views/backend/productfamily/macros.html.twig View File

#new #new
{% endif %} <br/> {% endif %} <br/>
{% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td> {% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td>
{{ _self.product_field(4, product.title, 'title') }}
{{ _self.product_field(4, product.title, 'title', false, "",'v-show="productFamily.productsQuantityAsTitle == false"' ) }}
{{ _self.product_field(2, product.quantity, 'quantity') }} {{ _self.product_field(2, product.quantity, 'quantity') }}
{{ _self.product_field(2, product.unit, 'unit', 'unitWording') }} {{ _self.product_field(2, product.unit, 'unit', 'unitWording') }}
{{ _self.product_field(3, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }} {{ _self.product_field(3, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }}

+ 59
- 23
ShopBundle/Resources/views/backend/productfamily/panel_products.html.twig View File

{% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %} {% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %}
{% trans_default_domain 'lcshop' %} {% trans_default_domain 'lcshop' %}


{#{% import _self as formMacros %}#}
{# {% import _self as formMacros %} #}
<div class="row"> <div class="row">
{{ macros.startCard(12, 'ProductFamily.products', 'light', true) }} {{ macros.startCard(12, 'ProductFamily.products', 'light', true) }}


<tr> <tr>
<th> <th>
</th> </th>
<th colspan="4" class="string">
<th colspan="4" class="string" v-show="productsQuantityAsTitle == false">
Titre Titre
<button v-on:click="emptyProductsField('title');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" class="string "> <th colspan="2" class="string ">
Quantité Quantité
<button v-on:click="emptyProductsField('quantity');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" class="quantity"> <th colspan="2" class="quantity">
Unité Unité
<button v-on:click="emptyProductsField('unit');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class="buyingPriceByRefUnit "> colspan="3" class="buyingPriceByRefUnit ">
PA HT / ${ getUnitReference() } PA HT / ${ getUnitReference() }
<button v-on:click="emptyProductsField('buyingPriceByRefUnit');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class="priceByRefUnit"> colspan="3" class="priceByRefUnit">
PA TTC / ${ getUnitReference() } PA TTC / ${ getUnitReference() }
<button v-on:click="emptyProductsField('buyingPriceByRefUnitWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>


<th colspan="3" class="price main-info"> <th colspan="3" class="price main-info">
PA HT PA HT
<button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'" v-on:click="emptyProductsField('buyingPrice');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="3" class="price" <th colspan="3" class="price"
v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">
PA TTC PA TTC
<button v-on:click="emptyProductsField('buyingPriceWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="3" class="main-info"> <th colspan="3" class="main-info">
Coef Coef
<button v-on:click="emptyProductsField('multiplyingFactor');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>




<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class=""> colspan="3" class="">
PV HT / ${ getUnitReference() } PV HT / ${ getUnitReference() }
<button v-on:click="emptyProductsField('priceByRefUnit');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class="price"> colspan="3" class="price">
PV TTC / ${ getUnitReference() } PV TTC / ${ getUnitReference() }
<button v-on:click="emptyProductsField('priceByRefUnitWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>


<th colspan="3" class="price"> <th colspan="3" class="price">
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">#}
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> #}
PV HT PV HT
<button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'" v-on:click="emptyProductsField('price');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="3" class="price main-info"> <th colspan="3" class="price main-info">
PV TTC PV TTC
<button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'" v-on:click="emptyProductsField('priceWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2"> <th colspan="2">
Marge HT Marge HT
<th colspan="2" class="" <th colspan="2" class=""
v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'"> v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'">
<span style="text-transform: uppercase"> ${typeExpirationDate}</span> <span style="text-transform: uppercase"> ${typeExpirationDate}</span>
<button v-on:click="emptyProductsField('propertyExpirationDate');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" <th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'"> v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'">
Stock Stock
<button v-on:click="emptyProductsField('availableQuantity');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" <th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'"> v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'">
Stock par défaut Stock par défaut
<button v-on:click="emptyProductsField('availableQuantityDefault');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" <th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' || behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'"> v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' || behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'">
<th> <th>
Rappel Rappel
</th> </th>
<th colspan="4" class="string">
<th colspan="4" class="string" v-show="productsQuantityAsTitle == false">
${title} ${title}

</th> </th>
<th colspan="2" class="string "> <th colspan="2" class="string ">
${productFamily.quantity} ${productFamily.quantity}
</th> </th>


<th colspan="3" class="price"> <th colspan="3" class="price">
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">#}
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> #}
${productFamily.price} ${productFamily.price}
</th> </th>
<th colspan="3" class="price main-info"> <th colspan="3" class="price main-info">
</tfoot> </tfoot>
</table> </table>


<button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span
class="fa fa-plus"></span> Ajouter une déclinaison
</button>
<p>
<strong>Aide à l'utilisation - Raccourci clavier</strong>
<ul>
<li><strong>TAB</strong> : Champ suivant</li>
<li><strong>SHIFT + TAB</strong> : Champ précédent</li>
<li><strong>FLÈCHE BAS</strong> : Déclinaison suivante</li>
<li><strong>FLÈCHE HAUT</strong> : Déclinaison précédente</li>
<li><strong>SHIFT + [+]</strong> : Ajout d'une nouvelle déclinaison</li>
</ul>
</p>

<div class="clearfix"></div>

<div class="col-12">
<button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span
class="fa fa-plus"></span> Ajouter une déclinaison
</button>

{{ form_row(form.productsQuantityAsTitle, {"attr":{'v-model' : 'productsQuantityAsTitle'}}) }}
<p>
<strong>Aide à l'utilisation - Raccourci clavier</strong>
<ul>
<li><strong>TAB</strong> : Champ suivant</li>
<li><strong>SHIFT + TAB</strong> : Champ précédent</li>
<li><strong>FLÈCHE BAS</strong> : Déclinaison suivante</li>
<li><strong>FLÈCHE HAUT</strong> : Déclinaison précédente</li>
<li><strong>SHIFT + [+]</strong> : Ajout d'une nouvelle déclinaison</li>
</ul>
</p>
</div>

<div class="clearfix"></div>


{{ macros.endCard() }} {{ macros.endCard() }}
</div> </div>
{% for keyForm,i in sortableProductsField %} {% for keyForm,i in sortableProductsField %}
{% set product = form.products[i] %} {% set product = form.products[i] %}


{#{% if product.vars.value.status >= 0 and (product.vars.value.originProduct is null or product.vars.value.originProduct == false) %}#}
{# {% if product.vars.value.status >= 0 and (product.vars.value.originProduct is null or product.vars.value.originProduct == false) %} #}
window.productForm[{{ keyForm }}] = { window.productForm[{{ keyForm }}] = {
{% if product.vars.value.originProduct is defined %}originProduct: parseInt({{ product.vars.value.originProduct }}),{% endif %} {% if product.vars.value.originProduct is defined %}originProduct: parseInt({{ product.vars.value.originProduct }}),{% endif %}
{% if product.vars.value.status is defined %}status: parseInt({{ product.vars.value.status }}),{% endif %} {% if product.vars.value.status is defined %}status: parseInt({{ product.vars.value.status }}),{% endif %}
{% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}),{% endif %} {% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}),{% endif %}
{% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}),{% endif %} {% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}),{% endif %}
{% if product.vars.value.propertyExpirationDate %}propertyExpirationDate: "{{ product.vars.value.propertyExpirationDate }}",{% endif %} {% if product.vars.value.propertyExpirationDate %}propertyExpirationDate: "{{ product.vars.value.propertyExpirationDate }}",{% endif %}
{#{% if product.vars.value.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %}#}
{# {% if product.vars.value.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %} #}
}; };
window.formProductTemplate[{{ keyForm }}] = '{{ product_family_macros.product_row(product, totalProductOrdered[product.vars.value.id])|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}'; window.formProductTemplate[{{ keyForm }}] = '{{ product_family_macros.product_row(product, totalProductOrdered[product.vars.value.id])|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}';
{#{% endif %}#}
{# {% endif %} #}
{% endfor %} {% endfor %}


</script> </script>

+ 19
- 13
ShopBundle/Resources/views/backend/user/block/user-switch.html.twig View File


{% if is_granted('ROLE_SUPER_ADMIN') %} {% if is_granted('ROLE_SUPER_ADMIN') %}
{% if is_dropdown %}
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ merchantUtils.merchantCurrent.getMerchantConfig('url') }}?_switch_user={{ item.username }}" target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
</a>
{% else %}
<a class="btn {{ action.css_class|default('btn-default') }}" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
href="{{ merchant.getMerchantConfig('url') }}?_switch_user={{ val }}" target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}

{% if 'localhost' in app.request.getSchemeAndHttpHost() %}
{% set href = app.request.getSchemeAndHttpHost()~ '?_switch_user='~item.username %}
{% else %}
{% set href = merchantUtils.merchantCurrent.getMerchantConfig('url')~ '?_switch_user='~item.username %}
{% endif %}
{% if is_dropdown %}
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ href }}"
target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
</a>
{% else %}
<a class="btn {{ action.css_class|default('btn-default') }}" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
href="{{ href }}" target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}
{% endif %} {% endif %}

+ 10
- 0
ShopBundle/Resources/views/backend/user/list-fields/field-countordershops.html.twig View File


{% if value|length > 0 %}
<span class="badge badge-success">
{{ value|length }} commandes
</span>
{% else %}
<span class="badge badge-danger">
0 commandes
</span>
{% endif %}

+ 1
- 1
ShopBundle/Services/CsvGenerator.php View File

$response = new StreamedResponse(function () { $response = new StreamedResponse(function () {
$this->createCsv('php://output'); $this->createCsv('php://output');
}); });
$response->headers->set('Content-Encoding', $this->toEncoding);
$response->headers->set('Content-Type', 'application/force-download'); $response->headers->set('Content-Type', 'application/force-download');
$response->headers->set('Content-Disposition', 'attachment; filename="'.$this->titleDocument.'.csv"'); $response->headers->set('Content-Disposition', 'attachment; filename="'.$this->titleDocument.'.csv"');
return $response; return $response;

+ 32
- 30
ShopBundle/Services/Order/OrderUtilsStockTrait.php View File

{ {
public function deductAvailabilityProduct(\Lc\ShopBundle\Model\OrderShop $orderShop) public function deductAvailabilityProduct(\Lc\ShopBundle\Model\OrderShop $orderShop)
{ {
//TODO ne pas déduire des stocks les orderProduct marqué en relivraison

foreach ($orderShop->getOrderProducts() as $orderProduct) { foreach ($orderShop->getOrderProducts() as $orderProduct) {
switch ($orderProduct->getProduct()->getProductFamily()->getBehaviorCountStock()) {
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE :
//Si ce n'esrt pas une relivraison OU si c'est une relivraison + relivraison + ce n'est pas une erruer producteur
if (!$orderProduct->isRedelivery() || ($orderProduct->isRedelivery() && $orderProduct->isRedeliverySupplierOrder() && !$orderProduct->isRedeliverySupplierMistake())) {
switch ($orderProduct->getProduct()->getProductFamily()->getBehaviorCountStock()) {
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE :


//Disponibilité par unité de référence
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - ($orderProduct->getQuantityOrder() * ($orderProduct->getQuantityProduct() / $orderProduct->getUnit()->getCoefficient()));
//Disponibilité par unité de référence
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - ($orderProduct->getQuantityOrder() * ($orderProduct->getQuantityProduct() / $orderProduct->getUnit()->getCoefficient()));


$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());
$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());


$this->em->persist($productFamily);
$this->em->persist($productFamily);


break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :
break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :


$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();


$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());
$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());


$this->em->persist($productFamily);
$this->em->persist($productFamily);


break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();
break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();


$product = $orderProduct->getProduct();
$product->setAvailableQuantity($newAvailability);
$product->setUpdatedBy($orderShop->getUser());
$product = $orderProduct->getProduct();
$product->setAvailableQuantity($newAvailability);
$product->setUpdatedBy($orderShop->getUser());


$this->em->persist($product);
$this->em->persist($product);


break;
}
break;
}


$this->em->flush();
$this->em->flush();
}
} }
} }



public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null)
{ {
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1) { if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1) {

+ 76
- 22
ShopBundle/Services/Price/OrderShopPriceUtils.php View File

return $total; return $total;
} }



//Inclus les ReductionCatalog des OrderProducts //Inclus les ReductionCatalog des OrderProducts
public function getMarginOrderProducts(OrderShopInterface $orderShop): float public function getMarginOrderProducts(OrderShopInterface $orderShop): float
{ {
return $total; return $total;
} }


public function getMarginOrderProductsWithReductions(OrderShopInterface $orderShop): float
{
$total = $this->getMarginOrderProducts($orderShop);

$totalReductionAmount = 0;
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart);
}

foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit);
}

$total -= $totalReductionAmount;

return $total;
}

public function getMarginOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float
{
if ($this->getTotalOrderProducts($orderShop)) {
return $this->round($this->getMarginOrderProductsWithReductions($orderShop) / $this->getTotalOrderProductsWithReductions($orderShop) * 100);
} else {
return 0;
}
}

public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float
{ {
if ($this->getTotalOrderProducts($orderShop)) { if ($this->getTotalOrderProducts($orderShop)) {
} else { } else {
return 0; return 0;
} }

} }


public function getBrandTaxesOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float
{
if ($this->getTotalOrderProducts($orderShop)) {
return $this->round($this->getMarginOrderProducts($orderShop) / $this->getTotalBuyingPriceOrderProducts($orderShop->getOrderProducts()) * 100);
} else {
return 0;
}
}


public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop): float public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop): float
{ {
return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()); return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts());
} }


public function getTotalBuyingPriceOrderProducts($orderProducts): float
{
$total = 0;

foreach ($orderProducts as $orderProduct) {
$total += $this->orderProductPriceUtils->getTotalBuyingPrice($orderProduct);
}

return $total;
}

public function getTotalBuyingPriceOrderProductsWithTax($orderProducts): float public function getTotalBuyingPriceOrderProductsWithTax($orderProducts): float
{ {
$total = 0; $total = 0;
return $total; return $total;
} }



public function getMarginOrderProductsWithReductions(OrderShopInterface $orderShop): float
{
$total = $this->getMarginOrderProducts($orderShop);

$totalReductionAmount = 0;
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart);
}

foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit);
}

$total -= $totalReductionAmount;

return $total;
}


public function getTotalOrderProductsWithTaxAndReductionCarts(OrderShopInterface $orderShop) public function getTotalOrderProductsWithTaxAndReductionCarts(OrderShopInterface $orderShop)
{ {
$total = $this->getTotalOrderProductsWithTax($orderShop); $total = $this->getTotalOrderProductsWithTax($orderShop);


return $amountWithTax; return $amountWithTax;
} }

public function getTotalReductions(OrderShopInterface $orderShop)
{
$total = 0 ;

foreach($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$total += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart) ;
}

foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$total += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit) ;
}

return $total ;
}

public function getTotalReductionsWithTax(OrderShopInterface $orderShop)
{
$total = 0 ;

foreach($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$total += $this->getOrderProductsReductionCartAmountWithTax($orderShop, $orderReductionCart) ;
}

foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$total += $this->getOrderProductsReductionCreditAmountWithTax($orderShop, $orderReductionCredit) ;
}

return $total ;
}
} }



+ 2
- 2
ShopBundle/Services/Price/PriceUtils.php View File

$service = 'orderProductPriceUtils'; $service = 'orderProductPriceUtils';
} }


if ($entity instanceof OrderShopInterface || is_array($entity)) {
if ($entity instanceof OrderShopInterface || is_iterable($entity) || is_array($entity)) {
$service = 'orderShopPriceUtils'; $service = 'orderShopPriceUtils';
} }


} }
} else { } else {
if (!strlen($service)) { if (!strlen($service)) {
throw new \ErrorException("PriceUtils : le type d'entité n'est pas géré.");
throw new \ErrorException("PriceUtils : le type d'entité n'est pas géré");
} else { } else {
if (!method_exists($this->$service, $name)) { if (!method_exists($this->$service, $name)) {
throw new \ErrorException("PriceUtils : la méthode " . $name . " du service " . $service . " n'existe pas."); throw new \ErrorException("PriceUtils : la méthode " . $name . " du service " . $service . " n'existe pas.");

+ 5
- 0
ShopBundle/Services/ProductFamilyUtils.php View File



foreach ($entity->getProducts() as $product) { foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity); $product->setProductFamily($entity);

if($entity->getProductsQuantityAsTitle() && $product->getStatus()>=1){
$product->setTitle(str_replace('.', ',',$product->getQuantityInherited()).$product->getUnitInherited()->getWording());
}

$this->em->persist($product); $this->em->persist($product);
$entity->addProduct($product); $entity->addProduct($product);
} }

Loading…
Cancel
Save