brotherton-erpnext/erpnext/docs/current/models/accounts/pricing_rule.md

22 KiB

Version 6.x.x
<a class="btn btn-default btn-sm" href="https://github.com/frappe/erpnext/tree/develop/erpnext/accounts/doctype/pricing_rule"
	target="_blank" style="margin-left: 10px; margin-bottom: 10px;"><i class="octicon octicon-mark-github"></i> Source</a>
<p><b>Table Name:</b> <code>tabPricing Rule</code></p>

Fields

    <tr class="info">
        <td>1</td>
        <td ><code>applicability_section</code></td>
        <td >
            Section Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>2</td>
        <td class="danger" title="Mandatory"><code>title</code></td>
        <td >
            Data</td>
        <td >
            Title
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>3</td>
        <td class="danger" title="Mandatory"><code>apply_on</code></td>
        <td >
            Select</td>
        <td >
            Apply On
            
        </td>
        <td>
            <pre>

Item Code Item Group Brand

    <tr >
        <td>4</td>
        <td ><code>item_code</code></td>
        <td >
            Link</td>
        <td >
            Item Code
            
        </td>
        <td>

Item

        </td>
    </tr>
    
    <tr >
        <td>5</td>
        <td ><code>brand</code></td>
        <td >
            Link</td>
        <td >
            Brand
            
        </td>
        <td>

Brand

        </td>
    </tr>
    
    <tr >
        <td>6</td>
        <td ><code>item_group</code></td>
        <td >
            Link</td>
        <td >
            Item Group
            
        </td>
        <td>

Item Group

        </td>
    </tr>
    
    <tr >
        <td>7</td>
        <td ><code>column_break_7</code></td>
        <td class="info">
            Column Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>8</td>
        <td ><code>priority</code></td>
        <td >
            Select</td>
        <td >
            Priority
            <p class="text-muted small">
                Higher the number, higher the priority</p>
        </td>
        <td>
            <pre>

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

    <tr >
        <td>9</td>
        <td ><code>disable</code></td>
        <td >
            Check</td>
        <td >
            Disable
            
        </td>
        <td></td>
    </tr>
    
    <tr class="info">
        <td>10</td>
        <td ><code>section_break_7</code></td>
        <td >
            Section Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>11</td>
        <td ><code>selling</code></td>
        <td >
            Check</td>
        <td >
            Selling
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>12</td>
        <td ><code>buying</code></td>
        <td >
            Check</td>
        <td >
            Buying
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>13</td>
        <td ><code>column_break_11</code></td>
        <td class="info">
            Column Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>14</td>
        <td ><code>applicable_for</code></td>
        <td >
            Select</td>
        <td >
            Applicable For
            
        </td>
        <td>
            <pre>

Customer Customer Group Territory Sales Partner Campaign Supplier Supplier Type

    <tr >
        <td>15</td>
        <td ><code>customer</code></td>
        <td >
            Link</td>
        <td >
            Customer
            
        </td>
        <td>

Customer

        </td>
    </tr>
    
    <tr >
        <td>16</td>
        <td ><code>customer_group</code></td>
        <td >
            Link</td>
        <td >
            Customer Group
            
        </td>
        <td>

Customer Group

        </td>
    </tr>
    
    <tr >
        <td>17</td>
        <td ><code>territory</code></td>
        <td >
            Link</td>
        <td >
            Territory
            
        </td>
        <td>

Territory

        </td>
    </tr>
    
    <tr >
        <td>18</td>
        <td ><code>sales_partner</code></td>
        <td >
            Link</td>
        <td >
            Sales Partner
            
        </td>
        <td>

Sales Partner

        </td>
    </tr>
    
    <tr >
        <td>19</td>
        <td ><code>campaign</code></td>
        <td >
            Link</td>
        <td >
            Campaign
            
        </td>
        <td>

Campaign

        </td>
    </tr>
    
    <tr >
        <td>20</td>
        <td ><code>supplier</code></td>
        <td >
            Link</td>
        <td >
            Supplier
            
        </td>
        <td>

Supplier

        </td>
    </tr>
    
    <tr >
        <td>21</td>
        <td ><code>supplier_type</code></td>
        <td >
            Link</td>
        <td >
            Supplier Type
            
        </td>
        <td>

Supplier Type

        </td>
    </tr>
    
    <tr class="info">
        <td>22</td>
        <td ><code>section_break_19</code></td>
        <td >
            Section Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>23</td>
        <td ><code>min_qty</code></td>
        <td >
            Float</td>
        <td >
            Min Qty
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>24</td>
        <td ><code>column_break_21</code></td>
        <td class="info">
            Column Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>25</td>
        <td ><code>max_qty</code></td>
        <td >
            Float</td>
        <td >
            Max Qty
            
        </td>
        <td></td>
    </tr>
    
    <tr class="info">
        <td>26</td>
        <td ><code>section_break_23</code></td>
        <td >
            Section Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>27</td>
        <td ><code>valid_from</code></td>
        <td >
            Date</td>
        <td >
            Valid From
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>28</td>
        <td ><code>valid_upto</code></td>
        <td >
            Date</td>
        <td >
            Valid Upto
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>29</td>
        <td ><code>col_break1</code></td>
        <td class="info">
            Column Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>30</td>
        <td ><code>company</code></td>
        <td >
            Link</td>
        <td >
            Company
            
        </td>
        <td>

Company

        </td>
    </tr>
    
    <tr class="info">
        <td>31</td>
        <td ><code>price_discount_section</code></td>
        <td >
            Section Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>32</td>
        <td class="danger" title="Mandatory"><code>price_or_discount</code></td>
        <td >
            Select</td>
        <td >
            Price or Discount
            
        </td>
        <td>
            <pre>

Price Discount Percentage

    <tr >
        <td>33</td>
        <td ><code>col_break2</code></td>
        <td class="info">
            Column Break</td>
        <td >
            
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>34</td>
        <td ><code>price</code></td>
        <td >
            Float</td>
        <td >
            Price
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>35</td>
        <td ><code>discount_percentage</code></td>
        <td >
            Float</td>
        <td >
            Discount on Price List Rate (%)
            
        </td>
        <td></td>
    </tr>
    
    <tr >
        <td>36</td>
        <td ><code>for_price_list</code></td>
        <td >
            Link</td>
        <td >
            For Price List
            
        </td>
        <td>

Price List

        </td>
    </tr>
    
    <tr class="info">
        <td>37</td>
        <td ><code>help_section</code></td>
        <td >
            Section Break</td>
        <td >
            
            
        </td>
        <td>
            <pre>Simple</pre>
        </td>
    </tr>
    
    <tr >
        <td>38</td>
        <td ><code>pricing_rule_help</code></td>
        <td >
            HTML</td>
        <td >
            Pricing Rule Help
            
        </td>
        <td></td>
    </tr>
    
</tbody>
Sr Fieldname Type Label Options
<hr>
<h3>Controller</h3>
<h4>erpnext.accounts.doctype.pricing_rule.pricing_rule</h4>






    
<h3 style="font-weight: normal;">Class <b>MultiplePricingRuleConflict</b></h3>

<p style="padding-left: 30px;"><i>Inherits from frappe.exceptions.ValidationError</i></h4>

<div class="docs-attr-desc"><p></p>
</div>
<hr>




    
<h3 style="font-weight: normal;">Class <b>PricingRule</b></h3>

<p style="padding-left: 30px;"><i>Inherits from frappe.model.document.Document</i></h4>

<div class="docs-attr-desc"><p></p>
<p class="docs-attr-name">
    <a name="cleanup_fields_value" href="#cleanup_fields_value" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>cleanup_fields_value</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="validate" href="#validate" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>validate</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="validate_applicable_for_selling_or_buying" href="#validate_applicable_for_selling_or_buying" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>validate_applicable_for_selling_or_buying</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="validate_mandatory" href="#validate_mandatory" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>validate_mandatory</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="validate_max_discount" href="#validate_max_discount" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>validate_max_discount</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="validate_min_max_qty" href="#validate_min_max_qty" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>validate_min_max_qty</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="validate_price_or_discount" href="#validate_price_or_discount" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	<b>validate_price_or_discount</b>
    <i class="text-muted">(self)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

</div>
<hr>




    


<p class="docs-attr-name">
    <a name="erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_internal_priority" href="#erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_internal_priority" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	erpnext.accounts.doctype.pricing_rule.pricing_rule.<b>apply_internal_priority</b>
    <i class="text-muted">(pricing_rules, field_set, args)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p><span class="label label-info">Public API</span>
    <br><code>/api/method/erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule</code>
</p>
<p class="docs-attr-name">
    <a name="erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule" href="#erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	erpnext.accounts.doctype.pricing_rule.pricing_rule.<b>apply_pricing_rule</b>
    <i class="text-muted">(args)</i>
</p>
<div class="docs-attr-desc"><p>args = {
"item<em>list": [{"doctype": "", "name": "", "item</em>code": "", "brand": "", "item<em>group": ""}, ...],
"customer": "something",
"customer</em>group": "something",
"territory": "something",
"supplier": "something",
"supplier<em>type": "something",
"currency": "something",
"conversion</em>rate": "something",
"price<em>list": "something",
"plc</em>conversion<em>rate": "something",
"company": "something",
"transaction</em>date": "something",
"campaign": "something",
"sales<em>partner": "something",
"ignore</em>pricing_rule": "something"

}


<p class="docs-attr-name">
    <a name="erpnext.accounts.doctype.pricing_rule.pricing_rule.filter_pricing_rules" href="#erpnext.accounts.doctype.pricing_rule.pricing_rule.filter_pricing_rules" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	erpnext.accounts.doctype.pricing_rule.pricing_rule.<b>filter_pricing_rules</b>
    <i class="text-muted">(args, pricing_rules)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="erpnext.accounts.doctype.pricing_rule.pricing_rule.get_pricing_rule_for_item" href="#erpnext.accounts.doctype.pricing_rule.pricing_rule.get_pricing_rule_for_item" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	erpnext.accounts.doctype.pricing_rule.pricing_rule.<b>get_pricing_rule_for_item</b>
    <i class="text-muted">(args)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="erpnext.accounts.doctype.pricing_rule.pricing_rule.get_pricing_rules" href="#erpnext.accounts.doctype.pricing_rule.pricing_rule.get_pricing_rules" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	erpnext.accounts.doctype.pricing_rule.pricing_rule.<b>get_pricing_rules</b>
    <i class="text-muted">(args)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

<p class="docs-attr-name">
    <a name="erpnext.accounts.doctype.pricing_rule.pricing_rule.if_all_rules_same" href="#erpnext.accounts.doctype.pricing_rule.pricing_rule.if_all_rules_same" class="text-muted small">
        <i class="icon-link small" style="color: #ccc;"></i></a>
	erpnext.accounts.doctype.pricing_rule.pricing_rule.<b>if_all_rules_same</b>
    <i class="text-muted">(pricing_rules, fields)</i>
</p>
<div class="docs-attr-desc"><p><span class="text-muted">No docs</span></p>

    <h4>Linked In:</h4>
    <ul>
    
		
        <li>

Delivery Note Item

        <li>

Purchase Invoice Item

        <li>

Purchase Order Item

        <li>

Purchase Receipt Item

        <li>

Quotation Item

        <li>

Sales Invoice Item

        <li>

Sales Order Item

        <li>

Supplier Quotation Item

    </ul>