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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-81 / +7 lines)
Lines 6-18 Link Here
6
<script type="text/JavaScript" language="JavaScript">
6
<script type="text/JavaScript" language="JavaScript">
7
//<![CDATA[
7
//<![CDATA[
8
	 $(document).ready(function() {
8
	 $(document).ready(function() {
9
		[% UNLESS ( preview ) %]$("#claimst").tablesorter({[% IF ( dateformat == 'metric' ) %]
9
        $("#claimst").tablesorter({[% IF ( dateformat == 'metric' ) %]
10
			dateFormat: 'uk',[% END %]
10
            dateFormat: 'uk',[% END %]
11
			headers: { 0: { sorter: false },1:{sorter:false}}
11
            headers: { 0: { sorter: false },1:{sorter:false}}
12
		});[% END %]
12
        });
13
	    $('#supplierid').change(function() {
13
        $('#supplierid').change(function() {
14
    	    $('#claims').submit();
14
            $('#claims').submit();
15
	    });
15
        });
16
16
17
	    // Case-insensitive version of jquery's contains function
17
	    // Case-insensitive version of jquery's contains function
18
	    jQuery.extend(
18
	    jQuery.extend(
Lines 138-161 Link Here
138
	    $("table#claimst tbody tr").show();
138
	    $("table#claimst tbody tr").show();
139
	}
139
	}
140
140
141
	function popup(supplierid,serialid){
142
		window.open('claims.pl?supplierid='+ supplierid +'&amp;serialid='+ serialid +'&amp;op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
143
	}
144
145
//]]>
141
//]]>
146
</script>
142
</script>
147
[% INCLUDE 'calendar.inc' %]
143
[% INCLUDE 'calendar.inc' %]
148
</head>
144
</head>
149
<body id="ser_claims" class="ser">
145
<body id="ser_claims" class="ser">
150
    [% INCLUDE 'header.inc' %]
146
    [% INCLUDE 'header.inc' %]
151
[% UNLESS ( preview ) %]
152
    [% INCLUDE 'serials-search.inc' %]
147
    [% INCLUDE 'serials-search.inc' %]
153
[% END %]
154
148
155
<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>
149
<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
150
157
[% UNLESS ( preview ) %]
158
159
<div id="doc3" class="yui-t2">
151
<div id="doc3" class="yui-t2">
160
   
152
   
161
   <div id="bd">
153
   <div id="bd">
Lines 338-414 Link Here
338
    </fieldset>
330
    </fieldset>
339
[% END %]
331
[% END %]
340
332
341
[% ELSE %]
342
343
<div id="doc" class="yui-t7">
344
   <div id="bd">
345
	
346
[% IF ( supplierloop ) %]
347
        [% FOREACH supplierloo IN supplierloop %]
348
        [% IF ( supplierloo.name ) %]
349
        <p><b>[% supplierloo.name %]</b><br />
350
        [% END %]
351
        [% IF ( supplierloo.postal ) %]
352
        [% supplierloo.postal %]<br />
353
        [% END %]
354
        [% IF ( supplierloo.contphone ) %]
355
        Ph: [% supplierloo.contphone %]<br />
356
        [% END %]
357
        [% IF ( supplierloo.contfax ) %]
358
        Fax: [% supplierloo.contfax %]<br />
359
        [% END %]
360
        [% IF ( supplierloo.contemail ) %]
361
        Email: [% supplierloo.contemail %]<br />
362
        [% END %]
363
        [% IF ( supplierloo.accountnumber ) %]
364
        A/C: [% supplierloo.accountnumber %]</p>
365
        [% END %]
366
        [% IF ( supplierloo.contact ) %]
367
        <p>Dear [% supplierloo.contact %]</p>
368
        [% ELSE %]
369
        <p>To whom it may concern</p>
370
        [% END %]
371
        <p>The following items have not been received from you and are now considered missing:</p>
372
        [% END %]
373
[% END %]
374
        [% IF ( missingissues ) %]
375
        <h3>Missing issues</h3>
376
        <table>
377
            <tr>
378
                <td><b>Vendor<b></td>
379
                <td><b>Title</b></td>
380
                <td><b>Issue number</b></td>
381
                <td><b>Missing since</b></td>
382
            </tr>
383
            [% FOREACH missingissue IN missingissues %]
384
                <tr>
385
                    <td>
386
                    [% missingissue.name %]
387
                    </td>
388
                    <td>
389
                    [% missingissue.Title |html %]
390
                    </td>
391
                    <td>
392
                    [% missingissue.serialseq %]
393
                    </td>
394
                    <td>
395
                    [% missingissue.planneddate %]
396
                    </td>
397
                </tr>
398
            [% END %]
399
        </table>
400
        [% END %]
401
402
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
403
[% END %]
404
405
</div>
333
</div>
406
</div>
334
</div>
407
335
408
[% UNLESS ( preview ) %]
409
<div class="yui-b">
336
<div class="yui-b">
410
[% INCLUDE 'serials-menu.inc' %]
337
[% INCLUDE 'serials-menu.inc' %]
411
</div>
338
</div>
412
[% END %]
413
</div>
339
</div>
414
[% INCLUDE 'intranet-bottom.inc' %]
340
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/serials/claims.pl (-22 / +15 lines)
Lines 59-84 for my $s (@{$supplierlist} ) { Link Here
59
my $branchloop = GetBranchesLoop();
59
my $branchloop = GetBranchesLoop();
60
unshift @$branchloop, {value=> 'all',name=>''};
60
unshift @$branchloop, {value=> 'all',name=>''};
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} and $err->{error} eq "no_email" ) {
78
            $template->{VARS}->{'error_claim'} = "no_email";
79
        } else {
80
            $template->{VARS}->{'info_claim'} = 1;
81
        }
69
        }
70
    };
71
    if ( $@ ) {
72
        $template->param(error_claim => $@);
73
    } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) {
74
        $template->{VARS}->{'error_claim'} = "no_email";
75
    } else {
76
        $template->{VARS}->{'info_claim'} = 1;
82
    }
77
    }
83
}
78
}
84
79
Lines 102-114 $template->param( Link Here
102
        phone => $supplierinfo[0]->{phone},
97
        phone => $supplierinfo[0]->{phone},
103
        booksellerfax => $supplierinfo[0]->{booksellerfax},
98
        booksellerfax => $supplierinfo[0]->{booksellerfax},
104
        bookselleremail => $supplierinfo[0]->{bookselleremail},
99
        bookselleremail => $supplierinfo[0]->{bookselleremail},
105
        preview => $preview,
106
        missingissues => \@missingissues,
100
        missingissues => \@missingissues,
107
        supplierid => $supplierid,
101
        supplierid => $supplierid,
108
        claimletter => $claimletter,
102
        claimletter => $claimletter,
109
        supplierloop => \@supplierinfo,
103
        supplierloop => \@supplierinfo,
110
        branchloop   => $branchloop,
104
        branchloop   => $branchloop,
111
        dateformat    => C4::Context->preference("dateformat"),
105
        dateformat    => C4::Context->preference("dateformat"),
112
    	DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
106
        DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
113
        );
107
        );
114
output_html_with_http_headers $input, $cookie, $template->output;
108
output_html_with_http_headers $input, $cookie, $template->output;
115
- 

Return to bug 5342