lsoto prueba de programas

This commit is contained in:
Luis
2026-10-20 21:53:39 -04:00
65 changed files with 2286 additions and 2295 deletions
+12
View File
@@ -126,6 +126,18 @@ FUNCTION convierteorden(
UPDATE prtb00020
SET num_oc = ISNULL(num_oc, 0) + 1, us_crea = xusuario, fech_crea = GETDATE()
SELECT num_oc INTO ult_numero FROM prtb00020
# RE-VALIDACION YA CON EL BLOQUEO DE prtb00020: la validacion del inicio
# corre fuera de la transaccion; si otro usuario estaba convirtiendo la
# misma cotizacion, aqui ya vemos su orden confirmada (cot 340001, 20/10/2026)
LET existe_oc = 0
SELECT COUNT(*) INTO existe_oc FROM prtb00012
WHERE cotizacion_no = xcotizacion_no AND status_t IS NULL
IF existe_oc > 0 THEN
ROLLBACK WORK
CALL fgl_winmessage(
"ERROR", "COTIZACION TIENE ORDEN, NO PUEDE CREAR ORDEN", "STOP")
RETURN 0, FALSE
END IF
# AUTOCORRECCION: si el contador quedo por detras de prtb00012
# (otro programa creo ordenes sin avanzarlo), salta al siguiente libre
LET existe_oc = 0