You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
7.2KB

  1. {{ form_start(form, {"attr": {'@change' : 'formUpdated'}}) }}
  2. {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}
  3. {% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %}
  4. {% set formValues = form.vars.value %}
  5. <div id="lc-product-family-edit" class="{% if app.request.query.get('inAdvancedEditingTable') %}in-advanced-editing-table{% endif %}">
  6. <div class="card card-light card-sections">
  7. <div class="lc-vue-js-container card-header p-0 border-bottom-0">
  8. <ul class="nav nav-tabs" id="nav-params">
  9. <li class="nav-item" v-for="section in sectionsArray">
  10. <a :href="'#'+section.name" type="button"
  11. v-if="(section.name == 'products' && activeProducts == true) || (section.name != 'products')"
  12. :class="'btn '+((currentSection == section.name) ? 'btn btn-primary' : 'btn ')"
  13. @click="changeSection(section)">
  14. ${ section.nameDisplay }
  15. <span v-if="section.name == 'products'">({{ form.products|length }})</span>
  16. <span class="glyphicon glyphicon-triangle-bottom"></span>
  17. <i class="fa fa-exclamation-circle invalid-form"></i>
  18. </a>
  19. </li>
  20. </ul>
  21. </div>
  22. </div>
  23. <div class="form ">
  24. <script>
  25. window.mixinUnitValues = {
  26. unitsList: {{ getUnitsList()|json_encode|raw }}
  27. };
  28. window.mixinPriceValues = {
  29. taxRatesList: {{ getTaxRatesList()|json_encode|raw }}
  30. };
  31. window.appProductFamilyValues = {
  32. {% if formValues.title %}title: "{{ formValues.title }}",{% endif %}
  33. {% if form.behaviorCountStock.vars.value %}behaviorCountStock: "{{ form.behaviorCountStock.vars.value }}",{% endif %}
  34. {% if form.behaviorStockWeek.vars.value %}behaviorStockWeek: "{{ form.behaviorStockWeek.vars.value }}",{% endif %}
  35. {% if formValues.availableQuantity %}availableQuantity: "{{ formValues.availableQuantity }}",{% endif %}
  36. {% if formValues.availableQuantityDefault %}availableQuantityDefault: "{{ formValues.availableQuantityDefault }}",{% endif %}
  37. {% if formValues.qualityLabels %}propertyQualityLabelActive: true,{% endif %}
  38. {% if formValues.qualityLabels %}qualityLabels: "",{% endif %}
  39. {% if formValues.propertyNoveltyExpirationDate %}propertyNoveltyExpirationDateActive: true,{% endif %}
  40. {% if formValues.propertyNoveltyExpirationDate %}propertyNoveltyExpirationDate: "{{ formValues.propertyNoveltyExpirationDate|date('Y-m-d') }}",{% endif %}
  41. {% if formValues.typeExpirationDate %}typeExpirationDate: "{{ formValues.typeExpirationDate }}",{% endif %}
  42. {% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %}
  43. {% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %}
  44. {% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %}
  45. {% if formValues.giftVoucherActive %}giftVoucherActive: "{{ formValues.giftVoucherActive }}",{% endif %}
  46. {% if formValues.productsQuantityAsTitle %}productsQuantityAsTitle: {{ formValues.productsQuantityAsTitle }},{% endif %}
  47. {% set current_section = app.request.query.get('currentSection') %}
  48. {% if current_section is defined and current_section|length > 0 %}currentSection: "{{ current_section }}",{% endif %}
  49. {% if form.sections.vars.value %}section: {{ form.sections.vars.value[0] }},{% endif %}
  50. };
  51. multiplyingFactor = "{{ form.multiplyingFactor.vars.value }}"
  52. window.productUnitPriceValues = {
  53. {% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %}
  54. {% if formValues.behaviorPrice %}behaviorPrice: "{{ formValues.behaviorPrice }}",{% endif %}
  55. {% if form.multiplyingFactor.vars.value %}multiplyingFactor: parseFloat(multiplyingFactor.replace(',', '.')),{% endif %}
  56. {% if formValues.unit %}unit: parseInt({{ formValues.unit.id }}),{% endif %}
  57. {% if formValues.quantity %}quantity: parseFloat({{ formValues.quantity }}),{% endif %}
  58. {% if formValues.taxRate %}taxRate: parseInt({{ formValues.taxRate.id }}),{% endif %}
  59. {% if formValues.price %}price: parseFloat({{ formValues.price }}).toFixed(3),{% endif %}
  60. {% if formValues.priceByRefUnit %}priceByRefUnit: parseFloat({{ formValues.priceByRefUnit }}).toFixed(3),{% endif %}
  61. {% if formValues.buyingPrice %}buyingPrice: parseFloat({{ formValues.buyingPrice }}).toFixed(3),{% endif %}
  62. {% if formValues.buyingPriceByRefUnit %}buyingPriceByRefUnit: parseFloat({{ formValues.buyingPriceByRefUnit }}).toFixed(3),{% endif %}
  63. {% if formValues.supplierTaxRate %}supplierTaxRate: parseInt({{ formValues.supplierTaxRate.id }}),{% endif %}
  64. {% if form.supplierTaxRate.vars.value != 0 %}differentSupplierTaxRate: true{% endif %}
  65. }
  66. </script>
  67. <div v-show="currentSection == 'general'" class="panel panel-default">
  68. {% include '@LcShop/backend/productfamily/panel_general.html.twig' %}
  69. </div>
  70. <div v-show="currentSection == 'price'" class="panel panel-default">
  71. {% include '@LcShop/backend/productfamily/panel_price.html.twig' %}
  72. </div>
  73. <div v-show="currentSection == 'products'" class="panel panel-default">
  74. {% include '@LcShop/backend/productfamily/panel_products.html.twig' %}
  75. </div>
  76. <div v-show="currentSection == 'stock'" class="panel panel-default">
  77. {% include '@LcShop/backend/productfamily/panel_stock.html.twig' %}
  78. </div>
  79. <div v-show="currentSection == 'property'" class="panel panel-default">
  80. {% include '@LcShop/backend/productfamily/panel_property.html.twig' %}
  81. </div>
  82. <div v-show="currentSection == 'reduction'" class="panel panel-default">
  83. {% include '@LcShop/backend/productfamily/panel_reduction.html.twig' %}
  84. </div>
  85. <div v-show="currentSection == 'seo'" class="panel panel-default">
  86. {% include '@LcShop/backend/productfamily/panel_seo.html.twig' %}
  87. </div>
  88. <div v-show="currentSection == 'note'" class="panel panel-default">
  89. <div class="row">
  90. {{ macros.startCard(12, 'ProductFamily.note', 'light') }}
  91. {{ form_row(form.note) }}
  92. {{ macros.endCard() }}
  93. </div>
  94. </div>
  95. {% if entity.note|striptags !="" %}
  96. <div class="row row-note">
  97. {{ macros.startCard(12, 'ProductFamily.note', 'light') }}
  98. {{ entity.note|raw }}
  99. {{ macros.endCard() }}
  100. </div>
  101. {% endif %}
  102. </div>
  103. {{ form_widget(form.stayOnPage, {"attr": {"v-model": "stayOnPage"}}) }}
  104. </div>
  105. {{ form_end(form) }}