Complete 1883270 - Enhance Document No Formatting

https://sourceforge.net/tracker2/?func=detail&atid=879335&aid=1883270&group_id=176962
This commit is contained in:
Carlos Ruiz 2009-01-06 21:22:46 +00:00
parent 08b8c112aa
commit 13088da9b4
4 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,24 @@
CREATE or REPLACE PROCEDURE NextIDByYear
(
p_AD_Sequence_ID IN NUMBER,
p_IncrementNo IN NUMBER,
p_CalendarYear IN CHAR,
o_NextID OUT NUMBER
)
AS
BEGIN
SELECT CurrentNext
INTO o_NextID
FROM AD_Sequence_No
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear
FOR UPDATE OF CurrentNext;
--
UPDATE AD_Sequence_No
SET CurrentNext = CurrentNext + p_IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END NextIDByYear;

View File

@ -0,0 +1,24 @@
CREATE or REPLACE FUNCTION NextIDByYear
(
p_AD_Sequence_ID IN numeric,
p_IncrementNo IN numeric,
p_CalendarYear IN varchar
)
RETURNS numeric AS $$
DECLARE
o_NextID numeric;
BEGIN
SELECT CurrentNext
INTO o_NextID
FROM ad_sequence_no
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear
FOR UPDATE OF ad_sequence_no;
--
UPDATE ad_sequence_no
SET CurrentNext = CurrentNext + p_IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear;
RETURN o_NextID;
END
$$ LANGUAGE plpgsql;

View File

@ -0,0 +1,29 @@
CREATE or REPLACE PROCEDURE NextIDByYear
(
p_AD_Sequence_ID IN NUMBER,
p_IncrementNo IN NUMBER,
p_CalendarYear IN CHAR,
o_NextID OUT NUMBER
)
AS
BEGIN
SELECT CurrentNext
INTO o_NextID
FROM AD_Sequence_No
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear
FOR UPDATE OF CurrentNext;
--
UPDATE AD_Sequence_No
SET CurrentNext = CurrentNext + p_IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END NextIDByYear;
/
-- [ 1883270 ] Enhance Document No Formatting
UPDATE AD_Field SET IsActive='Y' WHERE AD_Field_ID=335
;

View File

@ -0,0 +1,28 @@
CREATE or REPLACE FUNCTION NextIDByYear
(
p_AD_Sequence_ID IN numeric,
p_IncrementNo IN numeric,
p_CalendarYear IN varchar
)
RETURNS numeric AS $$
DECLARE
o_NextID numeric;
BEGIN
SELECT CurrentNext
INTO o_NextID
FROM ad_sequence_no
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear
FOR UPDATE OF ad_sequence_no;
--
UPDATE ad_sequence_no
SET CurrentNext = CurrentNext + p_IncrementNo
WHERE AD_Sequence_ID=p_AD_Sequence_ID
AND CalendarYear = p_CalendarYear;
RETURN o_NextID;
END
$$ LANGUAGE plpgsql;
-- [ 1883270 ] Enhance Document No Formatting
UPDATE AD_Field SET IsActive='Y' WHERE AD_Field_ID=335
;