From 594b23e7138ecfd924c4b51c504d83bedc92f66f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Nana?= <sebastien.nana@maarch.org>
Date: Wed, 10 Sep 2014 15:47:23 +0000
Subject: [PATCH] FEAT#1522: filtre sur le statut des attachments.

---
 core/trunk/structure.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/trunk/structure.sql b/core/trunk/structure.sql
index a74df21f77e..5afccffdabc 100644
--- a/core/trunk/structure.sql
+++ b/core/trunk/structure.sql
@@ -3639,7 +3639,7 @@ CREATE VIEW res_view_letterbox AS
     FROM doctypes d, doctypes_first_level dfl, doctypes_second_level dsl,
     (((((((((((ar_batch a RIGHT JOIN res_letterbox r ON ((r.arbatch_id = a.arbatch_id)))
     LEFT JOIN (SELECT res_attachments.res_id_master, count(res_attachments.res_id_master) AS count_attachment
-        FROM res_attachments GROUP BY res_attachments.res_id_master) att ON (r.res_id = att.res_id_master))
+        FROM res_attachments WHERE res_attachments.status <> 'DEL' GROUP BY res_attachments.res_id_master) att ON (r.res_id = att.res_id_master))
     LEFT JOIN entities en ON (((r.destination)::text = (en.entity_id)::text)))
     LEFT JOIN folders f ON ((r.folders_system_id = f.folders_system_id)))
     LEFT JOIN cases_res cr ON ((r.res_id = cr.res_id)))
@@ -3745,4 +3745,4 @@ CREATE VIEW view_contacts AS
   ca.website, ca.salutation_header, ca.salutation_footer, ca.other_data, ca.user_id, ca.entity_id, ca.is_private
   FROM contacts_v2 c
   RIGHT JOIN contact_addresses ca
-  ON c.contact_id = ca.contact_id;
\ No newline at end of file
+  ON c.contact_id = ca.contact_id;
-- 
GitLab