summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_monitoring.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-10-05 11:27:01 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-10-05 11:27:01 +0700
commit3abd0ca6790b9a278f9ddd52b063691b99d6916c (patch)
tree87c3d8261edf3eff40b556262ddbe51c68e877a5 /indoteknik_custom/models/sale_monitoring.py
parent77a6833006f406ffc7ddd5d50308c843cf9133a5 (diff)
Update sale_monitoring.py and sale_monitoring_detail.py
Diffstat (limited to 'indoteknik_custom/models/sale_monitoring.py')
-rwxr-xr-xindoteknik_custom/models/sale_monitoring.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/indoteknik_custom/models/sale_monitoring.py b/indoteknik_custom/models/sale_monitoring.py
index 2ef23f39..a837a6bc 100755
--- a/indoteknik_custom/models/sale_monitoring.py
+++ b/indoteknik_custom/models/sale_monitoring.py
@@ -35,12 +35,12 @@ class SaleMonitoring(models.Model):
SUM(smd.qty_so_delivered) AS qty_so_delivered,
SUM(smd.qty_so_invoiced) AS qty_so_invoiced,
CASE
- WHEN SUM(qty_po) <> SUM(qty_so) AND SUM(qty_po) <= 0 THEN 'Belum PO sama sekali'
- WHEN SUM(qty_po) <> SUM(qty_so) THEN 'Belum PO full'
- WHEN SUM(qty_po_received) <> SUM(qty_po) AND SUM(qty_po_received) <= 0 THEN 'Belum Received sama sekali'
- WHEN SUM(qty_po_received) <> SUM(qty_po) THEN 'Belum Received full'
- WHEN SUM(qty_so_delivered) <> SUM(qty_so) AND SUM(qty_so_delivered) <= 0 THEN 'SIAP KIRIM'
- WHEN SUM(qty_so_delivered) <> SUM(qty_so) THEN 'KIRIM SISANYA'
+ WHEN SUM(qty_po) < SUM(qty_so) AND SUM(qty_po) <= 0 THEN 'Belum PO sama sekali'
+ WHEN SUM(qty_po) < SUM(qty_so) THEN 'Belum PO full'
+ WHEN SUM(qty_po_received) < SUM(qty_so) AND SUM(qty_po_received) <= 0 THEN 'Belum Received sama sekali'
+ WHEN SUM(qty_po_received) < SUM(qty_so) THEN 'Belum Received full'
+ WHEN SUM(qty_to_delivered) = SUM(qty_so) THEN 'SIAP KIRIM'
+ WHEN SUM(qty_to_delivered) < SUM(qty_so) and SUM(qty_to_delivered) > 0 THEN 'KIRIM SISANYA'
ELSE 'Belum Invoiced'
END AS status,
get_po_number(smd.sale_order_id) as po_number