if( CheckVersion( $DBversion ) ) {
$dbh->do(q{ INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES
('circulation','CHECKINSLIP','','Checkin slip',1,'Checkin slip',
-"<h3><<branches.branchname>></h3>
-Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-(<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
-<<today>><br />
+[% today %]<br />
<h4>Checked in today</h4>
-<checkedin>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
<p>
-<<biblio.title>> <br />
-Barcode: <<items.barcode>><br />
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
</p>
-</checkedin>",
+[% END %]",
'print')
});
message_transport_type: print
lang: default
content:
- - "<h3><<branches.branchname>></h3>"
- - "Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />"
- - "(<<borrowers.cardnumber>>) <br />"
+ - "<h3>[% branch.branchname %]</h3>"
+ - "Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />"
+ - "([% borrower.cardnumber %]) <br />"
- ""
- - "<<today>><br />"
+ - "[% today %]<br />"
- ""
- "<h4>Checked in today</h4>"
- - "<checkedin>"
+ - "[% FOREACH checkin IN old_checkouts %]"
+ - "[% SET item = checkin.item %]"
- "<p>"
- - "<<biblio.title>> <br />"
- - "Barcode: <<items.barcode>><br />"
+ - "[% item.biblio.title %] <br />"
+ - "Barcode: [% item.barcode %] <br />"
- "</p>"
- - "</checkedin>"
+ - "[% END %]"
('suggestions','AVAILABLE','','Suggestion d\'achat disponible',0,'Suggestion d\'achat disponible','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons le plaisir de vous informer que le document fait aujourd\'hui partie de nos collection et qu\'il est disponible à la bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'),
('suggestions','ORDERED','','Suggestion d\'achat commandée',0,'Suggestion d\'achat commandée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons le plaisir de vous informer que le document a été commandé.\r\n\r\nVous recevrez une nouvelle notification quand le document sera disponible à bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'),
('suggestions','REJECTED','','Suggestion d\'achat rejetée',0,'Suggestion d\'achat rejetée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons évalué votre suggestion aujourd\'hui et décidé de ne pas l\'acheter cette fois.\r\n\r\nLa raison de notre refus est : <<suggestions.reason>>\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'),
-('circulation','CHECKINSLIP','','Checkin slip',1,'Checkin slip',"<h3><<branches.branchname>></h3>
-Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
-(<<borrowers.cardnumber>>) <br />
+('circulation','CHECKINSLIP','','Checkin slip',1,'Checkin slip',"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
-<<today>><br />
+[% today %]<br />
<h4>Checked in today</h4>
-<checkedin>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
<p>
-<<biblio.title>> <br />
-Barcode: <<items.barcode>><br />
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
</p>
-</checkedin>", 'print');
+[% END %]", 'print');
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
VALUES ('suggestions','NEW_SUGGESTION','Nouvelle suggestion','Nouvelle suggestion','<h3>Suggestion en attente</h3>
</ul>
</p>',1, 'email'),
('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
- "<h3><<branches.branchname>></h3>
- Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
- (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
- <<today>><br />
+[% today %]<br />
- <h4>Checked in today</h4>
- <checkedin>
- <p>
- <<biblio.title>> <br />
- Barcode: <<items.barcode>><br />
- </p>
- </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
INSERT INTO `letter` (module, code, name, title, content, is_html)
VALUES ('circulation','ISSUESLIP','Ticket de de prêt','Ticket de prêt', '<h3><<branches.branchname>></h3>
</ul>
</p>',1, 'email'),
('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
- "<h3><<branches.branchname>></h3>
- Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
- (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
- <<today>><br />
+[% today %]<br />
- <h4>Checked in today</h4>
- <checkedin>
- <p>
- <<biblio.title>> <br />
- Barcode: <<items.barcode>><br />
- </p>
- </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
INSERT INTO letter (module, code, name, title, content, is_html)
VALUES ('circulation','ISSUESLIP','Ricevuta di prestito','Ricevuta di prestito', '<h3><<branches.branchname>></h3>
</ul>
</p>',1, 'email'),
('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
- "<h3><<branches.branchname>></h3>
- Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
- (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
- <<today>><br />
+[% today %]<br />
- <h4>Checked in today</h4>
- <checkedin>
- <p>
- <<biblio.title>> <br />
- Barcode: <<items.barcode>><br />
- </p>
- </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
INSERT INTO `letter` (module, code, name, title, content, is_html)
VALUES ('circulation','ISSUESLIP','Utlån','Utlån', '<h3><<branches.branchname>></h3>
</ul>
</p>',1, 'email'),
('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
- "<h3><<branches.branchname>></h3>
- Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
- (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
- <<today>><br />
+[% today %]<br />
- <h4>Checked in today</h4>
- <checkedin>
- <p>
- <<biblio.title>> <br />
- Barcode: <<items.barcode>><br />
- </p>
- </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
INSERT INTO `letter` (module, code, name, title, content, is_html)
VALUES ('circulation','ISSUESLIP','Issue slip','Issue slip', '<h3><<branches.branchname>></h3>
</ul>
</p>',1, 'email'),
('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
- "<h3><<branches.branchname>></h3>
- Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
- (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
- <<today>><br />
+[% today %]<br />
- <h4>Checked in today</h4>
- <checkedin>
- <p>
- <<biblio.title>> <br />
- Barcode: <<items.barcode>><br />
- </p>
- </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
INSERT INTO `letter` (module, code, name, title, content, is_html)
VALUES ('circulation','ISSUESLIP','Issue slip','Issue slip', '<h3><<branches.branchname>></h3>
</ul>
</p>',1, 'email'),
('circulation','CHECKINSLIP','Checkin slip','Checkin slip',
- "<h3><<branches.branchname>></h3>
- Checked in items for <<borrowers.title>> <<borrowers.firstname>> <<borrowers.initials>> <<borrowers.surname>> <br />
- (<<borrowers.cardnumber>>) <br />
+"<h3>[% branch.branchname %]</h3>
+Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.initials %] [% borrower.surname %] <br />
+([% borrower.cardnumber %]) <br />
- <<today>><br />
+[% today %]<br />
- <h4>Checked in today</h4>
- <checkedin>
- <p>
- <<biblio.title>> <br />
- Barcode: <<items.barcode>><br />
- </p>
- </checkedin>",1, 'print');
+<h4>Checked in today</h4>
+[% FOREACH checkin IN old_checkouts %]
+[% SET item = checkin.item %]
+<p>
+[% item.biblio.title %] <br />
+Barcode: [% item.barcode %] <br />
+</p>
+[% END %]", 1, 'print');
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES
('members', 'DISCHARGE', 'підтвердження на розрахування',
my $today_end = dt_from_string->set( hour => 23, minute => 59, second => 0 );
$today_start = Koha::Database->new->schema->storage->datetime_parser->format_datetime( $today_start );
$today_end = Koha::Database->new->schema->storage->datetime_parser->format_datetime( $today_end );
- my $todays_checkins = Koha::Old::Checkouts->search({
+ my @todays_checkins = Koha::Old::Checkouts->search({
returndate => {
'>=' => $today_start,
'<=' => $today_end,
branchcode => $checkinslip_branch,
});
- my @checkins;
- while ( my $c = $todays_checkins->next ) {
- push @checkins, {
- biblio => $c->item->biblio->unblessed,
- items => $c->item->unblessed,
- };
- }
- my %repeat = (
- checkedin => \@checkins,
+ my %loops = (
+ old_issues => [ map { $_->issue_id } @todays_checkins ],
);
my $letter = C4::Letters::GetPreparedLetter(
branches => $checkinslip_branch,
borrowers => $borrowernumber,
},
- repeat => \%repeat,
+ loops => \%loops,
message_transport_type => 'print'
);