home · contact · privacy
Fix /edit_structured replacement ignoring date line. master
authorChristian Heller <c.heller@plomlompom.de>
Wed, 26 Feb 2025 16:43:53 +0000 (17:43 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 26 Feb 2025 16:43:53 +0000 (17:43 +0100)
src/templates/edit_structured.tmpl

index c3431d3be4b870c0ded8b3e3502289cffeb05135..510ca84ff4be4b22b42fa65a17ddb8ca0f6f1893 100644 (file)
@@ -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) => {
   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();
   });
   taint();
   update_form();