<!DOCTYPE html>
<html lang='en'>
<head>
<title>ledger-smb - 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/ledger-smb/atom/doc/faq.html?h=1.2.17+jones' type='application/atom+xml'/>
<link rel='vcs-git' href='https://source.jones.dk/ledger-smb' title='ledger-smb Git repository'/>
<link rel='vcs-git' href='user@source.jones.dk:ledger-smb' title='ledger-smb 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='/ledger-smb/'>ledger-smb</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='d4825424af514d766af2b815778c08d7930c68f6'/><select name='h' onchange='this.form.submit();'>
<option value='1.2.13+jones'>1.2.13+jones</option>
<option value='1.2.16+jones'>1.2.16+jones</option>
<option value='1.2.17+jones' selected='selected'>1.2.17+jones</option>
<option value='master'>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='/ledger-smb/?h=1.2.17%2bjones'>summary</a><a href='/ledger-smb/refs/?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>refs</a><a href='/ledger-smb/log/doc/faq.html?h=1.2.17%2bjones'>log</a><a href='/ledger-smb/tree/doc/faq.html?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>tree</a><a href='/ledger-smb/commit/doc/faq.html?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>commit</a><a class='active' href='/ledger-smb/diff/doc/faq.html?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>diff</a></td><td class='form'><form class='right' method='get' action='/ledger-smb/log/doc/faq.html'>
<input type='hidden' name='h' value='1.2.17+jones'/><input type='hidden' name='id' value='d4825424af514d766af2b815778c08d7930c68f6'/><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='/ledger-smb/diff/?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>root</a>/<a href='/ledger-smb/diff/doc?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>doc</a>/<a href='/ledger-smb/diff/doc/faq.html?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>faq.html</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='1.2.17+jones'/><input type='hidden' name='id' value='d4825424af514d766af2b815778c08d7930c68f6'/><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><div class='diffstat-header'><a href='/ledger-smb/diff/?h=1.2.17%2bjones&amp;id=d4825424af514d766af2b815778c08d7930c68f6'>Diffstat</a> (limited to 'doc/faq.html')</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-27 01:23:06 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
i>
<li id="n_20" class="hl"><span class="hl slc"># This package contains tax related functions:</span></li>
<li id="n_21" class="hl"><span class="hl slc">#</span></li>
<li id="n_22" class="hl"><span class="hl slc"># apply_taxes - applies taxes to the given subtotal</span></li>
<li id="n_23" class="hl"><span class="hl slc"># extract_taxes - extracts taxes from the given total</span></li>
<li id="n_24" class="hl"><span class="hl slc"># initialize_taxes - loads taxes from the database</span></li>
<li id="n_25" class="hl"><span class="hl slc"># calculate_taxes - calculates taxes</span></li>
<li id="n_26" class="hl"><span class="hl slc">#</span></li>
<li id="n_27" class="hl"><span class="hl slc">#====================================================================</span></li>
<li id="n_28" class="hl"><span class="hl kwa">package </span>Tax<span class="hl opt">;</span></li>
<li id="n_29" class="hl"></li>
<li id="n_30" class="hl"><span class="hl kwa">use </span>Math<span class="hl opt">::</span>BigFloat<span class="hl opt">;</span></li>
<li id="n_31" class="hl"></li>
<li id="n_32" class="hl"><span class="hl kwa">sub </span>init_taxes <span class="hl opt">{</span></li>
<li id="n_33" class="hl">    <span class="hl kwc">my </span><span class="hl opt">( </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$taxaccounts</span><span class="hl opt">, </span><span class="hl kwb">$taxaccounts2 </span><span class="hl opt">) = </span><span class="hl kwb">&#64;_</span><span class="hl opt">;</span></li>
<li id="n_34" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$dbh </span><span class="hl opt">= </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;{</span>dbh<span class="hl opt">};</span></li>
<li id="n_35" class="hl">    <span class="hl kwb">&#64;taxes </span><span class="hl opt">= ();</span></li>
<li id="n_36" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">&#64;accounts </span><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">$taxaccounts</span><span class="hl opt">;</span></li>
<li id="n_37" class="hl">    <span class="hl kwa">if </span><span class="hl opt">( </span><span class="hl kwc">defined </span><span class="hl kwb">$taxaccounts2 </span><span class="hl opt">) {</span></li>
<li id="n_38" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">&#64;tmpaccounts </span><span class="hl opt">= </span><span class="hl kwb">&#64;accounts</span><span class="hl opt">;</span></li>
<li id="n_39" class="hl">        <span class="hl kwb">$#accounts </span><span class="hl opt">= -</span><span class="hl num">1</span><span class="hl opt">;</span></li>
<li id="n_40" class="hl">        <span class="hl kwa">for </span><span class="hl kwc">my </span><span class="hl kwb">$acct </span><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">$taxaccounts2 </span><span class="hl opt">) {</span></li>
<li id="n_41" class="hl">            <span class="hl kwa">if </span><span class="hl opt">( </span><span class="hl kwb">$taxaccounts </span><span class="hl opt">=~ </span><span class="hl kwd">/\b$acct\b/ </span><span class="hl opt">) {</span></li>
<li id="n_42" class="hl">                <span class="hl kwc">push </span><span class="hl kwb">&#64;accounts</span><span class="hl opt">, </span><span class="hl kwb">$acct</span><span class="hl opt">;</span></li>
<li id="n_43" class="hl">            <span class="hl opt">}</span></li>
<li id="n_44" class="hl">        <span class="hl opt">}</span></li>
<li id="n_45" class="hl"></li>
<li id="n_46" class="hl">    <span class="hl opt">}</span></li>
<li id="n_47" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$query </span><span class="hl opt">= </span>qq<span class="hl opt">|</span>SELECT t<span class="hl opt">.</span>taxnumber<span class="hl opt">, </span>c<span class="hl opt">.</span>description<span class="hl opt">,</span></li>
<li id="n_48" class="hl">            t<span class="hl opt">.</span>rate<span class="hl opt">, </span>t<span class="hl opt">.</span>chart_id<span class="hl opt">, </span>t<span class="hl opt">.</span>pass<span class="hl opt">, </span>m<span class="hl opt">.</span>taxmodulename</li>
<li id="n_49" class="hl">            FROM tax t INNER JOIN chart c ON <span class="hl opt">(</span>t<span class="hl opt">.</span>chart_id <span class="hl opt">= </span>c<span class="hl opt">.</span>id<span class="hl opt">)</span></li>
<li id="n_50" class="hl">            INNER JOIN taxmodule m ON <span class="hl opt">(</span>t<span class="hl opt">.</span>taxmodule_id <span class="hl opt">= </span>m<span class="hl opt">.</span>taxmodule_id<span class="hl opt">)</span></li>
<li id="n_51" class="hl">            WHERE c<span class="hl opt">.</span>accno <span class="hl opt">= ?|;</span></li>
<li id="n_52" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$sth </span><span class="hl opt">= </span><span class="hl kwb">$dbh</span><span class="hl opt">-&gt;</span><span class="hl kwd">prepare</span><span class="hl opt">(</span><span class="hl kwb">$query</span><span class="hl opt">);</span></li>
<li id="n_53" class="hl">    <span class="hl kwa">foreach </span><span class="hl kwb">$taxaccount </span><span class="hl opt">(</span><span class="hl kwb">&#64;accounts</span><span class="hl opt">) {</span></li>
<li id="n_54" class="hl">        <span class="hl kwa">next if </span><span class="hl opt">( !</span><span class="hl kwc">defined </span><span class="hl kwb">$taxaccount </span><span class="hl opt">);</span></li>
<li id="n_55" class="hl">        <span class="hl kwa">if </span><span class="hl opt">( </span><span class="hl kwc">defined </span><span class="hl kwb">$taxaccounts2 </span><span class="hl opt">) {</span></li>
<li id="n_56" class="hl">            <span class="hl kwa">next if </span><span class="hl kwb">$taxaccounts2 </span><span class="hl opt">!~ </span><span class="hl kwd">/\b$taxaccount\b/</span><span class="hl opt">;</span></li>
<li id="n_57" class="hl">        <span class="hl opt">}</span></li>
<li id="n_58" class="hl">        <span class="hl kwb">$sth</span><span class="hl opt">-&gt;</span><span class="hl kwd">execute</span><span class="hl opt">(</span><span class="hl kwb">$taxaccount</span><span class="hl opt">) || </span><span class="hl kwb">$form</span><span class="hl opt">-&gt;</span><span class="hl kwd">dberror</span><span class="hl opt">(</span><span class="hl kwb">$query</span><span class="hl opt">);</span></li>
<li id="n_59" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$ref </span><span class="hl opt">= </span><span class="hl kwb">$sth</span><span class="hl opt">-&gt;</span><span class="hl kwd">fetchrow_hashref</span><span class="hl opt">;</span></li>
<li id="n_60" class="hl"></li>
<li id="n_61" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$module </span><span class="hl opt">= </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;taxmodulename&#39;</span><span class="hl opt">};</span></li>
<li id="n_62" class="hl">        <span class="hl kwa">require </span><span class="hl sng">&quot;LedgerSMB/Taxes/${module}.pm&quot;</span><span class="hl opt">;</span></li>
<li id="n_63" class="hl">        <span class="hl kwb">$module </span><span class="hl opt">=~ </span><span class="hl kwd">s/\//</span><span class="hl opt">::/</span>g<span class="hl opt">;</span></li>
<li id="n_64" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$tax </span><span class="hl opt">= ( </span><span class="hl kwc">eval </span><span class="hl sng">&#39;Taxes::&#39;</span> <span class="hl opt">. </span><span class="hl kwb">$module </span><span class="hl opt">)-&gt;</span><span class="hl kwd">new</span><span class="hl opt">();</span></li>
<li id="n_65" class="hl"></li>
<li id="n_66" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">pass</span><span class="hl opt">( </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;pass&#39;</span><span class="hl opt">} );</span></li>
<li id="n_67" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">account</span><span class="hl opt">(</span><span class="hl kwb">$taxaccount</span><span class="hl opt">);</span></li>
<li id="n_68" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">rate</span><span class="hl opt">( </span>Math<span class="hl opt">::</span>BigFloat-<span class="hl opt">&gt;</span><span class="hl kwd">new</span><span class="hl opt">( </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;rate&#39;</span><span class="hl opt">} ) );</span></li>
<li id="n_69" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">taxnumber</span><span class="hl opt">( </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;taxnumber&#39;</span><span class="hl opt">} );</span></li>
<li id="n_70" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">chart</span><span class="hl opt">( </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;chart&#39;</span><span class="hl opt">} );</span></li>
<li id="n_71" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">description</span><span class="hl opt">( </span><span class="hl kwb">$ref</span><span class="hl opt">-&gt;{</span><span class="hl sng">&#39;description&#39;</span><span class="hl opt">} );</span></li>
<li id="n_72" class="hl">        <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">value</span><span class="hl opt">( </span>Math<span class="hl opt">::</span>BigFloat-<span class="hl opt">&gt;</span><span class="hl kwd">bzero</span><span class="hl opt">() );</span></li>
<li id="n_73" class="hl"></li>
<li id="n_74" class="hl">        <span class="hl kwc">push </span><span class="hl kwb">&#64;taxes</span><span class="hl opt">, </span><span class="hl kwb">$tax</span><span class="hl opt">;</span></li>
<li id="n_75" class="hl">        <span class="hl kwb">$sth</span><span class="hl opt">-&gt;</span><span class="hl kwd">finish</span><span class="hl opt">;</span></li>
<li id="n_76" class="hl">    <span class="hl opt">}</span></li>
<li id="n_77" class="hl">    <span class="hl kwa">return </span><span class="hl kwb">&#64;taxes</span><span class="hl opt">;</span></li>
<li id="n_78" class="hl"><span class="hl opt">}</span></li>
<li id="n_79" class="hl"></li>
<li id="n_80" class="hl"><span class="hl kwa">sub </span>calculate_taxes <span class="hl opt">{</span></li>
<li id="n_81" class="hl">    <span class="hl kwc">my </span><span class="hl opt">( </span><span class="hl kwb">$taxes</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal</span><span class="hl opt">, </span><span class="hl kwb">$extract </span><span class="hl opt">) = </span><span class="hl kwb">&#64;_</span><span class="hl opt">;</span></li>
<li id="n_82" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">$total </span><span class="hl opt">= </span>Math<span class="hl opt">::</span>BigFloat-<span class="hl opt">&gt;</span><span class="hl kwd">bzero</span><span class="hl opt">();</span></li>
<li id="n_83" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">%passes</span><span class="hl opt">;</span></li>
<li id="n_84" class="hl">    <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$tax </span><span class="hl opt">(</span><span class="hl kwb">&#64;taxes</span><span class="hl opt">) {</span></li>
<li id="n_85" class="hl">        <span class="hl kwc">push </span><span class="hl opt">&#64;{ </span><span class="hl kwb">$passes</span><span class="hl opt">{ </span><span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">pass </span><span class="hl opt">} }, </span><span class="hl kwb">$tax</span><span class="hl opt">;</span></li>
<li id="n_86" class="hl">    <span class="hl opt">}</span></li>
<li id="n_87" class="hl">    <span class="hl kwc">my </span><span class="hl kwb">&#64;passkeys </span><span class="hl opt">= </span><span class="hl kwc">sort keys </span><span class="hl kwb">%passes</span><span class="hl opt">;</span></li>
<li id="n_88" class="hl">    <span class="hl kwb">&#64;passkeys </span><span class="hl opt">= </span><span class="hl kwc">reverse </span><span class="hl kwb">&#64;passkeys </span><span class="hl kwa">if </span><span class="hl kwb">$extract</span><span class="hl opt">;</span></li>
<li id="n_89" class="hl">    <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$pass </span><span class="hl opt">(</span><span class="hl kwb">&#64;passkeys</span><span class="hl opt">) {</span></li>
<li id="n_90" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$passrate  </span><span class="hl opt">= </span>Math<span class="hl opt">::</span>BigFloat-<span class="hl opt">&gt;</span><span class="hl kwd">bzero</span><span class="hl opt">();</span></li>
<li id="n_91" class="hl">        <span class="hl kwc">my </span><span class="hl kwb">$passtotal </span><span class="hl opt">= </span>Math<span class="hl opt">::</span>BigFloat-<span class="hl opt">&gt;</span><span class="hl kwd">bzero</span><span class="hl opt">();</span></li>
<li id="n_92" class="hl">        <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$tax </span><span class="hl opt">( &#64;{ </span><span class="hl kwb">$passes</span><span class="hl opt">{</span><span class="hl kwb">$pass</span><span class="hl opt">} } ) {</span></li>
<li id="n_93" class="hl">            <span class="hl kwb">$passrate </span><span class="hl opt">+= </span><span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">rate</span><span class="hl opt">;</span></li>
<li id="n_94" class="hl">        <span class="hl opt">}</span></li>
<li id="n_95" class="hl">        <span class="hl kwa">foreach </span><span class="hl kwc">my </span><span class="hl kwb">$tax </span><span class="hl opt">( &#64;{ </span><span class="hl kwb">$passes</span><span class="hl opt">{</span><span class="hl kwb">$pass</span><span class="hl opt">} } ) {</span></li>
<li id="n_96" class="hl">            <span class="hl kwb">$passtotal </span><span class="hl opt">+= </span><span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">apply_tax</span><span class="hl opt">( </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal </span><span class="hl opt">+ </span><span class="hl kwb">$total </span><span class="hl opt">)</span></li>
<li id="n_97" class="hl">              <span class="hl kwa">if </span><span class="hl kwc">not </span><span class="hl kwb">$extract</span><span class="hl opt">;</span></li>
<li id="n_98" class="hl">            <span class="hl kwb">$passtotal </span><span class="hl opt">+=</span></li>
<li id="n_99" class="hl">              <span class="hl kwb">$tax</span><span class="hl opt">-&gt;</span><span class="hl kwd">extract_tax</span><span class="hl opt">( </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal </span><span class="hl opt">- </span><span class="hl kwb">$total</span><span class="hl opt">, </span><span class="hl kwb">$passrate </span><span class="hl opt">)</span></li>
<li id="n_100" class="hl">              <span class="hl kwa">if </span><span class="hl kwb">$extract</span><span class="hl opt">;</span></li>
<li id="n_101" class="hl">        <span class="hl opt">}</span></li>
<li id="n_102" class="hl">        <span class="hl kwb">$total </span><span class="hl opt">+= </span><span class="hl kwb">$passtotal</span><span class="hl opt">;</span></li>
<li id="n_103" class="hl">    <span class="hl opt">}</span></li>
<li id="n_104" class="hl">    <span class="hl kwa">return </span><span class="hl kwb">$total</span><span class="hl opt">;</span></li>
<li id="n_105" class="hl"><span class="hl opt">}</span></li>
<li id="n_106" class="hl"></li>
<li id="n_107" class="hl"><span class="hl kwa">sub </span>apply_taxes <span class="hl opt">{</span></li>
<li id="n_108" class="hl">    <span class="hl kwc">my </span><span class="hl opt">( </span><span class="hl kwb">$taxes</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal </span><span class="hl opt">) = </span><span class="hl kwb">&#64;_</span><span class="hl opt">;</span></li>
<li id="n_109" class="hl">    <span class="hl kwa">return </span><span class="hl kwb">$subtotal </span><span class="hl opt">+ </span>calculate_taxes<span class="hl opt">( </span><span class="hl kwb">$taxes</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal</span><span class="hl opt">, </span><span class="hl num">0 </span><span class="hl opt">);</span></li>
<li id="n_110" class="hl"><span class="hl opt">}</span></li>
<li id="n_111" class="hl"></li>
<li id="n_112" class="hl"><span class="hl kwa">sub </span>extract_taxes <span class="hl opt">{</span></li>
<li id="n_113" class="hl">    <span class="hl kwc">my </span><span class="hl opt">( </span><span class="hl kwb">$taxes</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal </span><span class="hl opt">) = </span><span class="hl kwb">&#64;_</span><span class="hl opt">;</span></li>
<li id="n_114" class="hl">    <span class="hl kwa">return </span><span class="hl kwb">$subtotal </span><span class="hl opt">- </span>calculate_taxes<span class="hl opt">( </span><span class="hl kwb">$taxes</span><span class="hl opt">, </span><span class="hl kwb">$form</span><span class="hl opt">, </span><span class="hl kwb">$subtotal</span><span class="hl opt">, </span><span class="hl num">1 </span><span class="hl opt">);</span></li>
<li id="n_115" class="hl"><span class="hl opt">}</span></li>
<li id="n_116" class="hl"></li>
<li id="n_117" class="hl"><span class="hl num">1</span><span class="hl opt">;</span></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-27 01:23:06 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
