summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-07-18 11:56:33 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-07-18 11:56:33 +0700
commit0aaf2d3af0e5096514f8b72850f6a3d2901cfc3e (patch)
tree860c7069ea092ec5ae30aef08c3cd80fa573575b /indoteknik_custom
parent5aa6e8f5ed1bd628a5f4559a3f752b6e83ee2c49 (diff)
refactor product real stock
Diffstat (limited to 'indoteknik_custom')
-rw-r--r--indoteknik_custom/models/product_sla.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/indoteknik_custom/models/product_sla.py b/indoteknik_custom/models/product_sla.py
index f969502f..2e663d30 100644
--- a/indoteknik_custom/models/product_sla.py
+++ b/indoteknik_custom/models/product_sla.py
@@ -51,12 +51,9 @@ class ProductSla(models.Model):
qty_available = 0
qty_available = product.qty_onhand_bandengan
- qty_available -= 10
- if qty_available < 10:
- qty_available = 0
-
- if qty_available > 10:
+
+ if qty_available > 0:
self.sla = '1 Hari'
query = [
@@ -80,7 +77,7 @@ class ProductSla(models.Model):
rounded_leadtime = math.ceil(avg_leadtime)
self.avg_leadtime = rounded_leadtime
if rounded_leadtime >= 1 and rounded_leadtime <= 5:
- self.sla = '3-6 Hari'
+ self.sla = '3-7 Hari'
elif rounded_leadtime >= 6 and rounded_leadtime <= 10:
self.sla = '4-12 Hari'
elif rounded_leadtime >= 11: