use strict;return sub{my $this = shift;my $C = $this->{C};$this->out("");$C->{HTMLTitle} = "Reconcile Paypal transactions";$this->out("\n");$this->out(Zen::PerlHandler->get("II5117351e1a4f1d07d1c88690b7a75168::mod_paypal->mnt_paypal_reconcile")->do($this->{C}));$this->out("\n");if ( $C->{Records} ) {$this->out("\n<script>\nfunction toggleObjectIDs()\n{\n	var e = document.getElementsByTagName(\"input\");\n	var n = 0;\n	\n	for (i = 0; i < e.length; i++)\n	{\n		if ( e[i].getAttribute(\"type\") == \'checkbox\' && e[i].getAttribute(\"name\") == \'delavo_code\' )\n		{\n			e[i].checked = e[i].checked ? false : true;\n			if (e[i].checked) n++;\n		}\n	}\n	\n	document.getElementById(\'ToggleChecked\').checked = false;\n	\n	return n > 0 ? (\'&nbsp;\' + n) : \'\';\n}\n</script>\n\n<form method=\"POST\">\n<table border=\"1\">\n	<tr>\n		<th style=\"color:blue\"><nobr><input id=\"ToggleChecked\" type=\"checkbox\" onChange=\"toggleObjectIDs()\">&nbsp;<b>Reconcile</b></nobr></th>\n");my $in = $C->{Headers};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{h} = -1;for my $f (@$loop) {$C->{ITERATION}{h}++;$C->{h} = $f;$this->out("			<th><nobr><b>$C->{h}</b></nobr></th>\n");}$this->out("	</tr>\n");my $in = $C->{Records};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{r} = -1;for my $f (@$loop) {$C->{ITERATION}{r}++;$C->{r} = $f;$this->out("		<tr>\n");if ( $C->{r}{delavo_code} ) {$this->out("");if ( $C->{r}{sale_found} ) {$this->out("					<td style=\"color:blue\"><nobr><input type=\"checkbox\" name=\"delavo_code\" value=\"$C->{r}{delavo_code}\">&nbsp;<b>$C->{r}{sale_id}</b></nobr></td>\n");} else {$this->out("					<td align=\"center\" style=\"color:red\"><nobr><b>$C->{r}{sale_id}</b></nobr></td>\n");}$this->out("");} else {$this->out("				<td align=\"center\" style=\"color:red\">n/a</td>\n");}$this->out("");my $in = $C->{r}{cells};my $loop = ref($in) eq "ARRAY" ? $in : ref($in) eq "CODE" ? &{$in} : [];$C->{ITERATION}{c} = -1;for my $f (@$loop) {$C->{ITERATION}{c}++;$C->{c} = $f;$this->out("				<td><nobr>$C->{c}</nobr></td>\n");}$this->out("		</tr>\n");}$this->out("</table>\n\n<br>\n<div style=\"text-align:left\">\n<input type=\"submit\" name=\"do_it\" value=\"Reconcile checked\">\n</div>\n\n</form>\n\n");} else {$this->out("\n	Data file is not a CSV file or contains no Paypal reconciliation records\n\n");}$this->out("\n");{my $G = (ref $this)->get("/headfoot/hf_main.html", $this->{param}) or die "no skel /headfoot/hf_main.html";my $out1 = $this->getOutput;$C->{central_content} = join('', @$out1);@$out1 = ();my $out2 = $G->execute($C);$this->out(@$out2) if $out2;}$this->out("");}