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>
145
<body>
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 336-412 Link Here
336
    </fieldset>
328
    </fieldset>
337
[% END %]
329
[% END %]
338
330
339
[% ELSE %]
340
341
<div id="doc" class="yui-t7">
342
   <div id="bd">
343
	
344
[% IF ( supplierloop ) %]
345
        [% FOREACH supplierloo IN supplierloop %]
346
        [% IF ( supplierloo.name ) %]
347
        <p><b>[% supplierloo.name %]</b><br />
348
        [% END %]
349
        [% IF ( supplierloo.postal ) %]
350
        [% supplierloo.postal %]<br />
351
        [% END %]
352
        [% IF ( supplierloo.contphone ) %]
353
        Ph: [% supplierloo.contphone %]<br />
354
        [% END %]
355
        [% IF ( supplierloo.contfax ) %]
356
        Fax: [% supplierloo.contfax %]<br />
357
        [% END %]
358
        [% IF ( supplierloo.contemail ) %]
359
        Email: [% supplierloo.contemail %]<br />
360
        [% END %]
361
        [% IF ( supplierloo.accountnumber ) %]
362
        A/C: [% supplierloo.accountnumber %]</p>
363
        [% END %]
364
        [% IF ( supplierloo.contact ) %]
365
        <p>Dear [% supplierloo.contact %]</p>
366
        [% ELSE %]
367
        <p>To whom it may concern</p>
368
        [% END %]
369
        <p>The following items have not been received from you and are now considered missing:</p>
370
        [% END %]
371
[% END %]
372
        [% IF ( missingissues ) %]
373
        <h3>Missing Issues</h3>
374
        <table>
375
            <tr>
376
                <td><b>Vendor<b></td>
377
                <td><b>Title</b></td>
378
                <td><b>Issue number</b></td>
379
                <td><b>Missing since</b></td>
380
            </tr>
381
            [% FOREACH missingissue IN missingissues %]
382
                <tr>
383
                    <td>
384
                    [% missingissue.name %]
385
                    </td>
386
                    <td>
387
                    [% missingissue.Title |html %]
388
                    </td>
389
                    <td>
390
                    [% missingissue.serialseq %]
391
                    </td>
392
                    <td>
393
                    [% missingissue.planneddate %]
394
                    </td>
395
                </tr>
396
            [% END %]
397
        </table>
398
        [% END %]
399
400
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
401
[% END %]
402
403
</div>
331
</div>
404
</div>
332
</div>
405
333
406
[% UNLESS ( preview ) %]
407
<div class="yui-b">
334
<div class="yui-b">
408
[% INCLUDE 'serials-menu.inc' %]
335
[% INCLUDE 'serials-menu.inc' %]
409
</div>
336
</div>
410
[% END %]
411
</div>
337
</div>
412
[% INCLUDE 'intranet-bottom.inc' %]
338
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/serials/claims.pl (-21 / +14 lines)
Lines 74-97 if ($supplierid) { Link Here
74
my $branchloop = GetBranchesLoop();
74
my $branchloop = GetBranchesLoop();
75
unshift @$branchloop, {value=> 'all',name=>''};
75
unshift @$branchloop, {value=> 'all',name=>''};
76
76
77
my $preview=0;
77
my @serialnums=$input->param('serialid');
78
if($op && $op eq 'preview'){
78
if (@serialnums) { # i.e. they have been flagged to generate claims
79
    $preview = 1;
79
    my $err;
80
} else {
80
    eval {
81
    my @serialnums=$input->param('serialid');
81
        SendAlerts('claimissues',\@serialnums,$input->param("letter_code"));
82
    if (@serialnums) { # i.e. they have been flagged to generate claims
82
        UpdateClaimdateIssues(\@serialnums);
83
        my $err;
83
    };
84
        eval {
84
    if ( $@ ) {
85
            SendAlerts('claimissues',\@serialnums,$input->param("letter_code"));
85
        $template->param(error_claim => $@);
86
            UpdateClaimdateIssues(\@serialnums);
86
    } elsif ( defined $err->{error} and $err->{error} eq "no_email" ) {
87
        };
87
        $template->{VARS}->{'error_claim'} = "no_email";
88
        if ( $@ ) {
88
    } else {
89
            $template->param(error_claim => $@);
89
        $template->{VARS}->{'info_claim'} = 1;
90
        } elsif ( defined $err->{error} and $err->{error} eq "no_email" ) {
91
            $template->{VARS}->{'error_claim'} = "no_email";
92
        } else {
93
            $template->{VARS}->{'info_claim'} = 1;
94
        }
95
    }
90
    }
96
}
91
}
97
$template->param('letters'=>\@letters,'letter'=>$letter);
92
$template->param('letters'=>\@letters,'letter'=>$letter);
Lines 101-113 $template->param( Link Here
101
        phone => $supplierinfo[0]->{phone},
96
        phone => $supplierinfo[0]->{phone},
102
        booksellerfax => $supplierinfo[0]->{booksellerfax},
97
        booksellerfax => $supplierinfo[0]->{booksellerfax},
103
        bookselleremail => $supplierinfo[0]->{bookselleremail},
98
        bookselleremail => $supplierinfo[0]->{bookselleremail},
104
        preview => $preview,
105
        missingissues => \@missingissues,
99
        missingissues => \@missingissues,
106
        supplierid => $supplierid,
100
        supplierid => $supplierid,
107
        claimletter => $claimletter,
101
        claimletter => $claimletter,
108
        supplierloop => \@supplierinfo,
102
        supplierloop => \@supplierinfo,
109
        branchloop   => $branchloop,
103
        branchloop   => $branchloop,
110
        dateformat    => C4::Context->preference("dateformat"),
104
        dateformat    => C4::Context->preference("dateformat"),
111
    	DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
105
        DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
112
        );
106
        );
113
output_html_with_http_headers $input, $cookie, $template->output;
107
output_html_with_http_headers $input, $cookie, $template->output;
114
- 

Return to bug 5342