summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_monitoring.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-10-06 08:59:52 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-10-06 08:59:52 +0700
commitd3a28f88b3b94123a3db4ae0873c7e157bbb13f8 (patch)
treec2a383be583f41d80f98ee78fddf0641f1ebefbe /indoteknik_custom/models/sale_monitoring.py
parent3d20a65942b64f252a10bada016042a3e1fc498a (diff)
parent1c18f6c7438537a60f181d089df06a0b4ba915f9 (diff)
Merge commit '1c18f6c7438537a60f181d089df06a0b4ba915f9'
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