PriceSource: Rabattbehandlung
[kivitendo-erp.git] / templates / webpages / oe / price_sources_dialog.html
index 92ee4eb..263cfd6 100644 (file)
@@ -3,12 +3,16 @@
 [%- USE L %]
 [%- USE LxERP %]
 [% SET best_price = price_source.best_price %]
+[% SET best_discount = price_source.best_discount %]
+  <h2>[% 'Prices' | $T8 %]</h2>
+
   <table>
    <tr class='listheading'>
     <th></th>
     <th>[% 'Price Source' | $T8 %]</th>
     <th>[% 'Price' | $T8 %]</th>
     <th>[% 'Best Price' | $T8 %]</th>
+    <th>[% 'Details' | $T8 %]</th>
    </tr>
    <tr class='listrow'>
 [%- IF price_source.record_item.active_price_source %]
     <td>[% 'None (PriceSource)' | $T8 %]</td>
     <td>-</td>
     <td></td>
+    <td></td>
    </tr>
    [%- FOREACH price IN price_source.available_prices %]
     <tr class='listrow'>
 [%- IF price_source.record_item.active_price_source != price.source %]
      <td>[% L.button_tag('kivi.io.update_price_source(' _ FORM.row _ ', \'' _ price.source _ '\', \'' _ LxERP.format_amount(price.price, -2) _ '\')', LxERP.t8('Select')) %]</td>
-[%- ELSIF price_source.record_item.sellprice_as_number != price.price_as_number %]
+[%- ELSIF price_source.record_item.sellprice != price.price %]
      <td>[% L.button_tag('kivi.io.update_price_source(' _ FORM.row _ ', \'' _ price.source _ '\', \'' _ LxERP.format_amount(price.price, -2) _ '\')', LxERP.t8('Update Price')) %]</td>
 [%- ELSE %]
     <td><b>[% 'Selected' | $T8 %]</b></td>
 [% END %]
-     <td>[% price.full_description | html %]</td>
+     <td>[% price.source_description | html %]</td>
      <td>[% price.price_as_number %]</td>
 [% IF price.source == best_price.source %]
      <td align='center'>&#x2022;</td>
 [% ELSE %]
      <td></td>
 [% END %]
+     <td>[% price.description | html %]</td>
+    </tr>
+   [%- END %]
+  </table>
+
+  <h2>[% 'Discounts' | $T8 %]</h2>
+
+  <table>
+   <tr class='listheading'>
+    <th></th>
+    <th>[% 'Price Source' | $T8 %]</th>
+    <th>[% 'Discount' | $T8 %]</th>
+    <th>[% 'Best Discount' | $T8 %]</th>
+    <th>[% 'Details' | $T8 %]</th>
+   </tr>
+   <tr class='listrow'>
+[%- IF price_source.record_item.active_discount_source %]
+    <td>[% L.button_tag('kivi.io.update_discount_source(' _ FORM.row _ ', \'\')', LxERP.t8('Select')) %]</td>
+[%- ELSE %]
+    <td><b>[% 'Selected' | $T8 %]</b></td>
+[%- END %]
+    <td>[% 'None (PriceSource Discount)' | $T8 %]</td>
+    <td>-</td>
+    <td></td>
+    <td></td>
+   </tr>
+   [%- FOREACH price IN price_source.available_discounts %]
+    <tr class='listrow'>
+[%- IF price_source.record_item.active_discount_source != price.source %]
+     <td>[% L.button_tag('kivi.io.update_discount_source(' _ FORM.row _ ', \'' _ price.source _ '\', \'' _ price.discount_as_percent _ '\')', LxERP.t8('Select')) %]</td>
+[%- ELSIF price_source.record_item.discount != price.discount * 100 %]
+     <td>[% L.button_tag('kivi.io.update_discount_source(' _ FORM.row _ ', \'' _ price.source _ '\', \'' _ price.discount_as_percent  _ '\')', LxERP.t8('Update Discount')) %]</td>
+[%- ELSE %]
+    <td><b>[% 'Selected' | $T8 %]</b></td>
+[% END %]
+     <td>[% price.source_description | html %]</td>
+     <td>[% price.discount_as_percent %] %</td>
+[% IF price.source == best_discount.source %]
+     <td align='center'>&#x2022;</td>
+[% ELSE %]
+     <td></td>
+[% END %]
+     <td>[% price.description | html %]</td>
     </tr>
    [%- END %]
   </table>