From 6368404125a25ef75691791087070cb3044b1689 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 27 Jun 2024 12:53:48 +0200 Subject: [PATCH] Attachments (more than one) do not follow the transaction after editing. Fixed. --- gl/includes/db/gl_db_banking.inc | 7 ++++--- gl/includes/db/gl_journal.inc | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gl/includes/db/gl_db_banking.inc b/gl/includes/db/gl_db_banking.inc index 157d59d5..e7fa811d 100644 --- a/gl/includes/db/gl_db_banking.inc +++ b/gl/includes/db/gl_db_banking.inc @@ -451,9 +451,10 @@ function write_bank_transaction($trans_type, $trans_no, $from_account, $items, $ } if ($aid != 0) { - $row = get_attachment($aid); - update_attachment($aid, $row['type_no'], $trans_no, $row['description'], - $row['filename'], $row['unique_name'], $row['filesize'], $row['filetype']); + move_trans_attachments($trans_type, $old_trans, $trans_no); + //$row = get_attachment($aid); + //update_attachment($aid, $row['type_no'], $trans_no, $row['description'], + // $row['filename'], $row['unique_name'], $row['filesize'], $row['filetype']); } // do the source account postings diff --git a/gl/includes/db/gl_journal.inc b/gl/includes/db/gl_journal.inc index 88a8553d..01eefaf4 100644 --- a/gl/includes/db/gl_journal.inc +++ b/gl/includes/db/gl_journal.inc @@ -124,9 +124,10 @@ function write_journal_entries(&$cart) $aid = has_attachment($trans_type, $old_no); if ($aid != 0) { - $row = get_attachment($aid); - update_attachment($aid, $row['type_no'], $trans_id, $row['description'], - $row['filename'], $row['unique_name'], $row['filesize'], $row['filetype']); + move_trans_attachments($trans_type, $old_no, $trans_id); + //$row = get_attachment($aid); + //update_attachment($aid, $row['type_no'], $trans_id, $row['description'], + // $row['filename'], $row['unique_name'], $row['filesize'], $row['filetype']); } } -- 2.30.2