2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Add API interface for SupplierPriceBreak

This commit is contained in:
Oliver Walters
2019-04-17 00:35:49 +10:00
parent a3b544e2a4
commit 150bc1e674
3 changed files with 38 additions and 3 deletions

View File

@ -508,6 +508,10 @@ class SupplierPart(models.Model):
return ' | '.join(items)
@property
def has_price_breaks(self):
return self.price_breaks.count() > 0
def get_price(self, quantity, moq=True, multiples=True):
""" Calculate the supplier price based on quantity price breaks.
- If no price breaks available, use the single_price field