View | Details | Raw Unified | Return to bug 9104
Collapse All | Expand All

(-)a/misc/cronjobs/overdue_notices.pl (-4 / +5 lines)
Lines 442-448 END_SQL Link Here
442
            # this text contains fields that are replaced by their value. Those fields must be written between brackets
442
            # this text contains fields that are replaced by their value. Those fields must be written between brackets
443
            # The following fields are available :
443
            # The following fields are available :
444
	    # itemcount is interpreted here as the number of items in the overdue range defined by the current notice or all overdues < max if(-list-all).
444
	    # itemcount is interpreted here as the number of items in the overdue range defined by the current notice or all overdues < max if(-list-all).
445
            # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
445
            # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode> <country>
446
446
447
            my $borrower_sql = <<'END_SQL';
447
            my $borrower_sql = <<'END_SQL';
448
SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email
448
SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email
Lines 551-556 END_SQL Link Here
551
                            address2       => $address2,
551
                            address2       => $address2,
552
                            city           => $city,
552
                            city           => $city,
553
                            postcode       => $postcode,
553
                            postcode       => $postcode,
554
                            country        => $country,
554
                            email          => $email,
555
                            email          => $email,
555
                            itemcount      => $itemcount,
556
                            itemcount      => $itemcount,
556
                            titles         => $titles,
557
                            titles         => $titles,
Lines 579-584 END_SQL Link Here
579
                                address2       => $address2,
580
                                address2       => $address2,
580
                                city           => $city,
581
                                city           => $city,
581
                                postcode       => $postcode,
582
                                postcode       => $postcode,
583
                                country        => $country,
582
                                email          => $email,
584
                                email          => $email,
583
                                itemcount      => $itemcount,
585
                                itemcount      => $itemcount,
584
                                titles         => $titles,
586
                                titles         => $titles,
Lines 604-610 END_SQL Link Here
604
                print @output_chunks;
606
                print @output_chunks;
605
        }
607
        }
606
        # Generate the content of the csv with headers
608
        # Generate the content of the csv with headers
607
        my $content = join(";", qw(title name surname address1 address2 zipcode city email itemcount itemsinfo due_date issue_date)) . "\n";
609
        my $content = join(";", qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
608
        $content .= join( "\n", @output_chunks );
610
        $content .= join( "\n", @output_chunks );
609
            
611
            
610
        my $attachment = {
612
        my $attachment = {
Lines 744-750 sub prepare_letter_for_printing { Link Here
744
    if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) {
746
    if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) {
745
        if ($csv->combine(
747
        if ($csv->combine(
746
                $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'},  $params->{'address2'}, $params->{'postcode'},
748
                $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'},  $params->{'address2'}, $params->{'postcode'},
747
                $params->{'city'},      $params->{'email'},    $params->{'itemcount'}, $params->{'titles'}
749
                $params->{'city'}, $params->{'country'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'}
748
            )
750
            )
749
          ) {
751
          ) {
750
            return $csv->string, "\n";
752
            return $csv->string, "\n";
751
- 

Return to bug 9104