Revision e2cc408f
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
| SL/DB/Part.pm | ||
|---|---|---|
|     map_to    => 'variant_property',
 | ||
|     type      => 'many to many',
 | ||
|   },
 | ||
|   variant_porperty_values => {
 | ||
|   variant_property_values => {
 | ||
|     map_class => 'SL::DB::VariantPropertyValuePart',
 | ||
|     map_from  => 'part',
 | ||
|     map_to    => 'variant_property_value',
 | ||
| templates/design40_webpages/part/_parent_variant.html | ||
|---|---|---|
| [% USE T8 %]
 | ||
| [% USE HTML %]
 | ||
| [% USE LxERP %]
 | ||
| [% USE L %]
 | ||
| [% USE P %]
 | ||
|  | ||
| <div class="wrapper input-panel">
 | ||
|   <h3> [% LxERP.t8("Create new Variants") %] </h3>
 | ||
|   <div class="wrapper">
 | ||
|   [% FOREACH variant_property = SELF.part.variant_properties %]
 | ||
|     <div class="col input-panel" style="min-width:fit-content;">
 | ||
|       <h4>[% variant_property.name_translated | html %]</h4>
 | ||
|       [% L.select_tag("variant_properties." _ variant_property.id _ ".selected_property_values[]",
 | ||
|         variant_property.property_values,
 | ||
|         title_key='value_translated', value_key='id',
 | ||
|         id="selected_property_values_" _ variant_property.id,
 | ||
|         multiple=1,
 | ||
|       ) %]
 | ||
|       [% L.multiselect2side(
 | ||
|         "selected_property_values_" _ variant_property.id,
 | ||
|         labelsx=LxERP.t8("All Property Values"),
 | ||
|         labeldx=LxERP.t8("Selected Property Values")
 | ||
|       ) %]
 | ||
|     </div>
 | ||
|   [% END %]
 | ||
|   </div>
 | ||
|   [% L.button_tag('kivi.Part.create_variants();', LxERP.t8("Create Variants with selected Values")) %]
 | ||
| </div>
 | ||
|  | ||
| <br>
 | ||
|  | ||
| variants:
 | ||
| [% FOREACH variant = SELF.part.variants %]
 | ||
|   [% variant.partnumber %]:[% variant.description %]
 | ||
| [% END %]
 | ||
|  | ||
|  | ||
| templates/design40_webpages/part/_variant.html | ||
|---|---|---|
| [% USE T8 %]
 | ||
| [% USE HTML %]
 | ||
| [% USE LxERP %]
 | ||
| [% USE L %]
 | ||
| [% USE P %]
 | ||
|  | ||
| <div class="wrapper input-panel">
 | ||
|   <h3> [% "Parent Variant" | $T8 %]:
 | ||
|     [% SELF.part.parent_variant.presenter.part %]
 | ||
|     [% SELF.part.parent_variant.description %]
 | ||
|   </h3>
 | ||
|   <table class="tbl-list">
 | ||
|     <caption>
 | ||
|       [% LxERP.t8("Variant Property Values") %]
 | ||
|     </caption>
 | ||
|     <thead>
 | ||
|       <th>[% "Transled Value" | $T8 %]</th>
 | ||
|       <th>[% "Value" | $T8 %]</th>
 | ||
|       <th>[% "Abbreviation" | $T8 %]</th>
 | ||
|     </thead>
 | ||
|     <tbody class="row_entry listrow">
 | ||
|     [% FOREACH variant_property_value = SELF.part.variant_property_values %]
 | ||
|       <tr>
 | ||
|       [% # L.dump(variant_property_value) %]
 | ||
|         <td>[% variant_property_value.value_translated | html %]</td>
 | ||
|         <td>[% variant_property_value.value | html %]</td>
 | ||
|         <td>[% variant_property_value.abbreviation | html %]</td>
 | ||
|       </tr>
 | ||
|     [% END %]
 | ||
|     </tbody>
 | ||
|   </table>
 | ||
| </div>
 | ||
| templates/design40_webpages/part/_variants.html | ||
|---|---|---|
| [% USE T8 %]
 | ||
| [% USE HTML %]
 | ||
| [% USE LxERP %]
 | ||
| [% USE L %]
 | ||
| [% USE P %]
 | ||
|  | ||
| <div class="wrapper input-panel">
 | ||
|   <h3> [% LxERP.t8("Create new Variants") %] </h3>
 | ||
|   <div class="wrapper">
 | ||
|   [% FOREACH variant_property = SELF.part.variant_properties %]
 | ||
|     <div class="col input-panel" style="min-width:fit-content;">
 | ||
|       <h4>[% variant_property.name_translated | html %]</h4>
 | ||
|       [% L.select_tag("variant_properties." _ variant_property.id _ ".selected_property_values[]",
 | ||
|         variant_property.property_values,
 | ||
|         title_key='value_translated', value_key='id',
 | ||
|         id="selected_property_values_" _ variant_property.id,
 | ||
|         multiple=1,
 | ||
|       ) %]
 | ||
|       [% L.multiselect2side(
 | ||
|         "selected_property_values_" _ variant_property.id,
 | ||
|         labelsx=LxERP.t8("All Property Values"),
 | ||
|         labeldx=LxERP.t8("Selected Property Values")
 | ||
|       ) %]
 | ||
|     </div>
 | ||
|   [% END %]
 | ||
|   </div>
 | ||
|   [% L.button_tag('kivi.Part.create_variants();', LxERP.t8("Create Variants with selected Values")) %]
 | ||
| </div>
 | ||
|  | ||
| <br>
 | ||
|  | ||
| variants:
 | ||
| [% FOREACH variant = SELF.part.variants %]
 | ||
|   [% variant.partnumber %]:[% variant.description %]
 | ||
| [% END %]
 | ||
|  | ||
|  | ||
| templates/design40_webpages/part/form.html | ||
|---|---|---|
|   <ul class="ui-tabs">
 | ||
|     <li><a href="#basic_data">[% 'Basic Data' | $T8 %]</a></li>
 | ||
|     [% IF SELF.part.is_parent_variant && SELF.part.id %]
 | ||
|       <li><a href="#variants_tab">[% 'Variants' | $T8 %]</a></li>
 | ||
|       <li><a href="#parent_variant_tab">[% 'Variants' | $T8 %]</a></li>
 | ||
|     [% END %]
 | ||
|     [% IF SELF.part.is_variant && SELF.part.id %]
 | ||
|       <li><a href="#variant_tab">[% 'Variant Properties' | $T8 %]</a></li>
 | ||
|     [% END %]
 | ||
|     [% IF SELF.part.is_assortment %]
 | ||
|       <li><a href="#assortment_tab">[% 'Assortment items' | $T8 %]</a></li>
 | ||
| ... | ... | |
|   </div>
 | ||
|  | ||
|   [% IF SELF.part.is_parent_variant && SELF.part.id %]
 | ||
|     <div id="variants_tab" class="ui-tabs-panel">
 | ||
|       [% PROCESS 'part/_variants.html' id=part.id %]
 | ||
|     <div id="parent_variant_tab" class="ui-tabs-panel">
 | ||
|       [% PROCESS 'part/_parent_variant.html' %]
 | ||
|     </div>
 | ||
|   [% END %]
 | ||
|   [% IF SELF.part.is_variant && SELF.part.id %]
 | ||
|     <div id="variant_tab" class="ui-tabs-panel">
 | ||
|       [% PROCESS 'part/_variant.html' %]
 | ||
|     </div>
 | ||
|   [% END %]
 | ||
|  | ||
Auch abrufbar als: Unified diff
Varianten: Varianten Eigenschaften Tab für Varianten