Hi,
From my testing, i created the following query based on the clients needs and added it to WOSTATUS - domain - completed status
So in this case the only thing the users cannot do is , they cannot complete the work order only if there are Materials added in Plan section, but not in Actual section
(
(EXISTS (
SELECT 1
FROM WPITEM
WHERE wonum = :wonum
) AND EXISTS (
SELECT 1
FROM MATUSETRANS
WHERE refwo = :wonum
))
OR
(NOT EXISTS (
SELECT 1
FROM WPITEM
WHERE wonum = :wonum
) AND NOT EXISTS (
SELECT 1
FROM MATUSETRANS
WHERE refwo = :wonum
))
OR
(EXISTS (
SELECT 1
FROM MATUSETRANS
WHERE refwo = :wonum
) AND NOT EXISTS (
SELECT 1
FROM WPITEM
WHERE wonum = :wonum
))
)
Thank you
------------------------------
Mateo Bako
Infosoft Business Solutions
------------------------------
Original Message:
Sent: 10-11-2024 11:17
From: Martin Fabra
Subject: Creating a condition on not being able to change the status of a Work Order to completed if there are records in" Planning" application but not in "Actuals" application.
Matea, one more thing. Planning materials does not mean that they must be consumed.
Perhaps in certain jobs it is correct (planned maintenance by use or time), but many times, there are companies that analyze the conditions and decide to extend the use, that is also valid and although the material is within the planning, it does not mean that it must be consumed. Also, if this is the case, the PLANNED vs. REAL comparison would always be identical and the idea is not to be able to compare them to see reality vs. what was planned in order to try to adjust (or the planning, or the execution or both).
Regards!
------------------------------
Martin Fabra
ARSAT S.A. - Actively seeking employment
------------------------------