50: THEN
51:
52: l_return_status := FND_API.G_RET_STS_ERROR;
53:
54: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
55: THEN
56:
57: FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
58: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','accounting_rule');
55: THEN
56:
57: FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
58: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','accounting_rule');
59: OE_MSG_PUB.Add;
60:
61: END IF;
62:
63: END IF;
68: THEN
69:
70: l_return_status := FND_API.G_RET_STS_ERROR;
71:
72: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
73: THEN
74:
75: FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
76: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','Price List Id');
73: THEN
74:
75: FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
76: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','Price List Id');
77: OE_MSG_PUB.Add;
78:
79: END IF;
80:
81: END IF;
92: THEN
93:
94: l_return_status := FND_API.G_RET_STS_ERROR;
95:
96: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
97: THEN
98:
99: FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
100: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','Term Id');
97: THEN
98:
99: FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
100: FND_MESSAGE.SET_TOKEN('ATTRIBUTE','Term Id');
101: OE_MSG_PUB.Add;
102:
103: END IF;
104:
105: END IF;
118: /* Revision Handling */
119: /* Check for Agreement Name exists */
120: IF p_Agreement_rec.name is not NULL THEN
121:
122: -- OE_MSG_PUB.Add_Exc_Msg
123: -- ( G_PKG_NAME
124: -- , 'Checking Revsion '
125: -- );
126:
126:
127: if NOT ( Allow_Revision( p_Agreement_rec => p_Agreement_rec))
128: THEN
129: l_return_status := FND_API.G_RET_STS_ERROR;
130: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
131: THEN
132: FND_MESSAGE.SET_NAME('QP','QP_NO_REVISION');
133: OE_MSG_PUB.Add;
134: end if;
129: l_return_status := FND_API.G_RET_STS_ERROR;
130: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
131: THEN
132: FND_MESSAGE.SET_NAME('QP','QP_NO_REVISION');
133: OE_MSG_PUB.Add;
134: end if;
135:
136: END IF;
137:
145: THEN
146:
147: l_return_status := FND_API.G_RET_STS_ERROR;
148:
149: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
150: THEN
151: FND_MESSAGE.SET_NAME('QP','QP_DUPLICATE_REVISION');
152: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
153: OE_MSG_PUB.Add;
149: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
150: THEN
151: FND_MESSAGE.SET_NAME('QP','QP_DUPLICATE_REVISION');
152: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
153: OE_MSG_PUB.Add;
154: -- OE_MSG_PUB.Add_Exc_Msg
155: -- ( G_PKG_NAME
156: -- , 'Revsion Cannot be the Same'
157: -- );
150: THEN
151: FND_MESSAGE.SET_NAME('QP','QP_DUPLICATE_REVISION');
152: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
153: OE_MSG_PUB.Add;
154: -- OE_MSG_PUB.Add_Exc_Msg
155: -- ( G_PKG_NAME
156: -- , 'Revsion Cannot be the Same'
157: -- );
158:
162: /* revision is OK, check for dates overlapping */
163: if NOT ( Check_Dates(p_Agreement_rec => p_Agreement_rec ))
164: then
165:
166: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
167: THEN
168: l_return_status := FND_API.G_RET_STS_ERROR;
169: FND_MESSAGE.SET_NAME('QP','QP_OVERLAPPING_START_DATE');
170: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
167: THEN
168: l_return_status := FND_API.G_RET_STS_ERROR;
169: FND_MESSAGE.SET_NAME('QP','QP_OVERLAPPING_START_DATE');
170: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
171: OE_MSG_PUB.Add;
172: /*
173: OE_MSG_PUB.Add_Exc_Msg
174: ( G_PKG_NAME
175: , 'Start Dates Cannot Overlap During Agreement Revisions'
169: FND_MESSAGE.SET_NAME('QP','QP_OVERLAPPING_START_DATE');
170: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
171: OE_MSG_PUB.Add;
172: /*
173: OE_MSG_PUB.Add_Exc_Msg
174: ( G_PKG_NAME
175: , 'Start Dates Cannot Overlap During Agreement Revisions'
176: );
177: */
189:
190: IF NOT ( Check_EndDates(p_Agreement_rec => p_Agreement_rec ))
191: THEN
192:
193: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
194: THEN
195: l_return_status := FND_API.G_RET_STS_ERROR;
196: FND_MESSAGE.SET_NAME('QP','QP_OVERLAPPING_END_DATE');
197: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
194: THEN
195: l_return_status := FND_API.G_RET_STS_ERROR;
196: FND_MESSAGE.SET_NAME('QP','QP_OVERLAPPING_END_DATE');
197: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
198: OE_MSG_PUB.Add;
199: /*
200: OE_MSG_PUB.Add_Exc_Msg
201: ( G_PKG_NAME
202: , 'End Dates Cannot Overlap During Agreement Revisions'
196: FND_MESSAGE.SET_NAME('QP','QP_OVERLAPPING_END_DATE');
197: -- FND_MESSAGE.SET_TOKEN('ATTRIBUTE','revision');
198: OE_MSG_PUB.Add;
199: /*
200: OE_MSG_PUB.Add_Exc_Msg
201: ( G_PKG_NAME
202: , 'End Dates Cannot Overlap During Agreement Revisions'
203: );
204: */
224: THEN
225:
226: l_return_status := FND_API.G_RET_STS_ERROR;
227:
228: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR) THEN
229: FND_MESSAGE.SET_NAME('QP','QP_INVALID_AGR_SOURCE_CODE');
230: OE_MSG_PUB.Add;
231: END IF;
232:
226: l_return_status := FND_API.G_RET_STS_ERROR;
227:
228: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR) THEN
229: FND_MESSAGE.SET_NAME('QP','QP_INVALID_AGR_SOURCE_CODE');
230: OE_MSG_PUB.Add;
231: END IF;
232:
233: END IF;
234:
267: WHEN OTHERS THEN
268:
269: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
270:
271: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
272: THEN
273: OE_MSG_PUB.Add_Exc_Msg
274: ( G_PKG_NAME
275: , 'Entity'
269: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
270:
271: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
272: THEN
273: OE_MSG_PUB.Add_Exc_Msg
274: ( G_PKG_NAME
275: , 'Entity'
276: );
277: END IF;
789: WHEN OTHERS THEN
790:
791: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
792:
793: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
794: THEN
795: OE_MSG_PUB.Add_Exc_Msg
796: ( G_PKG_NAME
797: , 'Attributes'
791: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
792:
793: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
794: THEN
795: OE_MSG_PUB.Add_Exc_Msg
796: ( G_PKG_NAME
797: , 'Attributes'
798: );
799: END IF;
831: WHEN OTHERS THEN
832:
833: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
834:
835: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
836: THEN
837: OE_MSG_PUB.Add_Exc_Msg
838: ( G_PKG_NAME
839: , 'Entity_Delete'
833: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
834:
835: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
836: THEN
837: OE_MSG_PUB.Add_Exc_Msg
838: ( G_PKG_NAME
839: , 'Entity_Delete'
840: );
841: END IF;
874: RETURN TRUE;
875: else
876: RETURN FALSE;
877: end if;
878: -- OE_MSG_PUB.Add_Exc_Msg
879: -- ( G_PKG_NAME
880: -- , 'End Dates are Overlapping' || l_count
881: -- );
882: /* Revison needs to be changed */
1017: where name = p_Agreement_rec.name
1018: and revision = p_Agreement_rec.revision;
1019:
1020:
1021: -- OE_MSG_PUB.Add_Exc_Msg
1022: -- ( G_PKG_NAME
1023: -- , 'Agreement Record Exists'
1024: -- );
1025: