display_fines.pl
Submitted by Brian Crampton on Wed, 2007-05-02 15:59.
Originally posted by R. Luddington
Help please!!
Everytime we run display_fines.pl with the NUMBER_OF_DAYS parameter
we have returned all of the extant charges rather than just the ones within the day range.
Is there anything we are doing wrong please?
It doesn't seem to make any difference whatever the value is set to.
Our parameter file looks like:
# Parameter file for display_fines.pl
#
HOME_SITE=
BORROWER_TYPE=
NUMBER_OF_DAYS=4
BORROWER_MESSAGE=
MINIMUM_AMOUNT=



display_fines.pl issue
Looking at the script it appears that the parameter being looked for in the script is actually MAX_FINE_AGE but the name some how got altered to NUMBER_OF_DAYS in the parameter file some where along the line but never got picked up.
Insert the following line into the parameter file and run the script again.
MAX_FINE_AGE=4
This should only be done on the MIS server at this point and NOT on the live server.
If this corrects the problem then the change can be inserted into the script on the live server and I will update the article and wrap file on the on the TDN site.
Brian Crampton
Developer, Talis
display_fines.pl
Thanks Brian ...works a treat now!
It would be really cool if this script could have a MIN_FINE_AGE also (??)
Bob
updating display_fines.pl
That's great.
I'll update the article and script today.
While I've got my head in the code I will look at what is involved in having a MIN_FINE_AGE parameter.
I can't guarantee anything but if I can make a change it would need to be tested. Would you be willing to try it out?
Thanks
Brian Crampton
Developer, Talis
display_fines.pl updated
The display_fines.pl script and article are now updated for MAX_FINE_AGE parameter
Brian Crampton
Developer, Talis
display_fines.pl emails
Hello Brian, I can't see the thread from last week about restricting borrowers by expiry date and displaying the email address but I would just like to say thank you. It worked perfectly. I wasn't expecting you do provide the code for the emails, you've saved me lots of time and it's very much appreciated.
Regards
John
display_fines.pl emails
Hello, I've just noticed that the email addresses and borrower accounts aren't matching. Is there any chance of having another look at the script you added last week?
Kind Regards
John
display_emails.pl emails
I did quickly check that the right email addresses would be displayed in tests here so I'm not entirely sure what the problem is. I have included the instructions here again so you can double check the changes. If there is a problem I may need to check on your system with your examples.
1) Update the display_fines.pl script by adding
require "/$TALIS_HOME/perl_tools/mis_utils.pl";
after
require 'sybperl.pl';
require "/$TALIS_HOME/perl_tools/std_utils.pl";
2) Replace the retrieveAddress subroutine with the following
sub retrieveAddress
{
my ($borrowerID) = @_;
my ($addressID) = "";
my ($addressDetails) = "~~~~~";
($addressID) = &sql($d, "select ADDRESS_ID from CONTACT_POINT
where BORROWER_ID = $borrowerID
and CURRENT_CONTACT_POINT = 'T'");
if ($addressID ne "")
{
($addressDetails) = &sql($d, "select LINE_1, LINE_2, LINE_3,
LINE_4, LINE_5, POST_CODE
from ADDRESS
where ADDRESS_ID=$addressID");
}
my ($line1,$line2,$line3,$line4,$line5,$postcode) =
&despace(split("~", $addressDetails));
&GetBorrowerDetails($borrowerID);
push(@BorrDetails, "$line1\n") if ($line1 ne "");
push(@BorrDetails, "$line2\n") if ($line2 ne "");
push(@BorrDetails, "$line3\n") if ($line3 ne "");
push(@BorrDetails, "$line4\n") if ($line4 ne "");
push(@BorrDetails, "$line5\n") if ($line5 ne "");
push(@BorrDetails, "$postcode\n") if ($postcode ne "");
push(@BorrDetails, "\n") if ($addressDetails ne " ~ ~ ~ ~ ~ ");
push(@BorrDetails, "$EmailAddress1\n") if ($EmailAddress1 ne "");
push(@BorrDetails, "\n")
}
3) It is not possible to modify the format except that if you want the email address before
the postal address the push commands in the retriveAddress section would be
push(@BorrDetails, "$EmailAddress1\n\n") if ($EmailAddress1 ne "");
push(@BorrDetails, "$line1\n") if ($line1 ne "");
push(@BorrDetails, "$line2\n") if ($line2 ne "");
push(@BorrDetails, "$line3\n") if ($line3 ne "");
push(@BorrDetails, "$line4\n") if ($line4 ne "");
push(@BorrDetails, "$line5\n") if ($line5 ne "");
push(@BorrDetails, "$postcode\n") if ($postcode ne "");
push(@BorrDetails, "\n") if ($addressDetails ne " ~ ~ ~ ~ ~ ");
push(@BorrDetails, "\n")
Thanks
Brian Crampton
Developer, Talis
display_fines.pl
Thank you for posting this again. I started over with the above code and it's all working perfectly. I must have deleted something I shouldn't have! Thanks again.
John