Lines 131-139
foreach my $type (@types) {
Link Here
|
131 |
module => $module, |
131 |
module => $module, |
132 |
letter_code => $code, |
132 |
letter_code => $code, |
133 |
tables => { |
133 |
tables => { |
134 |
borrowers => $issues->{'borrowernumber'}, |
134 |
borrowers => $issues->{borrowernumber}, |
135 |
biblio => $issues->{'biblionumber'}, |
135 |
biblio => $issues->{biblionumber}, |
136 |
biblioitems => $issues->{'biblionumber'}, |
136 |
biblioitems => $issues->{biblionumber}, |
|
|
137 |
items => $issues->{itemnumber}, |
138 |
issues => $issues->{itemnumber}, |
139 |
branches => $issues->{site}, |
140 |
}, |
141 |
substitute => { |
142 |
format => $format, |
143 |
language => $language, |
144 |
type => $type, |
145 |
level => $issues->{level}, |
146 |
library_code => $library_code, |
147 |
due_date => $due_date, |
137 |
}, |
148 |
}, |
138 |
message_transport_type => 'phone', |
149 |
message_transport_type => 'phone', |
139 |
); |
150 |
); |
Lines 151-162
foreach my $type (@types) {
Link Here
|
151 |
); |
162 |
); |
152 |
} |
163 |
} |
153 |
|
164 |
|
154 |
print $OUT |
165 |
if ( $letter->{is_tt} ) { |
155 |
"\"$format\",\"$language\",\"$type\",\"$issues->{level}\",\"$issues->{cardnumber}\",\"$issues->{patron_title}\",\"$issues->{firstname}\","; |
166 |
$letter->{content} =~ s/__MESSAGE_ID__/$message_id/g; |
156 |
print $OUT |
167 |
print $OUT $letter->{content}; |
157 |
"\"$issues->{surname}\",\"$issues->{phone}\",\"$issues->{email}\",\"$library_code\","; |
168 |
} else { |
158 |
print $OUT |
169 |
print $OUT "\"$format\",\"$language\",\"$type\",\"$issues->{level}\",\"$issues->{cardnumber}\",\"$issues->{patron_title}\",\"$issues->{firstname}\","; |
159 |
"\"$issues->{site}\",\"$issues->{site_name}\",\"$issues->{barcode}\",\"$due_date\",\"$issues->{title}\",\"$message_id\"\n"; |
170 |
print $OUT "\"$issues->{surname}\",\"$issues->{phone}\",\"$issues->{email}\",\"$library_code\","; |
|
|
171 |
print $OUT "\"$issues->{site}\",\"$issues->{site_name}\",\"$issues->{barcode}\",\"$due_date\",\"$issues->{title}\",\"$message_id\"\n"; |
172 |
} |
160 |
} |
173 |
} |
161 |
} |
174 |
} |
162 |
|
175 |
|
Lines 222-228
sub GetOverdueIssues {
Link Here
|
222 |
"SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, |
235 |
"SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, |
223 |
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, issues.date_due, |
236 |
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, issues.date_due, |
224 |
max(overduerules.branchcode) as rulebranch, TO_DAYS(NOW())-TO_DAYS(date_due) as daysoverdue, delay1, delay2, delay3, |
237 |
max(overduerules.branchcode) as rulebranch, TO_DAYS(NOW())-TO_DAYS(date_due) as daysoverdue, delay1, delay2, delay3, |
225 |
issues.branchcode as site, branches.branchname as site_name |
238 |
issues.branchcode as site, branches.branchname as site_name, items.itemnumber |
226 |
FROM borrowers JOIN issues USING (borrowernumber) |
239 |
FROM borrowers JOIN issues USING (borrowernumber) |
227 |
JOIN items USING (itemnumber) |
240 |
JOIN items USING (itemnumber) |
228 |
JOIN biblio USING (biblionumber) |
241 |
JOIN biblio USING (biblionumber) |
Lines 260-266
sub GetPredueIssues {
Link Here
|
260 |
my $query = |
273 |
my $query = |
261 |
"SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, |
274 |
"SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, |
262 |
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, issues.date_due, |
275 |
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, issues.date_due, |
263 |
issues.branchcode as site, branches.branchname as site_name |
276 |
issues.branchcode as site, branches.branchname as site_name, items.itemnumber |
264 |
FROM borrowers JOIN issues USING (borrowernumber) |
277 |
FROM borrowers JOIN issues USING (borrowernumber) |
265 |
JOIN items USING (itemnumber) |
278 |
JOIN items USING (itemnumber) |
266 |
JOIN biblio USING (biblionumber) |
279 |
JOIN biblio USING (biblionumber) |
Lines 286-292
sub GetWaitingHolds {
Link Here
|
286 |
my $query = |
299 |
my $query = |
287 |
"SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, |
300 |
"SELECT borrowers.borrowernumber, borrowers.cardnumber, borrowers.title as patron_title, borrowers.firstname, borrowers.surname, |
288 |
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, reserves.waitingdate, |
301 |
borrowers.phone, borrowers.email, borrowers.branchcode, biblio.biblionumber, biblio.title, items.barcode, reserves.waitingdate, |
289 |
reserves.branchcode AS site, branches.branchname AS site_name, |
302 |
reserves.branchcode AS site, branches.branchname AS site_name, items.itemnumber, |
290 |
TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting |
303 |
TO_DAYS(NOW())-TO_DAYS(reserves.waitingdate) AS days_since_waiting |
291 |
FROM borrowers JOIN reserves USING (borrowernumber) |
304 |
FROM borrowers JOIN reserves USING (borrowernumber) |
292 |
JOIN items USING (itemnumber) |
305 |
JOIN items USING (itemnumber) |
293 |
- |
|
|