From 24183a8d99a92a9cab623a497320a5f2e3212330 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 24 Nov 2021 11:49:20 +0100 Subject: [PATCH] Shopware6: Entweder shop_part.shop_description oder part.notes verwenden --- SL/ShopConnector/Shopware6.pm | 4 ++++ templates/webpages/part/_shop.html | 11 +++++++++-- templates/webpages/shop_part/edit.html | 9 ++++++++- templates/webpages/shops/form.html | 4 ++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/SL/ShopConnector/Shopware6.pm b/SL/ShopConnector/Shopware6.pm index abf5da274..47eca1627 100644 --- a/SL/ShopConnector/Shopware6.pm +++ b/SL/ShopConnector/Shopware6.pm @@ -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 diff --git a/templates/webpages/part/_shop.html b/templates/webpages/part/_shop.html index 051a2306c..3c65b4dac 100644 --- a/templates/webpages/part/_shop.html +++ b/templates/webpages/part/_shop.html @@ -18,13 +18,20 @@ [% LxERP.t8("Action") %] - [% # L.dump(SELF.part) %] + [%# L.dump(SELF.part) %] [%- FOREACH shop_part = SELF.part.shop_parts %] [% IF !shop_part.shop.obsolete %] + [% HTML.escape( shop_part.shop.description ) %] [% L.html_tag('span', shop_part.active, id => 'shop_part_active_' _ shop_part.id ) %] - [% L.html_tag('span', shop_part.shop_description, id => 'shop_part_description_' _ shop_part.id ) %] + + [% 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 %] + [% L.html_tag('span',LxERP.t8(), id => 'active_price_source_' _ shop_part.id) %] [% L.html_tag('span','Price', id => 'price_' _ shop_part.id) %] [% L.html_tag('span','Stock', id => 'stock_' _ shop_part.id) %] diff --git a/templates/webpages/shop_part/edit.html b/templates/webpages/shop_part/edit.html index 5536ad715..59bd27923 100644 --- a/templates/webpages/shop_part/edit.html +++ b/templates/webpages/shop_part/edit.html @@ -18,10 +18,17 @@ [%- L.hidden_tag("shop_part.part_id", FORM.part_id) %] [% END %] + [% # L.dump(SELF.shop_part.shop) %] - + diff --git a/templates/webpages/shops/form.html b/templates/webpages/shops/form.html index cda1e0bb1..3ab333ba2 100644 --- a/templates/webpages/shops/form.html +++ b/templates/webpages/shops/form.html @@ -79,6 +79,10 @@ + + + +
[% LxERP.t8("Description") %][% L.textarea_tag('shop_part.shop_description', SELF.shop_part.shop_description, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %] + [% 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 %] +
[% LxERP.t8("Active") %][% 'Obsolete' | $T8 %] [% L.checkbox_tag('shop.obsolete', checked = SELF.shop.obsolete, for_submit=1) %]
[% 'Use Long Description from Parts for Shop Long Description' | $T8 %][% L.yes_no_tag('shop.use_part_longdescription', SELF.shop.use_part_longdescription) %]

-- 2.20.1