From 1dce54d3e008101323403f011e8e226c5846ec8b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Dec 2013 12:17:50 +0100 Subject: [PATCH] Bug 11209: Check if a notice has been already sent today The previous patch checks if a notice has already been sent when the current notices has been sent in queue. Which is wrong! We have to check if a similar notice has been sent today. This patch has been created after an observation on a production server: If a user place on holds several items, he will receive 1 SMS per hold. Here we only want 1 SMS for all holds. Signed-off-by: Chris Cormack --- C4/Letters.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index a6c6640..3469d56 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -1010,9 +1010,9 @@ sub _is_duplicate { WHERE message_transport_type = ? AND borrowernumber = ? AND letter_code = ? - AND CAST(time_queued AS date) = CAST(? AS date) + AND CAST(time_queued AS date) = CAST(NOW() AS date) AND status="sent" - |, {}, $message->{message_transport_type}, $message->{borrowernumber}, $message->{letter_code}, $message->{time_queued} ); + |, {}, $message->{message_transport_type}, $message->{borrowernumber}, $message->{letter_code} ); return $count; } -- 1.8.3.2