<!DOCTYPE html>
<html lang='en'>
<head>
<title>* Detect invalid pagespecs and do not merge them in add_depends, - ikiwiki-upstream - Unnamed repository; edit this file to name it for gitweb.</title>
<meta name='generator' content='cgit v1.2.3'/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit-css/cgit.css'/>
<link rel='stylesheet' type='text/css' href='/cgit-local/local.css'/>
<script type='text/javascript' src='/cgit.js'></script>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://source.jones.dk/ikiwiki-upstream/atom/t/pagename.t?h=master' type='application/atom+xml'/>
<link rel='vcs-git' href='https://source.jones.dk/ikiwiki-upstream' title='ikiwiki-upstream Git repository'/>
<link rel='vcs-git' href='user@source.jones.dk:ikiwiki-upstream' title='ikiwiki-upstream Git repository'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='/cgit-css/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/ikiwiki-upstream/'>ikiwiki-upstream</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='8a29361c321b54607ba5b4a7675508325b450110'/><select name='h' onchange='this.form.submit();'>
<option value='layoutgala'>layoutgala</option>
<option value='master' selected='selected'>master</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Unnamed repository; edit this file to name it for gitweb.</td><td class='sub right'>Jonas Smedegaard</td></tr></table>
<table class='tabs'><tr><td>
<a href='/ikiwiki-upstream/'>summary</a><a href='/ikiwiki-upstream/refs/?id=8a29361c321b54607ba5b4a7675508325b450110'>refs</a><a href='/ikiwiki-upstream/log/t/pagename.t'>log</a><a href='/ikiwiki-upstream/tree/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>tree</a><a class='active' href='/ikiwiki-upstream/commit/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>commit</a><a href='/ikiwiki-upstream/diff/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>diff</a></td><td class='form'><form class='right' method='get' action='/ikiwiki-upstream/log/t/pagename.t'>
<input type='hidden' name='id' value='8a29361c321b54607ba5b4a7675508325b450110'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/ikiwiki-upstream/commit/?id=8a29361c321b54607ba5b4a7675508325b450110'>root</a>/<a href='/ikiwiki-upstream/commit/t?id=8a29361c321b54607ba5b4a7675508325b450110'>t</a>/<a href='/ikiwiki-upstream/commit/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>pagename.t</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='8a29361c321b54607ba5b4a7675508325b450110'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Joey Hess &lt;joey@kodama.kitenet.net&gt;</td><td class='right'>2008-03-17 14:04:59 -0400</td></tr>
<tr><th>committer</th><td>Joey Hess &lt;joey@kodama.kitenet.net&gt;</td><td class='right'>2008-03-17 14:04:59 -0400</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/ikiwiki-upstream/commit/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>8a29361c321b54607ba5b4a7675508325b450110</a> (<a href='/ikiwiki-upstream/patch/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/ikiwiki-upstream/tree/?id=8a29361c321b54607ba5b4a7675508325b450110'>3f4936d273ab9e79530f6e7c260d14216f11a14e</a> /<a href='/ikiwiki-upstream/tree/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110'>t/pagename.t</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/ikiwiki-upstream/commit/t/pagename.t?id=6ce7454cc33e94e22490c202210eff481acfd0c1'>6ce7454cc33e94e22490c202210eff481acfd0c1</a> (<a href='/ikiwiki-upstream/diff/t/pagename.t?id=8a29361c321b54607ba5b4a7675508325b450110&amp;id2=6ce7454cc33e94e22490c202210eff481acfd0c1'>diff</a>)</td></tr></table>
<div class='commit-subject'>* Detect invalid pagespecs and do not merge them in add_depends,</div><div class='commit-msg'>  as that can result in a broken merged pagespec that matches nothing.
</div><div class='diffstat-header'><a href='/ikiwiki-upstream/diff/?id=8a29361c321b54607ba5b4a7675508325b450110'>Diffstat</a> (limited to 't/pagename.t')</div><table summary='diffstat' class='diffstat'></table><div class='diffstat-summary'>0 files changed, 0 insertions, 0 deletions</div><table summary='diff' class='diff'><tr><td></td></tr></table></div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.46.0</a>) at 2025-06-26 12:11:54 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
/li>
<li id="n_31" class="hl"><span class="hl slc"># GNU General Public License for more details.</span></li>
<li id="n_32" class="hl"><span class="hl slc"># You should have received a copy of the GNU General Public License</span></li>
<li id="n_33" class="hl"><span class="hl slc"># along with this program; if not, write to the Free Software</span></li>
<li id="n_34" class="hl"><span class="hl slc"># Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span></li>
<li id="n_35" class="hl"><span class="hl slc">#======================================================================</span></li>
<li id="n_36" class="hl"><span class="hl slc">#</span></li>
<li id="n_37" class="hl"><span class="hl slc"># Account reconciliation module</span></li>
<li id="n_38" class="hl"><span class="hl slc">#</span></li>
<li id="n_39" class="hl"><span class="hl slc">#======================================================================</span></li>
<li id="n_40" class="hl"></li>
<li id="n_41" class="hl"><span class="hl kwa">use </span>LedgerSMB<span class="hl opt">::</span>RC<span class="hl opt">;</span></li>
<li id="n_42" class="hl"></li>
<li id="n_43" class="hl"><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_44" class="hl"><span class="hl slc"># end of main</span></li>
<li id="n_45" class="hl"></li>
<li id="n_46" class="hl"><span class="hl slc"># this is for our long dates</span></li>
<li id="n_47" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;January&#39;)</span></li>
<li id="n_48" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;February&#39;)</span></li>
<li id="n_49" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;March&#39;)</span></li>
<li id="n_50" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;April&#39;)</span></li>
<li id="n_51" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;May &#39;)</span></li>
<li id="n_52" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;June&#39;)</span></li>
<li id="n_53" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;July&#39;)</span></li>
<li id="n_54" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;August&#39;)</span></li>
<li id="n_55" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;September&#39;)</span></li>
<li id="n_56" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;October&#39;)</span></li>
<li id="n_57" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;November&#39;)</span></li>
<li id="n_58" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;December&#39;)</span></li>
<li id="n_59" class="hl"></li>
<li id="n_60" class="hl"><span class="hl slc"># this is for our short month</span></li>
<li id="n_61" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Jan&#39;)</span></li>
<li id="n_62" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Feb&#39;)</span></li>
<li id="n_63" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Mar&#39;)</span></li>
<li id="n_64" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Apr&#39;)</span></li>
<li id="n_65" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;May&#39;)</span></li>
<li id="n_66" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Jun&#39;)</span></li>
<li id="n_67" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Jul&#39;)</span></li>
<li id="n_68" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Aug&#39;)</span></li>
<li id="n_69" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Sep&#39;)</span></li>
<li id="n_70" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Oct&#39;)</span></li>
<li id="n_71" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Nov&#39;)</span></li>
<li id="n_72" class="hl"><span class="hl slc"># $locale-&gt;text(&#39;Dec&#39;)</span></li>
<li id="n_73" class="hl"></li>
<li id="n_74" class="hl"></li>
<li id="n_75" class="hl"><span class="hl kwa">sub </span>reconciliation <span class="hl opt">{</span></li>
<li id="n_76" class="hl">  </li>
<li id="n_77" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">paymentaccounts</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_78" class="hl"></li>
<li id="n_79" class="hl">  <span class="hl kwb">$selection </span><span class="hl opt">= </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_80" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>PR<span class="hl opt">} }) { </span><span class="hl kwb">$selection </span><span class="hl opt">.= </span><span class="hl sng">&quot;&lt;option&gt;</span><span class="hl ipl">$_</span><span class="hl sng">-&gt;{accno}--</span><span class="hl ipl">$_</span><span class="hl sng">-&gt;{description}</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span> <span class="hl opt">}</span></li>
<li id="n_81" class="hl"></li>
<li id="n_82" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">} = </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Reconciliation&#39;</span><span class="hl opt">);</span></li>
<li id="n_83" class="hl"></li>
<li id="n_84" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>report<span class="hl opt">}) {</span></li>
<li id="n_85" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">} = </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Reconciliation Report&#39;</span><span class="hl opt">);</span></li>
<li id="n_86" class="hl">    <span class="hl kwb">$cleared </span><span class="hl opt">= </span>qq<span class="hl opt">|</span></li>
<li id="n_87" class="hl">        <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>report value<span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">&gt;</span></li>
<li id="n_88" class="hl">        <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_89" class="hl">      <span class="hl opt">&lt;</span>td align<span class="hl opt">=</span>right<span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>checkbox <span class="hl kwa">class</span><span class="hl opt">=</span>checkbox name<span class="hl opt">=</span>outstanding value<span class="hl opt">=</span><span class="hl num">1 </span>checked<span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_90" class="hl">      <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Outstanding&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_91" class="hl">      <span class="hl opt">&lt;</span>td align<span class="hl opt">=</span>right<span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>checkbox <span class="hl kwa">class</span><span class="hl opt">=</span>checkbox name<span class="hl opt">=</span>cleared value<span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_92" class="hl">      <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Cleared&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_93" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_94" class="hl"><span class="hl opt">|;</span></li>
<li id="n_95" class="hl"></li>
<li id="n_96" class="hl">  <span class="hl opt">}</span></li>
<li id="n_97" class="hl"></li>
<li id="n_98" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>all_years<span class="hl opt">} }) {</span></li>
<li id="n_99" class="hl">    <span class="hl slc"># accounting years</span></li>
<li id="n_100" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>selectaccountingyear<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;option&gt;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_101" class="hl">    <span class="hl kwa">for </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>all_years<span class="hl opt">} }) { </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>selectaccountingyear<span class="hl opt">} .= </span>qq<span class="hl opt">|&lt;</span>option<span class="hl opt">&gt;</span><span class="hl kwb">$_</span><span class="hl esc">\n</span><span class="hl opt">| }</span></li>
<li id="n_102" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>selectaccountingmonth<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;option&gt;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_103" class="hl">    <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl kwc">sort keys </span><span class="hl opt">%{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>all_month<span class="hl opt">} }) { </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>selectaccountingmonth<span class="hl opt">} .= </span>qq<span class="hl opt">|&lt;</span>option value<span class="hl opt">=</span><span class="hl kwb">$_</span><span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>all_month<span class="hl opt">}{</span><span class="hl kwb">$_</span><span class="hl opt">}).</span>qq<span class="hl opt">|</span><span class="hl esc">\n</span><span class="hl opt">| }</span></li>
<li id="n_104" class="hl"></li>
<li id="n_105" class="hl">    <span class="hl kwb">$selectfrom </span><span class="hl opt">= </span>qq<span class="hl opt">|</span></li>
<li id="n_106" class="hl">        <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_107" class="hl">      <span class="hl opt">&lt;</span>th align<span class="hl opt">=</span>right<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Period&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_108" class="hl">      <span class="hl opt">&lt;</span>td colspan<span class="hl opt">=</span><span class="hl num">3</span><span class="hl opt">&gt;</span></li>
<li id="n_109" class="hl">      <span class="hl opt">&lt;</span><span class="hl kwc">select </span>name<span class="hl opt">=</span>month<span class="hl opt">&gt;</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>selectaccountingmonth<span class="hl opt">}&lt;/</span><span class="hl kwc">select</span><span class="hl opt">&gt;</span></li>
<li id="n_110" class="hl">      <span class="hl opt">&lt;</span><span class="hl kwc">select </span>name<span class="hl opt">=</span>year<span class="hl opt">&gt;</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>selectaccountingyear<span class="hl opt">}&lt;/</span><span class="hl kwc">select</span><span class="hl opt">&gt;</span></li>
<li id="n_111" class="hl">      <span class="hl opt">&lt;</span>input name<span class="hl opt">=</span>interval <span class="hl kwa">class</span><span class="hl opt">=</span>radio type<span class="hl opt">=</span>radio value<span class="hl opt">=</span><span class="hl num">0 </span>checked<span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Current&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|</span></li>
<li id="n_112" class="hl">      <span class="hl opt">&lt;</span>input name<span class="hl opt">=</span>interval <span class="hl kwa">class</span><span class="hl opt">=</span>radio type<span class="hl opt">=</span>radio value<span class="hl opt">=</span><span class="hl num">1</span><span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Month&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|</span></li>
<li id="n_113" class="hl">      <span class="hl opt">&lt;</span>input name<span class="hl opt">=</span>interval <span class="hl kwa">class</span><span class="hl opt">=</span>radio type<span class="hl opt">=</span>radio value<span class="hl opt">=</span><span class="hl num">3</span><span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Quarter&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|</span></li>
<li id="n_114" class="hl">      <span class="hl opt">&lt;</span>input name<span class="hl opt">=</span>interval <span class="hl kwa">class</span><span class="hl opt">=</span>radio type<span class="hl opt">=</span>radio value<span class="hl opt">=</span><span class="hl num">12</span><span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Year&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|</span></li>
<li id="n_115" class="hl">      <span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_116" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_117" class="hl"><span class="hl opt">|;</span></li>
<li id="n_118" class="hl">  <span class="hl opt">}</span></li>
<li id="n_119" class="hl"></li>
<li id="n_120" class="hl"></li>
<li id="n_121" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">header</span><span class="hl opt">;</span></li>
<li id="n_122" class="hl"></li>
<li id="n_123" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_124" class="hl"><span class="hl opt">&lt;</span>body<span class="hl opt">&gt;</span></li>
<li id="n_125" class="hl"></li>
<li id="n_126" class="hl"><span class="hl opt">&lt;</span>form <span class="hl kwa">method</span><span class="hl opt">=</span>post action<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>script<span class="hl opt">}&gt;</span></li>
<li id="n_127" class="hl"></li>
<li id="n_128" class="hl"><span class="hl opt">&lt;</span>table width<span class="hl opt">=</span><span class="hl num">100</span><span class="hl opt">%&gt;</span></li>
<li id="n_129" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_130" class="hl">    <span class="hl opt">&lt;</span>th <span class="hl kwa">class</span><span class="hl opt">=</span>listtop<span class="hl opt">&gt;</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">}&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_131" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_132" class="hl">  <span class="hl opt">&lt;</span>tr height<span class="hl opt">=</span><span class="hl sng">&quot;5&quot;</span><span class="hl opt">&gt;&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_133" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_134" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;</span></li>
<li id="n_135" class="hl">      <span class="hl opt">&lt;</span>table<span class="hl opt">&gt;</span></li>
<li id="n_136" class="hl">    <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_137" class="hl">      <span class="hl opt">&lt;</span>th align<span class="hl opt">=</span>right nowrap<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Account&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_138" class="hl">      <span class="hl opt">&lt;</span>td colspan<span class="hl opt">=</span><span class="hl num">3</span><span class="hl opt">&gt;&lt;</span><span class="hl kwc">select </span>name<span class="hl opt">=</span>accno<span class="hl opt">&gt;</span><span class="hl kwb">$selection</span><span class="hl opt">&lt;</span><span class="hl kwd">/select&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_139" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_140" class="hl">    <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_141" class="hl">      <span class="hl opt">&lt;</span>th align<span class="hl opt">=</span>right<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;From&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_142" class="hl">      <span class="hl opt">&lt;</span>td colspan<span class="hl opt">=</span><span class="hl num">3</span><span class="hl opt">&gt;&lt;</span>input name<span class="hl opt">=</span>fromdate size<span class="hl opt">=</span><span class="hl num">11 </span>title<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$myconfig</span><span class="hl sng">{dateformat}&quot;</span><span class="hl opt">&gt; &lt;</span>b<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;To&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;</span><span class="hl kwd">/b&gt; &lt;input name=todate size=11 title=&quot;$myconfig{dateformat}&quot;&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_143" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_144" class="hl">    <span class="hl kwb">$selectfrom</span></li>
<li id="n_145" class="hl">    <span class="hl kwb">$cleared</span></li>
<li id="n_146" class="hl">        <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_147" class="hl">      <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_148" class="hl">      <span class="hl opt">&lt;</span>td colspan<span class="hl opt">=</span><span class="hl num">3</span><span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>radio style<span class="hl opt">=</span>radio name<span class="hl opt">=</span>summary value<span class="hl opt">=</span><span class="hl num">1 </span>checked<span class="hl opt">&gt; |.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Summary&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|</span></li>
<li id="n_149" class="hl">      <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>radio style<span class="hl opt">=</span>radio name<span class="hl opt">=</span>summary value<span class="hl opt">=</span><span class="hl num">0</span><span class="hl opt">&gt; |.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Detail&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_150" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_151" class="hl">    <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_152" class="hl">      <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_153" class="hl">      <span class="hl opt">&lt;</span>td colspan<span class="hl opt">=</span><span class="hl num">3</span><span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>checkbox <span class="hl kwa">class</span><span class="hl opt">=</span>checkbox name<span class="hl opt">=</span>fx_transaction value<span class="hl opt">=</span><span class="hl num">1 </span>checked<span class="hl opt">&gt; |.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Include Exchange Rate Difference&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_154" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_155" class="hl">      <span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_156" class="hl">    <span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_157" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_158" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_159" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;</span>hr size<span class="hl opt">=</span><span class="hl num">3 </span>noshade<span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_160" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_161" class="hl"><span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_162" class="hl"></li>
<li id="n_163" class="hl"><span class="hl opt">&lt;</span>br<span class="hl opt">&gt;</span></li>
<li id="n_164" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>nextsub value<span class="hl opt">=</span>get_payments<span class="hl opt">&gt;</span></li>
<li id="n_165" class="hl"><span class="hl opt">|;</span></li>
<li id="n_166" class="hl"></li>
<li id="n_167" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">hide_form</span><span class="hl opt">(</span><span class="hl sng">qw(path login sessionid)</span><span class="hl opt">);</span></li>
<li id="n_168" class="hl"></li>
<li id="n_169" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_170" class="hl"><span class="hl opt">&lt;</span>button type<span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> <span class="hl kwa">class</span><span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;action&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;continue&quot;</span><span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Continue&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>button<span class="hl opt">&gt;</span></li>
<li id="n_171" class="hl"></li>
<li id="n_172" class="hl"><span class="hl opt">&lt;/</span>form<span class="hl opt">&gt;</span></li>
<li id="n_173" class="hl"><span class="hl opt">|;</span></li>
<li id="n_174" class="hl"></li>
<li id="n_175" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>lynx<span class="hl opt">}) {</span></li>
<li id="n_176" class="hl">    <span class="hl kwa">require </span><span class="hl sng">&quot;bin/menu.pl&quot;</span><span class="hl opt">;</span></li>
<li id="n_177" class="hl">    <span class="hl opt">&amp;</span>menubar<span class="hl opt">;</span></li>
<li id="n_178" class="hl">  <span class="hl opt">}</span></li>
<li id="n_179" class="hl"></li>
<li id="n_180" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_181" class="hl"></li>
<li id="n_182" class="hl"><span class="hl opt">&lt;/</span>body<span class="hl opt">&gt;</span></li>
<li id="n_183" class="hl"><span class="hl opt">&lt;/</span>html<span class="hl opt">&gt;</span></li>
<li id="n_184" class="hl"><span class="hl opt">|;</span></li>
<li id="n_185" class="hl"></li>
<li id="n_186" class="hl"><span class="hl opt">}</span></li>
<li id="n_187" class="hl"></li>
<li id="n_188" class="hl"></li>
<li id="n_189" class="hl"><span class="hl kwa">sub continue </span><span class="hl opt">{ &amp;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>nextsub<span class="hl opt">} } };</span></li>
<li id="n_190" class="hl"></li>
<li id="n_191" class="hl"><span class="hl kwa">sub </span>till_closing <span class="hl opt">{</span></li>
<li id="n_192" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>callback<span class="hl opt">} = </span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{script}?path=</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{path}&amp;login=</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{login}&amp;sessionid=</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{sessionid}&quot;</span><span class="hl opt">;</span></li>
<li id="n_193" class="hl"></li>
<li id="n_194" class="hl">  <span class="hl slc"># $locale-&gt;text(&quot;Source&quot;);</span></li>
<li id="n_195" class="hl">  <span class="hl slc"># $locale-&gt;text(&quot;Actual&quot;);</span></li>
<li id="n_196" class="hl">  <span class="hl slc"># $locale-&gt;text(&quot;Expected&quot;);</span></li>
<li id="n_197" class="hl">  <span class="hl slc"># $locale-&gt;text(&quot;Error&quot;);</span></li>
<li id="n_198" class="hl">  <span class="hl kwb">&#64;colheadings </span><span class="hl opt">= </span><span class="hl sng">qw(Source Actual Expected Error)</span><span class="hl opt">;</span></li>
<li id="n_199" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$curren </span><span class="hl opt">= </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;curren&#39;</span><span class="hl opt">};</span></li>
<li id="n_200" class="hl"></li>
<li id="n_201" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">} = </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Closing Till For [_1]&quot;</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>login<span class="hl opt">});</span></li>
<li id="n_202" class="hl">  <span class="hl kwa">require </span><span class="hl sng">&quot;pos.conf.pl&quot;</span><span class="hl opt">; </span></li>
<li id="n_203" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">getposlines</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_204" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">header</span><span class="hl opt">;</span></li>
<li id="n_205" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_206" class="hl"><span class="hl opt">&lt;</span>body<span class="hl opt">&gt;</span></li>
<li id="n_207" class="hl"></li>
<li id="n_208" class="hl"><span class="hl opt">&lt;</span>form <span class="hl kwa">method</span><span class="hl opt">=</span>post action<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>script<span class="hl opt">}&gt;</span></li>
<li id="n_209" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>path value<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>path<span class="hl opt">}&gt;</span></li>
<li id="n_210" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>login value<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>login<span class="hl opt">}&gt;</span></li>
<li id="n_211" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>sessionid value<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>sessionid<span class="hl opt">}&gt;</span></li>
<li id="n_212" class="hl"></li>
<li id="n_213" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>callback value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{callback}&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_214" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>sum value<span class="hl opt">=</span><span class="hl sng">&quot;|.</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{sum} * -1 .qq|&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_215" class="hl"><span class="hl opt">&lt;</span>table width<span class="hl opt">=</span><span class="hl num">100</span><span class="hl opt">%&gt;</span></li>
<li id="n_216" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_217" class="hl">    <span class="hl opt">&lt;</span>th <span class="hl kwa">class</span><span class="hl opt">=</span>listtop<span class="hl opt">&gt;</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">}&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_218" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_219" class="hl"><span class="hl opt">&lt;/</span>table<span class="hl opt">&gt; </span></li>
<li id="n_220" class="hl"><span class="hl opt">&lt;</span>table width<span class="hl opt">=</span><span class="hl num">100</span><span class="hl opt">%&gt;</span></li>
<li id="n_221" class="hl"><span class="hl opt">|;</span></li>
<li id="n_222" class="hl"></li>
<li id="n_223" class="hl">  <span class="hl kwc">print </span><span class="hl sng">&quot;&lt;tr&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_224" class="hl">  <span class="hl kwc">map </span><span class="hl opt">{</span><span class="hl kwc">print </span><span class="hl sng">&quot;&lt;td class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl kwb">$_</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/td&gt;&quot;</span><span class="hl opt">;} </span><span class="hl kwb">&#64;colheadings</span><span class="hl opt">;</span></li>
<li id="n_225" class="hl">  <span class="hl kwc">print </span><span class="hl sng">&quot;&lt;/tr&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_226" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$j</span><span class="hl opt">;</span></li>
<li id="n_227" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$source</span><span class="hl opt">;</span></li>
<li id="n_228" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwb">$source </span><span class="hl opt">(</span><span class="hl kwc">sort keys </span><span class="hl kwb">%pos_sources</span><span class="hl opt">){</span></li>
<li id="n_229" class="hl">    <span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_230" class="hl">    <span class="hl kwa">foreach </span><span class="hl kwb">$ref </span><span class="hl opt">(&#64;{</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>TB<span class="hl opt">}}){</span></li>
<li id="n_231" class="hl">      <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>source<span class="hl opt">} </span><span class="hl kwc">eq </span><span class="hl kwb">$source</span><span class="hl opt">){</span></li>
<li id="n_232" class="hl">        <span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * -</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_233" class="hl">        <span class="hl kwa">last</span><span class="hl opt">;</span></li>
<li id="n_234" class="hl">      <span class="hl opt">}</span></li>
<li id="n_235" class="hl">    <span class="hl opt">}</span></li>
<li id="n_236" class="hl">    <span class="hl opt">++</span><span class="hl kwb">$j</span><span class="hl opt">;</span></li>
<li id="n_237" class="hl">    <span class="hl kwb">$j </span><span class="hl opt">= </span><span class="hl kwb">$j </span><span class="hl opt">% </span><span class="hl num">2</span><span class="hl opt">;</span></li>
<li id="n_238" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|&lt;</span>tr <span class="hl kwa">class</span><span class="hl opt">=</span>listrow<span class="hl kwb">$j</span><span class="hl opt">&gt;&lt;</span>td<span class="hl opt">&gt;|.</span><span class="hl kwb">$pos_sources</span><span class="hl opt">{</span><span class="hl kwb">$source</span><span class="hl opt">}.</span>qq<span class="hl opt">|&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_239" class="hl">             <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;</span>input name<span class="hl opt">=</span><span class="hl sng">&quot;amount_</span><span class="hl ipl">$source</span><span class="hl sng">&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_240" class="hl">             <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;expected_</span><span class="hl ipl">$source</span><span class="hl sng">&quot;</span> </li>
<li id="n_241" class="hl">        value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$amount</span><span class="hl sng">&quot;</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_242" class="hl">             <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;${</span>curren<span class="hl opt">}</span><span class="hl kwb">$amount</span><span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_243" class="hl">             <span class="hl opt">&lt;</span>td id<span class="hl opt">=</span><span class="hl sng">&quot;error_</span><span class="hl ipl">$source</span><span class="hl sng">&quot;</span><span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;&lt;</span><span class="hl kwd">/td&gt;&lt;/</span>tr<span class="hl opt">&gt;|;</span></li>
<li id="n_244" class="hl">  <span class="hl opt">}</span></li>
<li id="n_245" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_246" class="hl"><span class="hl opt">&lt;</span>script type<span class="hl opt">=</span><span class="hl sng">&#39;text/javascript&#39;</span><span class="hl opt">&gt;</span></li>
<li id="n_247" class="hl"> </li>
<li id="n_248" class="hl">function money_round<span class="hl opt">(</span>m<span class="hl opt">){</span></li>
<li id="n_249" class="hl">  var r<span class="hl opt">;</span></li>
<li id="n_250" class="hl">  r <span class="hl opt">= </span>Math<span class="hl opt">.</span>round<span class="hl opt">(</span>m <span class="hl opt">* </span><span class="hl num">100</span><span class="hl opt">)/</span><span class="hl num">100</span><span class="hl opt">;</span></li>
<li id="n_251" class="hl">  <span class="hl kwa">return </span>r<span class="hl opt">;</span></li>
<li id="n_252" class="hl"><span class="hl opt">}</span></li>
<li id="n_253" class="hl"></li>
<li id="n_254" class="hl">function custom_calc_total<span class="hl opt">(){</span></li>
<li id="n_255" class="hl">  <span class="hl opt">|;</span></li>
<li id="n_256" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$subgen </span><span class="hl opt">= </span><span class="hl sng">&#39;document.forms[0].sub_sub.value = &#39;</span><span class="hl opt">;</span></li>
<li id="n_257" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$toround </span><span class="hl opt">= </span><span class="hl sng">&#39;&#39;</span><span class="hl opt">;</span></li>
<li id="n_258" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$unit </span><span class="hl opt">(&#64;{</span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;breakdown&#39;</span><span class="hl opt">}}) {</span></li>
<li id="n_259" class="hl">    <span class="hl slc"># XXX Needs to take into account currencies that don&#39;t use 2 dp</span></li>
<li id="n_260" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$parsed </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">parse_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%pos_config</span><span class="hl opt">, </span><span class="hl kwb">$unit</span><span class="hl opt">);</span></li>
<li id="n_261" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl kwb">$parsed</span><span class="hl opt">;</span></li>
<li id="n_262" class="hl">    <span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl kwc">sprintf</span><span class="hl opt">(</span><span class="hl sng">&#39;</span><span class="hl ipl">%03d</span><span class="hl sng">&#39;</span><span class="hl opt">, </span><span class="hl kwb">$calcval </span><span class="hl opt">* </span><span class="hl num">100</span><span class="hl opt">) </span><span class="hl kwa">if </span><span class="hl kwb">$calcval </span><span class="hl opt">&lt; </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_263" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$subval </span><span class="hl opt">= </span><span class="hl sng">&#39;sub_&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$calcval</span><span class="hl opt">;</span></li>
<li id="n_264" class="hl">    <span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl sng">&#39;calc_&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$calcval</span><span class="hl opt">;</span></li>
<li id="n_265" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_266" class="hl">  document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].${</span>subval<span class="hl opt">}.</span>value <span class="hl opt">= </span>document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].${</span>calcval<span class="hl opt">}.</span>value <span class="hl opt">* </span><span class="hl kwb">$parsed</span><span class="hl opt">;</span></li>
<li id="n_267" class="hl">    <span class="hl opt">|;</span></li>
<li id="n_268" class="hl">    <span class="hl kwb">$subgen </span><span class="hl opt">.= </span><span class="hl sng">&quot;document.forms[0].${subval}.value * 1 + &quot;</span><span class="hl opt">;</span></li>
<li id="n_269" class="hl">    <span class="hl kwb">$toround </span><span class="hl opt">.= </span>qq<span class="hl opt">|</span></li>
<li id="n_270" class="hl">        document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].${</span>subval<span class="hl opt">}.</span>value <span class="hl opt">= </span></li>
<li id="n_271" class="hl">        money_round<span class="hl opt">(</span>document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].${</span>subval<span class="hl opt">}.</span>value<span class="hl opt">); |;</span></li>
<li id="n_272" class="hl">  <span class="hl opt">}</span></li>
<li id="n_273" class="hl">  <span class="hl kwc">print </span><span class="hl kwb">$subgen </span><span class="hl opt">. </span><span class="hl sng">&quot;0;&quot;</span><span class="hl opt">;</span></li>
<li id="n_274" class="hl">  <span class="hl kwc">print </span><span class="hl kwb">$toround</span><span class="hl opt">;</span></li>
<li id="n_275" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span>document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].</span>sub_sub<span class="hl opt">.</span>value <span class="hl opt">= </span></li>
<li id="n_276" class="hl">           money_round<span class="hl opt">(</span>document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].</span>sub_sub<span class="hl opt">.</span>value<span class="hl opt">);</span></li>
<li id="n_277" class="hl">  document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].</span>amount_cash<span class="hl opt">.</span>value <span class="hl opt">= </span>money_round<span class="hl opt">(</span></li>
<li id="n_278" class="hl">    document<span class="hl opt">.</span>forms<span class="hl opt">[</span><span class="hl num">0</span><span class="hl opt">].</span>sub_sub<span class="hl opt">.</span>value <span class="hl opt">- </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span>till_cash<span class="hl opt">});</span></li>
<li id="n_279" class="hl">  check_errors<span class="hl opt">();</span></li>
<li id="n_280" class="hl"><span class="hl opt">}</span></li>
<li id="n_281" class="hl">function check_errors<span class="hl opt">(){</span></li>
<li id="n_282" class="hl">  var cumulative_error <span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_283" class="hl">  var source_error <span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_284" class="hl">  var err_cell<span class="hl opt">;</span></li>
<li id="n_285" class="hl">  <span class="hl opt">|;</span></li>
<li id="n_286" class="hl">  <span class="hl kwc">map </span><span class="hl opt">{</span></li>
<li id="n_287" class="hl">    <span class="hl kwc">print </span><span class="hl sng">&quot;  source_error = money_round(</span></li>
<li id="n_288" class="hl"><span class="hl sng">    document.forms[0].amount_</span><span class="hl ipl">$_</span><span class="hl sng">.value - </span></li>
<li id="n_289" class="hl"><span class="hl sng">    document.forms[0].expected_</span><span class="hl ipl">$_</span><span class="hl sng">.value);</span></li>
<li id="n_290" class="hl"><span class="hl sng">  cumulative_error = cumulative_error + source_error;</span></li>
<li id="n_291" class="hl"><span class="hl sng">  err_cell = document.getElementById(&#39;error_</span><span class="hl ipl">$_</span><span class="hl sng">&#39;);</span></li>
<li id="n_292" class="hl"><span class="hl sng">  err_cell.innerHTML = &#39;</span><span class="hl ipl">$curren</span><span class="hl sng">&#39; + source_error;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">; </span></li>
<li id="n_293" class="hl">  <span class="hl opt">} (</span><span class="hl kwc">keys </span><span class="hl kwb">%pos_sources</span><span class="hl opt">);</span></li>
<li id="n_294" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_295" class="hl">  alert<span class="hl opt">(</span><span class="hl sng">&#39;|.</span><span class="hl ipl">$locale</span><span class="hl sng">-&gt;text(&#39;</span>Cumulative Error<span class="hl opt">:</span><span class="hl sng">&#39;).qq| </span><span class="hl ipl">$curren</span><span class="hl sng">&#39;</span> <span class="hl opt">+ </span>money_round<span class="hl opt">(</span>cumulative_error<span class="hl opt">));</span></li>
<li id="n_296" class="hl"><span class="hl opt">}</span></li>
<li id="n_297" class="hl"><span class="hl opt">&lt;/</span>script<span class="hl opt">&gt;</span></li>
<li id="n_298" class="hl"></li>
<li id="n_299" class="hl"><span class="hl opt">&lt;</span>table<span class="hl opt">&gt;</span></li>
<li id="n_300" class="hl"><span class="hl opt">&lt;</span>col<span class="hl opt">&gt;&lt;</span>col<span class="hl opt">&gt;&lt;</span>col<span class="hl opt">&gt;|;</span></li>
<li id="n_301" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$unit </span><span class="hl opt">(&#64;{</span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;breakdown&#39;</span><span class="hl opt">}}) {</span></li>
<li id="n_302" class="hl">    <span class="hl slc"># XXX Needs to take into account currencies that don&#39;t use 2 dp</span></li>
<li id="n_303" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">parse_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%pos_config</span><span class="hl opt">, </span><span class="hl kwb">$unit</span><span class="hl opt">);</span></li>
<li id="n_304" class="hl">    <span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl kwc">sprintf</span><span class="hl opt">(</span><span class="hl sng">&#39;</span><span class="hl ipl">%03d</span><span class="hl sng">&#39;</span><span class="hl opt">, </span><span class="hl kwb">$calcval </span><span class="hl opt">* </span><span class="hl num">100</span><span class="hl opt">) </span><span class="hl kwa">if </span><span class="hl kwb">$calcval </span><span class="hl opt">&lt; </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_305" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$subval </span><span class="hl opt">= </span><span class="hl sng">&#39;sub_&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$calcval</span><span class="hl opt">;</span></li>
<li id="n_306" class="hl">    <span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl sng">&#39;calc_&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$calcval</span><span class="hl opt">;</span></li>
<li id="n_307" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_308" class="hl">      <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>text name<span class="hl opt">=</span><span class="hl kwb">$calcval </span>value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{</span><span class="hl ipl">$calcval</span><span class="hl sng">}&quot;</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_309" class="hl">      <span class="hl opt">&lt;</span>th<span class="hl opt">&gt;</span>X <span class="hl opt">${</span>curren<span class="hl opt">}${</span>unit<span class="hl opt">} = &lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_310" class="hl">      <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span><span class="hl sng">&quot;text&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$subval</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{</span><span class="hl ipl">$subval</span><span class="hl sng">}&quot;</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_311" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;|;</span></li>
<li id="n_312" class="hl">  <span class="hl opt">}</span></li>
<li id="n_313" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_314" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_315" class="hl">    <span class="hl opt">&lt;</span>th<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Subtotal&quot;</span><span class="hl opt">).</span>qq<span class="hl opt">|:&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_316" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>text name<span class="hl opt">=</span>sub_sub value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{sub_sub}&quot;</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_317" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_318" class="hl">  <span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_319" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>button name<span class="hl opt">=</span>calculate <span class="hl kwa">class</span><span class="hl opt">=</span>submit onClick<span class="hl opt">=</span><span class="hl sng">&quot;custom_calc_total()&quot;</span> </li>
<li id="n_320" class="hl">   value<span class="hl opt">=</span><span class="hl sng">&#39;|.</span><span class="hl ipl">$locale</span><span class="hl sng">-&gt;text(&#39;</span>Calculate<span class="hl sng">&#39;).qq|&#39;</span><span class="hl opt">&gt;</span></li>
<li id="n_321" class="hl"><span class="hl opt">|;</span></li>
<li id="n_322" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|&lt;/</span>table<span class="hl opt">&gt;&lt;</span>button type<span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;action&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;close_till&quot;</span><span class="hl opt">&gt;|.</span></li>
<li id="n_323" class="hl">        <span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Close Till&quot;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>button<span class="hl opt">&gt;|;</span></li>
<li id="n_324" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_325" class="hl"><span class="hl opt">&lt;/</span>form<span class="hl opt">&gt;</span></li>
<li id="n_326" class="hl"></li>
<li id="n_327" class="hl"><span class="hl opt">&lt;/</span>body<span class="hl opt">&gt;</span></li>
<li id="n_328" class="hl"><span class="hl opt">&lt;/</span>html<span class="hl opt">&gt;</span></li>
<li id="n_329" class="hl"><span class="hl opt">|;</span></li>
<li id="n_330" class="hl"><span class="hl opt">}</span></li>
<li id="n_331" class="hl"></li>
<li id="n_332" class="hl"></li>
<li id="n_333" class="hl"><span class="hl kwa">sub </span>close_till <span class="hl opt">{</span></li>
<li id="n_334" class="hl">  <span class="hl kwa">use </span>LedgerSMB<span class="hl opt">::</span>GL<span class="hl opt">;</span></li>
<li id="n_335" class="hl">  <span class="hl kwa">require </span><span class="hl sng">&#39;pos.conf.pl&#39;</span><span class="hl opt">;</span></li>
<li id="n_336" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">clear_till</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_337" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_338" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$expected </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_339" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$difference </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_340" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">$lines </span><span class="hl opt">= </span><span class="hl sng">&#39;&#39;</span><span class="hl opt">;</span></li>
<li id="n_341" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>rowcount<span class="hl opt">} = </span><span class="hl num">2</span><span class="hl opt">;</span></li>
<li id="n_342" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwb">$key </span><span class="hl opt">(</span><span class="hl kwc">keys </span><span class="hl kwb">%pos_sources</span><span class="hl opt">){</span></li>
<li id="n_343" class="hl">     <span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_344" class="hl">     <span class="hl kwb">$expected </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_345" class="hl">     <span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">parse_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&quot;amount_</span><span class="hl ipl">$key</span><span class="hl sng">&quot;</span><span class="hl opt">});</span></li>
<li id="n_346" class="hl">     <span class="hl kwb">$expected </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">parse_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&quot;expected_</span><span class="hl ipl">$key</span><span class="hl sng">&quot;</span><span class="hl opt">});</span></li>
<li id="n_347" class="hl">     <span class="hl kwb">$gl_entry </span><span class="hl opt">= </span><span class="hl sng">&quot;Closing Till </span><span class="hl ipl">$pos_config</span><span class="hl sng">{till} source = </span><span class="hl ipl">$key</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_348" class="hl">     <span class="hl kwb">$accno1 </span><span class="hl opt">= </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span>till_accno<span class="hl opt">};</span></li>
<li id="n_349" class="hl">     <span class="hl kwa">if </span><span class="hl opt">(${</span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;source_accno_override&#39;</span><span class="hl opt">}{</span><span class="hl kwb">$key</span><span class="hl opt">}}){</span></li>
<li id="n_350" class="hl">       <span class="hl kwb">$accno2 </span><span class="hl opt">= ${</span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;source_accno_override&#39;</span><span class="hl opt">}{</span><span class="hl kwb">$key</span><span class="hl opt">}};</span></li>
<li id="n_351" class="hl">     <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_352" class="hl">       <span class="hl kwb">$accno2 </span><span class="hl opt">= </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;close_cash_accno&#39;</span><span class="hl opt">};</span></li>
<li id="n_353" class="hl">     <span class="hl opt">}</span></li>
<li id="n_354" class="hl">     <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>reference<span class="hl opt">} = </span><span class="hl kwb">$gl_entry</span><span class="hl opt">;</span></li>
<li id="n_355" class="hl">     <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_1<span class="hl opt">} = </span><span class="hl kwb">$accno1</span><span class="hl opt">;</span></li>
<li id="n_356" class="hl">     <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>credit_1<span class="hl opt">} = </span><span class="hl kwb">$amount</span><span class="hl opt">;</span></li>
<li id="n_357" class="hl">     <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_2<span class="hl opt">} = </span><span class="hl kwb">$accno2</span><span class="hl opt">;</span></li>
<li id="n_358" class="hl">     <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>debit_2<span class="hl opt">} = </span><span class="hl kwb">$amount</span><span class="hl opt">;</span></li>
<li id="n_359" class="hl">     <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>transdate<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">current_date</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">);</span></li>
<li id="n_360" class="hl">     GL-<span class="hl opt">&gt;</span><span class="hl kwd">post_transaction</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_361" class="hl">     <span class="hl kwc">delete </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>id<span class="hl opt">};</span></li>
<li id="n_362" class="hl">     <span class="hl kwb">$error </span><span class="hl opt">= </span><span class="hl kwb">$amount </span><span class="hl opt">- </span><span class="hl kwb">$expected</span><span class="hl opt">;</span></li>
<li id="n_363" class="hl">     <span class="hl kwb">$difference </span><span class="hl opt">+= </span><span class="hl kwb">$error</span><span class="hl opt">;</span></li>
<li id="n_364" class="hl">     <span class="hl kwb">$lines </span><span class="hl opt">.= </span><span class="hl sng">&quot;Source: </span><span class="hl ipl">$key</span><span class="hl sng">, Amount: </span><span class="hl ipl">$amount</span><span class="hl sng"></span><span class="hl esc">\n</span><span class="hl sng">Expected: </span><span class="hl ipl">$expected</span><span class="hl sng">.  Error= </span><span class="hl ipl">$error</span><span class="hl sng"></span><span class="hl esc">\n\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_365" class="hl">  <span class="hl opt">}</span></li>
<li id="n_366" class="hl">  <span class="hl kwb">$gl_entry </span><span class="hl opt">= </span><span class="hl sng">&quot;Closing Till: </span><span class="hl ipl">$pos_config</span><span class="hl sng">{till} Over/Under&quot;</span><span class="hl opt">;</span></li>
<li id="n_367" class="hl">  <span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl kwb">$difference </span><span class="hl opt">* -</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_368" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>reference<span class="hl opt">} = </span><span class="hl kwb">$gl_entry</span><span class="hl opt">;</span></li>
<li id="n_369" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_1<span class="hl opt">} = </span><span class="hl kwb">$accno1</span><span class="hl opt">;</span></li>
<li id="n_370" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>credit_1<span class="hl opt">} = </span><span class="hl kwb">$amount</span><span class="hl opt">;</span></li>
<li id="n_371" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_2<span class="hl opt">} = </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span>coa_prefix<span class="hl opt">};</span></li>
<li id="n_372" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>debit_2<span class="hl opt">} = </span><span class="hl kwb">$amount</span><span class="hl opt">;</span></li>
<li id="n_373" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>transdate<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">current_date</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">);</span></li>
<li id="n_374" class="hl">  GL-<span class="hl opt">&gt;</span><span class="hl kwd">post_transaction</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_375" class="hl">  <span class="hl kwc">delete </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>id<span class="hl opt">};</span></li>
<li id="n_376" class="hl">  <span class="hl kwb">$lines </span><span class="hl opt">.= </span><span class="hl sng">&quot;Cumulative Error: </span><span class="hl ipl">$amount</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_377" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_1<span class="hl opt">};</span></li>
<li id="n_378" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">getbalance</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">); </span></li>
<li id="n_379" class="hl">  <span class="hl kwb">$amount </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>balance<span class="hl opt">} * -</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_380" class="hl">  <span class="hl kwb">$gl_entry </span><span class="hl opt">= </span><span class="hl sng">&quot;Resetting Till: </span><span class="hl ipl">$pos_config</span><span class="hl sng">{till}&quot;</span><span class="hl opt">;</span></li>
<li id="n_381" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>reference<span class="hl opt">} = </span><span class="hl kwb">$gl_entry</span><span class="hl opt">;</span></li>
<li id="n_382" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_1<span class="hl opt">} = </span><span class="hl kwb">$accno1</span><span class="hl opt">;</span></li>
<li id="n_383" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>credit_1<span class="hl opt">} = </span><span class="hl kwb">$amount</span><span class="hl opt">;</span></li>
<li id="n_384" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno_2<span class="hl opt">} = </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span>coa_prefix<span class="hl opt">};</span></li>
<li id="n_385" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>debit_2<span class="hl opt">} = </span><span class="hl kwb">$amount</span><span class="hl opt">;</span></li>
<li id="n_386" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>transdate<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">current_date</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">);</span></li>
<li id="n_387" class="hl">  GL-<span class="hl opt">&gt;</span><span class="hl kwd">post_transaction</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_388" class="hl">  <span class="hl kwc">delete </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>id<span class="hl opt">};</span></li>
<li id="n_389" class="hl"></li>
<li id="n_390" class="hl">  <span class="hl kwb">$head </span><span class="hl opt">= </span><span class="hl sng">&quot;Closing Till </span><span class="hl ipl">$pos_config</span><span class="hl sng">{till} for </span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{login}</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">.</span></li>
<li id="n_391" class="hl">    <span class="hl sng">&quot;Date: </span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{transdate}</span><span class="hl esc">\n\n\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_392" class="hl">  <span class="hl kwc">my </span><span class="hl kwb">&#64;cashlines </span><span class="hl opt">= [</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Cash Breakdown:&quot;</span><span class="hl opt">)];</span></li>
<li id="n_393" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$unit </span><span class="hl opt">(&#64;{</span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;breakdown&#39;</span><span class="hl opt">}}) {</span></li>
<li id="n_394" class="hl">    <span class="hl slc"># XXX Needs to take into account currencies that don&#39;t use 2 dp</span></li>
<li id="n_395" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$parsed </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">parse_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%pos_config</span><span class="hl opt">, </span><span class="hl kwb">$unit</span><span class="hl opt">);</span></li>
<li id="n_396" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl kwb">$parsed</span><span class="hl opt">;</span></li>
<li id="n_397" class="hl">    <span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl kwc">sprintf</span><span class="hl opt">(</span><span class="hl sng">&#39;</span><span class="hl ipl">%03d</span><span class="hl sng">&#39;</span><span class="hl opt">, </span><span class="hl kwb">$calcval </span><span class="hl opt">* </span><span class="hl num">100</span><span class="hl opt">) </span><span class="hl kwa">if </span><span class="hl kwb">$calcval </span><span class="hl opt">&lt; </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_398" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$subval </span><span class="hl opt">= </span><span class="hl sng">&#39;sub_&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$calcval</span><span class="hl opt">;</span></li>
<li id="n_399" class="hl">    <span class="hl kwb">$calcval </span><span class="hl opt">= </span><span class="hl sng">&#39;calc_&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$calcval</span><span class="hl opt">;</span></li>
<li id="n_400" class="hl">    <span class="hl kwc">push </span><span class="hl kwb">&#64;cashlines</span><span class="hl opt">, </span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{</span><span class="hl ipl">$calcval</span><span class="hl sng">} x </span><span class="hl ipl">$parseval </span><span class="hl sng">= </span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{</span><span class="hl ipl">$subval</span><span class="hl sng">}&quot;</span><span class="hl opt">;</span></li>
<li id="n_401" class="hl">  <span class="hl opt">}</span></li>
<li id="n_402" class="hl">  <span class="hl kwc">push </span><span class="hl kwb">&#64;cashlines</span><span class="hl opt">, </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Total Cash in Drawer: [_1]&quot;</span><span class="hl opt">, </span></li>
<li id="n_403" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>sub_sub<span class="hl opt">});</span></li>
<li id="n_404" class="hl">  <span class="hl kwc">push </span><span class="hl kwb">&#64;cashlines</span><span class="hl opt">, </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Less Cash in Till At Start: [_1]&quot;</span><span class="hl opt">, </span></li>
<li id="n_405" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>till_cash<span class="hl opt">});</span></li>
<li id="n_406" class="hl">  <span class="hl kwc">push </span><span class="hl kwb">&#64;cashlines</span><span class="hl opt">, </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_407" class="hl">  <span class="hl kwb">$cash </span><span class="hl opt">= </span><span class="hl kwc">join </span><span class="hl opt">(</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">, </span><span class="hl kwb">&#64;cashlines</span><span class="hl opt">);</span></li>
<li id="n_408" class="hl">  <span class="hl kwb">$foot </span><span class="hl opt">= </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Cumulative Error: [_1]&quot;</span><span class="hl opt">, </span><span class="hl kwb">$difference</span><span class="hl opt">).</span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_409" class="hl">  <span class="hl kwb">$foot </span><span class="hl opt">.= </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Reset Till By [_1]&#39;</span><span class="hl opt">, </span><span class="hl kwb">$amount</span><span class="hl opt">).</span><span class="hl sng">&quot;</span><span class="hl esc">\n\n\n\n\n\n\n\n\n\n</span><span class="hl sng">&quot;</span><span class="hl opt">;</span></li>
<li id="n_410" class="hl">  <span class="hl kwc">open </span><span class="hl opt">(</span>PRN<span class="hl opt">, </span><span class="hl sng">&quot;|-&quot;</span><span class="hl opt">,  ${</span>LedgerSMB<span class="hl opt">::</span>Sysconfig<span class="hl opt">::</span>printer<span class="hl opt">}{</span>Printer<span class="hl opt">});</span></li>
<li id="n_411" class="hl">  <span class="hl kwc">print </span>PRN <span class="hl kwb">$head</span><span class="hl opt">;</span></li>
<li id="n_412" class="hl">  <span class="hl kwc">print </span>PRN <span class="hl kwb">$lines</span><span class="hl opt">;</span></li>
<li id="n_413" class="hl">  <span class="hl kwc">print </span>PRN <span class="hl kwb">$cash</span><span class="hl opt">;</span></li>
<li id="n_414" class="hl">  <span class="hl kwc">print </span>PRN <span class="hl kwb">$cash</span><span class="hl opt">;</span></li>
<li id="n_415" class="hl">  <span class="hl kwc">print </span>PRN <span class="hl kwb">$foot</span><span class="hl opt">;</span></li>
<li id="n_416" class="hl">  <span class="hl kwc">close </span>PRN<span class="hl opt">;</span></li>
<li id="n_417" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$difference </span><span class="hl opt">&gt; </span><span class="hl num">0</span><span class="hl opt">){</span></li>
<li id="n_418" class="hl">    <span class="hl kwb">$message </span><span class="hl opt">= </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;You are over by [_1]&quot;</span><span class="hl opt">, </span><span class="hl kwb">$difference</span><span class="hl opt">);</span></li>
<li id="n_419" class="hl">  <span class="hl opt">} </span><span class="hl kwa">elsif </span><span class="hl opt">(</span><span class="hl kwb">$difference </span><span class="hl opt">&lt; </span><span class="hl num">0</span><span class="hl opt">){</span></li>
<li id="n_420" class="hl">    <span class="hl kwb">$message </span><span class="hl opt">= </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;You are under by [_1]&quot;</span><span class="hl opt">, </span><span class="hl kwb">$difference </span><span class="hl opt">* -</span><span class="hl num">1</span><span class="hl opt">);</span></li>
<li id="n_421" class="hl">  <span class="hl opt">}</span></li>
<li id="n_422" class="hl">  <span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_423" class="hl">    <span class="hl kwb">$message </span><span class="hl opt">= </span><span class="hl kwb">$local</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&quot;Congratulations!  Your till is exactly balanced.&quot;</span><span class="hl opt">);</span></li>
<li id="n_424" class="hl">  <span class="hl opt">}</span></li>
<li id="n_425" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">info</span><span class="hl opt">(</span><span class="hl kwb">$message</span><span class="hl opt">);</span></li>
<li id="n_426" class="hl"><span class="hl opt">}</span></li>
<li id="n_427" class="hl"></li>
<li id="n_428" class="hl"><span class="hl kwa">sub </span>get_payments <span class="hl opt">{</span></li>
<li id="n_429" class="hl"></li>
<li id="n_430" class="hl">  <span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno<span class="hl opt">}, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>account<span class="hl opt">}) = </span><span class="hl kwc">split </span><span class="hl kwd">/--/</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno<span class="hl opt">};</span></li>
<li id="n_431" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;pos&#39;</span><span class="hl opt">}){</span></li>
<li id="n_432" class="hl">    <span class="hl kwa">require </span><span class="hl sng">&quot;pos.conf.pl&quot;</span><span class="hl opt">;</span></li>
<li id="n_433" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fromdate<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">current_date</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">);</span></li>
<li id="n_434" class="hl">    <span class="hl kwa">unless </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>source<span class="hl opt">}){</span></li>
<li id="n_435" class="hl">      <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>source<span class="hl opt">} = (</span><span class="hl kwc">sort keys</span><span class="hl opt">(</span><span class="hl kwb">%pos_sources</span><span class="hl opt">))[</span><span class="hl num">0</span><span class="hl opt">];</span></li>
<li id="n_436" class="hl">    <span class="hl opt">}</span></li>
<li id="n_437" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>source<span class="hl opt">} </span><span class="hl kwc">eq </span><span class="hl sng">&#39;cash&#39;</span><span class="hl opt">){</span></li>
<li id="n_438" class="hl">      <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>summary<span class="hl opt">} = </span><span class="hl sng">&quot;true&quot;</span><span class="hl opt">;</span></li>
<li id="n_439" class="hl">    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_440" class="hl">      <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>summary<span class="hl opt">} = </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_441" class="hl">    <span class="hl opt">}</span></li>
<li id="n_442" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>accno<span class="hl opt">} = </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;coa_prefix&#39;</span><span class="hl opt">} . </span><span class="hl sng">&quot;.&quot;</span> <span class="hl opt">. </span><span class="hl kwb">$pos_config</span><span class="hl opt">{</span><span class="hl sng">&#39;till&#39;</span><span class="hl opt">};   </span></li>
<li id="n_443" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>account<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>source<span class="hl opt">};</span></li>
<li id="n_444" class="hl">  <span class="hl opt">}</span></li>
<li id="n_445" class="hl"></li>
<li id="n_446" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">payment_transactions</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_447" class="hl">  </li>
<li id="n_448" class="hl">  <span class="hl kwb">$ml </span><span class="hl opt">= (</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>category<span class="hl opt">} </span><span class="hl kwc">eq </span><span class="hl sng">&#39;A&#39;</span><span class="hl opt">) ? -</span><span class="hl num">1 </span><span class="hl opt">: </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_449" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>endingbalance<span class="hl opt">} * </span><span class="hl kwb">$ml</span><span class="hl opt">;</span></li>
<li id="n_450" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(! </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fx_transaction<span class="hl opt">}) {</span></li>
<li id="n_451" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">} = (</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>endingbalance<span class="hl opt">} - </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fx_endingbalance<span class="hl opt">}) * </span><span class="hl kwb">$ml</span><span class="hl opt">;</span></li>
<li id="n_452" class="hl">  <span class="hl opt">}</span></li>
<li id="n_453" class="hl">  </li>
<li id="n_454" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">}, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_455" class="hl">  </li>
<li id="n_456" class="hl">  <span class="hl opt">&amp;</span>display_form<span class="hl opt">;</span></li>
<li id="n_457" class="hl"></li>
<li id="n_458" class="hl"><span class="hl opt">}</span></li>
<li id="n_459" class="hl"></li>
<li id="n_460" class="hl"></li>
<li id="n_461" class="hl"><span class="hl kwa">sub </span>display_form <span class="hl opt">{</span></li>
<li id="n_462" class="hl">  </li>
<li id="n_463" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>report<span class="hl opt">}) {</span></li>
<li id="n_464" class="hl">    <span class="hl kwb">&#64;column_index </span><span class="hl opt">= </span><span class="hl sng">qw(transdate source name cleared debit credit)</span><span class="hl opt">;</span></li>
<li id="n_465" class="hl">  <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_466" class="hl">    <span class="hl kwb">&#64;column_index </span><span class="hl opt">= </span><span class="hl sng">qw(transdate source name cleared debit credit balance)</span><span class="hl opt">;</span></li>
<li id="n_467" class="hl">  <span class="hl opt">}</span></li>
<li id="n_468" class="hl">  </li>
<li id="n_469" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>cleared<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>th<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;R&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>th<span class="hl opt">&gt;|;</span></li>
<li id="n_470" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>source<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Source&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/a&gt;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_471" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>name<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Description&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/a&gt;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_472" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>transdate<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Date&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/a&gt;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_473" class="hl"></li>
<li id="n_474" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>debit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Debit&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/a&gt;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_475" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>credit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Credit&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/a&gt;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_476" class="hl">  <span class="hl kwb">$column_header</span><span class="hl opt">{</span>balance<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listheading&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Balance&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/a&gt;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_477" class="hl"></li>
<li id="n_478" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fromdate<span class="hl opt">}) {</span></li>
<li id="n_479" class="hl">    <span class="hl kwb">$option </span><span class="hl opt">.= </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&lt;br&gt;&quot;</span> <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$option</span><span class="hl opt">);</span></li>
<li id="n_480" class="hl">    <span class="hl kwb">$option </span><span class="hl opt">.= </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;From&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&amp;nbsp;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">date</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fromdate<span class="hl opt">}, </span><span class="hl num">1</span><span class="hl opt">);</span></li>
<li id="n_481" class="hl">  <span class="hl opt">}</span></li>
<li id="n_482" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>todate<span class="hl opt">}) {</span></li>
<li id="n_483" class="hl">    <span class="hl kwb">$option </span><span class="hl opt">.= </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng">&lt;br&gt;&quot;</span> <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$option</span><span class="hl opt">);</span></li>
<li id="n_484" class="hl">    <span class="hl kwb">$option </span><span class="hl opt">.= </span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;To&#39;</span><span class="hl opt">).</span><span class="hl sng">&quot;&amp;nbsp;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">date</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>todate<span class="hl opt">}, </span><span class="hl num">1</span><span class="hl opt">);</span></li>
<li id="n_485" class="hl">  <span class="hl opt">}</span></li>
<li id="n_486" class="hl"></li>
<li id="n_487" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">} = </span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{accno}--</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{account}&quot;</span><span class="hl opt">;</span></li>
<li id="n_488" class="hl">  </li>
<li id="n_489" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">header</span><span class="hl opt">;</span></li>
<li id="n_490" class="hl"></li>
<li id="n_491" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_492" class="hl"><span class="hl opt">&lt;</span>body<span class="hl opt">&gt;</span></li>
<li id="n_493" class="hl"></li>
<li id="n_494" class="hl"><span class="hl opt">&lt;</span>form <span class="hl kwa">method</span><span class="hl opt">=</span>post action<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>script<span class="hl opt">}&gt;</span></li>
<li id="n_495" class="hl"></li>
<li id="n_496" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>source value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{source}&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_497" class="hl"><span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>cumulative_error value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{cumulative_error}&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_498" class="hl"><span class="hl opt">&lt;</span>table width<span class="hl opt">=</span><span class="hl num">100</span><span class="hl opt">%&gt;</span></li>
<li id="n_499" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_500" class="hl">    <span class="hl opt">&lt;</span>th <span class="hl kwa">class</span><span class="hl opt">=</span>listtop<span class="hl opt">&gt;</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>title<span class="hl opt">}&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_501" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_502" class="hl">  <span class="hl opt">&lt;</span>tr height<span class="hl opt">=</span><span class="hl sng">&quot;5&quot;</span><span class="hl opt">&gt;&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_503" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_504" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;</span><span class="hl kwb">$option</span><span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_505" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_506" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_507" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;</span></li>
<li id="n_508" class="hl">      <span class="hl opt">&lt;</span>table width<span class="hl opt">=</span><span class="hl num">100</span><span class="hl opt">%&gt;</span></li>
<li id="n_509" class="hl">    <span class="hl opt">&lt;</span>tr <span class="hl kwa">class</span><span class="hl opt">=</span>listheading<span class="hl opt">&gt;</span></li>
<li id="n_510" class="hl"><span class="hl opt">|;</span></li>
<li id="n_511" class="hl"></li>
<li id="n_512" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl kwb">&#64;column_index</span><span class="hl opt">) { </span><span class="hl kwc">print </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng"></span><span class="hl ipl">$column_header</span><span class="hl sng">{</span><span class="hl ipl">$_</span><span class="hl sng">}&quot;</span> <span class="hl opt">}</span></li>
<li id="n_513" class="hl"></li>
<li id="n_514" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_515" class="hl">        <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_516" class="hl"><span class="hl opt">|;</span></li>
<li id="n_517" class="hl"></li>
<li id="n_518" class="hl">  <span class="hl kwb">$ml </span><span class="hl opt">= (</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>category<span class="hl opt">} </span><span class="hl kwc">eq </span><span class="hl sng">&#39;A&#39;</span><span class="hl opt">) ? -</span><span class="hl num">1 </span><span class="hl opt">: </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_519" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>beginningbalance<span class="hl opt">} *= </span><span class="hl kwb">$ml</span><span class="hl opt">;</span></li>
<li id="n_520" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fx_balance<span class="hl opt">} *= </span><span class="hl kwb">$ml</span><span class="hl opt">;</span></li>
<li id="n_521" class="hl">  </li>
<li id="n_522" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(! </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fx_transaction<span class="hl opt">}) {</span></li>
<li id="n_523" class="hl">    <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>beginningbalance<span class="hl opt">} -= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fx_balance<span class="hl opt">};</span></li>
<li id="n_524" class="hl">  <span class="hl opt">}</span></li>
<li id="n_525" class="hl">  <span class="hl kwb">$balance </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>beginningbalance<span class="hl opt">};</span></li>
<li id="n_526" class="hl">  </li>
<li id="n_527" class="hl">  <span class="hl kwb">$i </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_528" class="hl">  <span class="hl kwb">$j </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_529" class="hl">  </li>
<li id="n_530" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl sng">qw(cleared transdate source debit credit)</span><span class="hl opt">) { </span><span class="hl kwb">$column_data</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&quot;</span> <span class="hl opt">}</span></li>
<li id="n_531" class="hl"></li>
<li id="n_532" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(! </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>report<span class="hl opt">}) {</span></li>
<li id="n_533" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>name<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Beginning Balance&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>td<span class="hl opt">&gt;|;</span></li>
<li id="n_534" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>balance<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td align=right&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$balance</span><span class="hl opt">, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl num">0</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_535" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_536" class="hl">    <span class="hl opt">&lt;</span>tr <span class="hl kwa">class</span><span class="hl opt">=</span>listrow<span class="hl kwb">$j</span><span class="hl opt">&gt;</span></li>
<li id="n_537" class="hl"><span class="hl opt">|;</span></li>
<li id="n_538" class="hl"></li>
<li id="n_539" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl kwb">&#64;column_index</span><span class="hl opt">) { </span><span class="hl kwc">print </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng"></span><span class="hl ipl">$column_data</span><span class="hl sng">{</span><span class="hl ipl">$_</span><span class="hl sng">}&quot;</span> <span class="hl opt">}</span></li>
<li id="n_540" class="hl"></li>
<li id="n_541" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_542" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_543" class="hl"><span class="hl opt">|;</span></li>
<li id="n_544" class="hl">  <span class="hl opt">}</span></li>
<li id="n_545" class="hl"></li>
<li id="n_546" class="hl"></li>
<li id="n_547" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwb">$ref </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>PR<span class="hl opt">} }) {</span></li>
<li id="n_548" class="hl"></li>
<li id="n_549" class="hl">    <span class="hl kwb">$i++</span><span class="hl opt">;</span></li>
<li id="n_550" class="hl"></li>
<li id="n_551" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(! </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>fx_transaction<span class="hl opt">}) {</span></li>
<li id="n_552" class="hl">      <span class="hl kwa">next if </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>fx_transaction<span class="hl opt">};</span></li>
<li id="n_553" class="hl">    <span class="hl opt">}</span></li>
<li id="n_554" class="hl"></li>
<li id="n_555" class="hl">    <span class="hl kwb">$checked </span><span class="hl opt">= (</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>cleared<span class="hl opt">}) ? </span><span class="hl sng">&quot;checked&quot;</span> <span class="hl opt">: </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_556" class="hl">    </li>
<li id="n_557" class="hl">    <span class="hl kwb">%temp </span><span class="hl opt">= ();</span></li>
<li id="n_558" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(!</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>fx_transaction<span class="hl opt">}) {</span></li>
<li id="n_559" class="hl">      <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl sng">qw(name source transdate)</span><span class="hl opt">) { </span><span class="hl kwb">$temp</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} = </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl kwb">$_</span><span class="hl opt">} }</span></li>
<li id="n_560" class="hl">    <span class="hl opt">}</span></li>
<li id="n_561" class="hl">      </li>
<li id="n_562" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>name<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_563" class="hl">    <span class="hl kwa">for </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$temp</span><span class="hl opt">{</span>name<span class="hl opt">} }) { </span><span class="hl kwb">$column_data</span><span class="hl opt">{</span>name<span class="hl opt">} .= </span><span class="hl sng">&quot;</span><span class="hl ipl">$_</span><span class="hl sng">&lt;br&gt;&quot;</span> <span class="hl opt">}</span></li>
<li id="n_564" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>name<span class="hl opt">} .= </span><span class="hl sng">&quot;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_565" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>source<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td<span class="hl opt">&gt;</span><span class="hl kwb">$temp</span><span class="hl opt">{</span>source<span class="hl opt">}&amp;</span>nbsp<span class="hl opt">;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_566" class="hl">    <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;id_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>id<span class="hl opt">}&gt;|;</span></li>
<li id="n_567" class="hl">    </li>
<li id="n_568" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>debit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_569" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>credit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_570" class="hl">    </li>
<li id="n_571" class="hl">    <span class="hl kwb">$balance </span><span class="hl opt">+= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * </span><span class="hl kwb">$ml</span><span class="hl opt">;</span></li>
<li id="n_572" class="hl"></li>
<li id="n_573" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} &lt; </span><span class="hl num">0</span><span class="hl opt">) {</span></li>
<li id="n_574" class="hl">      </li>
<li id="n_575" class="hl">      <span class="hl kwb">$totaldebits </span><span class="hl opt">+= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * -</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_576" class="hl"></li>
<li id="n_577" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>debit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td align=right&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * -</span><span class="hl num">1</span><span class="hl opt">, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl sng">&quot;&amp;nbsp;&quot;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_578" class="hl">      </li>
<li id="n_579" class="hl">    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_580" class="hl">      </li>
<li id="n_581" class="hl">      <span class="hl kwb">$totalcredits </span><span class="hl opt">+= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">};</span></li>
<li id="n_582" class="hl"></li>
<li id="n_583" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>credit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td align=right&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">}, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl sng">&quot;&amp;nbsp;&quot;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_584" class="hl">      </li>
<li id="n_585" class="hl">    <span class="hl opt">}</span></li>
<li id="n_586" class="hl">    </li>
<li id="n_587" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>balance<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td align=right&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$balance</span><span class="hl opt">, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl num">0</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/td&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_588" class="hl"></li>
<li id="n_589" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>fx_transaction<span class="hl opt">}) {</span></li>
<li id="n_590" class="hl"></li>
<li id="n_591" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>cleared<span class="hl opt">} = (</span><span class="hl kwb">$clearfx</span><span class="hl opt">) ? </span>qq<span class="hl opt">|&lt;</span>td align<span class="hl opt">=</span>center<span class="hl opt">&gt;*&lt;</span><span class="hl kwd">/td&gt;| : qq|&lt;td&gt;&amp;nbsp;&lt;/</span>td<span class="hl opt">&gt;|;</span></li>
<li id="n_592" class="hl">      <span class="hl kwb">$cleared </span><span class="hl opt">+= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * </span><span class="hl kwb">$ml </span><span class="hl kwa">if </span><span class="hl kwb">$clearfx</span><span class="hl opt">;</span></li>
<li id="n_593" class="hl">      </li>
<li id="n_594" class="hl">    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_595" class="hl">      </li>
<li id="n_596" class="hl">      <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>report<span class="hl opt">}) {</span></li>
<li id="n_597" class="hl">    </li>
<li id="n_598" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>cleared<span class="hl opt">}) {</span></li>
<li id="n_599" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>cleared<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td align<span class="hl opt">=</span>center<span class="hl opt">&gt;*&lt;/</span>td<span class="hl opt">&gt;|;</span></li>
<li id="n_600" class="hl">      <span class="hl kwb">$clearfx </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_601" class="hl">    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_602" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>cleared<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td<span class="hl opt">&gt;&amp;</span>nbsp<span class="hl opt">;&lt;/</span>td<span class="hl opt">&gt;|;</span></li>
<li id="n_603" class="hl">      <span class="hl kwb">$clearfx </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_604" class="hl">    <span class="hl opt">}</span></li>
<li id="n_605" class="hl">    </li>
<li id="n_606" class="hl">      <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_607" class="hl"></li>
<li id="n_608" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>oldcleared<span class="hl opt">}) {</span></li>
<li id="n_609" class="hl">      <span class="hl kwb">$cleared </span><span class="hl opt">+= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * </span><span class="hl kwb">$ml</span><span class="hl opt">;</span></li>
<li id="n_610" class="hl">      <span class="hl kwb">$clearfx </span><span class="hl opt">= </span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_611" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>cleared<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td align<span class="hl opt">=</span>center<span class="hl opt">&gt;*&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_612" class="hl">      <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;cleared_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>cleared<span class="hl opt">}&gt;</span></li>
<li id="n_613" class="hl">      <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;oldcleared_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>oldcleared<span class="hl opt">}&gt;</span></li>
<li id="n_614" class="hl">      <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;source_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$ref</span><span class="hl sng">-&gt;{source}&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_615" class="hl">          <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;amount_</span><span class="hl ipl">$1</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$ref</span><span class="hl sng">-&gt;{amount}&quot;</span><span class="hl opt">&gt;|;</span></li>
<li id="n_616" class="hl">    <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_617" class="hl">      <span class="hl kwb">$cleared </span><span class="hl opt">+= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>amount<span class="hl opt">} * </span><span class="hl kwb">$ml </span><span class="hl kwa">if </span><span class="hl kwb">$checked</span><span class="hl opt">;</span></li>
<li id="n_618" class="hl">      <span class="hl kwb">$clearfx </span><span class="hl opt">= (</span><span class="hl kwb">$checked</span><span class="hl opt">) ? </span><span class="hl num">1 </span><span class="hl opt">: </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_619" class="hl">      <span class="hl kwb">$column_data</span><span class="hl opt">{</span>cleared<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td align<span class="hl opt">=</span>center<span class="hl opt">&gt;&lt;</span>input name<span class="hl opt">=</span><span class="hl sng">&quot;cleared_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> type<span class="hl opt">=</span>checkbox <span class="hl kwa">class</span><span class="hl opt">=</span>checkbox value<span class="hl opt">=</span><span class="hl num">1 </span><span class="hl kwb">$checked</span><span class="hl opt">&gt;</span></li>
<li id="n_620" class="hl">      <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;source_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$ref</span><span class="hl sng">-&gt;{source}&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_621" class="hl">          <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;amount_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;</span><span class="hl ipl">$ref</span><span class="hl sng">-&gt;{amount}&quot;</span><span class="hl opt">&gt;</span></li>
<li id="n_622" class="hl">          <span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;|;</span></li>
<li id="n_623" class="hl">    <span class="hl opt">}</span></li>
<li id="n_624" class="hl">    </li>
<li id="n_625" class="hl">      <span class="hl opt">}</span></li>
<li id="n_626" class="hl">    <span class="hl opt">}</span></li>
<li id="n_627" class="hl">    </li>
<li id="n_628" class="hl">    <span class="hl kwb">$column_data</span><span class="hl opt">{</span>transdate<span class="hl opt">} = </span>qq<span class="hl opt">|&lt;</span>td<span class="hl opt">&gt;</span><span class="hl kwb">$temp</span><span class="hl opt">{</span>transdate<span class="hl opt">}&amp;</span>nbsp<span class="hl opt">;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_629" class="hl">    <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl sng">&quot;transdate_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span> value<span class="hl opt">=</span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>transdate<span class="hl opt">}&gt;|;</span></li>
<li id="n_630" class="hl"></li>
<li id="n_631" class="hl">    <span class="hl kwb">$j++</span><span class="hl opt">; </span><span class="hl kwb">$j </span><span class="hl opt">%= </span><span class="hl num">2</span><span class="hl opt">;</span></li>
<li id="n_632" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_633" class="hl">    <span class="hl opt">&lt;</span>tr <span class="hl kwa">class</span><span class="hl opt">=</span>listrow<span class="hl kwb">$j</span><span class="hl opt">&gt;</span></li>
<li id="n_634" class="hl"><span class="hl opt">|;</span></li>
<li id="n_635" class="hl"></li>
<li id="n_636" class="hl">    <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl kwb">&#64;column_index</span><span class="hl opt">) { </span><span class="hl kwc">print </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng"></span><span class="hl ipl">$column_data</span><span class="hl sng">{</span><span class="hl ipl">$_</span><span class="hl sng">}&quot;</span> <span class="hl opt">}</span></li>
<li id="n_637" class="hl"></li>
<li id="n_638" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_639" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_640" class="hl"><span class="hl opt">|;</span></li>
<li id="n_641" class="hl"></li>
<li id="n_642" class="hl">  <span class="hl opt">}</span></li>
<li id="n_643" class="hl"></li>
<li id="n_644" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>rowcount<span class="hl opt">} = </span><span class="hl kwb">$i</span><span class="hl opt">;</span></li>
<li id="n_645" class="hl">  </li>
<li id="n_646" class="hl">  <span class="hl slc"># print totals</span></li>
<li id="n_647" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl kwb">&#64;column_index</span><span class="hl opt">) { </span><span class="hl kwb">$column_data</span><span class="hl opt">{</span><span class="hl kwb">$_</span><span class="hl opt">} = </span><span class="hl sng">&quot;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&quot;</span> <span class="hl opt">}</span></li>
<li id="n_648" class="hl"></li>
<li id="n_649" class="hl">  <span class="hl kwb">$column_data</span><span class="hl opt">{</span>debit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listtotal align=right&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$totaldebits</span><span class="hl opt">, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl sng">&quot;&amp;nbsp;&quot;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_650" class="hl">  <span class="hl kwb">$column_data</span><span class="hl opt">{</span>credit<span class="hl opt">} = </span><span class="hl sng">&quot;&lt;th class=listtotal align=right&gt;&quot;</span><span class="hl opt">.</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$totalcredits</span><span class="hl opt">, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl sng">&quot;&amp;nbsp;&quot;</span><span class="hl opt">).</span><span class="hl sng">&quot;&lt;/th&gt;&quot;</span><span class="hl opt">;</span></li>
<li id="n_651" class="hl">   </li>
<li id="n_652" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_653" class="hl">    <span class="hl opt">&lt;</span>tr <span class="hl kwa">class</span><span class="hl opt">=</span>listtotal<span class="hl opt">&gt;</span></li>
<li id="n_654" class="hl"><span class="hl opt">|;</span></li>
<li id="n_655" class="hl"></li>
<li id="n_656" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(</span><span class="hl kwb">&#64;column_index</span><span class="hl opt">) { </span><span class="hl kwc">print </span><span class="hl sng">&quot;</span><span class="hl esc">\n</span><span class="hl sng"></span><span class="hl ipl">$column_data</span><span class="hl sng">{</span><span class="hl ipl">$_</span><span class="hl sng">}&quot;</span> <span class="hl opt">}</span></li>
<li id="n_657" class="hl"> </li>
<li id="n_658" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">parse_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">});</span></li>
<li id="n_659" class="hl">  <span class="hl kwb">$difference </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>beginningbalance<span class="hl opt">} + </span><span class="hl kwb">$cleared </span><span class="hl opt">- </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">}, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_660" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>source<span class="hl opt">}){</span></li>
<li id="n_661" class="hl">    <span class="hl kwb">$difference </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_662" class="hl">  <span class="hl opt">}</span></li>
<li id="n_663" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">format_amount</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">}, </span><span class="hl num">2</span><span class="hl opt">, </span><span class="hl num">0</span><span class="hl opt">);</span></li>
<li id="n_664" class="hl"></li>
<li id="n_665" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_666" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_667" class="hl">      <span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_668" class="hl">    <span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_669" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_670" class="hl"><span class="hl opt">|;</span></li>
<li id="n_671" class="hl"></li>
<li id="n_672" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;pos&#39;</span><span class="hl opt">}){</span></li>
<li id="n_673" class="hl">     <span class="hl kwb">$close_next </span><span class="hl opt">= </span>qq<span class="hl opt">|&lt;</span>button type<span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> <span class="hl kwa">class</span><span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;action&quot;</span> </li>
<li id="n_674" class="hl">       value<span class="hl opt">=</span><span class="hl sng">&quot;close_next&quot;</span><span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Close Next&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>button<span class="hl opt">&gt;|;</span></li>
<li id="n_675" class="hl">     <span class="hl kwb">$done </span><span class="hl opt">= </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_676" class="hl">  <span class="hl opt">}</span></li>
<li id="n_677" class="hl">  <span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_678" class="hl">     <span class="hl kwb">$close_next </span><span class="hl opt">= </span><span class="hl sng">&quot;&quot;</span><span class="hl opt">;</span></li>
<li id="n_679" class="hl">     <span class="hl kwb">$done </span><span class="hl opt">= </span>qq<span class="hl opt">|&lt;</span>button type<span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> <span class="hl kwa">class</span><span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;action&quot;</span></li>
<li id="n_680" class="hl">       value<span class="hl opt">=</span><span class="hl sng">&quot;done&quot;</span><span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Done&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>button<span class="hl opt">&gt;|;</span></li>
<li id="n_681" class="hl">  <span class="hl opt">}</span></li>
<li id="n_682" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;pos&#39;</span><span class="hl opt">}){</span></li>
<li id="n_683" class="hl">    <span class="hl kwb">$difference </span><span class="hl opt">= </span>qq<span class="hl opt">|</span></li>
<li id="n_684" class="hl">              <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_685" class="hl">                 <span class="hl opt">&lt;</span>th align<span class="hl opt">=</span>right<span class="hl opt">&gt;&lt;</span><span class="hl kwc">select </span>name<span class="hl opt">=</span>over_under<span class="hl opt">&gt;</span></li>
<li id="n_686" class="hl">                     <span class="hl opt">&lt;</span>option value<span class="hl opt">=</span>under<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Under&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>option<span class="hl opt">&gt;</span></li>
<li id="n_687" class="hl">                     <span class="hl opt">&lt;</span>option value<span class="hl opt">=</span>over<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Over&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>option<span class="hl opt">&gt;</span></li>
<li id="n_688" class="hl">                   <span class="hl opt">&lt;/</span><span class="hl kwc">select</span><span class="hl opt">&gt;&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span><span class="hl kwc">pos </span>value<span class="hl opt">=</span><span class="hl sng">&#39;true&#39;</span><span class="hl opt">&gt;</span></li>
<li id="n_689" class="hl">                 <span class="hl opt">&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_690" class="hl">        <span class="hl opt">&lt;</span>td width<span class="hl opt">=</span><span class="hl num">10</span><span class="hl opt">%&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_691" class="hl">        <span class="hl opt">&lt;</span>td align<span class="hl opt">=</span>right<span class="hl opt">&gt;&lt;</span>input name<span class="hl opt">=</span>null size<span class="hl opt">=</span><span class="hl num">11 </span></li>
<li id="n_692" class="hl">                    value<span class="hl opt">=</span><span class="hl sng">&#39;|.</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{null2}.qq|&#39;</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_693" class="hl">        <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>difference </li>
<li id="n_694" class="hl">                     value<span class="hl opt">=</span><span class="hl kwb">$difference</span><span class="hl opt">&gt;</span></li>
<li id="n_695" class="hl">                </li>
<li id="n_696" class="hl">    <span class="hl opt">|;</span></li>
<li id="n_697" class="hl">    <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;over_under&#39;</span><span class="hl opt">}){</span></li>
<li id="n_698" class="hl">      <span class="hl kwb">$o_u </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;over_under&#39;</span><span class="hl opt">};</span></li>
<li id="n_699" class="hl">      <span class="hl kwb">$difference </span><span class="hl opt">=~ </span><span class="hl kwd">s/(value=$o_u)/SELECTED $1/g</span><span class="hl opt">;</span></li>
<li id="n_700" class="hl">    <span class="hl opt">}</span></li>
<li id="n_701" class="hl">  <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_702" class="hl">    <span class="hl kwb">$difference </span><span class="hl opt">= </span>qq<span class="hl opt">|</span></li>
<li id="n_703" class="hl">          <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_704" class="hl">        <span class="hl opt">&lt;</span>th align<span class="hl opt">=</span>right nowrap<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Difference&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_705" class="hl">                <span class="hl opt">&lt;</span>td width<span class="hl opt">=</span><span class="hl num">10</span><span class="hl opt">%&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_706" class="hl">        <span class="hl opt">&lt;</span>td align<span class="hl opt">=</span>right<span class="hl opt">&gt;&lt;</span>input name<span class="hl opt">=</span>null size<span class="hl opt">=</span><span class="hl num">11 </span>value<span class="hl opt">=</span><span class="hl kwb">$difference</span><span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_707" class="hl">        <span class="hl opt">&lt;</span>input type<span class="hl opt">=</span>hidden name<span class="hl opt">=</span>difference value<span class="hl opt">=</span><span class="hl kwb">$difference</span><span class="hl opt">&gt;</span></li>
<li id="n_708" class="hl">          <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;|;</span></li>
<li id="n_709" class="hl">  <span class="hl opt">}</span></li>
<li id="n_710" class="hl">   </li>
<li id="n_711" class="hl"> </li>
<li id="n_712" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>report<span class="hl opt">}) {</span></li>
<li id="n_713" class="hl"></li>
<li id="n_714" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_715" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_716" class="hl">  <span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_717" class="hl"><span class="hl opt">|;</span></li>
<li id="n_718" class="hl"></li>
<li id="n_719" class="hl">  <span class="hl opt">} </span><span class="hl kwa">else </span><span class="hl opt">{</span></li>
<li id="n_720" class="hl">    </li>
<li id="n_721" class="hl">    <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_722" class="hl">   </li>
<li id="n_723" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_724" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;</span></li>
<li id="n_725" class="hl">      <span class="hl opt">&lt;</span>table width<span class="hl opt">=</span><span class="hl num">100</span><span class="hl opt">%&gt;</span></li>
<li id="n_726" class="hl">        <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_727" class="hl">      <span class="hl opt">&lt;</span>td align<span class="hl opt">=</span>right<span class="hl opt">&gt;</span></li>
<li id="n_728" class="hl">        <span class="hl opt">&lt;</span>table<span class="hl opt">&gt;</span></li>
<li id="n_729" class="hl">          <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_730" class="hl">        <span class="hl opt">&lt;</span>th align<span class="hl opt">=</span>right nowrap<span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Statement Balance&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>th<span class="hl opt">&gt;</span></li>
<li id="n_731" class="hl">        <span class="hl opt">&lt;</span>td width<span class="hl opt">=</span><span class="hl num">10</span><span class="hl opt">%&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_732" class="hl">        <span class="hl opt">&lt;</span>td align<span class="hl opt">=</span>right<span class="hl opt">&gt;&lt;</span>input name<span class="hl opt">=</span>statementbalance size<span class="hl opt">=</span><span class="hl num">11 </span>value<span class="hl opt">=</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>statementbalance<span class="hl opt">}&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_733" class="hl">          <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_734" class="hl">        <span class="hl kwb">$difference</span></li>
<li id="n_735" class="hl">        <span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_736" class="hl">      <span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_737" class="hl">    <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_738" class="hl">      <span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_739" class="hl">    <span class="hl opt">&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_740" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_741" class="hl">  <span class="hl opt">&lt;</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_742" class="hl">    <span class="hl opt">&lt;</span>td<span class="hl opt">&gt;&lt;</span>hr size<span class="hl opt">=</span><span class="hl num">3 </span>noshade<span class="hl opt">&gt;&lt;/</span>td<span class="hl opt">&gt;</span></li>
<li id="n_743" class="hl">  <span class="hl opt">&lt;/</span>tr<span class="hl opt">&gt;</span></li>
<li id="n_744" class="hl"><span class="hl opt">&lt;/</span>table<span class="hl opt">&gt;</span></li>
<li id="n_745" class="hl"><span class="hl opt">|;</span></li>
<li id="n_746" class="hl"></li>
<li id="n_747" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">hide_form</span><span class="hl opt">(</span><span class="hl sng">qw(fx_transaction summary rowcount accno account fromdate todate path login sessionid)</span><span class="hl opt">);</span></li>
<li id="n_748" class="hl">  </li>
<li id="n_749" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_750" class="hl"><span class="hl opt">&lt;</span>br<span class="hl opt">&gt;</span></li>
<li id="n_751" class="hl"><span class="hl opt">&lt;</span>button type<span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> <span class="hl kwa">class</span><span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;action&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;update&quot;</span><span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Update&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>button<span class="hl opt">&gt;</span></li>
<li id="n_752" class="hl"><span class="hl opt">&lt;</span>button type<span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> <span class="hl kwa">class</span><span class="hl opt">=</span><span class="hl sng">&quot;submit&quot;</span> name<span class="hl opt">=</span><span class="hl sng">&quot;action&quot;</span> value<span class="hl opt">=</span><span class="hl sng">&quot;select_all&quot;</span><span class="hl opt">&gt;|.</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Select all&#39;</span><span class="hl opt">).</span>qq<span class="hl opt">|&lt;/</span>button<span class="hl opt">&gt;</span></li>
<li id="n_753" class="hl">    <span class="hl kwb">$done</span></li>
<li id="n_754" class="hl">    <span class="hl kwb">$close_next </span><span class="hl opt">|;</span></li>
<li id="n_755" class="hl">  <span class="hl opt">}</span></li>
<li id="n_756" class="hl"></li>
<li id="n_757" class="hl">  <span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>lynx<span class="hl opt">}) {</span></li>
<li id="n_758" class="hl">    <span class="hl kwa">require </span><span class="hl sng">&quot;bin/menu.pl&quot;</span><span class="hl opt">;</span></li>
<li id="n_759" class="hl">    <span class="hl opt">&amp;</span>menubar<span class="hl opt">;</span></li>
<li id="n_760" class="hl">  <span class="hl opt">}</span></li>
<li id="n_761" class="hl"></li>
<li id="n_762" class="hl">  <span class="hl kwc">print </span>qq<span class="hl opt">|</span></li>
<li id="n_763" class="hl"><span class="hl opt">&lt;/</span>form<span class="hl opt">&gt;</span></li>
<li id="n_764" class="hl"></li>
<li id="n_765" class="hl"><span class="hl opt">&lt;/</span>body<span class="hl opt">&gt;</span></li>
<li id="n_766" class="hl"><span class="hl opt">&lt;/</span>html<span class="hl opt">&gt;</span></li>
<li id="n_767" class="hl"><span class="hl opt">|;</span></li>
<li id="n_768" class="hl"></li>
<li id="n_769" class="hl"><span class="hl opt">}</span></li>
<li id="n_770" class="hl"></li>
<li id="n_771" class="hl"></li>
<li id="n_772" class="hl"><span class="hl kwa">sub </span>update <span class="hl opt">{</span></li>
<li id="n_773" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>null2<span class="hl opt">} = </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>null<span class="hl opt">};</span></li>
<li id="n_774" class="hl">  </li>
<li id="n_775" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">payment_transactions</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_776" class="hl"></li>
<li id="n_777" class="hl">  <span class="hl kwb">$i </span><span class="hl opt">= </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_778" class="hl">  <span class="hl kwa">foreach </span><span class="hl kwb">$ref </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>PR<span class="hl opt">} }) {</span></li>
<li id="n_779" class="hl">    <span class="hl kwb">$i++</span><span class="hl opt">;</span></li>
<li id="n_780" class="hl">    <span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span>cleared<span class="hl opt">} = (</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span><span class="hl sng">&quot;cleared_</span><span class="hl ipl">$i</span><span class="hl sng">&quot;</span><span class="hl opt">}) ? </span><span class="hl num">1 </span><span class="hl opt">: </span><span class="hl num">0</span><span class="hl opt">;</span></li>
<li id="n_781" class="hl">  <span class="hl opt">}</span></li>
<li id="n_782" class="hl"></li>
<li id="n_783" class="hl">  <span class="hl opt">&amp;</span>display_form<span class="hl opt">;</span></li>
<li id="n_784" class="hl">  </li>
<li id="n_785" class="hl"><span class="hl opt">}</span></li>
<li id="n_786" class="hl"></li>
<li id="n_787" class="hl"></li>
<li id="n_788" class="hl"><span class="hl kwa">sub </span>select_all <span class="hl opt">{</span></li>
<li id="n_789" class="hl">  </li>
<li id="n_790" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">payment_transactions</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_791" class="hl"></li>
<li id="n_792" class="hl">  <span class="hl kwa">for </span><span class="hl opt">(&#64;{ </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>PR<span class="hl opt">} }) { </span><span class="hl kwb">$_</span><span class="hl opt">-&gt;{</span>cleared<span class="hl opt">} = </span><span class="hl num">1 </span><span class="hl opt">}</span></li>
<li id="n_793" class="hl"></li>
<li id="n_794" class="hl">  <span class="hl opt">&amp;</span>display_form<span class="hl opt">;</span></li>
<li id="n_795" class="hl">  </li>
<li id="n_796" class="hl"><span class="hl opt">}</span></li>
<li id="n_797" class="hl"></li>
<li id="n_798" class="hl"></li>
<li id="n_799" class="hl"><span class="hl kwa">sub </span>done <span class="hl opt">{</span></li>
<li id="n_800" class="hl"></li>
<li id="n_801" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>callback<span class="hl opt">} = </span><span class="hl sng">&quot;</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{script}?path=</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{path}&amp;action=reconciliation&amp;login=</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{login}&amp;sessionid=</span><span class="hl ipl">$form</span><span class="hl sng">-&gt;{sessionid}&quot;</span><span class="hl opt">;</span></li>
<li id="n_802" class="hl"></li>
<li id="n_803" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">error</span><span class="hl opt">(</span><span class="hl kwb">$locale</span><span class="hl opt">-&gt;</span><span class="hl kwd">text</span><span class="hl opt">(</span><span class="hl sng">&#39;Out of balance!&#39;</span><span class="hl opt">)) </span><span class="hl kwa">if </span><span class="hl opt">(</span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>difference<span class="hl opt">} *= </span><span class="hl num">1</span><span class="hl opt">);</span></li>
<li id="n_804" class="hl"></li>
<li id="n_805" class="hl">  RC-<span class="hl opt">&gt;</span><span class="hl kwd">reconcile</span><span class="hl opt">(</span>\<span class="hl kwb">%myconfig</span><span class="hl opt">, </span>\<span class="hl kwb">%$form</span><span class="hl opt">);</span></li>
<li id="n_806" class="hl">  <span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">redirect</span><span class="hl opt">;</span></li>
<li id="n_807" class="hl">  </li>
<li id="n_808" class="hl"><span class="hl opt">}</span></li>
<li id="n_809" class="hl"></li>
<li id="n_810" class="hl"></li>
</ol></code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.46.0</a>) at 2025-06-26 12:11:54 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
