From 783cdc346dc43a90db342599497d4ae20f789fdc Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Wed, 26 Feb 2025 17:43:53 +0100
Subject: [PATCH] Fix /edit_structured replacement ignoring date line.

---
 src/templates/edit_structured.tmpl | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/templates/edit_structured.tmpl b/src/templates/edit_structured.tmpl
index c3431d3..510ca84 100644
--- a/src/templates/edit_structured.tmpl
+++ b/src/templates/edit_structured.tmpl
@@ -161,15 +161,15 @@ function replace() {
   const from = document.getElementById("replace_from").value;
   const to = document.getElementById("replace_to").value;
   dat_lines.forEach((dat_line) => {
-    dat_line.comment = dat_line.comment.replaceAll(from, to);
-    if ('code' in dat_line) {
-      dat_line.code = dat_line.code.replaceAll(from, to);
-    }
-    ['account', 'amount', 'currency'].forEach((key) => {
-      if (key in dat_line.booking_line) {
-        dat_line.booking_line[key] = dat_line.booking_line[key].replaceAll(from, to);
+      dat_line.comment = dat_line.comment.replaceAll(from, to);
+      if ('code' in dat_line) {
+        dat_line.code = dat_line.code.replaceAll(from, to);
       }
-    });
+      ['date', 'target', 'account', 'amount', 'currency'].forEach((key) => {
+          if (key in dat_line.booking_line) {
+              dat_line.booking_line[key] = dat_line.booking_line[key].replaceAll(from, to);
+          }
+      });
   });
   taint();
   update_form();
-- 
2.30.2