From 463f548f7df9f70d5b66ffa674634f6109a5b973 Mon Sep 17 00:00:00 2001
From: Andreas Rudin <andreas.rudin@revamp-it.ch>
Date: Thu, 7 Mar 2024 17:25:48 +0100
Subject: [PATCH] Fix #662 und #663 Debitorenbuchung Design40 Fehlbetrag setzen
 und Zahlung buchen

---
 templates/design40_webpages/ar/form_header.html | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/templates/design40_webpages/ar/form_header.html b/templates/design40_webpages/ar/form_header.html
index 6893898bd5..bff2ef3bc6 100644
--- a/templates/design40_webpages/ar/form_header.html
+++ b/templates/design40_webpages/ar/form_header.html
@@ -316,10 +316,12 @@ <h1>
         [% END %]
       </td>
       <td class="numeric">
+        [% temp = "paid_"_ row %]
         [% IF row.changeable %]
-          <input name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]" size="11" type="text" data-validate="number" class="numeric">
+          <input name="[% temp %]" value="[% $temp | html %]" id="[%- 'payment_' _ temp -%]" size="11" type="text" data-validate="number" class="numeric">
         [% ELSE %]
-          [% row.paid | html %]<input type="hidden" name="paid_[% loop.count %]" value="[% row.paid ? LxERP.format_amount(row.paid, 2) : '' | html %]"> [% defaultcurrency %]
+          [% $temp | html %] [% defaultcurrency %]
+	  <input type="hidden" name="[% temp %]" value="[% 'Set to paid missing' | $T8 %]">
         [% END %]
       </td>
       <td>
@@ -398,5 +400,5 @@ <h1>
 </div><!-- ./tabwidget -->
 
 <script type="text/javascript">
- $('#ar_set_to_paid_missing').click(function(){ $('input[name^="paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
+ $('#ar_set_to_paid_missing').click(function(){ $('input[id^="payment_paid_"]:last').val("[% LxERP.format_amount(paid_missing, 2) %]") });
 </script>