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 7-19 Link Here
7
<script type="text/JavaScript" language="JavaScript">
7
<script type="text/JavaScript" language="JavaScript">
8
//<![CDATA[
8
//<![CDATA[
9
	 $(document).ready(function() {
9
	 $(document).ready(function() {
10
		[% UNLESS ( preview ) %]$("#claimst").tablesorter({[% IF ( dateformat == 'metric' ) %]
10
        $("#claimst").tablesorter({[% IF ( dateformat == 'metric' ) %]
11
			dateFormat: 'uk',[% END %]
11
            dateFormat: 'uk',[% END %]
12
			headers: { 0: { sorter: false },1:{sorter:false}}
12
            headers: { 0: { sorter: false },1:{sorter:false}}
13
		});[% END %]
13
        });
14
	    $('#supplierid').change(function() {
14
        $('#supplierid').change(function() {
15
    	    $('#claims').submit();
15
            $('#claims').submit();
16
	    });
16
        });
17
17
18
	    // Case-insensitive version of jquery's contains function
18
	    // Case-insensitive version of jquery's contains function
19
	    jQuery.extend(
19
	    jQuery.extend(
Lines 139-161 Link Here
139
	    $("table#claimst tbody tr").show();
139
	    $("table#claimst tbody tr").show();
140
	}
140
	}
141
141
142
	function popup(supplierid,serialid){
143
		window.open('claims.pl?supplierid='+ supplierid +'&amp;serialid='+ serialid +'&amp;op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
144
	}
145
146
//]]>
142
//]]>
147
</script>
143
</script>
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 320-396 Link Here
320
    </fieldset>
312
    </fieldset>
321
[% END %]
313
[% END %]
322
314
323
[% ELSE %]
324
325
<div id="doc" class="yui-t7">
326
   <div id="bd">
327
	
328
[% IF ( supplierloop ) %]
329
        [% FOREACH supplierloo IN supplierloop %]
330
        [% IF ( supplierloo.name ) %]
331
        <p><b>[% supplierloo.name %]</b><br />
332
        [% END %]
333
        [% IF ( supplierloo.postal ) %]
334
        [% supplierloo.postal %]<br />
335
        [% END %]
336
        [% IF ( supplierloo.contphone ) %]
337
        Ph: [% supplierloo.contphone %]<br />
338
        [% END %]
339
        [% IF ( supplierloo.contfax ) %]
340
        Fax: [% supplierloo.contfax %]<br />
341
        [% END %]
342
        [% IF ( supplierloo.contemail ) %]
343
        Email: [% supplierloo.contemail %]<br />
344
        [% END %]
345
        [% IF ( supplierloo.accountnumber ) %]
346
        A/C: [% supplierloo.accountnumber %]</p>
347
        [% END %]
348
        [% IF ( supplierloo.contact ) %]
349
        <p>Dear [% supplierloo.contact %]</p>
350
        [% ELSE %]
351
        <p>To whom it may concern</p>
352
        [% END %]
353
        <p>The following items have not been received from you and are now considered missing:</p>
354
        [% END %]
355
[% END %]
356
        [% IF ( missingissues ) %]
357
        <h3>Missing issues</h3>
358
        <table>
359
            <tr>
360
                <td><b>Vendor<b></td>
361
                <td><b>Title</b></td>
362
                <td><b>Issue number</b></td>
363
                <td><b>Missing since</b></td>
364
            </tr>
365
            [% FOREACH missingissue IN missingissues %]
366
                <tr>
367
                    <td>
368
                    [% missingissue.name %]
369
                    </td>
370
                    <td>
371
                    [% missingissue.Title |html %]
372
                    </td>
373
                    <td>
374
                    [% missingissue.serialseq %]
375
                    </td>
376
                    <td>
377
                    [% missingissue.planneddate %]
378
                    </td>
379
                </tr>
380
            [% END %]
381
        </table>
382
        [% END %]
383
384
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
385
[% END %]
386
387
</div>
315
</div>
388
</div>
316
</div>
389
317
390
[% UNLESS ( preview ) %]
391
<div class="yui-b">
318
<div class="yui-b">
392
[% INCLUDE 'serials-menu.inc' %]
319
[% INCLUDE 'serials-menu.inc' %]
393
</div>
320
</div>
394
[% END %]
395
</div>
321
</div>
396
[% INCLUDE 'intranet-bottom.inc' %]
322
[% 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-115 $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
        (uc(C4::Context->preference("marcflavour"))) => 1
107
        (uc(C4::Context->preference("marcflavour"))) => 1
114
        );
108
        );
115
output_html_with_http_headers $input, $cookie, $template->output;
109
output_html_with_http_headers $input, $cookie, $template->output;
116
- 

Return to bug 5342