<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.talis.com/tdn" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Talis Developer Network - underdue letters - Comments</title>
 <link>http://www.talis.com/tdn/node/1757</link>
 <description>Comments for &quot;underdue letters&quot;</description>
 <language>en</language>
<item>
 <title>underdues script</title>
 <link>http://www.talis.com/tdn/node/1757#comment-596</link>
 <description>&lt;p&gt;I haven&#039;t heard of any problems with the script (yet).&lt;/p&gt;
&lt;p&gt;The preselect of the script selects current loans that have a DUE_DATE between two dates.  These dates are calculated based on the current date and number of days specified in the pre_days parameter.&lt;/p&gt;
&lt;p&gt;Assuming this parameter was set to 7 and the current date time is 03/10/07 9:13 then the SQL condition would be&lt;/p&gt;
&lt;p&gt;where CURRENT_LOAN= &#039;T&#039;&lt;br /&gt;
and DUE_DATE &amp;lt; &#039;11/10/07 9:13&#039;&lt;br /&gt;
and DUE_DATE &amp;gt; &#039;03/10/07 9:13&#039;&lt;/p&gt;
&lt;p&gt;The date in the future is actually the current date time + the pre_days value + 1 e.g. 8.  I think the logic of adding 1 to the pre_days value is to insure that all the values for the last day are picked up.&lt;/p&gt;
&lt;p&gt;In my example the time is 9:13. If I add 7 days to the current date time that would be 10/10/07 9:13 and this would mean that any items due on the 10th but after 9:13 would not be picked up.  Adding a day ensures that all items due on the 10th will be selected by the preselect for further processing.&lt;/p&gt;
&lt;p&gt;It is not possible to say in your case without more details but depending on the run time of the script and the time of the renewals (given that they could be renewals although the day and night in theory e.g. Prism or Talis Message) that extra day might be why you are picking up renewals.&lt;/p&gt;
&lt;p&gt;The script does not distinguish between whether a current LOAN row is a issue or a renewal.&lt;/p&gt;
&lt;p&gt;If you think the adding of one to the pre_days value is the problem then either reduce the value by one in the parameter file or remove the + 1 from the main.pl line below:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$query .= &quot;and (DUE_DATE &amp;lt; dateadd(dd, &quot; . ($pre_days + 1) . &quot;, getdate())&quot;;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you want to know what dates have been used in a run then add &lt;/p&gt;
&lt;p&gt;&lt;code&gt;print REPORT &quot;Query:\n$query \n&quot;;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;before the following line in the main.pl:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(@preselect_data) = &amp;amp;sql ($d, $query);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This will display the preselect SQL query in the script report (.rep) file.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Wed,  3 Oct 2007 10:19:20 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 596 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>underdue letters</title>
 <link>http://www.talis.com/tdn/node/1757</link>
 <description>&lt;p&gt;Hello All,&lt;br /&gt;
We have just started running the underdue letters script -daily. Thought all was ok but we seem to be generating underdue letters for those items which have been renewed in the past few days. Has anyone else used this and had any similar outcomes. Parameters seem correct any ideas?&lt;/p&gt;
</description>
 <comments>http://www.talis.com/tdn/node/1757#comments</comments>
 <category domain="http://www.talis.com/tdn/taxonomy/term/61">TDN Community</category>
 <pubDate>Tue,  2 Oct 2007 18:31:49 +0100</pubDate>
 <dc:creator>Bernadette Ryan</dc:creator>
 <guid isPermaLink="false">1757 at http://www.talis.com/tdn</guid>
</item>
</channel>
</rss>
