Lines 36-42
my $op = $input->param('op');
Link Here
|
36 |
my $claimletter = $input->param('claimletter'); |
36 |
my $claimletter = $input->param('claimletter'); |
37 |
my $supplierid = $input->param('supplierid'); |
37 |
my $supplierid = $input->param('supplierid'); |
38 |
my $suppliername = $input->param('suppliername'); |
38 |
my $suppliername = $input->param('suppliername'); |
39 |
my $order = $input->param('order'); |
|
|
40 |
|
39 |
|
41 |
# open template first (security & userenv set here) |
40 |
# open template first (security & userenv set here) |
42 |
my ($template, $loggedinuser, $cookie) |
41 |
my ($template, $loggedinuser, $cookie) |
Lines 51-62
my ($template, $loggedinuser, $cookie)
Link Here
|
51 |
# supplierlist is returned in name order |
50 |
# supplierlist is returned in name order |
52 |
my $supplierlist = GetSuppliersWithLateIssues(); |
51 |
my $supplierlist = GetSuppliersWithLateIssues(); |
53 |
for my $s (@{$supplierlist} ) { |
52 |
for my $s (@{$supplierlist} ) { |
54 |
$s->{count} = scalar GetLateOrMissingIssues($s->{id}, q{}, $order); |
53 |
$s->{count} = scalar GetLateOrMissingIssues($s->{id}, q{}); |
55 |
if ($supplierid && $s->{id} == $supplierid) { |
54 |
if ($supplierid && $s->{id} == $supplierid) { |
56 |
$s->{selected} = 1; |
55 |
$s->{selected} = 1; |
57 |
} |
56 |
} |
58 |
} |
57 |
} |
59 |
|
58 |
|
|
|
59 |
my $branchloop = GetBranchesLoop(); |
60 |
unshift @$branchloop, {value=> 'all',name=>''}; |
61 |
|
62 |
my $preview=0; |
63 |
if($op && $op eq 'preview'){ |
64 |
$preview = 1; |
65 |
} else { |
66 |
my @serialnums=$input->param('serialid'); |
67 |
if (@serialnums) { # i.e. they have been flagged to generate claims |
68 |
my $err; |
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 |
} |
82 |
} |
83 |
} |
84 |
|
60 |
my $letters = GetLetters('claimissues'); |
85 |
my $letters = GetLetters('claimissues'); |
61 |
my @letters; |
86 |
my @letters; |
62 |
foreach (keys %{$letters}){ |
87 |
foreach (keys %{$letters}){ |
Lines 67-93
my $letter=((scalar(@letters)>1) || ($letters[0]->{name}||$letters[0]->{code}));
Link Here
|
67 |
my @missingissues; |
92 |
my @missingissues; |
68 |
my @supplierinfo; |
93 |
my @supplierinfo; |
69 |
if ($supplierid) { |
94 |
if ($supplierid) { |
70 |
@missingissues = GetLateOrMissingIssues($supplierid,$serialid,$order); |
95 |
@missingissues = GetLateOrMissingIssues($supplierid); |
71 |
@supplierinfo=GetBookSeller($supplierid); |
96 |
@supplierinfo=GetBookSeller($supplierid); |
72 |
} |
97 |
} |
73 |
|
98 |
|
74 |
my $branchloop = GetBranchesLoop(); |
|
|
75 |
unshift @$branchloop, {value=> 'all',name=>''}; |
76 |
|
77 |
my $preview=0; |
78 |
if($op && $op eq 'preview'){ |
79 |
$preview = 1; |
80 |
} else { |
81 |
my @serialnums=$input->param('serialid'); |
82 |
if (@serialnums) { # i.e. they have been flagged to generate claims |
83 |
SendAlerts('claimissues',\@serialnums,$input->param("letter_code")); |
84 |
my $cntupdate=UpdateClaimdateIssues(\@serialnums); |
85 |
### $cntupdate SHOULD be equal to scalar(@$serialnums) |
86 |
} |
87 |
} |
88 |
$template->param('letters'=>\@letters,'letter'=>$letter); |
99 |
$template->param('letters'=>\@letters,'letter'=>$letter); |
89 |
$template->param( |
100 |
$template->param( |
90 |
order =>$order, |
|
|
91 |
suploop => $supplierlist, |
101 |
suploop => $supplierlist, |
92 |
phone => $supplierinfo[0]->{phone}, |
102 |
phone => $supplierinfo[0]->{phone}, |
93 |
booksellerfax => $supplierinfo[0]->{booksellerfax}, |
103 |
booksellerfax => $supplierinfo[0]->{booksellerfax}, |
94 |
- |
|
|