No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

188 líneas
11KB

  1. {% trans_default_domain 'lcshop' %}
  2. {% macro product_sales_statistic(productsSalesStatistic, productFamily=false) %}
  3. {% for weekNumber, weekNumberQuantity in productsSalesStatistic|reverse(true) %}
  4. <span class="text-success"><i class="fa fa-calendar"></i> {{ weekNumber }}</span>
  5. <span class="text-info"><i class="fa fa-shopping-basket"></i>
  6. <strong>
  7. {{ weekNumberQuantity is null ? 0 : weekNumberQuantity }}
  8. </strong>
  9. </span>
  10. <br/>
  11. {% endfor %}
  12. {% endmacro product_sales_statistic %}
  13. {% macro product_family_sales_statistic(productsSalesStatistic, productFamily) %}
  14. {% if productsSalesStatistic %}
  15. <button type="button" data-product-family="{{ productFamily.id }}"
  16. class="lc-show-products-sales-statistic btn btn-sm"
  17. data-toggle="tooltip" title="{{ 'action.product.statSales'|trans }}"
  18. data-url="{{ path('easyadmin', { action: 'showSalesStatistic', entity: 'ProductFamily', id: productFamily.id }) }}">
  19. {% for weekNumber, weekNumberQuantity in productsSalesStatistic['data']['total_sales']['data']|reverse(true) %}
  20. <span class="text-success"><i class="fa fa-calendar"></i> {{ weekNumber }}</span>
  21. <span class="text-info"><i class="fa fa-shopping-basket"></i>
  22. <strong>
  23. {{ weekNumberQuantity is null ? 0 : weekNumberQuantity }}
  24. {% if productFamily and (productFamily.behaviorDisplaySale== constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_DISPLAY_SALE_BY_MEASURE')) %}
  25. {{ productFamily.unit.unitReference }}
  26. {% endif %}
  27. </strong>
  28. </span>
  29. <br/>
  30. {% endfor %}
  31. </button>
  32. {% endif %}
  33. {% endmacro product_family_sales_statistic %}
  34. {% macro product_field(colspan, field, field_name, field_display = false, display_suffix="",attr="") %}
  35. {% if field_display == false %}{% set field_display = field_name %}{% endif %}
  36. <td {{ attr|raw }} colspan="{{ colspan }}" class="{{ field_name }}">
  37. <div class="value" v-show="{{ field_name }}Inherited == false"
  38. @click="setFocusOnField('{{ field_name }}Inherited', keyForm)">
  39. <div v-if="{{ field_name }}">
  40. {% verbatim %}{{ {% endverbatim %}{{ field_display }} {% verbatim %}}}{% endverbatim %}{{ display_suffix }}
  41. {% if field_name == 'priceWithTax' %}
  42. <br/>
  43. <span class="text-danger"
  44. v-show="productFamily.reductionActive">{% verbatim %}{{ finalPriceWithTaxAndReduction }}{% endverbatim %}€</span>
  45. {% endif %}
  46. </div>
  47. <div v-else class="inherited">
  48. {% verbatim %}{{ productFamily.{% endverbatim %}{{ field_display }} {% verbatim %}}}{% endverbatim %}{{ display_suffix }}
  49. {% if field_name == 'priceWithTax' %}
  50. <br/>
  51. <span class="text-danger"
  52. v-show="productFamily.reductionActive">{% verbatim %}{{ finalPriceWithTaxAndReduction }}{% endverbatim %}€</span>
  53. {% endif %}
  54. </div>
  55. </div>
  56. <div v-show="{{ field_name }}Inherited == true">
  57. {{ form_widget(field, {'attr' : {'v-model' : field_name , 'v-on:focusout': field_name~'Inherited = false', '@change' : field_name~'Updated', 'data-ref': field_name~'Inherited', ':data-y' : "keyForm" }}) }}
  58. </div>
  59. <button v-show="{{ field_name }}" v-on:click="{{ field_name }} = null; {{ field_name }}Inherited = false;"
  60. class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
  61. </td>
  62. {% endmacro %}
  63. {% macro product_row(product, productsSalesStatistic) %}
  64. <tr class="lc-draggable" v-show="originProduct != true && status >= 0 ">
  65. <td>
  66. {% if product.vars.value is not null %}
  67. #{{ product.vars.value.id }}
  68. {% else %}
  69. #new
  70. {% endif %} <br/>
  71. {% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td>
  72. {{ _self.product_field(4, product.title, 'title', false, "",'v-show="productFamily.productsQuantityAsTitle == false"' ) }}
  73. {{ _self.product_field(2, product.quantity, 'quantity') }}
  74. {{ _self.product_field(2, product.unit, 'unit', 'unitWording') }}
  75. {{ _self.product_field(3, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }}
  76. {{ _self.product_field(3, product.buyingPriceByRefUnitWithTax, 'buyingPriceByRefUnitWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }}
  77. {{ _self.product_field(3, product.buyingPrice, 'buyingPrice',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}
  78. {{ _self.product_field(3, product.buyingPriceWithTax, 'buyingPriceWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}
  79. <td class="buyingPrice" colspan="3"
  80. v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'">
  81. {% verbatim %}{{ finalBuyingPrice }}{% endverbatim %}€
  82. </td>
  83. {{ _self.product_field(3, product.multiplyingFactor, 'multiplyingFactor') }}
  84. {{ _self.product_field(3, product.priceByRefUnit, 'priceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }}
  85. {{ _self.product_field(3, product.priceByRefUnitWithTax, 'priceByRefUnitWithTax',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }}
  86. <td class="price" colspan="3"
  87. v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'">
  88. {% verbatim %}{{ finalPrice }}{% endverbatim %}€
  89. </td>
  90. <td class="priceWithTax" colspan="3"
  91. v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'">
  92. {% verbatim %}{{ finalPriceWithTax }}{% endverbatim %}€
  93. <span class="text-danger"
  94. v-show="productFamily.reductionActive">{% verbatim %}{{ finalPriceWithTaxAndReduction }}{% endverbatim %}€</span>
  95. </td>
  96. {{ _self.product_field(3, product.price, 'price', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}
  97. {{ _self.product_field(3, product.priceWithTax, 'priceWithTax', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}
  98. <td colspan="2" v-show="productFamily.giftVoucherActive!= true">
  99. <span v-if="productFamily.reductionActive" class="text-danger">
  100. {% verbatim %}{{ marginProfitWithReduction }}{% endverbatim %}€<br/>
  101. {% verbatim %}{{ marginProfitPercentWithReduction }}{% endverbatim %}%
  102. </span>
  103. <span v-else>
  104. {% verbatim %}{{ marginProfit }}{% endverbatim %}€<br/>
  105. {% verbatim %}{{ marginProfitPercent }}{% endverbatim %}%
  106. </span>
  107. </td>
  108. {{ _self.product_field(2, product.propertyExpirationDate, 'propertyExpirationDate','propertyExpirationDateValue', '', 'v-show="productFamily.behaviorExpirationDate== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') ~ '\'"') }}
  109. {{ _self.product_field(2, product.availableQuantity, 'availableQuantity',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\'"') }}
  110. {{ _self.product_field(2, product.availableQuantityDefault, 'availableQuantityDefault',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\' && productFamily.behaviorStockWeek!= \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') ~ '\'"') }}
  111. <td colspan="2">
  112. {{ _self.product_sales_statistic(productsSalesStatistic) }}
  113. </td>
  114. {# <td colspan="4" v-show="productFamily.giftVoucherActive== true">
  115. {{ form_row(product.giftVoucherReductionCart, {"label": false, "attr" : {'v-model' : 'giftVoucherReductionCart', ':required': 'status ==1 && productFamily.giftVoucherActive'}}) }}
  116. </td> #}
  117. <td colspan="3">
  118. <button type="button" :class="hasExportInfo ? 'btn-sm btn-info' : 'btn-sm btn-secondary'" @click="modalProductForm()">
  119. <i class="fa fa-edit"></i>
  120. </button>
  121. <button type="button" class="btn-sm btn-info" @click="changeStatus()">
  122. <i class="fa fa-check-square"></i>
  123. </button>
  124. <button type="button" class="btn-remove-product btn-sm btn-danger" @click="deleteProductForm()">
  125. <i class="fa fa-trash"></i>
  126. </button>
  127. {{ form_widget(product.position, {'attr' : {'class': "field-position", "v-model" : 'position'}}) }}
  128. {{ form_widget(product.status, {'attr' : {"v-model" : 'status'}}) }}
  129. <div class="modal fade show" :id="'modal-extends-product-'+keyForm">
  130. <div class="modal-dialog">
  131. <div class="modal-content">
  132. <div class="modal-header">
  133. <h4>{{ "group.ProductFamily.productsExtend"|trans }}</h4>
  134. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  135. <span aria-hidden="true">×</span>
  136. </button>
  137. </div>
  138. <div class="modal-body">
  139. <div class="col">
  140. {{ form_row(product.exportTitle, {'attr' : {"v-model" : 'exportTitle'}}) }}
  141. </div>
  142. <div class="col">
  143. {{ form_row(product.exportNote, {'attr' : {"v-model" : 'exportNote'}}) }}
  144. </div>
  145. </div>
  146. <div class="modal-footer justify-content-between">
  147. <button type="button" class="btn btn-info float-right" data-dismiss="modal">Ok</button>
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </td>
  153. </tr>
  154. {% endmacro %}