Shopware6: Entweder shop_part.shop_description oder part.notes verwenden
authorJan Büren <jan@kivitendo.de>
Wed, 24 Nov 2021 10:49:20 +0000 (11:49 +0100)
committerJan Büren <jan@kivitendo.de>
Fri, 11 Feb 2022 14:19:56 +0000 (15:19 +0100)
SL/ShopConnector/Shopware6.pm
templates/webpages/part/_shop.html
templates/webpages/shop_part/edit.html
templates/webpages/shops/form.html

index abf5da2..47eca16 100644 (file)
@@ -138,6 +138,10 @@ sub update_part {
   my $update_p;
   $update_p->{productNumber} = $part->partnumber;
   $update_p->{name}          = $part->description;
+  $update_p->{description}   =   $shop_part->shop->use_part_longdescription
+                               ? $part->notes
+                               : $shop_part->shop_description;
+
 
   $update_p->{stock}  = $::form->round_amount($part->onhand, 0) if ($todo =~ m/(stock|all)/);
   # JSON::true JSON::false
index 051a230..3c65b4d 100644 (file)
    <th>[% LxERP.t8("Action") %]</th>
   </tr>
   </thead>
-  [% # L.dump(SELF.part) %]
+  [% L.dump(SELF.part) %]
   [%- FOREACH shop_part = SELF.part.shop_parts %]
   [% IF !shop_part.shop.obsolete %]
+
   <tr class="listrow">
    <td>[% HTML.escape( shop_part.shop.description ) %]</td>
    <td>[% L.html_tag('span', shop_part.active, id => 'shop_part_active_' _ shop_part.id ) %]</td>
-   <td>[% L.html_tag('span', shop_part.shop_description, id => 'shop_part_description_' _ shop_part.id ) %]</td>
+   <td>
+    [% IF shop_part.shop.use_part_longdescription %]
+      [% L.html_tag('span', shop_part.part.notes, id => 'shop_part_description_' _ shop_part.id ) %]
+    [% ELSE %]
+      [% L.html_tag('span', shop_part.shop_description, id => 'shop_part_description_' _ shop_part.id ) %]
+    [% END %]
+  </td>
    <td>[% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] </td>
    <td>[% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %]</td>
    <td>[% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %]</td>
index 5536ad7..59bd279 100644 (file)
     [%- L.hidden_tag("shop_part.part_id", FORM.part_id) %]
     [% END %]
 
+  [% # L.dump(SELF.shop_part.shop) %]
     <table>
     <tr>
      <td>[% LxERP.t8("Description") %]</td>
-     <td colspan="3">[% L.textarea_tag('shop_part.shop_description', SELF.shop_part.shop_description, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]</td>
+     <td colspan="3">
+       [% IF SELF.shop_part.shop.use_part_longdescription %]
+         [% L.textarea_tag('shop_part.part.notes', SELF.shop_part.part.notes, wrap="soft", readonly="readonly", style="width: 350px; height: 150px", class="texteditor") %]
+       [% ELSE %]
+         [% L.textarea_tag('shop_part.shop_description', SELF.shop_part.shop_description, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
+       [% END %]
+     </td>
     </tr>
     <tr>
      <td>[% LxERP.t8("Active") %]</td>
index cda1e0b..3ab333b 100644 (file)
     <th align="right">[% 'Obsolete' | $T8 %]</th>
     <td>[% L.checkbox_tag('shop.obsolete', checked = SELF.shop.obsolete, for_submit=1) %]</td>
   </tr>
+  <tr>
+    <th align="right">[% 'Use Long Description from Parts for Shop Long Description' | $T8 %]</th>
+    <td>[% L.yes_no_tag('shop.use_part_longdescription', SELF.shop.use_part_longdescription) %]</td>
+  </tr>
 </table>
 
  <hr>