mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 15:15:42 +00:00 
			
		
		
		
	Remove 'minimum' order from SupplierPart
- This can be handled using the 'PriceBreak' set
This commit is contained in:
		@@ -57,7 +57,6 @@ class EditSupplierPartForm(HelperForm):
 | 
				
			|||||||
            'note',
 | 
					            'note',
 | 
				
			||||||
            'base_cost',
 | 
					            'base_cost',
 | 
				
			||||||
            'multiple',
 | 
					            'multiple',
 | 
				
			||||||
            'minimum',
 | 
					 | 
				
			||||||
            'packaging',
 | 
					            'packaging',
 | 
				
			||||||
            'lead_time'
 | 
					            'lead_time'
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					# Generated by Django 2.2 on 2019-05-21 03:51
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from django.db import migrations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Migration(migrations.Migration):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    dependencies = [
 | 
				
			||||||
 | 
					        ('company', '0002_auto_20190520_2204'),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    operations = [
 | 
				
			||||||
 | 
					        migrations.RemoveField(
 | 
				
			||||||
 | 
					            model_name='supplierpart',
 | 
				
			||||||
 | 
					            name='minimum',
 | 
				
			||||||
 | 
					        ),
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
@@ -173,7 +173,6 @@ class SupplierPart(models.Model):
 | 
				
			|||||||
        note: Longer form note field
 | 
					        note: Longer form note field
 | 
				
			||||||
        base_cost: Base charge added to order independent of quantity e.g. "Reeling Fee"
 | 
					        base_cost: Base charge added to order independent of quantity e.g. "Reeling Fee"
 | 
				
			||||||
        multiple: Multiple that the part is provided in
 | 
					        multiple: Multiple that the part is provided in
 | 
				
			||||||
        minimum: MOQ (minimum order quantity) required for purchase
 | 
					 | 
				
			||||||
        lead_time: Supplier lead time
 | 
					        lead_time: Supplier lead time
 | 
				
			||||||
        packaging: packaging that the part is supplied in, e.g. "Reel"
 | 
					        packaging: packaging that the part is supplied in, e.g. "Reel"
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
@@ -217,8 +216,6 @@ class SupplierPart(models.Model):
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    multiple = models.PositiveIntegerField(default=1, validators=[MinValueValidator(1)], help_text='Order multiple')
 | 
					    multiple = models.PositiveIntegerField(default=1, validators=[MinValueValidator(1)], help_text='Order multiple')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    minimum = models.PositiveIntegerField(default=1, validators=[MinValueValidator(1)], help_text='Minimum order quantity (MOQ)')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    lead_time = models.DurationField(blank=True, null=True)
 | 
					    lead_time = models.DurationField(blank=True, null=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
@@ -256,10 +253,6 @@ class SupplierPart(models.Model):
 | 
				
			|||||||
        if len(price_breaks) == 0:
 | 
					        if len(price_breaks) == 0:
 | 
				
			||||||
            return None
 | 
					            return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Minimum ordering requirement
 | 
					 | 
				
			||||||
        if moq and self.minimum > quantity:
 | 
					 | 
				
			||||||
            quantity = self.minimum
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Order multiples
 | 
					        # Order multiples
 | 
				
			||||||
        if multiples:
 | 
					        if multiples:
 | 
				
			||||||
            quantity = int(math.ceil(quantity / self.multiple) * self.multiple)
 | 
					            quantity = int(math.ceil(quantity / self.multiple) * self.multiple)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,9 +66,6 @@ InvenTree | {{ company.name }} - Parts
 | 
				
			|||||||
    {% if part.base_cost > 0 %}
 | 
					    {% if part.base_cost > 0 %}
 | 
				
			||||||
    <tr><td>Base Price (Flat Fee)</td><td>{{ part.base_cost }}</td></tr>
 | 
					    <tr><td>Base Price (Flat Fee)</td><td>{{ part.base_cost }}</td></tr>
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
    {% if part.minimum > 1 %}
 | 
					 | 
				
			||||||
    <tr><td>Minimum Order Quantity</td><td>{{ part.minimum }}</td></tr>
 | 
					 | 
				
			||||||
    {% endif %}
 | 
					 | 
				
			||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
        <th>Price Breaks</th>
 | 
					        <th>Price Breaks</th>
 | 
				
			||||||
        <th>
 | 
					        <th>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user