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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-76 lines)
Lines 9-15 Link Here
9
<script type="text/javascript">
9
<script type="text/javascript">
10
//<![CDATA[
10
//<![CDATA[
11
	 $(document).ready(function() {
11
	 $(document).ready(function() {
12
        [% UNLESS ( preview ) %]
13
         var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
12
         var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
14
            "sDom": 't',
13
            "sDom": 't',
15
                "aoColumnDefs": [
14
                "aoColumnDefs": [
Lines 19-25 Link Here
19
                ],
18
                ],
20
            "bPaginate": false
19
            "bPaginate": false
21
        }));
20
        }));
22
        [% END %]
23
	    $('#supplierid').change(function() {
21
	    $('#supplierid').change(function() {
24
    	    $('#claims').submit();
22
    	    $('#claims').submit();
25
	    });
23
	    });
Lines 148-170 Link Here
148
	    $("table#claimst tbody tr").show();
146
	    $("table#claimst tbody tr").show();
149
	}
147
	}
150
148
151
	function popup(supplierid,serialid){
152
		window.open('claims.pl?supplierid='+ supplierid +'&amp;serialid='+ serialid +'&amp;op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
153
	}
154
155
//]]>
149
//]]>
156
</script>
150
</script>
157
</head>
151
</head>
158
<body id="ser_claims" class="ser">
152
<body id="ser_claims" class="ser">
159
    [% INCLUDE 'header.inc' %]
153
    [% INCLUDE 'header.inc' %]
160
[% UNLESS ( preview ) %]
161
    [% INCLUDE 'serials-search.inc' %]
154
    [% INCLUDE 'serials-search.inc' %]
162
[% END %]
163
155
164
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Claims</div>
156
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Claims</div>
165
157
166
[% UNLESS ( preview ) %]
167
168
<div id="doc3" class="yui-t2">
158
<div id="doc3" class="yui-t2">
169
   
159
   
170
   <div id="bd">
160
   <div id="bd">
Lines 354-430 Link Here
354
    </fieldset>
344
    </fieldset>
355
[% END %]
345
[% END %]
356
346
357
[% ELSE %]
358
359
<div id="doc" class="yui-t7">
360
   <div id="bd">
361
	
362
[% IF ( supplierloop ) %]
363
        [% FOREACH supplierloo IN supplierloop %]
364
        [% IF ( supplierloo.name ) %]
365
        <p><b>[% supplierloo.name %]</b><br />
366
        [% END %]
367
        [% IF ( supplierloo.postal ) %]
368
        [% supplierloo.postal %]<br />
369
        [% END %]
370
        [% IF ( supplierloo.contphone ) %]
371
        Ph: [% supplierloo.contphone %]<br />
372
        [% END %]
373
        [% IF ( supplierloo.contfax ) %]
374
        Fax: [% supplierloo.contfax %]<br />
375
        [% END %]
376
        [% IF ( supplierloo.contemail ) %]
377
        Email: [% supplierloo.contemail %]<br />
378
        [% END %]
379
        [% IF ( supplierloo.accountnumber ) %]
380
        A/C: [% supplierloo.accountnumber %]</p>
381
        [% END %]
382
        [% IF ( supplierloo.contact ) %]
383
        <p>Dear [% supplierloo.contact %]</p>
384
        [% ELSE %]
385
        <p>To whom it may concern</p>
386
        [% END %]
387
        <p>The following items have not been received from you and are now considered missing:</p>
388
        [% END %]
389
[% END %]
390
        [% IF ( missingissues ) %]
391
        <h3>Missing issues</h3>
392
        <table>
393
            <tr>
394
                <td><b>Vendor<b></td>
395
                <td><b>Title</b></td>
396
                <td><b>Issue number</b></td>
397
                <td><b>Missing since</b></td>
398
            </tr>
399
            [% FOREACH missingissue IN missingissues %]
400
                <tr>
401
                    <td>
402
                    [% missingissue.name %]
403
                    </td>
404
                    <td>
405
                    [% missingissue.Title |html %]
406
                    </td>
407
                    <td>
408
                    [% missingissue.serialseq %]
409
                    </td>
410
                    <td>
411
                    [% missingissue.planneddate %]
412
                    </td>
413
                </tr>
414
            [% END %]
415
        </table>
416
        [% END %]
417
418
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
419
[% END %]
420
421
</div>
347
</div>
422
</div>
348
</div>
423
349
424
[% UNLESS ( preview ) %]
425
<div class="yui-b">
350
<div class="yui-b">
426
[% INCLUDE 'serials-menu.inc' %]
351
[% INCLUDE 'serials-menu.inc' %]
427
</div>
352
</div>
428
[% END %]
429
</div>
353
</div>
430
[% INCLUDE 'intranet-bottom.inc' %]
354
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/serials/claims.pl (-25 / +18 lines)
Lines 59-88 for my $s (@{$supplierlist} ) { Link Here
59
59
60
my $branchloop = GetBranchesLoop();
60
my $branchloop = GetBranchesLoop();
61
61
62
my $preview=0;
62
my @serialnums=$input->param('serialid');
63
if($op && $op eq 'preview'){
63
if (@serialnums) { # i.e. they have been flagged to generate claims
64
    $preview = 1;
64
    my $err;
65
} else {
65
    eval {
66
    my @serialnums=$input->param('serialid');
66
        $err = SendAlerts('claimissues',\@serialnums,$input->param("letter_code"));
67
    if (@serialnums) { # i.e. they have been flagged to generate claims
67
        if ( not ref $err or not exists $err->{error} ) {
68
        my $err;
68
           UpdateClaimdateIssues(\@serialnums);
69
        eval {
70
            $err = SendAlerts('claimissues',\@serialnums,$input->param("letter_code"));
71
            if ( not ref $err or not exists $err->{error} ) {
72
               UpdateClaimdateIssues(\@serialnums);
73
            }
74
        };
75
        if ( $@ ) {
76
            $template->param(error_claim => $@);
77
        } elsif ( ref $err and exists $err->{error} ) {
78
            if ( $err->{error} eq "no_email" ) {
79
                $template->param( error_claim => 'no_vendor_email' );
80
            } elsif ( $err->{error} =~ m|Bad or missing From address| ) {
81
                $template->param( error_claim => 'no_loggedin_user_email' );
82
            }
83
        } else {
84
            $template->param( info_claim => 1 );
85
        }
69
        }
70
    };
71
    if ( $@ ) {
72
        $template->param(error_claim => $@);
73
    } elsif ( ref $err and exists $err->{error} ) {
74
        if ( $err->{error} eq "no_email" ) {
75
            $template->param( error_claim => 'no_vendor_email' );
76
        } elsif ( $err->{error} =~ m|Bad or missing From address| ) {
77
            $template->param( error_claim => 'no_loggedin_user_email' );
78
        }
79
    } else {
80
        $template->param( info_claim => 1 );
86
    }
81
    }
87
}
82
}
88
83
Lines 100-106 $template->param( Link Here
100
        phone => $supplierinfo[0]->{phone},
95
        phone => $supplierinfo[0]->{phone},
101
        booksellerfax => $supplierinfo[0]->{booksellerfax},
96
        booksellerfax => $supplierinfo[0]->{booksellerfax},
102
        bookselleremail => $supplierinfo[0]->{bookselleremail},
97
        bookselleremail => $supplierinfo[0]->{bookselleremail},
103
        preview => $preview,
104
        missingissues => \@missingissues,
98
        missingissues => \@missingissues,
105
        supplierid => $supplierid,
99
        supplierid => $supplierid,
106
        claimletter => $claimletter,
100
        claimletter => $claimletter,
107
- 

Return to bug 12404