PROCEDURE DOCACFIXEDPRICEREPRICE (ADOCTYPE IN TDOCTYPE, ADOCID IN TDOCID,
AOLDSTATE IN TDOCSTATE DEFAULT NULL,
ANEWSTATE IN TDOCSTATE DEFAULT NULL,
ADOBEFORE IN CORE.SMBOOL DEFAULT NULL)
IS
BEGIN
ONSTARTTRANS;
IF ADOCTYPE <> 'AC'
THEN
RETURN;
END IF;
IF SKIPAC(ADOCTYPE, ADOCID, ANEWSTATE)
THEN
RETURN;
END IF;
IF((DOCAC.NEEDINSPECT(ADOCID, 50)='0'))
THEN
RETURN;
END IF;
INSERT INTO TTINSPECTRESBUFFER ( INSPECTID, ERRID, INSPECTNAME, ERRTEXT )
SELECT DISTINCT
50,
0,
TO_CHAR (50),
'В спецификации акта переоценки "' || ADOCID || '" содержится артикул ''' ||
S.ARTICLE || ''' с фиксированной ценой в позиции №' || S.DISPLAYITEM
FROM SMDOCUMENTS D, SMACTS A, SMSPEC S, SMCARD C
WHERE D.DOCTYPE = ADOCTYPE AND
D.ID = ADOCID AND
D.DOCTYPE = A.DOCTYPE AND
D.ID = A.ID AND
D.DOCTYPE = S.DOCTYPE AND
D.ID = S.DOCID AND
S.ARTICLE = C.ARTICLE AND
A.REASON = 1 AND
BITAND (C.FLAGS, 32) > 0;
SETFUNCNAME (50);
END;
PROCEDURE DOCACFIXEDPRICEREPRICE (ADOCTYPE IN TDOCTYPE, ADOCID IN TDOCID,
AOLDSTATE IN TDOCSTATE DEFAULT NULL,
ANEWSTATE IN TDOCSTATE DEFAULT NULL,
ADOBEFORE IN CORE.SMBOOL DEFAULT NULL)
IS
BEGIN
ONSTARTTRANS;
IF ADOCTYPE <> 'AC'
THEN
RETURN;
END IF;
IF SKIPAC(ADOCTYPE, ADOCID, ANEWSTATE)
THEN
RETURN;
END IF;
IF((DOCAC.NEEDINSPECT(ADOCID, 50)='0'))
THEN
RETURN;
END IF;
INSERT INTO TTINSPECTRESBUFFER ( INSPECTID, ERRID, INSPECTNAME, ERRTEXT )
SELECT DISTINCT
50,
0,
TO_CHAR (50),
'В спецификации акта переоценки "' || ADOCID || '" содержится артикул ''' ||
S.ARTICLE || ''' с фиксированной ценой в позиции №' || S.DISPLAYITEM
FROM SMDOCUMENTS D, SMACTS A, SMSPEC S, SMCARD C
WHERE D.DOCTYPE = ADOCTYPE AND
D.ID = ADOCID AND
D.DOCTYPE = A.DOCTYPE AND
D.ID = A.ID AND
D.DOCTYPE = S.DOCTYPE AND
D.ID = S.DOCID AND
S.ARTICLE = C.ARTICLE AND
A.REASON = 1 AND
BITAND (C.FLAGS, 32) > 0;
SETFUNCNAME (50);
END;