<a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.svg">
</a>
<a name="variable-discount-in-contract-recurrent-invoicing"></a>
<h2>Variable discount in contract recurrent invoicing</h2>
<p>With this module, you will be able to define in recurring contracts some
lines with variable discount according to a provided formula.</p>
<a name="configuration"></a>
<h3>Configuration</h3>
<ol class="arabic">
<li><p class="first">Go to Sales > Configuration > Contracts > Formulas (discount).</p>
</li>
<li><p class="first">Define any formula based on Python code that stores at some moment a
float/integer value of the discount to invoice in the variable 'result'.</p>
<p>You can use these variables to compute your formula:</p>
<ul class="simple">
<li><em>env</em>: Environment variable for getting other models.</li>
<li><em>context</em>: Current context dictionary.</li>
<li><em>user</em>: Current user.</li>
<li><em>partner</em>: Contract partner.</li>
<li><em>line</em>: Contract recurring invoice line that triggers this formula.</li>
<li><em>contract</em>: Contract whose line belongs to.</li>
</ul>
</li>
</ol>
<div class="figure">
<img alt="Formula form" src="images/formula_form.png" style="width: 600px;" />
</div>
<a name="usage"></a>
<h3>Usage</h3>
<p>To use this module, you need to:</p>
<ol class="arabic simple">
<li>Go to Sales -> Contracts and select or create a new contract.</li>
<li>Check <em>Generate recurring invoices automatically</em>.</li>
<li>Add a new recurring invoicing line.</li>
<li>Select "Variable discount" in column "Discount. type".</li>
<li>Select one of the possible formulas to use (previously created).</li>
</ol>
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/110/10.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a>
<a name="bug-tracker"></a>
<h3>Bug Tracker</h3>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.</p>
<a name="credits"></a>
<h3>Credits</h3>
<a name="contributors"></a>
<h4>Contributors</h4>
<ul class="simple">
<li>Pedro M. Baeza <<a class="reference external" href="mailto:pedro.baeza@tecnativa.com">pedro.baeza@tecnativa.com</a>></li>
<li>Dave Lasley <<a class="reference external" href="mailto:dave@laslabs.com">dave@laslabs.com</a>></li>
</ul>
<a name="maintainer"></a>
<h4>Maintainer</h4>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>This module is maintained by the OCA.</p>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>To contribute to this module, please visit <a class="reference external" href="https://odoo-community.org">https://odoo-community.org</a>.</p>