50 Hours of Instructor-led Classes.
-
CTS
-
HCL Technologies
-
Wipro
-
Infosys
-
TCS
-
Plsql
Feel & Decide after a Free Demo Class in Chennai with our Real Time AWS Experts.
Call us for Chennai Center: +91 8939975692 and grab a job just not a Seat!
Interested in knowing more about the AWS Certificate and Placement Program in Cloud Computing? Fill in your details and one of our academic counselors will get in touch with you.
BOOK A FREE DEMOInstructor Led live online training
Instructor Led classroom training
Customized and Exclusive training based on your requirement
Customized Corporate Training
15+ Years of Experience as a cloud architect who works with DevOps, Amazon Web Services and Microsfor Azure including Java, Groovy and Python.
Experience in providing End to End Cloud Computing Training Program with Job Guarantee.
Trained 8000+ professionals
Prepare participants to get IT job ready in 12 weeks
Extensive sessions on job-readiness & insider tips help you land your dream job at leading Cloud Computing Companies.Flexible Timings / Weekend classes Available.
Talk to the Trainer @ +91 8939975692Karthik is an industry recognised expert in AWS training and has 13+ years experience in driving digital experience through the Cloud to deliver business value. Karthik is a Senior AWS Cloud Architect and specialises in advanced architecting, advanced developing on AWS, DevOps engineering, System operation on AWS.
Karthik has delivered more AWS training courses in India than any other person.
In 2010 Karthik commenced teaching AWS online meaning people from all around the world can participate in his AWS training courses, and not just those people in Chennai.
He brings his business and IT experience to the table to get fast and effective results and help you with solving business problems with Amazon Web Services.
Flexible Timings / Weekend classes Available.
Talk to the Trainer @ +91 8939975692Learn to use Amazon Web Services to Crack a Job Opportunity as you enter the world of cloud computing.
Some companies that use AWS include Amazon, LinkedIn, Twitch, Netflix and Facebook.
Employers are paying people with the knowledge covered in this AWS and DevOps course a salary of $98,000 - $150,000 per year.
Become an AWS Cloud Practitioner
Learn the AWS Cloud Practitioner Essentials. Understand the AWS Cloud architecture and services, and prepare for the certification.
There are no pre-requisites for this course. All non-technical individuals and Freshers are welcome! Absolute beginners who want to learn AWS
Get Hands-on AWS Technical Essentials Certification Training Course in Chennai from Experts
Learn AWS Technical Essentials course in Chennai with Greens Technologies will provide you with an overview of the tools and technologies that make up Amazon Web Services. Familiarize yourself with AWS and the many services available, as you learn about EC2, S3, RDS, DynamoDB, Route53, VPC, and more.
Next Demo Sessions
Green’s Technologies’ AWS training course in Chennai is a perfect course which is ideal for all the passionate individuals who want to pursue a dream career in Cloud computing or develop Cloud applications using AWS. We guarantee that you would stand amongst the crowd in any organization, by implementing best practices around advanced cloud based solutions and migrate existing workloads to the cloud.
AWS Solutions Architect Certified Professionals generally solve operational issues in an organization and are also accountable for implementing new software for complex deployment, infrastructure, design and troubleshooting of cloud solutions. Few Cloud Portfolios that require AWS certification are listed as:Cloud Developer, Cloud Software Engineer, AWS Solutions Architect and DevOps Engineer
Definitely it’s worth it. There is a tremendous demand and an exponential future growth in AWS. Hence giving way to an enormous scope for Job seekers. It is one of the top trending cloud computing platform.So anyone who wants to learn AWS has an amazing future. No second thought on that.
As you all know that there is an exponential growth and focus on cloud computing and infrastructure over the last few years, cloud professionals are in great demand worldwide. Several companies have migrated to cloud platforms for better mobility, security and scalability and cloud solutions architects are among the highest paid professionals in the IT Fraternity. According to a survey, cloud computing is one of the top trending platforms which is being used by IT executives .
Amazon web service is a platform that offers flexible, reliable, scalable, easy-to-use and cost-effective cloud computing solutions. It offers a multiple range of cloud-based products meant for various business purpos. This platform is developed with a combination of infrastructure as a service (IaaS), platform as a service (PaaS) and packaged software as a service (SaaS) offerings.
AWS Certification validates the efficiency levels of cloud professionals to enable these executives promote their skills which is in demand so that organizations can build effective teams for cloud initiatives using AWS. An aspirant can choose from various certification exams which is sorted by role and specialty designed to enhance them and the groups to meet their goals.Skilled professionals are in huge demand and that’s exactly what AWS certification courses provide!
Recruiters are looking for you! All you need is Learn from beginner, advanced, expert to architect of AWS with Greens Technologies, Become AWS Certified Professional And Get JOB with our Placement Assurance Program
Greens Technologies, AWS Training offers flexible training options including Class room and Online training for your learning needs. Choose what to learn, and when and how to learn it. With AWS -accredited instructors in a hands-on learning environment.
Feel & Decide after a Free Demo Class with our Real Time AWS Experts.
Call us : +91 8939975692 and Book your Seat Now!
AWS Certified Professionals stand apart from the pack. Join them.
Put your potential to work.
AWS Certification is more than just a piece of paper. Certification exams measure not only knowledge, but also real deployment skills, ensuring that AWS Certified Professionals know exactly how to deliver a successful project. Get certified, showcase your skills and share your knowledge. Earning certification helps you as an IT professional establish credibility with both your employer and the greater IT industry.
100% Placement & Interview Program - Learn how to tilt the interview in your favor & aligning your needs with the organization. We will send you for interviews till you get a JOB.
The dedicated and experts of Greens Technologies placement team is known for their regular scheduling of interviews to the learners with the biggest IT company in the world. Being a leading software Training and Placements provider for the past 15 years, Greens Technologies has global tie-ups with multinational giants
50 Hours of Instructor-led Classes.
We ensure that each student gets a AWS certification based on your internal assignments and practical session performances.
Definitely it’s worth it. There is a tremendous demand and an exponential future growth in AWS. Hence giving way to an enormous scope for Job seekers. It is one of the top trending cloud computing platform. So anyone who wants to learn AWS has an amazing future. No second thought on that.
Every student will be given industry recognized course completion certificate.
Yes ofcourse.We provide online training programs as well .Timing is completely chosen basis the availability of the aspirant.Hence highly flexible and comfortable.
The average salary for AWS professional is Rs.10Lacs/annum. In the United states, the average salary is US $120,000/annum.
It depends upon every individual’s preparation strategy, effort and time invested. However if an aspirant has a background and basic knowledge of AWS, It would take around 2months .If an aspirant is a fresher then it would take around 3months.
After completion of graduation, was very disappointed in life as I didn’t get through any campus interviews.. Then I chose Greens technologies for learning AWS as my friend conveyed that it was THE BEST Institute. After joining them I gradually developed interest in the subject and achieved what I had dreamt of once. The whole credit goes to Mr.Karthik who taught me AWS and helped me in clearing AWS Certification .And not only that. Today I have been placed as AWS developer in one of the most reputed organizations. Ever grateful to Karthik sir and the whole team.
I had opted for AWS training in Greens Technologies. I would suggest to take this course because when I investigated for this course online cost was bit high, but Greens Technologies offered it for better fees. And regarding the course agenda, they are very sincere and punctual. And they also provide the recorded sessions to study it offline. Though I had taken online program ,the team ensured that I completed my certification successfully and got placed .
AWS Training was excellent, with Karthik Sir sharing a lot of scenarios and covering the concepts .The training center was good and well maintained. Would recommend Greens Technologies for AWS Training for sure.. Also, placement team was very supportive and prompt in sharing the required details. Thanks to the whole team for helping me to clear my certification and also to get placed as AWS developer.
No:11,
First Street,
Padmanabha Nagar,
Adyar,
Chennai-600 020.
4th Floor, W122, 3rd Ave,
W Block, Annanagar East, Chennai,
Tamil Nadu - 600040.
(Landmark : Above Erode
Amman Mess Restaurant)
Plot No.19,
Balamurugan Garden,
OMR Road,Kancheepuram District,
Okkiam, Thoraipakkam,
Jain college bus stop,
No.1, Apparao Colony,
Tambaram,
Sanatorium,
Near HP Petrol Bunk,
Chennai-600 020.
149, 1C/1D,
1st Floor,
Opp to DLF IT Park,
Ramapuram,
Chennai-600 020.
1st Floor, No. 19 &20,
American Advent Christian Layout,
Sholinganallur to Medavakkam Main
Road, Perumbakkam,
Chennai-600 020.
No. 05,
Bakthavachalam Street,
West Tambaram,
Chennai - 600045.
51-A, 2nd floor,
Velachery Road,
Dhadeswaram Nagar,
Velachery,
Chennai 600042.
Pseudo columns_18th_Jan
Set_operators__19th_Jan
Table_Partition_19th_Jan
SUBQUERY_20th_Jan
+91 8428334425
Pavithra
Css Corp
Oracle job
Company name:craft silicon
Name:Mary nancy
Ph no:+91 73581 96990
Mail id:marynancy.r@craftsilicon.com
Indhu: +918778972194
Object frontier software (OFS)
Shushma.chellapandi@object-frontier.com
+91 81899 32190
Name:Selli
Company: TCS
Client : ally bank
Expectation: 6 + years
Email : pavithra.gopalakrishnan@csscorp.com
Phone No : 8428334425
keerthi@dreammakershr.com- Beyontec solutions
Greetings form Mindgate Solution!!
We are CMMI 3 product based company dealing with UPI payment & banking domain.
We provide payment solution to banking sector.
For more details please go through www.mindgate.in
Mindgate (www.mindgate.in) is hiring for below position :
Position: Database Developer
Job Location: Guindy Chennai
Employment Type : Permanent
Notice Period: Immediate to 15 days
Primary Skills -
Should have relevant 3 to 4.5 years experience primarily in Oracle or Mysql or Sql server
Should have expertise level skill in writing efficient and complex queries, Procedures, Functions and analyses/debug issues.
Person should have 3 -6 years of experience working in any one the database like Oracle/MySQL/SQL
Must have experience in Query tuning/Performance Tuning
Must have worked on Linux
DB migration is required
Soft Skill :
Good to have worked on Banking projects
Should be a good team player who can coordinate and work closely with front-end developers.
Team cooperation &commitment towards the work is required.
Interested candidates can send their profiles at rachana.mishra@mindgate.in with below details
Total Exp -
Database Development Exp
Linux Exp -
Query Tuning Exp -
SQL Queries -
Shell Scripting -
Ctc -
Exp Ctc -
Notice -
Current location -
Interested for Guindy Chennai
Mail I'd: rachana.mishra@mindgate.in
Contact No: 8925222645
Intellectual design arena
Irfana 073059 99525
Robert bosch
HR. +919916374007
For bangalore location
Looking for 4+ years
Hi,
We have Opening for " PLSQL Developer "with one of our leading clients BNP PARIBAS
for working on their Applications
You will be taken on Permanent payroll with MITS IT Services (www.mitsit.in) and placed at the client site BNP Paribas (www.bnppispl.com) in Mumbai
BNP Paribas India Solutions (BNPPISPL) is a global delivery centre for BNP Paribas Group, one of the largest banking groups in the world. Its strength is more than 2000 people in India. BNPPISPL has its presence in Mumbai and Chennai.
MITS IT services provides onsite services to large IT companies and offshore development centres for companies like BNP PARIBAS, HSBC, ANZ, Sears, Societe Generale etc.
We provide facilities like PF, Mediclaim, Training, Bench Support .
Job Profile : PLSQL Developer
Experience : 4 to 9. years
Location : Chennai (Global Infocity )
Notice Period :0 to 45 days only
Job Description :
5-8 years experience as a Oracle developer.
ODI/OBIEE good to have.
If interested, please revert with you updated CV only in "word format" along with the following details asap; Bhagyashree@mitsit.in
* Current CTC:
* Expected CTC:
* Notice period:
PAN Card No :
Current location (Chennai /Hometown ) :
Comfortable for Payroll:
* Your full name:
* Marital status:
--
Thanks & Regards,
Bhagyashree Pashte
IT - Recruitment
MITS Global Consulting Pvt.Ltd
Ph: 91-9137875045
Website: www.mitsit.in
HR name rachana
+91 89252 22645
Database developer position
Job Description·
* Person should have 3 -6 years of experience working in any one the database like Oracle/MySQL/SQL
* Must have experience in Query tuning, Shell Scripting, Performance tuning & Sql queries
* Must have worked on Linux
* DB migration
* Must be ready to work from Office location whenever notified
this is from KG information system Pvt. Ltd
HR name Ravi Kumar
+91 96885 17095
Guhan optimum solution
8973274866
9600787106 Gayathri bhawan cyber
9600170667 Ashok bhawan cyber
Mohan Bawan Cybertek
+91 87546 08866
1. Tell abt u r self
2. Roles and responsibilities
3. Recent CR in project
4. Views and types
5. (Steven) count no of 'e' in string.
6. Name1 $ name 2 $ name3
Display without $ symbol.
7. T1. T2
10. 10
20. 20
30. 30
40
50
Display the records not in t2 table using sub queries
8. Sub queries and types
9. Primary and foreign key functions
10. Scenario questions from NVL functions
11. Difference between cursors and refcursor, How to declare refcursor
12. What is collection and types, Can we initialize collection in procedure
13. Difference between procedures and functions
14. What is trigger and purpose
15. Current CTC, Expected CTC and Notice period
1.company name
2.where it is
3.what is tkprof
4.can u do pragma autonomous for function
5.can u do pragma autonomous for procedure
6.i have two procedure P1(normal procedure) and P2(pragma autonomous procedure) i have function F1 ,i want use P1 and P2 inside F1 how can i do
7.i have an insert and delete statement and i want to use it repeatedly how can i do it
8.what is pragma autonomous transaction and where u used in Ur project
9.i have a table T1 which has more than 1lakh row ,i want separate the data genderwise and insert into table T2 and T3, write a program for that performance effectively
10.what is cronta
11.Have u worked in forms
12.what is Ur day today activity
13.have u worked in set operators, group function and nvl
14.what are the types of nvl with example
1. Tell about yourself.
2. Daily activities.
3. SQL*loader and used for?
4.what is external table?
5.dbms_profiler?
6. Explain plan?
7. Optimiser?
8. Write a query to find max salary in each department?
9. Write plsql query Using cursor ( with bulk collect) fetch from one table and insert it another table?
10.what is normalisation?
11.Update table c is the column name. Having two rows. A and b. Update a to b and b to a.
12. How to connect Unix with database?
13. In Unix $?,$$,$# for what it is used.
1.Tell me about yourself
2.Roles & Responsibilites
3.What is ir?
4.What is the name of your ticket tracking tool?
5.What is SLA?And describe it.
6.Tell me about the ir that you solved?
7.What are the sql commands that you used during ir?
8.What are joins?
9.Sql loader
10.What file did you use for sql loader?
11.What is mview?
12.Mview vs View
13.Trigger types?
14.Trigger timings?
15.Rate yourself on unix
16.Scenario based que on bad file
17.How to find directories and files?
18.Load sql file using shellscript?
19.Ok with rotational shifts?
20.Current ctc and expected ctc?
1. Brief about yourself
2.Roles and Responsibilities
3. What is incedent and change request
4. How you process in both
5. Commonly occurred incedent request in ur project
6.what is mview
7. Cam mview contains index
8.mview and photocopy
9.do you create mview
10.what is trigger
11.types
12.main purpose of trigger
13.day today activity
14.reason of leaving this company
1: Tell about your roles and responsibilities?
2:rate ur self sql&plsql
3: Explain abt Constraints?
4:write a syntax for foreign key?
5:what are all the types of joins?
6:tell about group functions and analytical functions?
7:what is synonyms?
8:write a program to display above age of 18 is meager and below age of 18 is minor ?
9:types of sub queries?
10: what is context Switching?
11:what is cursor ?
12:different between procedures and functions?
13: curent CTC
14:how many years do you have experience with forms and reports?
15:Do you have any knowlage on that?
1)Tell Abt ur self ?
2) Wat s joins
3)Wat s group function
4) Wat s constraints nd it's type write example
5) Wat s cursor nd ref cursor
6)exp in forms nd report
7) Wat s SQL loader
8) Wat s procedure
1)Tell Abt ur self
2)day by day Activities
3)SQL loder
4)External table
5) diff bw SQL loder nd external table
6)Wat s cvs
7)write query for create Database
8) write a query for create 3 tables
9) highest salary for Abve 3 tables wid employees details
10)Wat s record
11)Abt ur current project
12) Wat s Erwin ? It's work
1.tell abt ur project.
2.roles and responsibilities.
3.diff Between primary and unique?
4.table normalisation ?
5.tell about oracle forms and reports?
6.triggers used in ur current project?
7.tell abt mutating table ?
8.applications errors?
9.can we use commit and rollback in log table?
10.if yes what will happen?
11.exceptions used in ur project?
12.where u used index in ur project?
13.collections,methods,what collection u used?
14.sub questions and purpose?
15.analytical functions and aggregate functions?
16.packages,procedures and functions.
17.reason for a job change
18.current ctc and expectations
19.notice period.
1. Tell about yourself.
2. Roles and responsibilities
3. Performance tuning
4. Explain plan.
5. Index
6. Index types
7. If the query run time is 10 and then time we are run same query it's get one hour. What will the necessary step to take.
8. Hints
9. How will you connect UNIX
10. Are you in support or development process
11. What is shift timing.
12. CTC
13. Notice period.
1. Dbms_profiler
2. Sequence
3. Index
4. Explain plan
5. Bulk collection
6. Exception handling
7. SQL loader
8. Can we load image using sqlloader
9. Ref cursor
10. Triggers
11. Materlized view
12. Progma Types
13. Can we use commit comment inside the trigger
14. What are the previous defined exception are used
15. Senario based questions
1. What's view
2. What's virtual table
3. Can we manipulate data in view
4. What is Synonym
5. What is the use of set operater
6. What is joined
7. Difference between union operater and joins
8. What's metrilized view
9. Difference between trigger and package
10. Parameterized cursor
11. Difference between union index column and unique constraint column
12. Types of triggers
13. Difference between row level and statement level triggers
14. Ref cursor
15. Difference between procedure and function
16. Use of sequence
17. Raise application error
OLAM telephonic interview
1. tell about ur self
2. how much % working with Dev & support
3. ready to work with production support
4. what is ur role
5. what is ur team size
6. concepts of production support
7. what is ur project conscepts
8. rate itself unix
9. what ticket tracking tool u r used
10. how to solve ticket
11. last faced ticket
1. tell about ur self
2. how much % working with Dev & support
3. ready to work with production support
4. what is ur role
5. what is ur team size
6. concepts of production support
7. what is ur project conscepts
8. rate itself unix
9. what ticket tracking tool u r used
10. how to solve ticket
11. last faced ticket
1. Tell abt yourself
2.role and responsiblity your project
3. Detail explain your project
4. What is achieve you project
5.what is migration you project
6.'9000009 maker' display only maker
7.how to delete duplicate row
8.. highest salary from each department
1: Tell about ur project ?
2:Daily activities ?
3: tell about SLA's and responce and resolution timing?
4: who will do the deployment the code ?
5: what is IR, problem management and change management?
6: what are all the ways of communication between the team ?
7: tell about ur team structure ?
8: how many members are there in your team?
9: what challenging issue you faced recently tell me ur experience on that ?
10: if no one taking care of the tickets what will happen ?
11: how many IR you are handel in a month?
12: what is view?
13: whats is M.view and types?
14: types of joins ?
15: types of analytical functions?
16: current CTC
17: Expected CTC
18: Noties period
1.Tell about yourself
2.Difference between views & materialised view?
3.What is sequence and what about CYCLE,CACHE?
4.What is synonym?
5.what is public and private
synonym?
6.Difference between Function & Procedure?
7.In that function DML operation and commit? what will be doing?
8.What is cursor?
9.What is Trigger?
10.How many trigger used in an table?
11.In trigger what will be execute first its ROWLEVEL, STATEMENT LEVEL?
12.What is REF Cursor?
13.What is global temporary table?
14.What about Explain plan?
15.External Table?
16. Raise application error?
17.collections?
18.Bulk collect?
19.IR,PROBLEM MANAGEMENT?
qus 1 round
1. tell about ur self
2. oracle rate ur self out of 5
3. day today activities
4. last bug
5. update emp table a to b and b to a
6. cursor ref cursor diff
7. bulk collect with save exception
8. dbms profiler steps
9. what are tables involved dbms_profiler
10. user,all_user,dba_user permission difference
11. difference b/w pkg drop after create pkg and
create or replace pkg.
12. how find modify table affected proc
rate ur self in UNIX
13 how to find only files in location
14. how to connect oracle DB
15. particular string find & replace Permanant
2 round
---------------------
1. about ur self
2. explain ur project
3. insert into table two tables
4. record type program
5. collection methods
6. what is extend
7. delete perform in varray
8. how to partition existing table having 1 laksh of data
1. Tell about yourself
2. Roles and Responsibility
3. Bulk Collect
4. use of Bulk Collect using For All
5. Collections
6. differnce in collctions, Syntax for collection.
7. collection methods
8. cursor and ref cursor difference
9. functions and can dml be performed in functions and how
10. what is the use of procedure
11. package and procedure difference
12. the name of procedure in package is p1 and same p1 name can be used outside to create procedure.
13. types of trigger and trigger order
14. which one will execute first statement level or row level
15. synonym and what is public and private
16. 11g feautures
17. if we add column with default value of 1 how long will it take time to complete the transaction
18. what is materialized view.
19. how will you do tuning in sql queries
20. how will we create explain plan is there any default table for it
21. write a query to delete duplicate rows
22. what is global temporary table
23. why have you named your project online portal
24. what is sequence have you creted sequence
25. what is raise application error
26. what is the use of raise exception.
27. difference between save exceptions and exception
28. if a query cose is 40 how will you reduce the cost what are the ways u use.
29. in GTT once the session terminates will table exist in database
30. why we use cache and cycle in sequence
31. if a session gets terminated will catche fetched data will be in its memory
32. how will you view changes happening in log file live in unix
33. what is the use of tail command
first round
1. tell about urself
2. roles and responablities
3. know about production support
4. u know about data migration
5. how to interact with customer
6. production support teams rules
7. what is latest version of oracle DB used
8. sla concepts
9. what is anonymous block and procedure
10. where u used trigger and syntax of trigger
11. what are joins are there .
12. what is cross join
13. what is itil process
14. what is project concepts
....................................
second round project Manager
1. tell about urself
2. tel about project concepts
3. how to genrate forms having particular duration
4. what is ur application
5. are ready work with production suport
6. tell about education details
....................................
Third round -client round
1. tell about urself
2. how to connect database
3. u worked with data migration
4. what is ur roles
5. what are the joins used in performance tunning
6. how to lock a user, ulock user, change password
7. r u interact with customer
create or replace PACKAGE /*FS-250620-01*/ FS_AirQuotationManagement
AUTHID DEFINER
AS
/*
-----------------------------------------------------------------------------------------------------------------------------------
Modification History
----------------------------------------------------------------------------------------------------------------------------------
|| Version When Who What
|| -------------------------------------------------------------------------------------------------------------------------------
|| FS-020620-01 02-JUN-2020 Praveen Kumar. D Package created to define Air Quotation.
|| FS-250620-01 25-JUN-2020 Praveen Kumar. D Get_Ratefromtariff_Prc procedure added.
-----------------------------------------------------------------------------------------------------------------------------------
*/
TYPE t_list IS REF CURSOR;
PROCEDURE getLov_Airquotationreference_prc (
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE, -- To get air tariff reference number
p_type IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE ,
p_searchtext IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE ,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_Airquotation_count OUT fsaqh_airquotationheader.fsaqh_id%TYPE,
p_Airquotationreference OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsbkg_booking.fsbkg_referencenumber%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE getLov_copyreference_prc (
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE, -- To get copy reference number
p_searchtext IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE ,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_Airquotation_count OUT fsaqh_airquotationheader.fsaqh_id%TYPE,
p_Airquotationreference OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsbkg_booking.fsbkg_referencenumber%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE GetList_fsaqh_Prc ( --search for air quotation
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_fsbue_idcustomer IN fsaqh_airquotationheader.fsbue_idcustomer%TYPE,
p_fsaqh_quotationtype IN fsaqh_airquotationheader.fsaqh_quotationtype%TYPE,
p_fsaqh_shipmenttype IN fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_fsaqh_referencenumber IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqh_validfrom IN fsaqh_airquotationheader.fsaqh_validfrom%TYPE,
p_fsaqh_validto IN fsaqh_airquotationheader.fsaqh_validto%TYPE,
p_fsbue_idcarrier IN fsaqh_airquotationheader.fsbue_idcustomer%TYPE,
p_fsart_idfromAirport IN fsaqt_airquotationtransportstation.fsart_idfromAirport%TYPE,
p_fsart_idtoAirport IN fsaqt_airquotationtransportstation.fsart_idtoAirport%TYPE,
p_quotationparty IN fsaqh_airquotationheader.fsaqh_quotationtype%TYPE,
p_partner IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_fsaqh_status IN fsaqh_airquotationheader.fsaqh_status%TYPE,
p_page_index IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_page_size IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_sort_field IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE,
p_sort_type IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE,
p_fsaqh_count OUT fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqh_list OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_status%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE Get_airquotationratedetails_Prc ( --Quotation creation
p_fsaqh_id IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_airquotationrateheader_details OUT FS_AirQuotationManagement.t_list,
p_airquotationrate_details OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_status%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE Get_Ratefromtariff_Prc ( --get rates from tariff
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_fsbue_idcustomer IN fsaqh_airquotationheader.fsbue_idcustomer%TYPE,
p_fssqh_shipmenttype IN fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_fsbue_idcarrier IN fsbue_businessentity.fsbue_name%TYPE,
p_route IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_header_details OUT FS_AirQuotationManagement.t_list,
p_Tariff_details OUT FS_AirQuotationManagement.t_list,
p_weightdetails OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE Get_localcharges_Prc ( --get local charges
p_fsofo_id IN fssqh_seaquotationheader.fsofo_id%TYPE,
p_fsbue_idcustomer IN fssqh_seaquotationheader.fsbue_idcustomer%TYPE,
p_fsofo_idpartner IN fssqh_seaquotationheader.fsofo_idpartner%TYPE,
p_fssqh_shipmenttype IN fssqh_seaquotationheader.fssqh_shipmenttype%TYPE,
p_fssqh_isexportimport IN fssqh_seaquotationheader.fssqh_isexportimport%TYPE,
p_route IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_Tariff_deatils OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fssqh_seaquotationheader.fssqh_shipmenttype %TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE Get_airquotationtariff_Prc ( --Retrive quotation details
p_fsaqh_id IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqt_id IN fsaqh_airquotationheader.fsaqh_remarks%TYPE,
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_airquotationhdrdetails OUT FS_AirQuotationManagement.t_list,
p_airquotationport_details OUT FS_AirQuotationManagement.t_list,
p_airquotationrate_details OUT FS_AirQuotationManagement.t_list,
p_surcharge_details OUT FS_AirQuotationManagement.t_list,
p_localcharge_details OUT FS_AirQuotationManagement.t_list,
p_weightdetails OUT FS_AirQuotationManagement.t_list,
p_precarriage_details OUT FS_AirQuotationManagement.t_list,
p_precarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_oncarriage_details OUT FS_AirQuotationManagement.t_list,
p_oncarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_status%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE Get_intermodel_Prc (
p_fsaqh_id IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqu_id IN FSAQU_AirQuotationIntermodel.fsaqu_id%TYPE,
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_precarriage_details OUT FS_AirQuotationManagement.t_list,
p_precarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_oncarriage_details OUT FS_AirQuotationManagement.t_list,
p_oncarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqh_prc(
p_fsaqh_id IN OUT FSAQH_AirQuotationHeader.fsaqh_id%TYPE,
p_fsofo_id IN FSAQH_AirQuotationHeader.fsofo_id%TYPE,
p_fsaqh_referencenumber IN OUT FSAQH_AirQuotationHeader.fsaqh_referencenumber%TYPE,
p_fsaqh_referencedate IN FSAQH_AirQuotationHeader.fsaqh_referencedate%TYPE,
p_fsbue_idcustomer IN FSAQH_AirQuotationHeader.fsbue_idcustomer%TYPE,
p_fsofo_idsalesoffice IN FSAQH_AirQuotationHeader.fsofo_idsalesoffice%TYPE,
p_fsaqh_customerdetails IN FSAQH_AirQuotationHeader.fsaqh_customerdetails%TYPE,
p_fsaqh_quotationtype IN FSAQH_AirQuotationHeader.fsaqh_quotationtype%TYPE,
p_fsaqh_shipmenttype IN FSAQH_AirQuotationHeader.fsaqh_shipmenttype%TYPE,
p_fsaqh_minimumconfirmedquantity IN FSAQH_AirQuotationHeader.fsaqh_minimumconfirmedquantity%TYPE,
p_fsaqh_minimumconfirmedquantitytype IN FSAQH_AirQuotationHeader.fsaqh_minimumconfirmedquantitytype%TYPE,
p_fsaqh_incoterms IN FSAQH_AirQuotationHeader.fsaqh_incoterms%TYPE,
p_fsaqh_isexportimport IN FSAQH_AirQuotationHeader.fsaqh_isexportimport%TYPE,
p_fscry_idquotation IN FSAQH_AirQuotationHeader.fscry_idquotation%TYPE,
p_fsaqh_validfrom IN FSAQH_AirQuotationHeader.fsaqh_validfrom%TYPE,
p_fsaqh_validto IN FSAQH_AirQuotationHeader.fsaqh_validto%TYPE,
p_fsaqh_weight IN FSAQH_AirQuotationHeader.fsaqh_weight%TYPE,
p_fsmea_id IN FSAQH_AirQuotationHeader.fsmea_id%TYPE,
p_fsaqh_volume IN FSAQH_AirQuotationHeader.fsaqh_volume%TYPE,
p_fsaqh_quotationpartytype IN FSAQH_AirQuotationHeader.fsaqh_quotationpartytype%TYPE,
p_fsofo_idpartner IN FSAQH_AirQuotationHeader.fsofo_idpartner%TYPE,
p_fsaqh_isshowcarrier IN FSAQH_AirQuotationHeader.fsaqh_isshowcarrier%TYPE,
p_fsaqh_withdrawreason IN FSAQH_AirQuotationHeader.fsaqh_withdrawreason%TYPE,
p_fsaqh_status IN FSAQH_AirQuotationHeader.fsaqh_status%TYPE,
p_fsaqh_remarks IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_user_id IN FSAQH_AirQuotationHeader.fsaqh_createdby%TYPE,
p_record_status IN FSAQH_AirQuotationHeader.fsaqh_purgeyear%TYPE,
p_issuccess OUT FSAQH_AirQuotationHeader.fsaqh_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqc_prc(
p_fsaqc_id IN OUT FSAQC_AirQuotationCarrier.fsaqc_id%TYPE,
p_fsofo_id IN FSAQC_AirQuotationCarrier.fsofo_id%TYPE,
p_fsaqh_id IN FSAQC_AirQuotationCarrier.fsaqh_id%TYPE,
p_fsbue_idcarrier IN FSAQC_AirQuotationCarrier.fsbue_idcarrier%TYPE,
p_user_id IN FSAQC_AirQuotationCarrier.fsaqc_createdby%TYPE,
p_record_status IN FSAQC_AirQuotationCarrier.fsaqc_purgeyear%TYPE,
p_issuccess OUT FSAQC_AirQuotationCarrier.fsaqc_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqd_prc(
p_fsaqd_id IN OUT FSAQD_AirQuotationDeal.fsaqd_id%TYPE,
p_fsofo_id IN FSAQD_AirQuotationDeal.fsofo_id%TYPE,
p_fsaqh_id IN FSAQD_AirQuotationDeal.fsaqh_id%TYPE,
p_fsdlm_id IN FSAQD_AirQuotationDeal.fsdlm_id%TYPE,
p_user_id IN FSAQD_AirQuotationDeal.fsaqd_createdby%TYPE,
p_record_status IN FSAQD_AirQuotationDeal.fsaqd_purgeyear%TYPE,
p_issuccess OUT FSAQD_AirQuotationDeal.fsaqd_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqt_prc(
p_fsaqt_id IN OUT FSAQT_AirQuotationTransportStation.fsaqt_id%TYPE,
p_fsofo_id IN FSAQT_AirQuotationTransportStation.fsofo_id%TYPE,
p_fsaqh_id IN FSAQT_AirQuotationTransportStation.fsaqh_id%TYPE,
p_fsart_fromport IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_fsart_toport IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_transhipmentport IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_fsaqt_travellingtime IN FSAQT_AirQuotationTransportStation.fsaqt_travellingtime%TYPE,
p_fsaqt_dayoffrequency IN FSAQT_AirQuotationTransportStation.fsaqt_dayoffrequency%TYPE,
p_routeexist IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_user_id IN FSAQT_AirQuotationTransportStation.fsaqt_createdby%TYPE,
p_record_status IN FSAQT_AirQuotationTransportStation.fsaqt_purgeyear%TYPE,
p_issuccess OUT FSAQT_AirQuotationTransportStation.fsaqt_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaql_prc( -- Air Quotation Email
p_fsaql_id IN OUT FSAQL_AirQuotationEmail.fsaql_id%TYPE,
p_fsofo_id IN FSAQL_AirQuotationEmail.fsofo_id%TYPE,
p_fsaqh_id IN FSAQL_AirQuotationEmail.fsaqh_id%TYPE,
p_fsaql_email IN FSAQH_AirQuotationheader.fsaqh_remarks%TYPE,
p_user_id IN FSAQL_AirQuotationEmail.fsaql_createdby%TYPE,
p_record_status IN FSAQL_AirQuotationEmail.fsaql_purgeyear%TYPE,
p_issuccess OUT FSAQL_AirQuotationEmail.fsaql_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqe_prc(
p_fsaqe_id IN OUT FSAQE_AirQuotationEquipment.fsaqe_id%TYPE,
p_fsofo_id IN FSAQE_AirQuotationEquipment.fsofo_id%TYPE,
p_fsaqt_id IN FSAQE_AirQuotationEquipment.fsaqt_id%TYPE,
p_fseqt_sizetypeuld IN FSAQE_AirQuotationEquipment.fseqt_sizetypeuld%TYPE,
p_fsaqe_cargotype IN FSAQE_AirQuotationEquipment.fsaqe_cargotype%TYPE,
p_fscmg_group IN FSAQH_AirQuotationheader.fsaqh_remarks%TYPE,
p_user_id IN FSAQE_AirQuotationEquipment.fsaqe_createdby%TYPE,
p_record_status IN FSAQE_AirQuotationEquipment.fsaqe_purgeyear%TYPE,
p_issuccess OUT FSAQE_AirQuotationEquipment.fsaqe_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqu_prc(
p_fsaqu_id IN OUT FSAQU_AirQuotationIntermodel.fsaqu_id%TYPE,
p_fsofo_id IN FSAQU_AirQuotationIntermodel.fsofo_id%TYPE,
p_fsaqh_id IN FSAQU_AirQuotationIntermodel.fsaqh_id%TYPE,
p_fsaqu_shipmenttype IN FSAQU_AirQuotationIntermodel.fsaqu_shipmenttype%TYPE,
p_fsaqu_ismultimode IN FSAQU_AirQuotationIntermodel.fsaqu_ismultimode%TYPE,
p_fsaqu_ismultistop IN FSAQU_AirQuotationIntermodel.fsaqu_ismultistop%TYPE,
p_fsloc_idfrom IN FSAQU_AirQuotationIntermodel.fsloc_idfrom%TYPE,
p_fsaqu_zipcodefrom IN FSAQU_AirQuotationIntermodel.fsaqu_zipcodefrom%TYPE,
p_fsaqu_zipcodeto IN FSAQU_AirQuotationIntermodel.fsaqu_zipcodeto%TYPE,
p_fsloc_idto IN FSAQU_AirQuotationIntermodel.fsloc_idto%TYPE,
p_fsaqu_modeoftransport IN FSAQU_AirQuotationIntermodel.fsaqu_modeoftransport%TYPE,
p_fsaqu_transit IN FSAQU_AirQuotationIntermodel.fsaqu_transit%TYPE,
p_fsaqu_transittype IN FSAQU_AirQuotationIntermodel.fsaqu_transittype%TYPE,
p_fsaqu_specialinstruction IN FSAQU_AirQuotationIntermodel.fsaqu_specialinstruction%TYPE,
p_fsaqu_fromlocationaddress IN FSAQU_AirQuotationIntermodel.fsaqu_fromlocationaddress%TYPE,
p_fsaqu_tolocationaddress IN FSAQU_AirQuotationIntermodel.fsaqu_tolocationaddress%TYPE,
p_fsaqu_locationtype IN FSAQU_AirQuotationIntermodel.fsaqu_locationtype%TYPE,
p_fsaqu_idparent IN FSAQU_AirQuotationIntermodel.fsaqu_idparent%TYPE,
p_fsaqu_purgeyear IN FSAQU_AirQuotationIntermodel.fsaqu_purgeyear%TYPE,
p_user_id IN FSAQU_AirQuotationIntermodel.fsaqu_createdby%TYPE,
p_record_status IN FSAQU_AirQuotationIntermodel.fsaqu_purgeyear%TYPE,
p_issuccess OUT FSAQU_AirQuotationIntermodel.fsaqu_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqr_prc(
p_fsaqr_id IN OUT FSAQR_AirQuotationRate.fsaqr_id%TYPE,
p_fsofo_id IN FSAQR_AirQuotationRate.fsofo_id%TYPE,
p_fsaqt_id IN FSAQR_AirQuotationRate.fsaqt_id%TYPE,
p_fsaqu_id IN FSAQR_AirQuotationRate.fsaqu_id%TYPE,
p_fsatr_id IN FSAQR_AirQuotationRate.fsatr_id%TYPE,
p_fsasr_id IN FSAQR_AirQuotationRate.fsasr_id%TYPE,
p_fslar_id IN FSAQR_AirQuotationRate.fslar_id%TYPE,
p_fschg_id IN FSAQR_AirQuotationRate.fschg_id%TYPE,
p_fsaqr_basis IN FSAQR_AirQuotationRate.fsaqr_basis%TYPE,
p_fsaqr_cargotype IN FSAQR_AirQuotationRate.fsaqr_cargotype%TYPE,
p_fseqt_sizetypeuld IN FSAQR_AirQuotationRate.fseqt_sizetypeuld%TYPE,
p_fscmg_id IN FSAQR_AirQuotationRate.fscmg_id%TYPE,
p_fsaqr_weighttype IN FSAQR_AirQuotationRate.fsaqr_weighttype%TYPE,
p_fscry_id IN FSAQR_AirQuotationRate.fscry_id%TYPE,
p_fsaqr_ispax IN FSAQR_AirQuotationRate.fsaqr_ispax%TYPE,
p_fsaqr_weight IN FSAQR_AirQuotationRate.fsaqr_weight%TYPE,
p_fsmea_id IN FSAQR_AirQuotationRate.fsmea_id%TYPE,
p_fsaqr_tariffrate IN FSAQR_AirQuotationRate.fsaqr_tariffrate%TYPE,
p_fsaqr_markuptype IN FSAQR_AirQuotationRate.fsaqr_markuptype%TYPE,
p_fsaqr_markupvalue IN FSAQR_AirQuotationRate.fsaqr_markupvalue%TYPE,
p_fsaqr_sellingrate IN FSAQR_AirQuotationRate.fsaqr_sellingrate%TYPE,
p_fsaqr_mintariffrate IN FSAQR_AirQuotationRate.fsaqr_mintariffrate%TYPE,
p_fsaqr_minmarkuptype IN FSAQR_AirQuotationRate.fsaqr_minmarkuptype%TYPE,
p_fsaqr_minmarkupvalue IN FSAQR_AirQuotationRate.fsaqr_minmarkupvalue%TYPE,
p_fsaqr_minsellingrate IN FSAQR_AirQuotationRate.fsaqr_minsellingrate%TYPE,
p_fsaqr_additionaldayfee IN FSAQR_AirQuotationRate.fsaqr_additionaldayfee%TYPE,
p_fsaqr_pivotweight IN FSAQR_AirQuotationRate.fsaqr_pivotweight%TYPE,
p_fsbue_idcarrier IN FSAQR_AirQuotationRate.fsbue_idcarrier%TYPE,
p_fsaqr_isexportimport IN FSAQR_AirQuotationRate.fsaqr_isexportimport%TYPE,
p_fsaqr_remarks IN FSAQR_AirQuotationRate.fsaqr_remarks%TYPE,
p_inclusivecharge IN FSAQR_AirQuotationRate.fsaqr_remarks%TYPE,
p_user_id IN FSAQR_AirQuotationRate.fsaqr_createdby%TYPE,
p_record_status IN FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_issuccess OUT FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
PROCEDURE put_fsaqw_prc(
p_fsaqw_id IN OUT FSAQW_AirQuotationSlabRate.fsaqw_id%TYPE,
p_fsofo_id IN FSAQW_AirQuotationSlabRate.fsofo_id%TYPE,
p_fsaqr_id IN FSAQW_AirQuotationSlabRate.fsaqr_id%TYPE,
p_fsatm_id IN FSAQW_AirQuotationSlabRate.fsatm_id%TYPE,
p_fsaqw_buyingrate IN FSAQW_AirQuotationSlabRate.fsaqw_buyingrate%TYPE,
p_fsaqw_markupvalue IN FSAQW_AirQuotationSlabRate.fsaqw_markupvalue%TYPE,
p_fsaqw_sellingrate IN FSAQW_AirQuotationSlabRate.fsaqw_sellingrate%TYPE,
P_fsaqw_weight IN FSAQW_AirQuotationSlabRate.fsaqw_weight%TYPE,
p_user_id IN FSAQR_AirQuotationRate.fsaqr_createdby%TYPE,
p_record_status IN FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_issuccess OUT FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list);
END FS_AirQuotationManagement;
create or replace PACKAGE BODY FS_AirQuotationManagement
AS
PROCEDURE getLov_Airquotationreference_prc (
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE, -- To get air tariff reference number
p_type IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE ,
p_searchtext IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE ,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_Airquotation_count OUT fsaqh_airquotationheader.fsaqh_id%TYPE,
p_Airquotationreference OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsbkg_booking.fsbkg_referencenumber%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_type) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_searchtext) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query :='SELECT NULL AS fsaqh_id ,
NULL AS fsaqh_referencenumber
FROM fsaqh_airquotationheader fsaqh
WHEER 1=2 ' ;
ELSE
l_query :='SELECT fsaqh.fsaqh_id AS fsaqh_id ,
fsaqh.fsaqh_referencenumber AS fsaqh_referencenumber
FROM fsaqh_airquotationheader fsaqh
WHERE ('''|| p_type || ''' IS NULL OR fsaqh.fsaqh_quotationtype = '''|| p_type || ''')
AND (('''|| p_searchtext|| ''' IS NULL) OR ( (UPPER(fsaqh.fsaqh_referencenumber) LIKE '''||'%'|| UPPER (p_searchtext)|| '%'||'''))) ';
l_query_cnt := 'SELECT COUNT(fsaqh_id) FROM (' || l_query || ') ';
p_Airquotation_count :=0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_Airquotation_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_Airquotationreference FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getLov_Airquotationreference_prc;
PROCEDURE getLov_copyreference_prc (
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE, -- To get copy reference number
p_searchtext IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE ,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_Airquotation_count OUT fsaqh_airquotationheader.fsaqh_id%TYPE,
p_Airquotationreference OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsbkg_booking.fsbkg_referencenumber%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_searchtext) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query :='SELECT NULL AS fsaqh_id ,
NULL AS fsaqh_referencenumber,
NULL AS Quotationpartytype,
NULL AS fsaqh_validto,
NULL AS fsgec_export_description,
NULL AS Customername,
NULL AS Partnername
FROM fsdul_dual fsdul
WHEER 1=2 ' ;
ELSE
l_query :='SELECT fsaqh.fsaqh_id AS fsaqh_id ,
fsaqh.fsaqh_referencenumber AS fsaqh_referencenumber,
partytype.fsgec_description AS Quotationpartytype,
fsaqh.fsaqh_validto AS fsaqh_validto,
fsgec_export.fsgec_description AS fsgec_export_description,
fsbue.fsbue_name AS Customername,
fsofo.fsofo_organizationname AS Partnername
FROM fsaqh_airquotationheader fsaqh
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsaqh.fsbue_idcustomer)
LEFT JOIN fsofo_officeorganization fsofo ON (fsofo.fsofo_id=fsaqh.fsofo_idpartner)
JOIN FSGEC_GeneralCode partytype ON (partytype.fsgec_referencename=''QUOTATIONPARTYTYPE'' AND partytype.fsgec_value=fsaqh.fsaqh_quotationpartytype )
JOIN fsgec_generalcode fsgec_export ON (fsgec_export.fsgec_referencename = ''BOOKINGTYPE'' AND fsgec_export.fsgec_value =fsaqh.fsaqh_isexportimport)
WHERE (('''|| p_searchtext|| ''' IS NULL) OR ( (UPPER(fsaqh.fsaqh_referencenumber) LIKE '''|| UPPER (p_searchtext)|| '%'||'''))) ';
l_query_cnt := 'SELECT COUNT(fsaqh_id) FROM (' || l_query || ') ';
p_Airquotation_count :=0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_Airquotation_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_Airquotationreference FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getLov_copyreference_prc;
PROCEDURE GetList_fsaqh_Prc ( --search for air quotation
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_fsbue_idcustomer IN fsaqh_airquotationheader.fsbue_idcustomer%TYPE,
p_fsaqh_quotationtype IN fsaqh_airquotationheader.fsaqh_quotationtype%TYPE,
p_fsaqh_shipmenttype IN fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_fsaqh_referencenumber IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqh_validfrom IN fsaqh_airquotationheader.fsaqh_validfrom%TYPE,
p_fsaqh_validto IN fsaqh_airquotationheader.fsaqh_validto%TYPE,
p_fsbue_idcarrier IN fsaqh_airquotationheader.fsbue_idcustomer%TYPE,
p_fsart_idfromAirport IN fsaqt_airquotationtransportstation.fsart_idfromAirport%TYPE,
p_fsart_idtoAirport IN fsaqt_airquotationtransportstation.fsart_idtoAirport%TYPE,
p_quotationparty IN fsaqh_airquotationheader.fsaqh_quotationtype%TYPE,
p_partner IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_fsaqh_status IN fsaqh_airquotationheader.fsaqh_status%TYPE,
p_page_index IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_page_size IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_sort_field IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE,
p_sort_type IN fsaqh_airquotationheader.fsaqh_referencenumber%TYPE,
p_fsaqh_count OUT fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqh_list OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_status%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_fsaqh_quotationtype) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_fsaqh_shipmenttype) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_quotationparty) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_fsaqh_status) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
p_fsaqh_count := 0;
OPEN p_fsaqh_list FOR SELECT NULL AS fsaqh_id,
NULL AS fsaqh_customername,
NULL AS fsaqh_quotationtype,
NULL AS fsaqh_quotationtype_description,
NULL AS fsaqh_shipmenttype,
NULL AS fsaqh_shipmenttype_description,
NULL AS fsaqh_referencenumber,
NULL AS fsaqh_carriername,
NULL AS fsart_fromport,
NULL AS fsart_toport,
NULL AS fsaqh_validfrom,
NULL AS fsaqh_validto,
NULL AS fsaqh_status_description
--NULL AS fsaqh_versionnumber
FROM FSDUL_Dual
WHERE 1=2 ;
ELSE
l_query := '
SELECT fsaqh.fsaqh_id AS fsaqh_id,
fsbue_customer.fsbue_name AS fsaqh_customername,
fsaqh.fsaqh_quotationtype AS fsaqh_quotationtype,
fsgec_quotationtype.fsgec_description AS fsaqh_quotationtype_description,
fsaqh.fsaqh_shipmenttype AS fsaqh_shipmenttype,
fsgec_shipmenttype.fsgec_description AS fsaqh_shipmenttype_description,
fsaqh.fsaqh_referencenumber AS fsaqh_referencenumber,
(SELECT listagg (DISTINCT fsbue.fsbue_name,'', '' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqc.fsaqc_id)
FROM fsaqc_airquotationcarrier fsaqc
JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsaqc.fsbue_idcarrier)
WHERE fsaqc.fsaqh_id= fsaqc.fsaqh_id
) AS fsaqh_carriername,
fsart_fromairport.fsart_name AS fsart_fromport,
fsart_toairport.fsart_name AS fsart_toport,
fsaqh.fsaqh_validfrom AS fsaqh_validfrom,
fsaqh.fsaqh_validto AS fsaqh_validto,
fsgec_status.fsgec_description AS fsaqh_status_description
--fsaqh.fsaqh_versionnumber AS fsaqh_versionnumber
FROM fsaqh_airquotationheader fsaqh
JOIN fsaqt_airquotationtransportstation fsaqt ON (fsaqt.fsaqh_id=fsaqh.fsaqh_id)
JOIN FSART_AirportMaster fsart_fromairport ON (fsart_fromairport.fsart_id=fsaqt.fsart_idfromairport)
JOIN FSART_AirportMaster fsart_toairport ON (fsart_toairport.fsart_id=fsaqt.fsart_idtoairport)
JOIN fsbue_businessentity fsbue_customer ON (fsbue_customer.fsbue_id=fsaqh.fsbue_idcustomer)
--JOIN fsaqc_airquotationcarrier fsaqc ON (fsaqc.fsaqh_id=fsaqh.fsaqh_id)
-- JOIN fsbue_businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsaqc.fsbue_idcarrier)
JOIN FSGEC_GeneralCode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_value=fsaqh.fsaqh_quotationtype AND fsgec_quotationtype.fsgec_referencename=''QUOTATIONTYPE'')
JOIN FSGEC_GeneralCode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_value=fsaqh.fsaqh_shipmenttype AND fsgec_shipmenttype.fsgec_referencename=''AIRSHIPMENTTYPE'')
JOIN FSGEC_GeneralCode fsgec_status ON (fsgec_status.fsgec_value=fsaqh.fsaqh_status AND fsgec_status.fsgec_referencename=''QUOTATIONSTATUS'')
WHERE 1=1 ';
IF p_fsaqh_validfrom IS NOT NULL THEN
l_query := l_query || ' AND TRUNC(fsaqh.fsaqh_validfrom) >= '''|| TRUNC(p_fsaqh_validfrom) ||'''' ;
END IF;
IF p_fsaqh_validto IS NOT NULL THEN
l_query := l_query || ' AND TRUNC(fsaqh.fsaqh_validto) <= '''|| TRUNC(p_fsaqh_validto)||'''' ;
END IF;
IF p_fsaqh_status IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsaqh_status = '''|| p_fsaqh_status|| '''';
END IF;
IF p_fsbue_idcustomer IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsbue_idcustomer = '''|| p_fsbue_idcustomer|| ''' ';
END IF;
IF p_fsaqh_referencenumber IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsaqh_referencenumber = '''|| p_fsaqh_referencenumber|| '''';
END IF;
IF p_fsaqh_quotationtype IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsaqh_quotationtype = '''|| p_fsaqh_quotationtype|| '''';
END IF;
IF p_fsaqh_shipmenttype IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsaqh_shipmenttype = '''|| p_fsaqh_shipmenttype|| '''';
END IF;
IF p_fsbue_idcarrier IS NOT NULL THEN
l_query := l_query || ' AND EXISTS (SELECT ''Y'' FROM fsaqc_airquotationcarrier fsaqc
WHERE fsaqc.fsaqh_id=fssqh.fsaqh_id
AND fsaqc.fsbue_idcarrier='''|| p_fsbue_idcarrier|| ''')';
END IF;
IF p_fsart_idfromAirport IS NOT NULL THEN
l_query := l_query || ' AND fsaqt.fsart_idfromAirport ='''|| p_fsart_idfromAirport|| '''';
END IF;
IF p_fsart_idtoAirport IS NOT NULL THEN
l_query := l_query || ' AND fsaqt.fsart_idtoAirport ='''|| p_fsart_idtoAirport|| '''';
END IF;
IF p_partner IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsofo_idpartner = '''|| p_partner|| '''';
END IF;
IF p_quotationparty IS NOT NULL THEN
l_query := l_query || ' AND fsaqh.fsaqh_quotationpartytype = '''|| p_quotationparty|| '''';
END IF;
l_query_cnt := 'SELECT COUNT(fsaqh_id) FROM (' || l_query || ') ';
p_fsaqh_count := 0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_fsaqh_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_fsaqh_list FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END GetList_fsaqh_Prc;
PROCEDURE Get_airquotationratedetails_Prc ( --Quotation creation
p_fsaqh_id IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_airquotationrateheader_details OUT FS_AirQuotationManagement.t_list,
p_airquotationrate_details OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_status%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
OPEN p_airquotationrateheader_details FOR
SELECT fsaqh.fsaqh_id AS fsaqh_id,
fsaqh.fsbue_idcustomer AS fsbue_idcustomer,
fsbue_customer.fsbue_name AS fsaqh_customername,
fsaqh.fsaqh_customerdetails AS fsbue_customerdetail,
quotationpartytype.fsgec_description AS quotationpartytype_description ,
fsaqh.fsaqh_quotationpartytype AS fsaqh_quotationpartytype,
fsaqh.fsofo_idpartner AS fsofo_idpartner,
fsofo_partner.fsofo_organizationname AS parter_name,
--fsbua.fsbua_buildingname||' '||fsbua.fsbua_street||' '||fsbua.fsbua_pobox||' '||fsbua.fsbua_phone||' '||fsbua.fsbua_fax AS fsbue_customerdetail,
fsaqh.fsaqh_quotationtype AS fsaqh_quotationtype,
fsgec_quotationtype.fsgec_description AS fsaqh_quotationtype_description,
fsaqh.fsaqh_shipmenttype AS fsaqh_shipmenttype,
fsgec_shipmenttype.fsgec_description AS fsaqh_shipmenttype_description,
fsaqh.fsaqh_minimumconfirmedquantity AS fsaqh_minimumconfirmedquantity,
fsaqh.fsaqh_minimumconfirmedquantitytype AS fsaqh_minimumconfirmedquantitytype,
fsgec_mcq.fsgec_description AS fsaqh_mcqtype_description,
fsaqh.fsaqh_weight AS fsaqh_weight,
fsaqh.fsmea_id AS fsmea_id,
fsmea_weight.fsmea_isocode AS fsaqh_weight_unit,
fsaqh.fsaqh_volume AS fsaqh_volume,
fsaqh.fsaqh_incoterms AS fsaqh_incoterms,
fsgec_incoterms.fsgec_description AS fsaqh_incoterms_description,
fsaqh.fscry_idquotation AS fscry_idquotation,
fscry.fscry_code AS fscry_code,
fsaqh.fsaqh_isexportimport AS fsaqh_isexportimport,
fsgec_importexport.fsgec_description AS fsaqh_isexportimport_description,
(SELECT listagg (DISTINCT fsaqc.fsbue_idcarrier,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqc.fsaqc_id)
FROM fsaqc_airquotationcarrier fsaqc
WHERE fsaqc.fsaqh_id = fsaqh.fsaqh_id) AS fsaqh_carrierid,
(SELECT listagg (DISTINCT fsbue_carrier.fsbue_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqc.fsaqc_id)
FROM fsaqc_airquotationcarrier fsaqc
JOIN fsbue_businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsaqc.fsbue_idcarrier)
WHERE fsaqc.fsaqh_id = fsaqh.fsaqh_id) AS fsaqh_carriername,
fsaqh.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsofo.fsofo_organizationname AS sales_office,
fsaqh.fsaqh_remarks AS fsaqh_remarks,
(SELECT listagg (DISTINCT fsaqd.fsdlm_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqd.fsaqd_id)
FROM fsaqd_airquotationdeal fsaqd
WHERE fsaqd.fsaqh_id = fsaqh.fsaqh_id) AS DEALID,
(SELECT listagg (DISTINCT fsdlm.fsdlm_referencenumber,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqd.fsaqd_id)
FROM fsaqd_airquotationdeal fsaqd
JOIN fsdlm_dealmanagement fsdlm ON (fsdlm.fsdlm_id=fsaqd.fsdlm_id)
WHERE fsaqd.fsaqh_id = fsaqh.fsaqh_id) AS fsdlm_referencenumber
FROM fsaqh_airquotationheader fsaqh
LEFT JOIN fsbue_businessentity fsbue_customer ON (fsbue_customer.fsbue_id=fsaqh.fsbue_idcustomer)
LEFT JOIN FSOFO_Officeorganization fsofo ON (fsofo.fsofo_id=fsaqh.fsofo_idsalesoffice)
LEFT JOIN FSOFO_Officeorganization fsofo_partner ON (fsofo_partner.fsofo_id=fsaqh.fsofo_idpartner)
LEFT JOIN fsmea_measurement fsmea_weight ON (fsmea_weight.fsmea_id=fsaqh.fsmea_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsaqh.fscry_idquotation)
JOIN fsgec_generalcode quotationpartytype ON (quotationpartytype.fsgec_referencename='QUOTATIONPARTYTYPE' AND quotationpartytype.fsgec_value=fsaqh.fsaqh_quotationpartytype )
JOIN FSGEC_GeneralCode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_value=fsaqh.fsaqh_quotationtype AND fsgec_quotationtype.fsgec_referencename='QUOTATIONTYPE')
JOIN FSGEC_GeneralCode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_value=fsaqh.fsaqh_shipmenttype AND fsgec_shipmenttype.fsgec_referencename='AIRSHIPMENTTYPE')
LEFT JOIN FSGEC_GeneralCode fsgec_mcq ON (fsgec_mcq.fsgec_value=fsaqh.fsaqh_minimumconfirmedquantitytype AND fsgec_mcq.fsgec_referencename='QUOTATIONMCQ')
JOIN FSGEC_GeneralCode fsgec_incoterms ON (fsgec_incoterms.fsgec_value=fsaqh.fsaqh_incoterms AND fsgec_incoterms.fsgec_referencename='BOOKINGINCOTERMS')
JOIN FSGEC_GeneralCode fsgec_importexport ON (fsgec_importexport.fsgec_value=fsaqh.fsaqh_isexportimport AND fsgec_importexport.fsgec_referencename='BOOKINGTYPE')
WHERE fsaqh.fsaqh_id=p_fsaqh_id;
OPEN p_airquotationrate_details FOR
SELECT fsart_fromport.fsart_name AS fsart_fromport,
fsaqt.fsart_idfromAirport AS fsart_idfromAirport,
fsart_toport.fsart_name AS fsart_toport,
fsaqt.fsart_idtoAirport AS fsart_idtoAirport,
(SELECT listagg (DISTINCT transhipment.fsart_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqp.fsaqp_id)
FROM fsaqp_airquotationtranshipment fsaqp
JOIN fsart_airportmaster transhipment ON (transhipment.fsart_id=fsaqp.fsart_idtranshipment)
WHERE fsaqp.fsaqt_id = fsaqt.fsaqt_id) AS fsprt_transhipment,
(SELECT listagg (DISTINCT fsaqp.fsart_idtranshipment,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqp.fsaqp_id)
FROM fsaqp_airquotationtranshipment fsaqp
WHERE fsaqp.fsaqt_id = fsaqt.fsaqt_id) AS transhipmentid,
(SELECT listagg (DISTINCT fsaqe.fsaqe_cargotype,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqe.fsaqe_id)
FROM fsaqe_airquotationequipment fsaqe
WHERE fsaqe.fsaqt_id = fsaqt.fsaqt_id) AS fsaqe_cargotype,
(SELECT listagg (DISTINCT fsaqe.fseqt_sizetypeuld,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqe.fsaqe_id)
FROM fsaqe_airquotationequipment fsaqe
WHERE fsaqe.fsaqt_id = fsaqt.fsaqt_id) AS fseqt_sizetypeuld,
(SELECT listagg (DISTINCT fsaqm.fscmg_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqm.fsaqm_id)
FROM fsaqm_airquotationcommodity fsaqm
WHERE fsaqm.fsaqt_id = fsaqt.fsaqt_id) AS commodityid,
(SELECT listagg (DISTINCT fscmg.fscmg_code,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqm.fsaqm_id)
FROM fsaqm_airquotationcommodity fsaqm
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsaqm.fscmg_id)
WHERE fsaqm.fsaqt_id = fsaqt.fsaqt_id) AS fscmg_groupcode
FROM fsaqt_airquotationtransportstation fsaqt
JOIN fsart_airportmaster fsart_fromport ON (fsart_fromport.fsart_id = fsaqt.fsart_idfromAirport)
JOIN fsart_airportmaster fsart_toport ON (fsart_toport.fsart_id = fsaqt.fsart_idtoAirport)
WHERE fsaqt.fsaqh_id=p_fsaqh_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_airquotationratedetails_Prc;
PROCEDURE Get_Ratefromtariff_Prc ( --get rates from tariff
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_fsbue_idcustomer IN fsaqh_airquotationheader.fsbue_idcustomer%TYPE,
p_fssqh_shipmenttype IN fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_fsbue_idcarrier IN fsbue_businessentity.fsbue_name%TYPE,
p_route IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_header_details OUT FS_AirQuotationManagement.t_list,
p_Tariff_details OUT FS_AirQuotationManagement.t_list,
p_weightdetails OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
v_route fsdcl_documentationchangelog.fsdcl_content%TYPE;
BEGIN
v_route:=REPLACE(p_route,'\','');
OPEN p_header_details FOR
WITH route_details AS
(SELECT jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType,
LISTAGG(DISTINCT jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup,
LISTAGG(DISTINCT jt.Via, ',') WITHIN GROUP (ORDER BY 1) Viaport
FROM
JSON_TABLE(v_route,'$[*]'
COLUMNS (
Fromportid VARCHAR2(100) PATH '$.From',
Toportid VARCHAR2(100) PATH '$.To' ,
CargoType VARCHAR2(100) PATH '$.CargoType' ,
UldType VARCHAR2(100) PATH '$.UldType' ,
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id') ,
NESTED PATH '$.Via[*]'
COLUMNS (Via VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType)
SELECT fsath.fsath_id AS fsath_id,
fsatt.fsatt_id AS fsatt_id,
fsath.fsbue_idline AS fsbue_idline,
fsbue.fsbue_name AS fsbue_name,
fsart_fromport.fsart_name AS fsart_fromport,
fsatt.fsart_idfromAirport AS fsart_idfromAirport,
fsart_toport.fsart_name AS fsart_toport,
fsatt.fsart_idtoAirport AS fsart_idtoAirport,
fsatt.fsatt_transitdays AS fsatt_transitdays,
(SELECT listagg (DISTINCT fsatp.fsart_idtranshipment,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsatp.fsatp_id)
FROM fsatp_airtarifftranshipment fsatp
WHERE fsatp.fsatt_id = fsatt.fsatt_id) AS transhipmentid,
(SELECT listagg (DISTINCT transhipment.fsart_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsatp.fsatp_id)
FROM fsatp_airtarifftranshipment fsatp
JOIN fsart_airportmaster transhipment ON (transhipment.fsart_id=fsatp.fsart_idtranshipment)
WHERE fsatp.fsatt_id = fsatt.fsatt_id) AS transhipment,
(SELECT listagg (DISTINCT fsatf.fsatf_dayoffrequency,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsatf.fsatf_id)
FROM fsatf_airtarifftransportfrequency fsatf
WHERE fsatf.fsatt_id=fsatt.fsatt_id
) AS fsatf_dayoffrequency,
(SELECT listagg (DISTINCT fsgec.fsgec_description,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsatf.fsatf_id)
FROM fsatf_airtarifftransportfrequency fsatf
JOIN fsgec_generalcode fsgec ON (fsgec.fsgec_referencename='FREQUENCY' AND fsgec.fsgec_value=fsatf.fsatf_dayoffrequency)
WHERE fsatf.fsatt_id=fsatt.fsatt_id
) AS fsatf_dayoffrequency_description
FROM fsath_airtariffheader fsath
JOIN fsatt_airtarifftransport fsatt ON (fsatt.fsath_id=fsath.fsath_id)
JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsath.fsbue_idline)
JOIN fsart_airportmaster fsart_fromport ON (fsart_fromport.fsart_id = fsatt.fsart_idfromAirport)
JOIN fsart_airportmaster fsart_toport ON (fsart_toport.fsart_id = fsatt.fsart_idtoAirport)
JOIN route_details ON (route_details.Fromportid=fsatt.fsart_idfromairport AND route_details.Toportid=fsatt.fsart_idtoairport)
WHERE fsath.fsath_status ='P'
AND (fsath.fsath_referencenumber,fsath.fsath_versionnumber) IN (SELECT fsath.fsath_referencenumber,MAX(fsath.fsath_versionnumber)
FROM fsath_airtariffheader fsath
GROUP BY fsath.fsath_referencenumber)
AND (p_fsbue_idcarrier IS NULL OR fsath.fsbue_idline IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_fsbue_idcustomer IS NULL OR EXISTS (SELECT 'X'
FROM fsatb_airtariffcustomer fsatb
WHERE fsatb.fsath_id=fsath.fsath_id
AND fsatb.fsbue_idcustomer=p_fsbue_idcustomer))
AND EXISTS (SELECT 'X'
FROM fsatr_airtariffrate fsatr
WHERE fsatr.fsatt_id=fsatt.fsatt_id
AND fsatr.fsatr_ratetype=p_fssqh_shipmenttype
AND (route_details.CargoType IS NULL OR fsatr.fsatr_cargouldtype IN (SELECT REGEXP_SUBSTR (route_details.CargoType, '[^,]+', 1,LEVEL) AS cargouldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CargoType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.UldType IS NULL OR fsatr.fseqt_sizetypeuld IN (SELECT REGEXP_SUBSTR (route_details.UldType, '[^,]+', 1,LEVEL) AS uldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.UldType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsatr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL)))
AND (EXISTS (SELECT 'Y' FROM fsatp_airtarifftranshipment fsatt_transhipment
WHERE fsatt_transhipment.fsatt_id=fsatt.fsatt_id
AND fsatt_transhipment.fsart_idtranshipment IN (SELECT REGEXP_SUBSTR (route_details.viaport, '[^,]+', 1,LEVEL) AS viaport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.viaport,'[^,]+', 1, LEVEL) IS NOT NULL)) OR (route_details.viaport IS NULL));
OPEN p_Tariff_details FOR
WITH route_details AS
(SELECT jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType,
LISTAGG(DISTINCT jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup,
LISTAGG(DISTINCT jt.Via, ',') WITHIN GROUP (ORDER BY 1) Viaport
FROM
JSON_TABLE(v_route,'$[*]'
COLUMNS (
Fromportid VARCHAR2(100) PATH '$.From',
Toportid VARCHAR2(100) PATH '$.To' ,
CargoType VARCHAR2(100) PATH '$.CargoType' ,
UldType VARCHAR2(100) PATH '$.UldType' ,
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id') ,
NESTED PATH '$.Via[*]'
COLUMNS (Via VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType)
SELECT TO_CHAR(fsath.fsath_id) AS fsath_id,
fsatt.fsatt_id AS fsatt_id,
fsatr.fsatr_id AS fsatr_id,
fschg.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsatr.fsatr_cargouldtype AS fsatr_cargouldtype,
fsgec.fsgec_description AS fsatr_cargouldtype_description,
fsatr.fseqt_sizetypeuld AS fseqt_sizetypeuld,
fsatr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsatr.fsatr_buyingrate AS fsatr_buyingrate,
fsatr.fsatr_markuptype AS fsatr_markuptype,
fsgec_markuptype.fsgec_description AS fsatr_markuptype_description,
fsatr.fsatr_minimummarkuptype As fsatr_minimummarkuptype,
fsgec_minmarkuptype.fsgec_description AS fsatr_minmarkuptype_description,
fsatr.fsatr_minimumsellingrate AS fsatr_minimumsellingrate,
fsatr.fsatr_minimumbuyingrate AS fsatr_minimumbuyingrate,
fsatr.fsatr_minimummarkupvalue AS fsatr_minimummarkupvalue,
fsatr.fsatr_markupvalue AS fsatr_markupvalue,
fsatr.fsatr_sellingrate AS fsatr_sellingrate,
fsatr.fsatr_additionaldayfee AS fsatr_additionaldayfee,
fsatr.fsatr_pivotweight AS fsatr_pivotweight,
(SELECT listagg (DISTINCT fsati.fschg_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsati.fsati_id)
FROM fsati_airtariffinclusivecharge fsati
WHERE fsati.fsatr_id = fsatr.fsatr_id) AS inclusive_chargeid,
(SELECT listagg (DISTINCT fschg.fschg_code,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsati.fsati_id)
FROM fsati_airtariffinclusivecharge fsati
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsati.fschg_id)
WHERE fsati.fsatr_id = fsatr.fsatr_id) AS inclusive_chargedescription,
fsatr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fsatr.fsatr_remarks AS fsatr_remarks,
fsatr.fsatr_ispax AS fsatr_ispax,
fsgec_pax.fsgec_description AS fsatr_ispax_description,
fsath.fsbue_idline AS fsbue_idline,
fsath.fsath_referencenumber AS fsath_referencenumber,
fsatt.fsart_idfromAirport AS fsart_idfromAirport,
fsatt.fsart_idtoAirport AS fsart_idtoAirport,
(SELECT listagg (DISTINCT fsatp.fsart_idtranshipment,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsatp.fsatp_id)
FROM fsatp_airtarifftranshipment fsatp
WHERE fsatp.fsatt_id = fsatt.fsatt_id) AS transhipmentid
FROM fsath_airtariffheader fsath
JOIN fsatt_airtarifftransport fsatt ON (fsatt.fsath_id=fsath.fsath_id)
JOIN fsatr_airtariffrate fsatr ON (fsatr.fsatt_id=fsatt.fsatt_id)
LEFT JOIN fsgec_generalcode fsgec ON (fsgec.fsgec_referencename='AIRTARIFFCARGOTYPE' AND fsgec.fsgec_value=fsatr.fsatr_cargouldtype)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsatr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsatr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsatr.fscry_id)
JOIN fsgec_generalcode fsgec_pax ON (fsgec_pax.fsgec_value=fsatr.fsatr_ispax AND fsgec_pax.fsgec_referencename='AIRTARIFFPAX')
JOIN fsgec_generalcode fsgec_markuptype ON (fsgec_markuptype.fsgec_referencename='AIRMARKUPTYPE' AND fsgec_markuptype.fsgec_value=fsatr.fsatr_markuptype )
LEFT JOIN fsgec_generalcode fsgec_minmarkuptype ON (fsgec_minmarkuptype.fsgec_referencename='MARKUPTYPE' AND fsgec_minmarkuptype.fsgec_value=fsatr.fsatr_minimummarkuptype )
JOIN route_details ON (route_details.Fromportid=fsatt.fsart_idfromairport AND route_details.Toportid=fsatt.fsart_idtoairport)
WHERE fsath.fsath_status ='P'
AND (fsath.fsath_referencenumber,fsath.fsath_versionnumber) IN (SELECT fsath.fsath_referencenumber,MAX(fsath.fsath_versionnumber)
FROM fsath_airtariffheader fsath
GROUP BY fsath.fsath_referencenumber)
AND (p_fsbue_idcarrier IS NULL OR fsath.fsbue_idline IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_fsbue_idcustomer IS NULL OR EXISTS (SELECT 'X'
FROM fsatb_airtariffcustomer fsatb
WHERE fsatb.fsath_id=fsath.fsath_id
AND fsatb.fsbue_idcustomer=p_fsbue_idcustomer)
)
AND fsatr.fsatr_ratetype=p_fssqh_shipmenttype
AND (route_details.CargoType IS NULL OR fsatr.fsatr_cargouldtype IN (SELECT REGEXP_SUBSTR (route_details.CargoType, '[^,]+', 1,LEVEL) AS cargouldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CargoType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.UldType IS NULL OR fsatr.fseqt_sizetypeuld IN (SELECT REGEXP_SUBSTR (route_details.UldType, '[^,]+', 1,LEVEL) AS uldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.UldType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsatr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (EXISTS (SELECT 'Y' FROM fsatp_airtarifftranshipment fsatt_transhipment
WHERE fsatt_transhipment.fsatt_id=fsatt.fsatt_id
AND fsatt_transhipment.fsart_idtranshipment IN (SELECT REGEXP_SUBSTR (route_details.viaport, '[^,]+', 1,LEVEL) AS viaport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.viaport,'[^,]+', 1, LEVEL) IS NOT NULL)) OR (route_details.viaport IS NULL))
UNION ALL--
SELECT TO_CHAR(fsath.fsath_id) AS fsath_id,
fsatt.fsatt_id AS fsatt_id,
fsatr.fsatr_id AS fsatr_id,
fschg.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsatr.fsatr_cargouldtype AS fsatr_cargouldtype,
fsgec.fsgec_description AS fsatr_cargouldtype_description,
fsatr.fseqt_sizetypeuld AS fseqt_sizetypeuld,
fsatr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsatr.fsatr_buyingrate AS fsatr_buyingrate,
fsatr.fsatr_markuptype AS fsatr_markuptype,
fsgec_markuptype.fsgec_description AS fsatr_markuptype_description,
fsatr.fsatr_minimummarkuptype As fsatr_minimummarkuptype,
fsgec_minmarkuptype.fsgec_description AS fsatr_minmarkuptype_description,
fsatr.fsatr_minimumsellingrate AS fsatr_minimumsellingrate,
fsatr.fsatr_minimumbuyingrate AS fsatr_minimumbuyingrate,
fsatr.fsatr_minimummarkupvalue AS fsatr_minimummarkupvalue,
fsatr.fsatr_markupvalue AS fsatr_markupvalue,
fsatr.fsatr_sellingrate AS fsatr_sellingrate,
fsatr.fsatr_additionaldayfee AS fsatr_additionaldayfee,
fsatr.fsatr_pivotweight AS fsatr_pivotweight,
(SELECT listagg (DISTINCT fsati.fschg_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsati.fsati_id)
FROM fsati_airtariffinclusivecharge fsati
WHERE fsati.fsatr_id = fsatr.fsatr_id) AS inclusive_chargeid,
(SELECT listagg (DISTINCT fschg.fschg_code,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsati.fsati_id)
FROM fsati_airtariffinclusivecharge fsati
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsati.fschg_id)
WHERE fsati.fsatr_id = fsatr.fsatr_id) AS inclusive_chargedescription,
fsatr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fsatr.fsatr_remarks AS fsatr_remarks,
fsatr.fsatr_ispax AS fsatr_ispax,
fsgec_pax.fsgec_description AS fsatr_ispax_description,
fsath.fsbue_idline AS fsbue_idline,
fsath.fsath_referencenumber AS fsath_referencenumber,
fsatt.fsart_idfromAirport AS fsart_idfromAirport,
fsatt.fsart_idtoAirport AS fsart_idtoAirport,
(SELECT listagg (DISTINCT fsatp.fsart_idtranshipment,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsatp.fsatp_id)
FROM fsatp_airtarifftranshipment fsatp
WHERE fsatp.fsatt_id = fsatt.fsatt_id) AS transhipmentid
FROM fsath_airtariffheader fsath
JOIN fsatt_airtarifftransport fsatt ON (fsatt.fsath_id=fsath.fsath_id)
JOIN fsatr_airtariffrate fsatr ON (fsatr.fsatt_id=fsatt.fsatt_id)
LEFT JOIN fsgec_generalcode fsgec ON (fsgec.fsgec_referencename='AIRTARIFFCARGOTYPE' AND fsgec.fsgec_value=fsatr.fsatr_cargouldtype)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsatr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsatr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsatr.fscry_id)
JOIN fsgec_generalcode fsgec_pax ON (fsgec_pax.fsgec_value=fsatr.fsatr_ispax AND fsgec_pax.fsgec_referencename='AIRTARIFFPAX')
JOIN fsgec_generalcode fsgec_markuptype ON (fsgec_markuptype.fsgec_referencename='AIRMARKUPTYPE' AND fsgec_markuptype.fsgec_value=fsatr.fsatr_markuptype )
LEFT JOIN fsgec_generalcode fsgec_minmarkuptype ON (fsgec_minmarkuptype.fsgec_referencename='MARKUPTYPE' AND fsgec_minmarkuptype.fsgec_value=fsatr.fsatr_minimummarkuptype )
JOIN route_details ON (route_details.Fromportid=fsatt.fsart_idfromairport AND route_details.Toportid=fsatt.fsart_idtoairport)
WHERE fsath.fsath_status ='P'
AND (fsath.fsath_referencenumber,fsath.fsath_versionnumber) IN (SELECT fsath.fsath_referencenumber,MAX(fsath.fsath_versionnumber)
FROM fsath_airtariffheader fsath
GROUP BY fsath.fsath_referencenumber)
AND (p_fsbue_idcarrier IS NULL OR fsath.fsbue_idline IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_fsbue_idcustomer IS NULL OR NOT EXISTS (SELECT 'X'
FROM fsatb_airtariffcustomer fsatb
WHERE fsatb.fsath_id=fsath.fsath_id
AND fsatb.fsbue_idcustomer=p_fsbue_idcustomer)
)
AND fsatr.fsatr_ratetype=p_fssqh_shipmenttype
AND (route_details.CargoType IS NULL OR fsatr.fsatr_cargouldtype IN (SELECT REGEXP_SUBSTR (route_details.CargoType, '[^,]+', 1,LEVEL) AS cargouldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CargoType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.UldType IS NULL OR fsatr.fseqt_sizetypeuld IN (SELECT REGEXP_SUBSTR (route_details.UldType, '[^,]+', 1,LEVEL) AS uldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.UldType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsatr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (EXISTS (SELECT 'Y' FROM fsatp_airtarifftranshipment fsatt_transhipment
WHERE fsatt_transhipment.fsatt_id=fsatt.fsatt_id
AND fsatt_transhipment.fsart_idtranshipment IN (SELECT REGEXP_SUBSTR (route_details.viaport, '[^,]+', 1,LEVEL) AS viaport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.viaport,'[^,]+', 1, LEVEL) IS NOT NULL)) OR (route_details.viaport IS NULL))
AND NOT EXISTS (SELECT 'X'
FROM fsath_airtariffheader fsath
JOIN fsatt_airtarifftransport fsatt ON (fsatt.fsath_id=fsath.fsath_id)
JOIN fsatr_airtariffrate fsatr ON (fsatr.fsatt_id=fsatt.fsatt_id)
LEFT JOIN fsgec_generalcode fsgec ON (fsgec.fsgec_referencename='AIRTARIFFCARGOTYPE' AND fsgec.fsgec_value=fsatr.fsatr_cargouldtype)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsatr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsatr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsatr.fscry_id)
JOIN fsgec_generalcode fsgec_pax ON (fsgec_pax.fsgec_value=fsatr.fsatr_ispax AND fsgec_pax.fsgec_referencename='AIRTARIFFPAX')
JOIN fsgec_generalcode fsgec_markuptype ON (fsgec_markuptype.fsgec_referencename='AIRMARKUPTYPE' AND fsgec_markuptype.fsgec_value=fsatr.fsatr_markuptype )
LEFT JOIN fsgec_generalcode fsgec_minmarkuptype ON (fsgec_minmarkuptype.fsgec_referencename='MARKUPTYPE' AND fsgec_minmarkuptype.fsgec_value=fsatr.fsatr_minimummarkuptype )
JOIN route_details ON (route_details.Fromportid=fsatt.fsart_idfromairport AND route_details.Toportid=fsatt.fsart_idtoairport)
WHERE fsath.fsath_status ='P'
AND (fsath.fsath_referencenumber,fsath.fsath_versionnumber) IN (SELECT fsath.fsath_referencenumber,MAX(fsath.fsath_versionnumber)
FROM fsath_airtariffheader fsath
GROUP BY fsath.fsath_referencenumber)
AND (p_fsbue_idcarrier IS NULL OR fsath.fsbue_idline IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND EXISTS (SELECT 'X'
FROM fsatb_airtariffcustomer fsatb
WHERE fsatb.fsath_id=fsath.fsath_id
AND fsatb.fsbue_idcustomer=p_fsbue_idcustomer)
)
AND fsatr.fsatr_ratetype=p_fssqh_shipmenttype
AND (route_details.CargoType IS NULL OR fsatr.fsatr_cargouldtype IN (SELECT REGEXP_SUBSTR (route_details.CargoType, '[^,]+', 1,LEVEL) AS cargouldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CargoType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.UldType IS NULL OR fsatr.fseqt_sizetypeuld IN (SELECT REGEXP_SUBSTR (route_details.UldType, '[^,]+', 1,LEVEL) AS uldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.UldType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsatr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (EXISTS (SELECT 'Y' FROM fsatp_airtarifftranshipment fsatt_transhipment
WHERE fsatt_transhipment.fsatt_id=fsatt.fsatt_id
AND fsatt_transhipment.fsart_idtranshipment IN (SELECT REGEXP_SUBSTR (route_details.viaport, '[^,]+', 1,LEVEL) AS viaport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.viaport,'[^,]+', 1, LEVEL) IS NOT NULL)) OR (route_details.viaport IS NULL))
UNION ALL
SELECT fsast.fsast_uigroupingreference AS fsath_id,
fsast.fsast_id AS fsatt_id,
fsasr.fsasr_id AS fsatr_id,
fschg.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
NULL AS fsatr_cargouldtype,
NULL AS fsatr_cargouldtype_description,
NULL AS fseqt_sizetypeuld,
fsasr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
NULL AS fsatr_buyingrate,
fsasr.fsasr_calculationprocedure AS fsatr_markuptype,
fsgec_calcprc.fsgec_description AS fsatr_markuptype_description,
NULL AS fsatr_minimummarkuptype,
NULL AS fsatr_minmarkuptype_description,
NULL AS fsatr_minimumsellingrate,
NULL AS fsatr_minimumbuyingrate,
NULL AS fsatr_minimummarkupvalue,
fsasr.fsasr_value AS fsatr_markupvalue,
fsasr.fsasr_rate AS fsatr_sellingrate,
NULL AS fsatr_additionaldayfee,
NULL AS fsatr_pivotweight,
NULL AS inclusive_chargeid,
NULL AS inclusive_chargedescription,
fsasr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fsasr.fsasr_remarks AS fsasr_remarks,
NULL AS fsatr_ispax,
NULL AS fsatr_ispax_description,
fsasr.fsbue_idcarrier AS fsbue_idline,
NULL AS fsath_referencenumber,
fsast.fsart_idfromairport AS fsart_idfromAirport,
fsast.fsart_idtoairport AS fsart_idtoAirport,
NULL AS transhipmentid
FROM fsast_airsurchargetransport fsast
JOIN fsasr_airsurchargerate fsasr ON (fsast.fsast_id=fsasr.fsast_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsasr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsasr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsasr.fscry_id)
LEFT JOIN FSGEC_GeneralCode fsgec_calcprc ON (fsgec_calcprc.fsgec_referencename = 'MARKUPTYPE' AND fsgec_calcprc.fsgec_value = fsasr.fsasr_calculationprocedure)
JOIN route_details ON (route_details.Fromportid=fsast.fsart_idfromairport AND route_details.Toportid=fsast.fsart_idtoairport)
WHERE fsasr.fsasr_shipmenttype = p_fssqh_shipmenttype
AND (p_fsbue_idcarrier IS NULL OR fsasr.fsbue_idcarrier IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsasr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS commodity FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL)) ;
OPEN p_weightdetails FOR
WITH route_details AS
(SELECT jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType,
LISTAGG(DISTINCT jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup,
LISTAGG(DISTINCT jt.Via, ',') WITHIN GROUP (ORDER BY 1) Viaport
FROM
JSON_TABLE(v_route,'$[*]'
COLUMNS (
Fromportid VARCHAR2(100) PATH '$.From',
Toportid VARCHAR2(100) PATH '$.To' ,
CargoType VARCHAR2(100) PATH '$.CargoType' ,
UldType VARCHAR2(100) PATH '$.UldType' ,
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id') ,
NESTED PATH '$.Via[*]'
COLUMNS (Via VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType)
SELECT fsatr.fsatr_id AS fsatr_id,
fsatm.fsatm_buyingrate AS fsatm_buyingrate,
fsatm.fsatm_sellingrate AS fsatm_sellingrate,
fsatm.fsatm_markupvalue AS fsatm_markupvalue,
fsatd.fsatd_weight AS fsatd_weight,
fsatm.fsatm_id AS fsatm_id
FROM fsath_airtariffheader fsath
JOIN fsatt_airtarifftransport fsatt ON (fsatt.fsath_id=fsath.fsath_id)
JOIN fsatr_airtariffrate fsatr ON (fsatr.fsatt_id=fsatt.fsatt_id)
JOIN fsatm_airtariffslabrate fsatm ON (fsatm.fsatr_id=fsatr.fsatr_id)
JOIN FSATD_AirTariffweightSlab fsatd ON (fsatd.fsatd_id=fsatm.fsatd_id)
JOIN route_details ON (route_details.Fromportid=fsatt.fsart_idfromairport AND route_details.Toportid=fsatt.fsart_idtoairport)
WHERE fsath.fsath_status ='P'
AND (p_fsbue_idcarrier IS NULL OR fsath.fsbue_idline IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_fsbue_idcustomer IS NULL OR EXISTS (SELECT 'X'
FROM fsatb_airtariffcustomer fsatb
WHERE fsatb.fsath_id=fsath.fsath_id
AND fsatb.fsbue_idcustomer=p_fsbue_idcustomer))
AND fsatr.fsatr_ratetype=p_fssqh_shipmenttype
AND (route_details.CargoType IS NULL OR fsatr.fsatr_cargouldtype IN (SELECT REGEXP_SUBSTR (route_details.CargoType, '[^,]+', 1,LEVEL) AS cargouldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CargoType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.UldType IS NULL OR fsatr.fseqt_sizetypeuld IN (SELECT REGEXP_SUBSTR (route_details.UldType, '[^,]+', 1,LEVEL) AS uldtype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.UldType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsatr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (EXISTS (SELECT 'Y' FROM fsatp_airtarifftranshipment fsatt_transhipment
WHERE fsatt_transhipment.fsatt_id=fsatt.fsatt_id
AND fsatt_transhipment.fsart_idtranshipment IN (SELECT REGEXP_SUBSTR (route_details.viaport, '[^,]+', 1,LEVEL) AS viaport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.viaport,'[^,]+', 1, LEVEL) IS NOT NULL)) OR (route_details.viaport IS NULL))
AND (fsath.fsath_referencenumber,fsath.fsath_versionnumber) IN (SELECT fsath.fsath_referencenumber,MAX(fsath.fsath_versionnumber)
FROM fsath_airtariffheader fsath
GROUP BY fsath.fsath_referencenumber);
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_Ratefromtariff_Prc;
PROCEDURE Get_localcharges_Prc ( --get local charges
p_fsofo_id IN fssqh_seaquotationheader.fsofo_id%TYPE,
p_fsbue_idcustomer IN fssqh_seaquotationheader.fsbue_idcustomer%TYPE,
p_fsofo_idpartner IN fssqh_seaquotationheader.fsofo_idpartner%TYPE,
p_fssqh_shipmenttype IN fssqh_seaquotationheader.fssqh_shipmenttype%TYPE,
p_fssqh_isexportimport IN fssqh_seaquotationheader.fssqh_isexportimport%TYPE,
p_route IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_Tariff_deatils OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fssqh_seaquotationheader.fssqh_shipmenttype %TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
OPEN p_Tariff_deatils FOR
WITH route_details AS
(SELECT jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType,
LISTAGG(DISTINCT jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup,
LISTAGG(DISTINCT jt.Via, ',') WITHIN GROUP (ORDER BY 1) Viaport
FROM
JSON_TABLE(REPLACE(p_route,'\',''),'$[*]'
COLUMNS (
Fromportid VARCHAR2(100) PATH '$.From',
Toportid VARCHAR2(100) PATH '$.To' ,
CargoType VARCHAR2(100) PATH '$.CargoType' ,
UldType VARCHAR2(100) PATH '$.UldType' ,
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id') ,
NESTED PATH '$.Via[*]'
COLUMNS (Via VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.Fromportid,jt.Toportid,jt.CargoType,jt.UldType)
SELECT fsalp.fslap_id AS fsalp_id,
fslar.fslar_id AS fslar_id,
fschg.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fslar.fslar_basis AS fslar_basis,
basis.fsgec_description AS basis_description,
fslar.fseqt_sizetype AS fseqt_sizetype,
fslar.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fslar.fslar_amount AS fslar_amount,
fslar.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fslar.fslar_isexportimport AS fslar_isexportimport,
fsgec_importexport.fsgec_description AS fsalr_isexportimport_description,
fslar.fslar_remarks AS fslar_remarks
FROM fslap_localchargeairport fsalp
JOIN fslar_localchargeairrate fslar ON (fslar.fslar_uigroupingreference=fsalp.fslap_uigroupingreference AND fslar.fslar_uicardreference = fsalp.fslap_uicardreference)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fslar.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fslar.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fslar.fscry_id)
JOIN FSGEC_GeneralCode fsgec_importexport ON ( fsgec_importexport.fsgec_referencename='BOOKINGTYPE' AND fsgec_importexport.fsgec_value=fslar.fslar_isexportimport)
JOIN FSGEC_GeneralCode basis ON (basis.fsgec_referencename='LOCALCHARGEBASIS' AND basis.fsgec_value=fslar.fslar_basis )
JOIN route_details ON (route_details.Fromportid=fsalp.fsart_idfrom AND route_details.Toportid=fsalp.fsart_idto)
WHERE (p_fsbue_idcustomer IS NULL OR fsalp.fsbue_idcustomer=p_fsbue_idcustomer)
AND (p_fsofo_idpartner IS NULL OR fsalp.fsofo_idpartner=p_fsofo_idpartner)
AND (route_details.UldType IS NULL OR fslar.fseqt_sizetype IN (SELECT REGEXP_SUBSTR (route_details.UldType, '[^,]+', 1,LEVEL) AS sizetype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.UldType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fslar.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_fssqh_isexportimport IS NULL OR fslar.fslar_isexportimport =p_fssqh_isexportimport);
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_localcharges_Prc;
PROCEDURE Get_airquotationtariff_Prc ( --Retrive quotation details
p_fsaqh_id IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqt_id IN fsaqh_airquotationheader.fsaqh_remarks%TYPE,
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_airquotationhdrdetails OUT FS_AirQuotationManagement.t_list,
p_airquotationport_details OUT FS_AirQuotationManagement.t_list,
p_airquotationrate_details OUT FS_AirQuotationManagement.t_list,
p_surcharge_details OUT FS_AirQuotationManagement.t_list,
p_localcharge_details OUT FS_AirQuotationManagement.t_list,
p_weightdetails OUT FS_AirQuotationManagement.t_list,
p_precarriage_details OUT FS_AirQuotationManagement.t_list,
p_precarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_oncarriage_details OUT FS_AirQuotationManagement.t_list,
p_oncarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_status%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
OPEN p_airquotationhdrdetails FOR
SELECT fsaqh.fsaqh_id AS fsaqh_id,
fsaqh.fsbue_idcustomer AS fsbue_idcustomer,
fsbue_customer.fsbue_name AS fsaqh_customername,
fsaqh.fsaqh_customerdetails AS fsbue_customerdetail,
quotationpartytype.fsgec_description AS quotationpartytype_description ,
fsaqh.fsaqh_quotationpartytype AS fsaqh_quotationpartytype,
fsaqh.fsofo_idpartner AS fsofo_idpartner,
fsofo_partner.fsofo_organizationname AS parter_name,
fsaqh.fsaqh_quotationtype AS fsaqh_quotationtype,
fsgec_quotationtype.fsgec_description AS fsaqh_quotationtype_description,
fsaqh.fsaqh_shipmenttype AS fsaqh_shipmenttype,
fsgec_shipmenttype.fsgec_description AS fsaqh_shipmenttype_description,
fsaqh.fsaqh_minimumconfirmedquantitytype AS fsaqh_minimumconfirmedquantitytype,
fsgec_mcq.fsgec_description AS fsaqh_mcqtype_description,
fsaqh.fsaqh_weight AS fsaqh_weight,
fsaqh.fsmea_id AS fsmea_id,
fsmea_weight.fsmea_isocode AS fsaqh_weight_unit,
fsaqh.fsaqh_volume AS fsaqh_volume,
fsaqh.fsaqh_incoterms AS fsaqh_incoterms,
fsgec_incoterms.fsgec_description AS fsaqh_incoterms_description,
fsaqh.fscry_idquotation AS fscry_idquotation,
fscry.fscry_code AS fscry_code,
fsaqh.fsaqh_isexportimport AS fsaqh_isexportimport,
fsgec_importexport.fsgec_description AS fsaqh_isexportimport_description,
fsaqh.fsaqh_validfrom AS fsaqh_validfrom,
fsaqh.fsaqh_validto AS fsaqh_validto,
fsaqh.fsaqh_isshowcarrier AS fsaqh_isshowcarrier,
(SELECT listagg (DISTINCT fsaqc.fsbue_idcarrier,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqc.fsaqc_id)
FROM fsaqc_airquotationcarrier fsaqc
WHERE fsaqc.fsaqh_id = fsaqh.fsaqh_id) AS fsaqh_carrierid,
(SELECT listagg (DISTINCT fsbue_carrier.fsbue_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqc.fsaqc_id)
FROM fsaqc_airquotationcarrier fsaqc
JOIN fsbue_businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsaqc.fsbue_idcarrier)
WHERE fsaqc.fsaqh_id = fsaqh.fsaqh_id) AS fsaqh_carriername,
fsaqh.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsofo.fsofo_organizationname AS sales_office,
fsaqh.fsaqh_remarks AS fsaqh_remarks,
(SELECT listagg (DISTINCT fsaqd.fsdlm_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqd.fsaqd_id)
FROM fsaqd_airquotationdeal fsaqd
WHERE fsaqd.fsaqh_id = fsaqh.fsaqh_id) AS DEALID,
(SELECT listagg (DISTINCT fsdlm.fsdlm_referencenumber,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqd.fsaqd_id)
FROM fsaqd_airquotationdeal fsaqd
JOIN fsdlm_dealmanagement fsdlm ON (fsdlm.fsdlm_id=fsaqd.fsdlm_id)
WHERE fsaqd.fsaqh_id = fsaqh.fsaqh_id) AS fsdlm_referencenumber,
fsaqh.fsaqh_minimumconfirmedquantity AS fsaqh_minimumconfirmedquantity,
fsaqh.fsaqh_status AS fsaqh_status,
fsgec_status.fsgec_description AS fsaqh_status_description,
fsaqh.fsaqh_referencenumber AS fsaqh_referencenumber
FROM fsaqh_airquotationheader fsaqh
LEFT JOIN fsbue_businessentity fsbue_customer ON (fsbue_customer.fsbue_id=fsaqh.fsbue_idcustomer)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsaqh.fscry_idquotation)
LEFT JOIN FSOFO_Officeorganization fsofo ON (fsofo.fsofo_id=fsaqh.fsofo_idsalesoffice)
LEFT JOIN FSOFO_Officeorganization fsofo_partner ON (fsofo_partner.fsofo_id=fsaqh.fsofo_idpartner)
LEFT JOIN fsmea_measurement fsmea_weight ON (fsmea_weight.fsmea_id=fsaqh.fsmea_id)
JOIN FSGEC_GeneralCode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_value=fsaqh.fsaqh_quotationtype AND fsgec_quotationtype.fsgec_referencename='QUOTATIONTYPE')
JOIN FSGEC_GeneralCode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_value=fsaqh.fsaqh_shipmenttype AND fsgec_shipmenttype.fsgec_referencename='AIRSHIPMENTTYPE')
JOIN FSGEC_GeneralCode fsgec_incoterms ON (fsgec_incoterms.fsgec_value=fsaqh.fsaqh_incoterms AND fsgec_incoterms.fsgec_referencename='BOOKINGINCOTERMS')
LEFT JOIN FSGEC_GeneralCode fsgec_mcq ON (fsgec_mcq.fsgec_value=fsaqh.fsaqh_minimumconfirmedquantitytype AND fsgec_mcq.fsgec_referencename='QUOTATIONMCQ')
JOIN FSGEC_GeneralCode fsgec_importexport ON (fsgec_importexport.fsgec_value=fsaqh.fsaqh_isexportimport AND fsgec_importexport.fsgec_referencename='BOOKINGTYPE')
JOIN fsgec_generalcode quotationpartytype ON (quotationpartytype.fsgec_referencename='QUOTATIONPARTYTYPE' AND quotationpartytype.fsgec_value=fsaqh.fsaqh_quotationpartytype )
JOIN FSGEC_GeneralCode fsgec_status ON (fsgec_status.fsgec_value=fsaqh.fsaqh_status AND fsgec_status.fsgec_referencename='QUOTATIONSTATUS')
WHERE fsaqh.fsaqh_id=p_fsaqh_id;
OPEN p_airquotationport_details FOR
SELECT DISTINCT fsaqh.fsaqh_id AS fsaqh_id,
fsaqc.fsbue_idcarrier AS fsbue_idcarrier,
fsbue_carrier.fsbue_name AS fsbue_carriername,
fsaqt.fsart_idfromairport AS fsart_idfromairport,
fsaqt.fsart_idtoairport AS fsart_idtoairport,
fsart_from.fsart_name AS fsart_fromname,
fsart_to.fsart_name AS fsart_toname ,
(SELECT listagg (DISTINCT transhipment.fsart_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqp.fsaqp_id)
FROM fsaqp_airquotationtranshipment fsaqp
JOIN fsart_airportmaster transhipment ON (transhipment.fsart_id=fsaqp.fsart_idtranshipment)
WHERE fsaqp.fsaqt_id = fsaqt.fsaqt_id) AS fsprt_transhipment,
(SELECT listagg (DISTINCT fsaqp.fsart_idtranshipment,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqp.fsaqp_id)
FROM fsaqp_airquotationtranshipment fsaqp
WHERE fsaqp.fsaqt_id = fsaqt.fsaqt_id) AS transhipmentid,
(SELECT listagg (DISTINCT fsaqm.fscmg_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqm.fsaqm_id)
FROM fsaqm_airquotationcommodity fsaqm
WHERE fsaqm.fsaqt_id = fsaqt.fsaqt_id) AS fscmg_id,
(SELECT listagg (DISTINCT fscmg.fscmg_code,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqm.fsaqm_id)
FROM fsaqm_airquotationcommodity fsaqm
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsaqm.fscmg_id)
WHERE fsaqm.fsaqt_id = fsaqt.fsaqt_id) AS fscmg_code,
(SELECT listagg (DISTINCT fscmg.fscmg_description,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqm.fsaqm_id)
FROM fsaqm_airquotationcommodity fsaqm
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsaqm.fscmg_id)
WHERE fsaqm.fsaqt_id = fsaqt.fsaqt_id) AS fscmg_description,
(SELECT listagg (DISTINCT fsaqe.fseqt_sizetypeuld,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqe.fsaqe_id)
FROM fsaqe_airquotationequipment fsaqe
WHERE fsaqe.fsaqt_id = fsaqt.fsaqt_id) AS fseqt_sizetypeuld,
(SELECT listagg (DISTINCT fsaqe.fsaqe_cargotype,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqe.fsaqe_id)
FROM fsaqe_airquotationequipment fsaqe
WHERE fsaqe.fsaqt_id = fsaqt.fsaqt_id) AS fsaqe_cargotype,
(SELECT listagg (DISTINCT cargotype.fsgec_description,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqe.fsaqe_id)
FROM fsaqe_airquotationequipment fsaqe
JOIN fsgec_generalcode cargotype ON (cargotype.fsgec_value=fsaqe.fsaqe_cargotype AND cargotype.fsgec_referencename='AIRTARIFFCARGOTYPE')
WHERE fsaqe.fsaqt_id = fsaqt.fsaqt_id
) AS fsaqe_cargotype_description,
fsaqt.fsaqt_travellingtime AS fsaqt_travellingtime,
fsaqt.fsaqt_dayoffrequency AS fsaqt_dayoffrequency,
fsgec.fsgec_description AS fsaqt_dayoffrequency_desccription,
fsaqt.fsaqt_id AS fsaqt_id
FROM fsaqh_airquotationheader fsaqh
JOIN fsaqt_airquotationtransportstation fsaqt ON (fsaqt.fsaqh_id=fsaqh.fsaqh_id)
JOIN FSART_AirportMaster fsart_from ON (fsart_from.fsart_id=fsaqt.fsart_idfromairport)
JOIN FSART_AirportMaster fsart_to ON (fsart_to.fsart_id=fsaqt.fsart_idtoairport)
LEFT JOIN fsaqc_airquotationcarrier fsaqc ON (fsaqc.fsaqh_id=fsaqh.fsaqh_id)
LEFT JOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsaqc.fsbue_idcarrier)
LEFT JOIN fsgec_generalcode fsgec ON (fsgec.fsgec_referencename='FREQUENCY' AND fsgec.fsgec_value=fsaqt.fsaqt_dayoffrequency)
WHERE fsaqh.fsaqh_id=p_fsaqh_id ;
OPEN p_airquotationrate_details FOR
SELECT fsaqr.fsaqt_id AS fsaqt_id,
fsaqr.fsaqr_id AS fsaqr_id,
fsaqr.fsbue_idcarrier AS fsbue_idcarrier,
fsbue.fsbue_name AS carriername,
fsaqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsaqr.fsaqr_cargotype AS fsaqr_cargotype,
cargotype.fsgec_description AS cargotype_description,
fsaqr.fseqt_sizetypeuld AS fseqt_sizetypeuld,
fscmg.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsaqr.fsaqr_tariffrate AS fsaqr_tariffrate,
fsaqr.fsaqr_markuptype AS fsaqr_markuptype,
fsgec_markuptype.fsgec_description AS fsaqr_markuptype_description,
fsaqr.fsaqr_markupvalue AS fsaqr_markupvalue,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fsaqr_mintariffrate AS fsaqr_mintariffrate,
fsaqr.fsaqr_minmarkuptype AS fsaqr_minmarkuptype,
fsaqr.fsaqr_minmarkupvalue AS fsaqr_minmarkupvalue,
fsaqr.fsaqr_minsellingrate AS fsaqr_minsellingrate,
fsaqr.fsaqr_additionaldayfee AS fsaqr_additionaldayfee,
fsaqr.fsaqr_pivotweight AS fsaqr_pivotweight ,
(SELECT listagg (DISTINCT fschg.fschg_code,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqi.fsaqi_id)
FROM fsaqi_airquotationinclusivecharge fsaqi
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqi.fschg_id)
WHERE fsaqi.fsaqr_id = fsaqr.fsaqr_id) AS fsaqi_inclusivechargecode,
(SELECT listagg (DISTINCT fsaqi.fschg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsaqi.fsaqi_id)
FROM fsaqi_airquotationinclusivecharge fsaqi
WHERE fsaqi.fsaqr_id = fsaqr.fsaqr_id) AS fsaqi_inclusivechargeid,
fscry.fscry_code AS fscry_code,
fsaqr.fsaqr_remarks AS fsaqr_remarks,
fsaqr.fsaqr_ispax AS fsaqr_ispax,
fsgec_pax.fsgec_description AS fsaqr_ispax_description
FROM fsaqr_airquotationrate fsaqr
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsaqr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsaqr.fscry_id)
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsaqr.fsbue_idcarrier)
JOIN fsgec_generalcode cargotype ON (cargotype.fsgec_value=fsaqr.fsaqr_cargotype AND cargotype.fsgec_referencename='AIRTARIFFCARGOTYPE')
JOIN fsgec_generalcode fsgec_markuptype ON (fsgec_markuptype.fsgec_value=fsaqr.fsaqr_markuptype AND fsgec_markuptype.fsgec_referencename='CARGOMARKUPTYPE')
JOIN fsgec_generalcode fsgec_pax ON (fsgec_pax.fsgec_value=fsaqr.fsaqr_ispax AND fsgec_pax.fsgec_referencename='AIRTARIFFPAX')
WHERE EXISTS (SELECT 'X'
FROM fsaqt_airquotationtransportstation fsaqt
WHERE fsaqt.fsaqt_id=fsaqr.fsaqt_id
AND fsaqt.fsaqh_id=p_fsaqh_id
AND (p_fsaqt_id IS NULL OR fsaqt.fsaqt_id IN (SELECT REGEXP_SUBSTR (p_fsaqt_id, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaqt_id,'[^,]+', 1, LEVEL) IS NOT NULL)));
OPEN p_weightdetails FOR
SELECT fsaqw.fsaqw_weight AS fsaqw_weight,
fsaqw.fsaqw_buyingrate AS fsaqw_buyingrate ,
fsaqw.fsaqw_sellingrate AS fsaqw_sellingrate ,
fsaqw.fsaqw_markupvalue AS fsaqw_markupvalue,
fsaqw.fsaqw_id AS fsaqw_id,
fsaqw.fsatm_id AS fsatm_id,
fsaqw.fsaqr_id AS fsaqr_id
FROM fsaqr_airquotationrate fsaqr
JOIN fsaqw_airquotationslabrate fsaqw ON (fsaqw.fsaqr_id=fsaqr.fsaqr_id)
WHERE EXISTS (SELECT 'X'
FROM fsaqt_airquotationtransportstation fsaqt
WHERE fsaqt.fsaqt_id=fsaqr.fsaqt_id
AND fsaqt.fsaqh_id=p_fsaqh_id
AND (p_fsaqt_id IS NULL OR fsaqt.fsaqt_id IN (SELECT REGEXP_SUBSTR (p_fsaqt_id, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaqt_id,'[^,]+', 1, LEVEL) IS NOT NULL)));
OPEN p_surcharge_details FOR
SELECT fsaqr.fsaqt_id AS fsaqt_id,
fsaqr.fsaqr_id AS fsaqr_id,
fschg.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fscmg.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsaqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fsaqr.fsaqr_markuptype AS calcproc,
fsgec_markuptype.fsgec_description AS calcproc_description,
fsaqr.fsaqr_markupvalue AS fsaqr_markupvalue,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fsaqr_remarks AS fsaqr_remarks
FROM fsaqr_airquotationrate fsaqr
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsaqr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsaqr.fscry_id)
JOIN fsgec_generalcode fsgec_markuptype ON (fsgec_markuptype.fsgec_value=fsaqr.fsaqr_markuptype AND fsgec_markuptype.fsgec_referencename='MARKUPTYPE' )
WHERE EXISTS (SELECT 'X'
FROM fsaqt_airquotationtransportstation fsaqt
WHERE fsaqt.fsaqt_id=fsaqr.fsaqt_id
AND fsaqt.fsaqh_id=p_fsaqh_id
AND (p_fsaqt_id IS NULL OR fsaqt.fsaqt_id IN (SELECT REGEXP_SUBSTR (p_fsaqt_id, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaqt_id,'[^,]+', 1, LEVEL) IS NOT NULL)));
OPEN p_localcharge_details FOR
SELECT fsaqr.fsaqt_id AS fsaqt_id,
fsaqr.fsaqr_id AS fsaqr_id,
fschg.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fscmg.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsaqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fsaqr_remarks AS fsaqr_remarks,
fsaqr.fsaqr_basis AS fsaqr_basis,
gec_basis.fsgec_description AS gec_basisdescription,
fsaqr.fsaqr_isexportimport AS export_import,
export.fsgec_description AS export_importdescription
FROM fsaqr_airquotationrate fsaqr
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsaqr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsaqr.fscry_id)
JOIN fsgec_generalcode gec_basis ON (gec_basis.fsgec_value=fsaqr.fsaqr_basis AND gec_basis.fsgec_referencename='LOCALCHARGEBASIS' )
JOIN FSGEC_GeneralCode export ON (export.fsgec_referencename='BOOKINGTYPE' AND export.fsgec_value=fsaqr.fsaqr_isexportimport )
WHERE EXISTS (SELECT 'X'
FROM fsaqt_airquotationtransportstation fsaqt
WHERE fsaqt.fsaqt_id=fsaqr.fsaqt_id
AND fsaqt.fsaqh_id=p_fsaqh_id
AND (p_fsaqt_id IS NULL OR fsaqt.fsaqt_id IN (SELECT REGEXP_SUBSTR (p_fsaqt_id, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaqt_id,'[^,]+', 1, LEVEL) IS NOT NULL)));
OPEN p_precarriage_details FOR
SELECT fsaqu.fsaqu_id AS fsaqu_id,
NVL(fsaqu.fsaqu_idparent,fsaqu.fsaqu_id) AS fsaqu_idparent,
fsaqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS fromlocation,
fsaqu.fsaqu_fromlocationaddress AS fsaqu_fromlocationaddress,
fsaqu.fsaqu_zipcodefrom AS fsaqu_zipcodefrom,
fsaqu.fsaqu_zipcodeto AS fsaqu_zipcodeto,
fsaqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS tolocation,
fsaqu.fsaqu_modeoftransport AS fsaqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsaqu_modeoftransport_description,
fsaqu.fsaqu_transit AS fsaqu_transit,
fsaqu.fsaqu_transittype AS fsaqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsaqu.fsaqu_specialinstruction AS fsaqu_specialinstruction,
fsaqu.fsaqu_tolocationaddress AS fsaqu_tolocationaddress,
fsaqu.fsaqu_ismultimode AS fsaqu_ismultimode,
fsaqu.fsaqu_ismultistop AS fsaqu_ismultistop,
fsaqu.fsaqu_shipmenttype AS fsaqu_shipmenttype
FROM FSAQU_AirQuotationIntermodel fsaqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsaqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsaqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsaqu.fsaqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsaqu.fsaqu_transittype)
WHERE fsaqu.fsaqh_id=p_fsaqh_id
AND fsaqu.fsaqu_shipmenttype='P';
OPEN p_precarriagecharge_details FOR
SELECT fsaqr.fsaqr_id AS fsaqr_id,
fsaqu.fsaqu_id AS fsaqu_id,
fsaqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsaqr.fsaqr_weight AS fsaqr_weight,
fsmea.fsmea_isocode AS fsaqr_weight_unit,
fsaqr.fsaqr_tariffrate AS fsaqr_tariffrate,
fsaqr.fsaqr_markuptype AS fsaqr_markuptype,
markuptype.fsgec_description AS fsaqr_markuptype_description,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code
FROM FSAQU_AirQuotationIntermodel fsaqu
JOIN fsaqr_airquotationrate fsaqr ON (fsaqr.fsaqu_id=fsaqu.fsaqu_id AND fsaqu.fsaqu_idparent IS NULL)
JOIN fsmea_measurement fsmea ON (fsmea.fsmea_id=fsaqr.fsmea_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsaqr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsaqr.fsaqr_markuptype )
WHERE fsaqu.fsaqh_id=p_fsaqh_id
AND fsaqu.fsaqu_shipmenttype='P';
OPEN p_oncarriage_details FOR
SELECT fsaqu.fsaqu_id AS fsaqu_id,
NVL(fsaqu.fsaqu_idparent,fsaqu.fsaqu_id) AS fsaqu_idparent,
fsaqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS fromlocation,
fsaqu.fsaqu_fromlocationaddress AS fsaqu_fromlocationaddress,
fsaqu.fsaqu_zipcodefrom AS fsaqu_zipcodefrom,
fsaqu.fsaqu_zipcodeto AS fsaqu_zipcodeto,
fsaqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS tolocation,
fsaqu.fsaqu_modeoftransport AS fsaqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsaqu_modeoftransport_description,
fsaqu.fsaqu_transit AS fsaqu_transit,
fsaqu.fsaqu_transittype AS fsaqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsaqu.fsaqu_specialinstruction AS fsaqu_specialinstruction,
fsaqu.fsaqu_tolocationaddress AS fsaqu_tolocationaddress,
fsaqu.fsaqu_ismultimode AS fsaqu_ismultimode,
fsaqu.fsaqu_ismultistop AS fsaqu_ismultistop,
fsaqu.fsaqu_shipmenttype AS fsaqu_shipmenttype
FROM fsaqu_airquotationintermodel fsaqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsaqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsaqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsaqu.fsaqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsaqu.fsaqu_transittype)
WHERE fsaqu.fsaqh_id=p_fsaqh_id
AND fsaqu.fsaqu_shipmenttype='O';
OPEN p_oncarriagecharge_details FOR
SELECT fsaqr.fsaqr_id AS fsaqr_id,
fsaqu.fsaqu_id AS fsaqu_id,
fsaqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsaqr.fsaqr_weight AS fsaqr_weight,
fsmea.fsmea_isocode AS fsaqr_weight_unit,
fsaqr.fsaqr_tariffrate AS fsaqr_tariffrate,
fsaqr.fsaqr_markuptype AS fsaqr_markuptype,
markuptype.fsgec_description AS fsaqr_markuptype_description,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code
FROM FSAQU_AirQuotationIntermodel fsaqu
JOIN fsaqr_airquotationrate fsaqr ON (fsaqr.fsaqu_id=fsaqu.fsaqu_id AND fsaqu.fsaqu_idparent IS NULL)
JOIN fsmea_measurement fsmea ON (fsmea.fsmea_id=fsaqr.fsmea_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsaqr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsaqr.fsaqr_markuptype )
WHERE fsaqu.fsaqh_id=p_fsaqh_id
AND fsaqu.fsaqu_shipmenttype='O';
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_airquotationtariff_Prc;
PROCEDURE Get_intermodel_Prc (
p_fsaqh_id IN fsaqh_airquotationheader.fsaqh_id%TYPE,
p_fsaqu_id IN FSAQU_AirQuotationIntermodel.fsaqu_id%TYPE,
p_fsofo_id IN fsaqh_airquotationheader.fsofo_id%TYPE,
p_precarriage_details OUT FS_AirQuotationManagement.t_list,
p_precarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_oncarriage_details OUT FS_AirQuotationManagement.t_list,
p_oncarriagecharge_details OUT FS_AirQuotationManagement.t_list,
p_issuccess OUT fsaqh_airquotationheader.fsaqh_shipmenttype%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
OPEN p_precarriage_details FOR
SELECT fsaqu.fsaqu_id AS fsaqu_id,
NVL(fsaqu.fsaqu_idparent,fsaqu.fsaqu_id) AS fsaqu_idparent,
fsaqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS fromlocation,
fsaqu.fsaqu_fromlocationaddress AS fsaqu_fromlocationaddress,
fsaqu.fsaqu_zipcodefrom AS fsaqu_zipcodefrom,
fsaqu.fsaqu_zipcodeto AS fsaqu_zipcodeto,
fsaqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS tolocation,
fsaqu.fsaqu_modeoftransport AS fsaqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsaqu_modeoftransport_description,
fsaqu.fsaqu_transit AS fsaqu_transit,
fsaqu.fsaqu_transittype AS fsaqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsaqu.fsaqu_specialinstruction AS fsaqu_specialinstruction,
fsaqu.fsaqu_tolocationaddress AS fsaqu_tolocationaddress,
fsaqu.fsaqu_ismultimode AS fsaqu_ismultimode,
fsaqu.fsaqu_ismultistop AS fsaqu_ismultistop,
fsaqu.fsaqu_shipmenttype AS fsaqu_shipmenttype
FROM FSAQU_AirQuotationIntermodel fsaqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsaqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsaqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsaqu.fsaqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsaqu.fsaqu_transittype)
WHERE fsaqu.fsaqh_id=p_fsaqh_id
AND NVL(fsaqu.fsaqu_idparent,fsaqu.fsaqu_id)=p_fsaqu_id
AND fsaqu.fsaqu_shipmenttype='P';
OPEN p_precarriagecharge_details FOR
SELECT fsaqr.fsaqr_id AS fsaqr_id,
fsaqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsaqr.fsaqr_weight AS fsaqr_weight,
fsmea.fsmea_isocode AS fsaqr_weight_unit,
fsaqr.fsaqr_tariffrate AS fsaqr_tariffrate,
fsaqr.fsaqr_markuptype AS fsaqr_markuptype,
markuptype.fsgec_description AS fsaqr_markuptype_description,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code
FROM fsaqr_airquotationrate fsaqr
JOIN fsmea_measurement fsmea ON (fsmea.fsmea_id=fsaqr.fsmea_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsaqr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsaqr.fsaqr_markuptype )
WHERE fsaqr.fsaqu_id= p_fsaqu_id;
OPEN p_oncarriage_details FOR
SELECT fsaqu.fsaqu_id AS fsaqu_id,
NVL(fsaqu.fsaqu_idparent,fsaqu.fsaqu_id) AS fsaqu_idparent,
fsaqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS fromlocation,
fsaqu.fsaqu_fromlocationaddress AS fsaqu_fromlocationaddress,
fsaqu.fsaqu_zipcodefrom AS fsaqu_zipcodefrom,
fsaqu.fsaqu_zipcodeto AS fsaqu_zipcodeto,
fsaqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS tolocation,
fsaqu.fsaqu_modeoftransport AS fsaqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsaqu_modeoftransport_description,
fsaqu.fsaqu_transit AS fsaqu_transit,
fsaqu.fsaqu_transittype AS fsaqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsaqu.fsaqu_specialinstruction AS fsaqu_specialinstruction,
fsaqu.fsaqu_tolocationaddress AS fsaqu_tolocationaddress,
fsaqu.fsaqu_ismultimode AS fsaqu_ismultimode,
fsaqu.fsaqu_ismultistop AS fsaqu_ismultistop,
fsaqu.fsaqu_shipmenttype AS fsaqu_shipmenttype
FROM fsaqu_airquotationintermodel fsaqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsaqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsaqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsaqu.fsaqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsaqu.fsaqu_transittype)
WHERE fsaqu.fsaqh_id=p_fsaqh_id
AND NVL(fsaqu.fsaqu_idparent,fsaqu.fsaqu_id)=p_fsaqu_id
AND fsaqu.fsaqu_shipmenttype='O';
OPEN p_oncarriagecharge_details FOR
SELECT fsaqr.fsaqr_id AS fsaqr_id,
fsaqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsaqr.fsaqr_weight AS fsaqr_weight,
fsmea.fsmea_isocode AS fsaqr_weight_unit,
fsaqr.fsaqr_tariffrate AS fsaqr_tariffrate,
fsaqr.fsaqr_markuptype AS fsaqr_markuptype,
markuptype.fsgec_description AS fsaqr_markuptype_description,
fsaqr.fsaqr_sellingrate AS fsaqr_sellingrate,
fsaqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code
FROM fsaqr_airquotationrate fsaqr
JOIN fsmea_measurement fsmea ON (fsmea.fsmea_id=fsaqr.fsmea_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsaqr.fschg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id =fsaqr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsaqr.fsaqr_markuptype )
WHERE fsaqr.fsaqu_id= p_fsaqu_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_intermodel_Prc;
PROCEDURE put_fsaqh_prc(
p_fsaqh_id IN OUT FSAQH_AirQuotationHeader.fsaqh_id%TYPE,
p_fsofo_id IN FSAQH_AirQuotationHeader.fsofo_id%TYPE,
p_fsaqh_referencenumber IN OUT FSAQH_AirQuotationHeader.fsaqh_referencenumber%TYPE,
p_fsaqh_referencedate IN FSAQH_AirQuotationHeader.fsaqh_referencedate%TYPE,
p_fsbue_idcustomer IN FSAQH_AirQuotationHeader.fsbue_idcustomer%TYPE,
p_fsofo_idsalesoffice IN FSAQH_AirQuotationHeader.fsofo_idsalesoffice%TYPE,
p_fsaqh_customerdetails IN FSAQH_AirQuotationHeader.fsaqh_customerdetails%TYPE,
p_fsaqh_quotationtype IN FSAQH_AirQuotationHeader.fsaqh_quotationtype%TYPE,
p_fsaqh_shipmenttype IN FSAQH_AirQuotationHeader.fsaqh_shipmenttype%TYPE,
p_fsaqh_minimumconfirmedquantity IN FSAQH_AirQuotationHeader.fsaqh_minimumconfirmedquantity%TYPE,
p_fsaqh_minimumconfirmedquantitytype IN FSAQH_AirQuotationHeader.fsaqh_minimumconfirmedquantitytype%TYPE,
p_fsaqh_incoterms IN FSAQH_AirQuotationHeader.fsaqh_incoterms%TYPE,
p_fsaqh_isexportimport IN FSAQH_AirQuotationHeader.fsaqh_isexportimport%TYPE,
p_fscry_idquotation IN FSAQH_AirQuotationHeader.fscry_idquotation%TYPE,
p_fsaqh_validfrom IN FSAQH_AirQuotationHeader.fsaqh_validfrom%TYPE,
p_fsaqh_validto IN FSAQH_AirQuotationHeader.fsaqh_validto%TYPE,
p_fsaqh_weight IN FSAQH_AirQuotationHeader.fsaqh_weight%TYPE,
p_fsmea_id IN FSAQH_AirQuotationHeader.fsmea_id%TYPE,
p_fsaqh_volume IN FSAQH_AirQuotationHeader.fsaqh_volume%TYPE,
p_fsaqh_quotationpartytype IN FSAQH_AirQuotationHeader.fsaqh_quotationpartytype%TYPE,
p_fsofo_idpartner IN FSAQH_AirQuotationHeader.fsofo_idpartner%TYPE,
p_fsaqh_isshowcarrier IN FSAQH_AirQuotationHeader.fsaqh_isshowcarrier%TYPE,
p_fsaqh_withdrawreason IN FSAQH_AirQuotationHeader.fsaqh_withdrawreason%TYPE,
p_fsaqh_status IN FSAQH_AirQuotationHeader.fsaqh_status%TYPE,
p_fsaqh_remarks IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_user_id IN FSAQH_AirQuotationHeader.fsaqh_createdby%TYPE,
p_record_status IN FSAQH_AirQuotationHeader.fsaqh_purgeyear%TYPE,
p_issuccess OUT FSAQH_AirQuotationHeader.fsaqh_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
v_fsaqh_referencenumber FSAQH_AirQuotationHeader.fsaqh_referencenumber%TYPE;
BEGIN
IF p_record_status =fs_constants.k_insert_status THEN
SELECT 'QHA'||LPAD(quotationair_seq.NEXTVAL,7,0) INTO v_fsaqh_referencenumber
FROM fsdul_dual;
p_fsaqh_referencenumber := v_fsaqh_referencenumber;
END IF;
FSAQH_AirQuotationHeader_PKG.put_fsaqh_prc(
p_fsaqh_id => p_fsaqh_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqh_referencenumber => p_fsaqh_referencenumber ,
p_fsaqh_referencedate => p_fsaqh_referencedate ,
p_fsbue_idcustomer => p_fsbue_idcustomer ,
p_fsofo_idsalesoffice => p_fsofo_idsalesoffice ,
p_fsaqh_customerdetails => p_fsaqh_customerdetails ,
p_fsaqh_quotationtype => p_fsaqh_quotationtype ,
p_fsaqh_shipmenttype => p_fsaqh_shipmenttype ,
p_fsaqh_minimumconfirmedquantity => p_fsaqh_minimumconfirmedquantity ,
p_fsaqh_minimumconfirmedquantitytype => p_fsaqh_minimumconfirmedquantitytype ,
p_fsaqh_incoterms => p_fsaqh_incoterms ,
p_fsaqh_isexportimport => p_fsaqh_isexportimport ,
p_fscry_idquotation => p_fscry_idquotation ,
p_fsaqh_validfrom => p_fsaqh_validfrom ,
p_fsaqh_validto => p_fsaqh_validto ,
p_fsaqh_weight => p_fsaqh_weight ,
p_fsmea_id => p_fsmea_id ,
p_fsaqh_volume => p_fsaqh_volume ,
p_fsaqh_status => p_fsaqh_status ,
p_fsaqh_remarks => p_fsaqh_remarks ,
p_fsaqh_quotationpartytype => p_fsaqh_quotationpartytype,
p_fsofo_idpartner => p_fsofo_idpartner,
p_fsaqh_isshowcarrier => p_fsaqh_isshowcarrier,
p_fsaqh_withdrawreason => p_fsaqh_withdrawreason,
p_fsaqh_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqh_prc;
PROCEDURE put_fsaqc_prc(
p_fsaqc_id IN OUT FSAQC_AirQuotationCarrier.fsaqc_id%TYPE,
p_fsofo_id IN FSAQC_AirQuotationCarrier.fsofo_id%TYPE,
p_fsaqh_id IN FSAQC_AirQuotationCarrier.fsaqh_id%TYPE,
p_fsbue_idcarrier IN FSAQC_AirQuotationCarrier.fsbue_idcarrier%TYPE,
p_user_id IN FSAQC_AirQuotationCarrier.fsaqc_createdby%TYPE,
p_record_status IN FSAQC_AirQuotationCarrier.fsaqc_purgeyear%TYPE,
p_issuccess OUT FSAQC_AirQuotationCarrier.fsaqc_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
FSAQC_AirQuotationCarrier_PKG.put_fsaqc_prc(
p_fsaqc_id => p_fsaqc_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqh_id => p_fsaqh_id ,
p_fsbue_idcarrier => p_fsbue_idcarrier ,
p_fsaqc_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqc_prc;
PROCEDURE put_fsaql_prc(
p_fsaql_id IN OUT FSAQL_AirQuotationEmail.fsaql_id%TYPE,
p_fsofo_id IN FSAQL_AirQuotationEmail.fsofo_id%TYPE,
p_fsaqh_id IN FSAQL_AirQuotationEmail.fsaqh_id%TYPE,
p_fsaql_email IN FSAQH_AirQuotationheader.fsaqh_remarks%TYPE,
p_user_id IN FSAQL_AirQuotationEmail.fsaql_createdby%TYPE,
p_record_status IN FSAQL_AirQuotationEmail.fsaql_purgeyear%TYPE,
p_issuccess OUT FSAQL_AirQuotationEmail.fsaql_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsaql_email, '[^,]+', 1,LEVEL) AS fsaql_email FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaql_email,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSAQL_AirQuotationEmail_PKG.put_fsaql_prc(
p_fsaql_id => p_fsaql_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqh_id => p_fsaqh_id ,
p_fsaql_email => i.fsaql_email ,
p_fsaql_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaql_prc;
PROCEDURE put_fsaqd_prc(
p_fsaqd_id IN OUT FSAQD_AirQuotationDeal.fsaqd_id%TYPE,
p_fsofo_id IN FSAQD_AirQuotationDeal.fsofo_id%TYPE,
p_fsaqh_id IN FSAQD_AirQuotationDeal.fsaqh_id%TYPE,
p_fsdlm_id IN FSAQD_AirQuotationDeal.fsdlm_id%TYPE,
p_user_id IN FSAQD_AirQuotationDeal.fsaqd_createdby%TYPE,
p_record_status IN FSAQD_AirQuotationDeal.fsaqd_purgeyear%TYPE,
p_issuccess OUT FSAQD_AirQuotationDeal.fsaqd_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
FSAQD_AirQuotationDeal_PKG.put_fsaqd_prc(
p_fsaqd_id => p_fsaqd_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqh_id => p_fsaqh_id ,
p_fsdlm_id => p_fsdlm_id ,
p_fsaqd_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqd_prc;
PROCEDURE put_fsaqt_prc(
p_fsaqt_id IN OUT FSAQT_AirQuotationTransportStation.fsaqt_id%TYPE,
p_fsofo_id IN FSAQT_AirQuotationTransportStation.fsofo_id%TYPE,
p_fsaqh_id IN FSAQT_AirQuotationTransportStation.fsaqh_id%TYPE,
p_fsart_fromport IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_fsart_toport IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_transhipmentport IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_fsaqt_travellingtime IN FSAQT_AirQuotationTransportStation.fsaqt_travellingtime%TYPE,
p_fsaqt_dayoffrequency IN FSAQT_AirQuotationTransportStation.fsaqt_dayoffrequency%TYPE,
p_routeexist IN FSAQH_AirQuotationHeader.fsaqh_remarks%TYPE,
p_user_id IN FSAQT_AirQuotationTransportStation.fsaqt_createdby%TYPE,
p_record_status IN FSAQT_AirQuotationTransportStation.fsaqt_purgeyear%TYPE,
p_issuccess OUT FSAQT_AirQuotationTransportStation.fsaqt_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
v_transhipment_sequence fsaqt_airquotationtransportstation.fsaqt_id%TYPE;
v_fsaqp_id fsaqt_airquotationtransportstation.fsaqt_id%TYPE;
BEGIN
IF p_record_status=fs_constants.k_update_status AND p_routeexist='Y' AND p_fsaqt_id IS NOT NULL THEN
UPDATE fsaqi_airquotationinclusivecharge fsaqi SET fsaqi.fsaqi_lastupdatedby=p_user_id,fsaqi.fsaqi_lastupdatedon=SYSDATE
WHERE fsaqi.fsaqr_id IN (SELECT fsaqr.fsaqr_id FROM fsaqr_airQuotationRate fsaqr WHERE fsaqr.fsaqt_id=p_fsaqt_id);
DELETE FROM fsaqi_airquotationinclusivecharge fsaqi WHERE fsaqi.fsaqr_id IN (SELECT fsaqr.fsaqr_id FROM fsaqr_airQuotationRate fsaqr WHERE fsaqr.fsaqt_id=p_fsaqt_id);
UPDATE fsaqr_airQuotationRate fsaqr SET fsaqr.fsaqr_lastupdatedby=p_user_id,fsaqr.fsaqr_lastupdatedon=SYSDATE
WHERE fsaqr.fsaqt_id=p_fsaqt_id;
DELETE FROM fsaqr_airQuotationRate fsaqr WHERE fsaqr.fsaqt_id=p_fsaqt_id;
END IF;
FSAQT_AirQuotationTransportStation_PKG.put_fsaqt_prc(
p_fsaqt_id => p_fsaqt_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqh_id => p_fsaqh_id ,
p_fsart_idfromAirport => p_fsart_fromport ,
p_fsart_idtoAirport => p_fsart_toport ,
p_fsaqt_travellingtime => p_fsaqt_travellingtime,
p_fsaqt_dayoffrequency => p_fsaqt_dayoffrequency,
p_fsaqt_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
IF p_issuccess=fs_constants.k_success AND p_record_status=fs_constants.k_insert_status AND p_transhipmentport IS NOT NULL THEN
FOR k in (SELECT REGEXP_SUBSTR (p_transhipmentport, '[^,]+', 1,LEVEL) AS transhipmentport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_transhipmentport,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
v_transhipment_sequence:= NVL(v_transhipment_sequence,0)+ 1;
fsaqp_airquotationtranshipment_pkg.put_fsaqp_prc(
p_fsaqp_id => v_fsaqp_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fsaqp_sequence => v_transhipment_sequence ,
p_fsart_idtranshipment => k.transhipmentport ,
p_fsaqp_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
ELSIF p_issuccess=fs_constants.k_success AND p_record_status=fs_constants.k_update_status THEN
DELETE FROM fsaqp_airquotationtranshipment WHERE fsaqt_id=p_fsaqt_id;
IF p_transhipmentport IS NOT NULL THEN
FOR k in (SELECT REGEXP_SUBSTR (p_transhipmentport, '[^,]+', 1,LEVEL) AS transhipmentport FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_transhipmentport,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
v_transhipment_sequence:= NVL(v_transhipment_sequence,0)+ 1;
fsaqp_airquotationtranshipment_pkg.put_fsaqp_prc(
p_fsaqp_id => v_fsaqp_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fsaqp_sequence => v_transhipment_sequence ,
p_fsart_idtranshipment => k.transhipmentport ,
p_fsaqp_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqt_prc;
PROCEDURE put_fsaqe_prc(
p_fsaqe_id IN OUT FSAQE_AirQuotationEquipment.fsaqe_id%TYPE,
p_fsofo_id IN FSAQE_AirQuotationEquipment.fsofo_id%TYPE,
p_fsaqt_id IN FSAQE_AirQuotationEquipment.fsaqt_id%TYPE,
p_fseqt_sizetypeuld IN FSAQE_AirQuotationEquipment.fseqt_sizetypeuld%TYPE,
p_fsaqe_cargotype IN FSAQE_AirQuotationEquipment.fsaqe_cargotype%TYPE,
p_fscmg_group IN FSAQH_AirQuotationheader.fsaqh_remarks%TYPE,
p_user_id IN FSAQE_AirQuotationEquipment.fsaqe_createdby%TYPE,
p_record_status IN FSAQE_AirQuotationEquipment.fsaqe_purgeyear%TYPE,
p_issuccess OUT FSAQE_AirQuotationEquipment.fsaqe_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
v_fsaqm_id fsaqe_airquotationequipment.fsaqe_id%TYPE;
BEGIN
IF p_record_status=fs_constants.k_insert_status AND p_fsaqe_cargotype IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsaqe_cargotype, '[^,]+', 1,LEVEL) AS fsaqe_cargotype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaqe_cargotype,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSAQE_AirQuotationEquipment_PKG.put_fsaqe_prc(
p_fsaqe_id => p_fsaqe_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fseqt_sizetypeuld => p_fseqt_sizetypeuld ,
p_fsaqe_cargotype => i.fsaqe_cargotype ,
p_fsaqe_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
ELSIF p_record_status=fs_constants.k_update_status THEN
DELETE FROM FSAQE_AirQuotationEquipment WHERE fsaqt_id=p_fsaqt_id;
IF p_fsaqe_cargotype IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsaqe_cargotype, '[^,]+', 1,LEVEL) AS fsaqe_cargotype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsaqe_cargotype,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSAQE_AirQuotationEquipment_PKG.put_fsaqe_prc(
p_fsaqe_id => p_fsaqe_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fseqt_sizetypeuld => p_fseqt_sizetypeuld ,
p_fsaqe_cargotype => i.fsaqe_cargotype ,
p_fsaqe_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
END IF;
END IF;
IF p_record_status=fs_constants.k_insert_status AND p_fscmg_group IS NOT NULL THEN
FOR j IN (SELECT REGEXP_SUBSTR (p_fscmg_group, '[^,]+', 1,LEVEL) AS fscmg_group FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fscmg_group,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSAQM_AirQuotationCommodity_PKG.put_fsaqm_prc(
p_fsaqm_id => v_fsaqm_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fscmg_id => j.fscmg_group ,
p_fsaqm_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
ELSIF p_record_status=fs_constants.k_update_status THEN
DELETE FROM FSAQM_AirQuotationCommodity WHERE fsaqt_id=p_fsaqt_id;
IF p_fscmg_group IS NOT NULL THEN
FOR j IN (SELECT REGEXP_SUBSTR (p_fscmg_group, '[^,]+', 1,LEVEL) AS fscmg_group FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fscmg_group,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSAQM_AirQuotationCommodity_PKG.put_fsaqm_prc(
p_fsaqm_id => v_fsaqm_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fscmg_id => j.fscmg_group ,
p_fsaqm_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqe_prc;
PROCEDURE put_fsaqu_prc(
p_fsaqu_id IN OUT FSAQU_AirQuotationIntermodel.fsaqu_id%TYPE,
p_fsofo_id IN FSAQU_AirQuotationIntermodel.fsofo_id%TYPE,
p_fsaqh_id IN FSAQU_AirQuotationIntermodel.fsaqh_id%TYPE,
p_fsaqu_shipmenttype IN FSAQU_AirQuotationIntermodel.fsaqu_shipmenttype%TYPE,
p_fsaqu_ismultimode IN FSAQU_AirQuotationIntermodel.fsaqu_ismultimode%TYPE,
p_fsaqu_ismultistop IN FSAQU_AirQuotationIntermodel.fsaqu_ismultistop%TYPE,
p_fsloc_idfrom IN FSAQU_AirQuotationIntermodel.fsloc_idfrom%TYPE,
p_fsaqu_zipcodefrom IN FSAQU_AirQuotationIntermodel.fsaqu_zipcodefrom%TYPE,
p_fsaqu_zipcodeto IN FSAQU_AirQuotationIntermodel.fsaqu_zipcodeto%TYPE,
p_fsloc_idto IN FSAQU_AirQuotationIntermodel.fsloc_idto%TYPE,
p_fsaqu_modeoftransport IN FSAQU_AirQuotationIntermodel.fsaqu_modeoftransport%TYPE,
p_fsaqu_transit IN FSAQU_AirQuotationIntermodel.fsaqu_transit%TYPE,
p_fsaqu_transittype IN FSAQU_AirQuotationIntermodel.fsaqu_transittype%TYPE,
p_fsaqu_specialinstruction IN FSAQU_AirQuotationIntermodel.fsaqu_specialinstruction%TYPE,
p_fsaqu_fromlocationaddress IN FSAQU_AirQuotationIntermodel.fsaqu_fromlocationaddress%TYPE,
p_fsaqu_tolocationaddress IN FSAQU_AirQuotationIntermodel.fsaqu_tolocationaddress%TYPE,
p_fsaqu_locationtype IN FSAQU_AirQuotationIntermodel.fsaqu_locationtype%TYPE,
p_fsaqu_idparent IN FSAQU_AirQuotationIntermodel.fsaqu_idparent%TYPE,
p_fsaqu_purgeyear IN FSAQU_AirQuotationIntermodel.fsaqu_purgeyear%TYPE,
p_user_id IN FSAQU_AirQuotationIntermodel.fsaqu_createdby%TYPE,
p_record_status IN FSAQU_AirQuotationIntermodel.fsaqu_purgeyear%TYPE,
p_issuccess OUT FSAQU_AirQuotationIntermodel.fsaqu_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
FSAQU_AirQuotationIntermodel_PKG.put_fsaqu_prc
(
p_fsaqu_id => p_fsaqu_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqh_id => p_fsaqh_id ,
p_fsaqu_shipmenttype => p_fsaqu_shipmenttype ,
p_fsaqu_ismultimode => p_fsaqu_ismultimode ,
p_fsaqu_ismultistop => p_fsaqu_ismultistop ,
p_fsloc_idfrom => p_fsloc_idfrom ,
p_fsaqu_zipcodefrom => p_fsaqu_zipcodefrom ,
p_fsaqu_zipcodeto => p_fsaqu_zipcodeto ,
p_fsloc_idto => p_fsloc_idto ,
p_fsaqu_modeoftransport => p_fsaqu_modeoftransport ,
p_fsaqu_transit => p_fsaqu_transit ,
p_fsaqu_transittype => p_fsaqu_transittype ,
p_fsaqu_specialinstruction => p_fsaqu_specialinstruction ,
p_fsaqu_fromlocationaddress => p_fsaqu_fromlocationaddress ,
p_fsaqu_tolocationaddress => p_fsaqu_tolocationaddress ,
p_fsaqu_locationtype => p_fsaqu_locationtype ,
p_fsaqu_idparent => p_fsaqu_idparent ,
p_fsaqu_purgeyear => p_fsaqu_purgeyear ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqu_prc;
PROCEDURE put_fsaqr_prc(
p_fsaqr_id IN OUT FSAQR_AirQuotationRate.fsaqr_id%TYPE,
p_fsofo_id IN FSAQR_AirQuotationRate.fsofo_id%TYPE,
p_fsaqt_id IN FSAQR_AirQuotationRate.fsaqt_id%TYPE,
p_fsaqu_id IN FSAQR_AirQuotationRate.fsaqu_id%TYPE,
p_fsatr_id IN FSAQR_AirQuotationRate.fsatr_id%TYPE,
p_fsasr_id IN FSAQR_AirQuotationRate.fsasr_id%TYPE,
p_fslar_id IN FSAQR_AirQuotationRate.fslar_id%TYPE,
p_fschg_id IN FSAQR_AirQuotationRate.fschg_id%TYPE,
p_fsaqr_basis IN FSAQR_AirQuotationRate.fsaqr_basis%TYPE,
p_fsaqr_cargotype IN FSAQR_AirQuotationRate.fsaqr_cargotype%TYPE,
p_fseqt_sizetypeuld IN FSAQR_AirQuotationRate.fseqt_sizetypeuld%TYPE,
p_fscmg_id IN FSAQR_AirQuotationRate.fscmg_id%TYPE,
p_fsaqr_weighttype IN FSAQR_AirQuotationRate.fsaqr_weighttype%TYPE,
p_fscry_id IN FSAQR_AirQuotationRate.fscry_id%TYPE,
p_fsaqr_ispax IN FSAQR_AirQuotationRate.fsaqr_ispax%TYPE,
p_fsaqr_weight IN FSAQR_AirQuotationRate.fsaqr_weight%TYPE,
p_fsmea_id IN FSAQR_AirQuotationRate.fsmea_id%TYPE,
p_fsaqr_tariffrate IN FSAQR_AirQuotationRate.fsaqr_tariffrate%TYPE,
p_fsaqr_markuptype IN FSAQR_AirQuotationRate.fsaqr_markuptype%TYPE,
p_fsaqr_markupvalue IN FSAQR_AirQuotationRate.fsaqr_markupvalue%TYPE,
p_fsaqr_sellingrate IN FSAQR_AirQuotationRate.fsaqr_sellingrate%TYPE,
p_fsaqr_mintariffrate IN FSAQR_AirQuotationRate.fsaqr_mintariffrate%TYPE,
p_fsaqr_minmarkuptype IN FSAQR_AirQuotationRate.fsaqr_minmarkuptype%TYPE,
p_fsaqr_minmarkupvalue IN FSAQR_AirQuotationRate.fsaqr_minmarkupvalue%TYPE,
p_fsaqr_minsellingrate IN FSAQR_AirQuotationRate.fsaqr_minsellingrate%TYPE,
p_fsaqr_additionaldayfee IN FSAQR_AirQuotationRate.fsaqr_additionaldayfee%TYPE,
p_fsaqr_pivotweight IN FSAQR_AirQuotationRate.fsaqr_pivotweight%TYPE,
p_fsbue_idcarrier IN FSAQR_AirQuotationRate.fsbue_idcarrier%TYPE,
p_fsaqr_isexportimport IN FSAQR_AirQuotationRate.fsaqr_isexportimport%TYPE,
p_fsaqr_remarks IN FSAQR_AirQuotationRate.fsaqr_remarks%TYPE,
p_inclusivecharge IN FSAQR_AirQuotationRate.fsaqr_remarks%TYPE,
p_user_id IN FSAQR_AirQuotationRate.fsaqr_createdby%TYPE,
p_record_status IN FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_issuccess OUT FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
v_fsaqi_id fsaqi_airquotationinclusivecharge.fsaqi_id%TYPE;
BEGIN
FSAQR_AirQuotationRate_PKG.put_fsaqr_prc(
p_fsaqr_id => p_fsaqr_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqt_id => p_fsaqt_id ,
p_fsaqu_id => p_fsaqu_id ,
p_fsatr_id => p_fsatr_id ,
p_fsasr_id => p_fsasr_id ,
p_fslar_id => p_fslar_id ,
p_fschg_id => p_fschg_id ,
p_fsaqr_basis => p_fsaqr_basis ,
p_fsaqr_cargotype => p_fsaqr_cargotype ,
p_fseqt_sizetypeuld => p_fseqt_sizetypeuld ,
p_fscmg_id => p_fscmg_id ,
p_fsaqr_weighttype => p_fsaqr_weighttype ,
p_fscry_id => p_fscry_id ,
p_fsaqr_ispax => p_fsaqr_ispax ,
p_fsaqr_weight => p_fsaqr_weight ,
p_fsmea_id => p_fsmea_id ,
p_fsaqr_tariffrate => p_fsaqr_tariffrate ,
p_fsaqr_markuptype => p_fsaqr_markuptype ,
p_fsaqr_markupvalue => p_fsaqr_markupvalue ,
p_fsaqr_sellingrate => p_fsaqr_sellingrate ,
p_fsaqr_mintariffrate => p_fsaqr_mintariffrate ,
p_fsaqr_minmarkuptype => p_fsaqr_minmarkuptype ,
p_fsaqr_minmarkupvalue => p_fsaqr_minmarkupvalue ,
p_fsaqr_minsellingrate => p_fsaqr_minsellingrate ,
p_fsaqr_remarks => p_fsaqr_remarks ,
p_fsaqr_additionaldayfee => p_fsaqr_additionaldayfee ,
p_fsaqr_pivotweight => p_fsaqr_pivotweight ,
p_fsbue_idcarrier => p_fsbue_idcarrier,
p_fsaqr_isexportimport => p_fsaqr_isexportimport,
p_fsaqr_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
IF p_inclusivecharge IS NOT NULL AND p_issuccess=fs_constants.k_success AND p_record_status=fs_constants.k_insert_status THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_inclusivecharge, '[^,]+', 1,LEVEL) AS fschg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_inclusivecharge,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
fsaqi_airquotationinclusivecharge_PKG.put_fsaqi_prc(
p_fsaqi_id => v_fsaqi_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqr_id => p_fsaqr_id ,
p_fschg_id => i.fschg_id ,
p_fsaqi_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
ELSIF p_issuccess=fs_constants.k_success AND p_record_status=fs_constants.k_update_status THEN
DELETE FROM fsaqi_airquotationinclusivecharge WHERE fsaqr_id=p_fsaqr_id;
IF p_inclusivecharge IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_inclusivecharge, '[^,]+', 1,LEVEL) AS fschg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_inclusivecharge,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
fsaqi_airquotationinclusivecharge_PKG.put_fsaqi_prc(
p_fsaqi_id => v_fsaqi_id ,
p_fsofo_id => p_fsofo_id ,
p_fsaqr_id => p_fsaqr_id ,
p_fschg_id => i.fschg_id ,
p_fsaqi_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqr_prc;
PROCEDURE put_fsaqw_prc(
p_fsaqw_id IN OUT FSAQW_AirQuotationSlabRate.fsaqw_id%TYPE,
p_fsofo_id IN FSAQW_AirQuotationSlabRate.fsofo_id%TYPE,
p_fsaqr_id IN FSAQW_AirQuotationSlabRate.fsaqr_id%TYPE,
p_fsatm_id IN FSAQW_AirQuotationSlabRate.fsatm_id%TYPE,
p_fsaqw_buyingrate IN FSAQW_AirQuotationSlabRate.fsaqw_buyingrate%TYPE,
p_fsaqw_markupvalue IN FSAQW_AirQuotationSlabRate.fsaqw_markupvalue%TYPE,
p_fsaqw_sellingrate IN FSAQW_AirQuotationSlabRate.fsaqw_sellingrate%TYPE,
P_fsaqw_weight IN FSAQW_AirQuotationSlabRate.fsaqw_weight%TYPE,
p_user_id IN FSAQR_AirQuotationRate.fsaqr_createdby%TYPE,
p_record_status IN FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_issuccess OUT FSAQR_AirQuotationRate.fsaqr_purgeyear%TYPE,
p_message OUT FS_AirQuotationManagement.t_list)
AS
BEGIN
FSAQW_AirQuotationSlabRate_PKG.put_fsaqw_prc(
p_fsaqw_id => p_fsaqw_id,
p_fsofo_id => p_fsofo_id,
p_fsaqr_id => p_fsaqr_id,
p_fsatm_id => p_fsatm_id,
p_fsaqw_buyingrate => p_fsaqw_buyingrate,
p_fsaqw_markupvalue => p_fsaqw_markupvalue,
p_fsaqw_sellingrate => p_fsaqw_sellingrate,
P_fsaqw_weight => P_fsaqw_weight,
p_fsaqw_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id,
p_record_status => p_record_status,
p_issuccess => p_issuccess,
p_message => p_message);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsaqw_prc;
END FS_AirQuotationManagement;
create or replace PACKAGE /*FS-050620-01*/ FS_Country
AUTHID DEFINER
AS
/*
-----------------------------------------------------------------------------------------------------------------------------------
Modification History
----------------------------------------------------------------------------------------------------------------------------------
|| Version When Who What
|| -------------------------------------------------------------------------------------------------------------------------------
|| FS-240120-01 24-Jan-2020 Praveen Kumar.D FS_Country - This package contains procedures of Country Details.
|| FS-250520-01 25-May-2020 Sarith S GetLov_nationality_Prc procedure added
|| FS-050620-01 05-Jun-2020 Praveen Kumar.D getLov_fscty_prc - p_idregion added to get country based on region.
|| FS-220620-01 06-Jun-2020 Muthuraj B Dial code field added and dial code lov created.
-----------------------------------------------------------------------------------------------------------------------------------
*/
TYPE t_list IS REF CURSOR;
PROCEDURE getLov_fscty_prc (
p_region IN fsprt_port.fsprt_remarks%TYPE,
p_iscountryorzip IN fscty_country.fscty_name%TYPE, -- S -for SubDivision , Z - For Zip code
p_Country_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE GetLov_nationality_Prc (
p_nationality_count OUT fscty_country.fscty_id%TYPE,
p_nationality_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE GetLov_dialcode_Prc (
p_country_id IN fscty_country.fscty_id%TYPE,
p_dialcode_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE GetList_fscty_Prc (
p_search IN FSCTY_Country.fscty_name%TYPE ,
p_page_index IN fscty_country.fscty_id%TYPE,
p_page_size IN fscty_country.fscty_id%TYPE,
p_sort_field IN fscty_country.fscty_name%TYPE,
p_sort_type IN fscty_country.fscty_name%TYPE,
p_country_count OUT fscty_country.fscty_id%TYPE,
p_country_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE get_fscty_prc (
p_fscty_id IN FSCTY_Country.fscty_id%TYPE,
p_Countrydetail_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE put_fscty_prc (
p_fscty_id IN OUT FSCTY_Country.fscty_id%TYPE,
p_fsrgc_id IN OUT FSRGC_Regioncountry.fsrgc_id%TYPE,
p_fscty_code IN FSCTY_Country.fscty_code%TYPE,
p_fscty_name IN FSCTY_Country.fscty_name%TYPE,
p_fscry_idbase IN FSCTY_Country.fscry_idbase%TYPE,
p_fscry_idancillary IN FSCTY_Country.fscry_idancillary%TYPE,
p_fscty_timezoneadjustmenthr IN FSCTY_Country.fscty_timezoneadjustmenthr%TYPE,
p_fscty_timezoneadjustmentmin IN FSCTY_Country.fscty_timezoneadjustmentmin%TYPE,
p_fscty_nationality IN FSCTY_Country.fscty_nationality%TYPE,
p_fscty_validfrom IN FSCTY_Country.fscty_validfrom%TYPE,
p_fscty_validto IN FSCTY_Country.fscty_validto%TYPE,
p_fscty_issubdivisionused IN FSCTY_Country.fscty_issubdivisionused%TYPE,
p_fscty_iszipcodeused IN FSCTY_Country.fscty_iszipcodeused%TYPE,
p_regioncountry_id IN FSCTY_Country.fscty_name%TYPE,
p_fscty_remarks IN FSCTY_Country.fscty_remarks%TYPE,
p_user_id IN FSCTY_Country.fscty_createdby%TYPE,
p_record_status IN fscty_country.fscty_name%TYPE,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE put_fsrgc_prc(
p_fsrgc_id IN OUT fsrgc_regioncountry.fsrgc_id%TYPE,
p_fsrgn_id IN fsrgc_regioncountry.fsrgn_id%TYPE ,
p_fscty_id IN fsrgc_regioncountry.fscty_id%TYPE,
p_user_id IN fsrgc_regioncountry.fsrgc_createdby%TYPE,
p_record_status IN fscty_country.fscty_name%TYPE,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
PROCEDURE put_fscty_prc_del(
P_fscty_id IN fscty_country.fscty_id%TYPE,
p_user_id IN fscty_country.fscty_lastupdatedby%type,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FSCTY_COUNTRY_PKG.t_list);
PROCEDURE put_fsrgc_prc_del(
p_fsrgc_id IN fsrgc_regioncountry.fsrgc_id%TYPE,
p_user_id IN fsrgc_regioncountry.fsrgc_createdby%TYPE,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list);
END FS_Country;
/
create or replace PACKAGE BODY FS_Country
AS
PROCEDURE getLov_fscty_prc (
p_region IN fsprt_port.fsprt_remarks%TYPE,
p_iscountryorzip IN fscty_country.fscty_name%TYPE,
p_Country_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
AS
BEGIN
IF p_region IS NULL THEN
OPEN p_Country_list FOR
SELECT fscty.fscty_id AS fscty_id ,
fscty.fscty_code AS fscty_code ,
fscty.fscty_name AS fscty_name
FROM fscty_country fscty
WHERE ((p_iscountryorzip IS NULL) OR (p_iscountryorzip ='Z' AND fscty_iszipcodeused =fs_constants.k_isactive)
OR (p_iscountryorzip ='S' AND fscty_issubdivisionused =fs_constants.k_isactive));
ELSE
OPEN p_Country_list FOR
SELECT fscty.fscty_id AS fscty_id ,
fscty.fscty_code AS fscty_code ,
fscty.fscty_name AS fscty_name
FROM fscty_country fscty
JOIN fsrgc_regioncountry fsrgc ON (fsrgc.fscty_id=fscty.fscty_id)
WHERE fsrgc.fsrgn_id IN (SELECT REGEXP_SUBSTR (p_region, '[^,]+', 1,LEVEL) AS fschg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_region,'[^,]+', 1, LEVEL) IS NOT NULL)
AND fscty.fscty_isdeleted =fs_constants.k_isnonactive;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getLov_fscty_prc;
PROCEDURE GetLov_nationality_Prc (
p_nationality_count OUT fscty_country.fscty_id%TYPE,
p_nationality_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
IS
BEGIN
OPEN p_nationality_list FOR
SELECT DISTINCT fscty.fscty_nationality AS fscty_nationality
FROM FSCTY_Country fscty
WHERE fscty.fscty_isdeleted = fs_constants.k_isnonactive;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END GetLov_nationality_Prc;
PROCEDURE GetLov_dialcode_Prc (
p_country_id IN fscty_country.fscty_id%TYPE,
p_dialcode_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
IS
BEGIN
OPEN p_dialcode_list FOR
SELECT fscty.fscty_id AS fscty_id,
fscty.fscty_Dialcode AS fscty_Dialcode
FROM FSCTY_Country fscty
WHERE (p_country_id IS NULL OR (fscty.fscty_id=p_country_id))
AND fscty.fscty_isdeleted = fs_constants.k_isnonactive
AND fscty.fscty_Dialcode IS NOT NULL;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END GetLov_dialcode_Prc;
PROCEDURE GetList_fscty_Prc (
p_search IN FSCTY_Country.fscty_name%TYPE ,
p_page_index IN fscty_country.fscty_id%TYPE,
p_page_size IN fscty_country.fscty_id%TYPE,
p_sort_field IN fscty_country.fscty_name%TYPE,
p_sort_type IN fscty_country.fscty_name%TYPE,
p_country_count OUT fscty_country.fscty_id%TYPE,
p_country_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
IS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_search) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query_cnt := 'SELECT 0 FROM FSDUL_Dual';
l_query := 'SELECT NULL AS fscty_id,
NULL AS fscty_code,
NULL AS fscty_name,
NULL AS fscty_timezoneadjustmenthr,
NULL AS fscty_timezoneadjustmentmin,
NULL AS fscty_timezone_description ,
NULL AS fscty_nationality
FROM FSDUL_Dual
WHERE 1=2 ';
EXECUTE IMMEDIATE l_query_cnt INTO p_country_count;
OPEN p_country_list FOR l_query;
ELSE --ELSE PART OF SQL INJECTION
IF p_search IS NULL THEN
l_query := 'SELECT fscty.fscty_id AS fscty_id,
fscty.fscty_code AS fscty_code,
fscty.fscty_name AS fscty_name,
LPAD(fscty.fscty_timezoneadjustmenthr,2,0) AS fscty_timezoneadjustmenthr,
LPAD(fscty.fscty_timezoneadjustmentmin,2,0) AS fscty_timezoneadjustmentmin,
fsgecz.fsgec_description AS fscty_timezone_description ,
fscty.fscty_nationality AS fscty_nationality
FROM FSCTY_Country fscty
LEFT JOIN FSGEC_Generalcode fsgecz ON ( fsgecz.fsgec_value = CASE WHEN INSTR (fscty.fscty_timezoneadjustmenthr, ''-'', 1) > 0 THEN CASE WHEN LENGTH (fscty.fscty_timezoneadjustmenthr) = 2 THEN
REPLACE (fscty.fscty_timezoneadjustmenthr, ''-'',''-0'')
ELSE
LPAD (fscty.fscty_timezoneadjustmenthr, 3, 0)
END
ELSE
LPAD (fscty.fscty_timezoneadjustmenthr, 2, 0) END|| '':''|| LPAD (fscty.fscty_timezoneadjustmentmin, 2, 0) AND fsgecz.fsgec_referencename = ''TIMEZONEADJUSTMENTHR'')
WHERE fscty.fscty_isdeleted = '''||fs_constants.k_isnonactive||''' ';
ELSE
l_query := 'SELECT fscty.fscty_id AS fscty_id,
fscty.fscty_code AS fscty_code,
fscty.fscty_name AS fscty_name,
LPAD(fscty.fscty_timezoneadjustmenthr,2,0) AS fscty_timezoneadjustmenthr,
LPAD(fscty.fscty_timezoneadjustmentmin,2,0) AS fscty_timezoneadjustmentmin,
fsgecz.fsgec_description AS fscty_timezone_description ,
fscty.fscty_nationality AS fscty_nationality
FROM FSCTY_Country fscty
LEFT JOIN FSGEC_Generalcode fsgecz ON ( fsgecz.fsgec_value = CASE WHEN INSTR (fscty.fscty_timezoneadjustmenthr, ''-'', 1) > 0 THEN CASE WHEN LENGTH (fscty.fscty_timezoneadjustmenthr) = 2 THEN
REPLACE (fscty.fscty_timezoneadjustmenthr, ''-'',''-0'')
ELSE
LPAD (fscty.fscty_timezoneadjustmenthr, 3, 0)
END
ELSE
LPAD (fscty.fscty_timezoneadjustmenthr, 2, 0) END|| '':''|| LPAD (fscty.fscty_timezoneadjustmentmin, 2, 0) AND fsgecz.fsgec_referencename = ''TIMEZONEADJUSTMENTHR'')
WHERE (UPPER(fscty.fscty_code) LIKE '''||'%'|| UPPER(p_search)|| '%'||'''
OR UPPER(fscty.fscty_name) LIKE '''||'%'|| UPPER(p_search)|| '%'||''' )
AND fscty.fscty_isdeleted = '''||fs_constants.k_isnonactive||''' ';
END IF;
l_query_cnt := 'SELECT COUNT(fscty_id) FROM (' || l_query || ') ';
p_country_count := 0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_country_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_country_list FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END GetList_fscty_Prc;
PROCEDURE get_fscty_prc (
p_fscty_id IN FSCTY_Country.fscty_id%TYPE,
p_Countrydetail_list OUT FS_Country.t_list,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
AS
BEGIN
OPEN p_Countrydetail_list FOR
SELECT fscty.fscty_id AS fscty_id ,
fscty.fscty_code AS fscty_code ,
fscty.fscty_name AS fscty_name ,
(SELECT LISTAGG (DISTINCT fsrgc.fsrgn_id,', ' ON OVERFLOW TRUNCATE WITH COUNT) WITHIN GROUP (ORDER BY fsrgc.fsrgn_id)
FROM FSRGN_Region fsrgn
LEFT JOIN FSRGC_RegionCountry fsrgc ON (fsrgc.fscty_id = fscty.fscty_id)
WHERE fsrgn.fsrgn_id=fsrgc.fsrgn_id) AS fsrgn_id ,
(SELECT LISTAGG (DISTINCT fsrgn.fsrgn_name,', ' ON OVERFLOW TRUNCATE WITH COUNT) WITHIN GROUP (ORDER BY fsrgn.fsrgn_name)
FROM FSRGN_Region fsrgn
LEFT JOIN FSRGC_RegionCountry fsrgc ON (fsrgc.fscty_id = fscty.fscty_id)
WHERE fsrgn.fsrgn_id=fsrgc.fsrgn_id) AS fsrgn_name ,
fscty.fscry_idbase AS fscry_idbase ,
fscry.fscry_description AS fscry_description ,
fscty.fscry_idancillary AS fscry_idancillary ,
anci_fscry.fscry_description AS fscry_idancillary_description,
LPAD(fscty.fscty_timezoneadjustmenthr,2,0) AS fscty_timezoneadjustmenthr ,
LPAD(fscty.fscty_timezoneadjustmentmin,2,0) AS fscty_timezoneadjustmentmin ,
fsgecz.fsgec_description AS fscty_timezone_description ,
fscty.fscty_validfrom AS fscty_validfrom ,
fscty.fscty_validto AS fscty_validto ,
fscty.fscty_nationality AS fscty_nationality ,
fscty.fscty_issubdivisionused AS fscty_issubdivisionused ,
fscty.fscty_iszipcodeused AS fscty_iszipcodeused ,
fscty.fscty_remarks AS fscty_remarks
FROM FSCTY_Country fscty
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fscty.fscry_idbase )
LEFT JOIN FSCRY_Currency anci_fscry ON (anci_fscry.fscry_id=fscty.fscry_idancillary)
LEFT JOIN FSRGC_RegionCountry fsrgc ON (fsrgc.fscty_id = fscty.fscty_id)
LEFT JOIN FSGEC_Generalcode fsgecz ON ( fsgecz.fsgec_value = CASE WHEN INSTR (fscty.fscty_timezoneadjustmenthr, '-', 1) > 0 THEN CASE WHEN LENGTH (fscty.fscty_timezoneadjustmenthr) = 2 THEN
REPLACE (fscty.fscty_timezoneadjustmenthr, '-','-0')
ELSE
LPAD (fscty.fscty_timezoneadjustmenthr, 3, 0)
END
ELSE
LPAD (fscty.fscty_timezoneadjustmenthr, 2, 0) END|| ':'|| LPAD (fscty.fscty_timezoneadjustmentmin, 2, 0) AND fsgecz.fsgec_referencename = 'TIMEZONEADJUSTMENTHR')
WHERE fscty.fscty_id = p_fscty_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END get_fscty_prc;
PROCEDURE put_fscty_prc (
p_fscty_id IN OUT FSCTY_Country.fscty_id%TYPE,
p_fsrgc_id IN OUT FSRGC_Regioncountry.fsrgc_id%TYPE,
p_fscty_code IN FSCTY_Country.fscty_code%TYPE,
p_fscty_name IN FSCTY_Country.fscty_name%TYPE,
p_fscry_idbase IN FSCTY_Country.fscry_idbase%TYPE,
p_fscry_idancillary IN FSCTY_Country.fscry_idancillary%TYPE,
p_fscty_timezoneadjustmenthr IN FSCTY_Country.fscty_timezoneadjustmenthr%TYPE,
p_fscty_timezoneadjustmentmin IN FSCTY_Country.fscty_timezoneadjustmentmin%TYPE,
p_fscty_nationality IN FSCTY_Country.fscty_nationality%TYPE,
p_fscty_validfrom IN FSCTY_Country.fscty_validfrom%TYPE,
p_fscty_validto IN FSCTY_Country.fscty_validto%TYPE,
p_fscty_issubdivisionused IN FSCTY_Country.fscty_issubdivisionused%TYPE,
p_fscty_iszipcodeused IN FSCTY_Country.fscty_iszipcodeused%TYPE,
p_regioncountry_id IN FSCTY_Country.fscty_name%TYPE,
p_fscty_remarks IN FSCTY_Country.fscty_remarks%TYPE,
p_user_id IN FSCTY_Country.fscty_createdby%TYPE,
p_record_status IN fscty_country.fscty_name%TYPE,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
AS
BEGIN
FSCTY_Country_PKG.put_fscty_prc
(
p_fscty_id => p_fscty_id ,
p_fscty_code => p_fscty_code ,
p_fscty_name => p_fscty_name ,
p_fscry_idbase => p_fscry_idbase ,
p_fscry_idancillary => p_fscry_idancillary ,
p_fscty_timezoneadjustmenthr => p_fscty_timezoneadjustmenthr ,
p_fscty_timezoneadjustmentmin => p_fscty_timezoneadjustmentmin ,
p_fscty_nationality => p_fscty_nationality ,
p_fscty_validfrom => p_fscty_validfrom ,
p_fscty_validto => p_fscty_validto ,
p_fscty_issubdivisionused => p_fscty_issubdivisionused ,
p_fscty_iszipcodeused => p_fscty_iszipcodeused ,
p_fscty_remarks => p_fscty_remarks ,
p_fscty_isdeleted => fs_constants.k_isnonactive,
p_fscty_issynchronized => fs_constants.k_isnonactive,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
IF p_regioncountry_id IS NOT NULL AND NVL(p_issuccess,'$') = FS_CONSTANTS.k_success THEN
IF p_record_status= FS_CONSTANTS.k_insert_status THEN
-- IF p_regioncountry_id IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_regioncountry_id, '[^,]+', 1,LEVEL) AS region_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_regioncountry_id,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRGC_Regioncountry_PKG.put_fsrgc_prc
(
p_fsrgc_id => p_fsrgc_id ,
p_fsrgn_id => i.region_id ,
p_fscty_id => p_fscty_id ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
-- END IF;
ELSIF p_record_status= FS_CONSTANTS.k_update_status THEN
UPDATE FSRGC_Regioncountry SET fsrgc_lastupdatedby =p_user_id , fsrgc_lastupdatedon = SYSDATE
WHERE fscty_id =p_fscty_id;
DELETE FROM FSRGC_Regioncountry WHERE fscty_id =p_fscty_id;
IF p_regioncountry_id IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_regioncountry_id, '[^,]+', 1,LEVEL) AS region_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_regioncountry_id,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRGC_Regioncountry_PKG.put_fsrgc_prc
(
p_fsrgc_id => p_fsrgc_id ,
p_fsrgn_id => i.region_id ,
p_fscty_id => p_fscty_id ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
END IF;
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fscty_prc;
PROCEDURE put_fsrgc_prc(
p_fsrgc_id IN OUT fsrgc_regioncountry.fsrgc_id%TYPE,
p_fsrgn_id IN fsrgc_regioncountry.fsrgn_id%TYPE ,
p_fscty_id IN fsrgc_regioncountry.fscty_id%TYPE,
p_user_id IN fsrgc_regioncountry.fsrgc_createdby%TYPE,
p_record_status IN fscty_country.fscty_name%TYPE,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
AS
BEGIN
FSRGC_Regioncountry_pkg.put_fsrgc_prc
(
p_fsrgc_id => p_fsrgc_id ,
p_fsrgn_id => p_fsrgn_id ,
p_fscty_id => p_fscty_id ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrgc_prc;
PROCEDURE put_fscty_prc_del(
P_fscty_id IN fscty_country.fscty_id%TYPE,
p_user_id IN fscty_country.fscty_lastupdatedby%type,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FSCTY_COUNTRY_PKG.t_list)
IS
BEGIN
fscty_country_pkg.put_fscty_prc_del
(
P_fscty_id => P_fscty_id,
p_user_id => p_user_id,
p_issuccess => p_issuccess,
p_message => p_message
);
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
FS_EXCEPTION.raise_exception;
END put_fscty_prc_del;
PROCEDURE put_fsrgc_prc_del(
p_fsrgc_id IN fsrgc_regioncountry.fsrgc_id%TYPE,
p_user_id IN fsrgc_regioncountry.fsrgc_createdby%TYPE,
p_issuccess OUT fscty_country.fscty_name%TYPE,
p_message OUT FS_Country.t_list)
IS
BEGIN
FSRGC_Regioncountry_pkg.put_fsrgc_prc_del
(
p_fsrgc_id => p_fsrgc_id,
p_user_id => p_user_id,
p_issuccess => p_issuccess,
p_message => p_message
);
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
FS_EXCEPTION.raise_exception;
END put_fsrgc_prc_del;
END FS_Country;
/
create or replace PACKAGE FS_RailQuotation /*FS-260520-01*/
AS
/*
-----------------------------------------------------------------------------------------------------------------------------------
Modification history
----------------------------------------------------------------------------------------------------------------------------------
|| Version When Who What
|| -------------------------------------------------------------------------------------------------------------------------------
|| FS-26052020-01 26-MAY-2020 Muthuraj B FS_RailQuotation - This package contains Rail quotation details.
|| FS-19082020-01 19-AUG-2020 Harish Kumar.D Added getLov_customerdetails_prc.
-----------------------------------------------------------------------------------------------------------------------------------
*/
TYPE t_list IS REF cursor;
PROCEDURE getLov_reference_prc (
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_searchtext IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_reference_count OUT FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_reference OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE getLov_copyreference_prc (
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_searchtext IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_reference_count OUT FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_reference OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE getLov_customerdetails_prc (
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsbue_id IN fsbue_businessentity.fsbue_id%TYPE,
p_customeraddress_list OUT FS_RailQuotation.t_list,
p_issuccess OUT fsbue_businessentity.fsbue_name%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE getlist_fsrqh_prc ( --getlist for rail quotation
p_customer_id IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_quotationtype IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_validfrom IN FSRQH_RailQuotationHeader.fsrQH_validfrom%TYPE,
p_validto IN FSRQH_RailQuotationHeader.fsrQH_validto%TYPE,
p_status IN FSRQH_RailQuotationHeader.fsrQH_status%TYPE,
p_shipmenttype IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_referenceno IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fromstation IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_tostation IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_carrier_id IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_quotationparty IN FSRQH_RailQuotationHeader.fsrqh_quotationpartytype%TYPE,
p_partner IN FSRQH_RailQuotationHeader.fsofo_idpartner%TYPE,
p_salesoffice IN FSRQH_RailQuotationHeader.fsofo_idpartner%TYPE,
p_page_index IN NUMBER,
p_page_size IN NUMBER,
p_sort_field IN VARCHAR2,
p_sort_type IN VARCHAR2,
p_quotation_count OUT NUMBER,
p_quotation_list OUT FS_RailQuotation.t_list,
p_issuccess OUT VARCHAR2,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE Get_generaldetails_Prc ( --header edit
p_fsrqh_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_general_details OUT FS_RailQuotation.t_list,
p_route_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE Get_rateretrive_Prc ( --SP to fetch charges details using rate retrive button
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_customer_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_shipmenttype IN FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_carrier IN fsbue_businessentity.fsbue_name%TYPE,
p_routedetails IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_header_details OUT FS_RailQuotation.t_list,
p_rate_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE Get_localcharges_Prc ( --SP to fetch local charges details
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_customer_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_exportimport IN FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_shipmenttype IN FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_route IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_rate_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_message OUT FS_RailQuotation.t_list);
/*PROCEDURE Get_ratemanagement_Prc ( --charges details(not in use)
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsprt_fromstation IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsprt_tostation IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsloc_origin IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsloc_destination IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_carrier_details OUT FS_RailQuotation.t_list,
p_freight_details OUT FS_RailQuotation.t_list,
p_surcharge_details OUT FS_RailQuotation.t_list,
p_localcharge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_message OUT FS_RailQuotation.t_list);*/
/*PROCEDURE Get_header_Prc ( --header edit
p_fsrqh_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_rate_details OUT FS_RailQuotation.t_list,
p_transport_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list); */
PROCEDURE Getlist_charges_Prc ( --charges details
p_fsrqt_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_route IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_general_details OUT FS_RailQuotation.t_list,
p_header_details OUT FS_RailQuotation.t_list,
p_freight_details OUT FS_RailQuotation.t_list,
p_surcharge_details OUT FS_RailQuotation.t_list,
p_localcharge_details OUT FS_RailQuotation.t_list,
p_precarrige_details OUT FS_RailQuotation.t_list,
p_precarriegecharge_details OUT FS_RailQuotation.t_list,
p_oncarrige_details OUT FS_RailQuotation.t_list,
p_oncarriegecharge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE Get_charges_Prc ( --charges details
p_fsrqr_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_charge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list);
/*PROCEDURE Getlist_intermodel_Prc ( --intermodel details(not in use)
p_fsrqh_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_precarrige_details OUT FS_RailQuotation.t_list,
p_precarriegecharge_details OUT FS_RailQuotation.t_list,
p_oncarrige_details OUT FS_RailQuotation.t_list,
p_oncarriegecharge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list);*/
PROCEDURE Get_intermodel_Prc ( --intermodel details
p_fsrqu_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_carrige_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE put_fsrqh_prc(
p_fsrqh_id IN OUT FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsrqs_id IN OUT FSRQS_RailQuOtationStatus.fsrqs_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsbue_idcustomer IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_fsofo_idsalesoffice IN FSRQH_RailQuotationHeader.fsofo_idsalesoffice%TYPE,
p_fsrqh_quotationtype IN FSRQH_RailQuotationHeader.fsrqh_quotationtype%TYPE,
p_fsrqh_shipmenttype IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_fsrqh_mcq IN FSRQH_RailQuotationHeader.fsrqh_minimumconfirmedquantity%TYPE,
p_fsrqh_mcqtype IN FSRQH_RailQuotationHeader.fsrqh_minimumconfirmedquantitytype%TYPE,
p_fsrqh_referencenumber IN OUT FSRQH_RailQuotationHeader.fsrqh_referencenumber%TYPE,
p_fsrqh_referencedate IN FSRQH_RailQuotationHeader.fsrqh_referencedate%TYPE,
p_fsrqh_validfrom IN FSRQH_RailQuotationHeader.fsrqh_validfrom%TYPE,
p_fsrqh_validto IN FSRQH_RailQuotationHeader.fsrqh_validto%TYPE,
p_fsrqh_customerdetails IN FSRQH_RailQuotationHeader.fsrqh_customerdetails%TYPE,
p_fsrqh_incoterms IN FSRQH_RailQuotationHeader.fsrqh_incoterms%TYPE,
p_fsrqh_isexportimport IN FSRQH_RailQuotationHeader.fsrqh_isexportimport%TYPE,
p_fscry_idquotation IN FSRQH_RailQuotationHeader.fscry_idquotation%TYPE,
p_fsrqh_remarks IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fsrqh_status IN FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_fsrqc_id IN OUT FSRQC_RailQuotationCarrier.fsrqc_id%TYPE,
p_fsbue_idcarrier IN FSRQC_RailQuotationCarrier.fsbue_idcarrier%TYPE,
p_fsrqh_isshowcarrier IN FSRQH_RailQuotationHeader.fsrqh_isshowcarrier%TYPE,
p_fsrqh_quotationpartytype IN FSRQH_RailQuotationHeader.fsrqh_quotationpartytype%TYPE,
p_fsofo_idpartner IN FSRQH_RailQuotationHeader.fsofo_idpartner%TYPE,
p_fsrqh_weight IN FSRQH_RailQuotationHeader.fsrqh_weight%TYPE,
p_fsmea_idweight IN FSRQH_RailQuotationHeader.fsmea_idweight%TYPE,
p_fsrqh_volume IN FSRQH_RailQuotationHeader.fsrqh_volume%TYPE,
p_fsrqh_withdrawreason IN FSRQH_RailQuotationHeader.fsrqh_withdrawreason%TYPE,
p_fsdlm_id IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fsrqh_purgeyear IN FSRQH_RailQuotationHeader.fsrqh_purgeyear%TYPE,
p_user_id IN FSRQH_RailQuotationHeader.fsrqh_createdby%TYPE,
p_record_status IN FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_issuccess OUT FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE put_fsrqt_prc(
p_fsrqt_id IN OUT FSRQT_RailQuotationTransportStation.fsrqt_id%TYPE,
p_fsofo_id IN FSRQT_RailQuotationTransportStation.fsofo_id%TYPE,
p_fsrqh_id IN FSRQT_RailQuotationTransportStation.fsrqh_id%TYPE,
p_fsloc_idplaceoforigin IN FSRQT_RailQuotationTransportStation.fsloc_idplaceoforigin%TYPE,
p_fsrat_idfromstation IN FSRQT_RailQuotationTransportStation.fsrat_idfromstation%TYPE,
p_fsrat_idtostation IN FSRQT_RailQuotationTransportStation.fsrat_idtostation%TYPE,
p_fsloc_idplaceofdestination IN FSRQT_RailQuotationTransportStation.fsloc_idplaceofdestination%TYPE,
p_fsrqt_travellingtime IN FSRQT_RailQuotationTransportStation.fsrqt_travellingtime%TYPE,
p_fsrqt_dayoffrequency IN FSRQT_RailQuotationTransportStation.fsrqt_dayoffrequency%TYPE,
p_fseqt_sizetype IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fscmg_id IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_routeexist IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fsrqt_purgeyear IN FSRQT_RailQuotationTransportStation.fsrqt_purgeyear%TYPE,
p_user_id IN FSRQT_RailQuotationTransportStation.fsrqt_createdby%TYPE,
p_record_status IN FSRQT_RailQuotationTransportStation.fsrqt_purgeyear%TYPE,
p_issuccess OUT FSRQT_RailQuotationTransportStation.fsrqt_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE put_fsrqr_prc(
p_fsrqr_id IN OUT FSRQR_RailQuotationRate.fsrqr_id%TYPE,
p_fsofo_id IN FSRQR_RailQuotationRate.fsofo_id%TYPE,
p_fsrqt_id IN FSRQR_RailQuotationRate.fsrqt_id%TYPE,
p_fschg_id IN FSRQR_RailQuotationRate.fschg_id%TYPE,
p_fslrr_id IN FSRQR_RailQuotationRate.fslrr_id%TYPE,
p_fsrqr_basis IN FSRQR_RailQuotationRate.fsrqr_basis%TYPE,
p_fseqt_sizetype IN FSRQR_RailQuotationRate.fseqt_sizetype%TYPE,
p_fscmg_id IN FSRQR_RailQuotationRate.fscmg_id%TYPE,
p_fsrtr_id IN FSRQR_RailQuotationRate.fsrtr_id%TYPE,
p_fsrsr_id IN FSRQR_RailQuotationRate.fsrsr_id%TYPE,
p_fsrqu_id IN FSRQR_RailQuotationRate.fsrqu_id%TYPE,
p_fsrqr_weight IN FSRQR_RailQuotationRate.fsrqr_weight%TYPE,
p_fsmea_id IN FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_fsrqr_volume IN FSRQR_RailQuotationRate.fsrqr_volume%TYPE,
p_fsrqr_Tariffrate IN FSRQR_RailQuotationRate.fsrqr_Tariffrate%TYPE,
p_fsrqr_ratemarkuptype IN FSRQR_RailQuotationRate.fsrqr_ratemarkuptype%TYPE,
p_fsrqr_ratemarkupvalue IN FSRQR_RailQuotationRate.fsrqr_ratemarkupvalue%TYPE,
p_fsrqr_sellingrate IN FSRQR_RailQuotationRate.fsrqr_sellingrate%TYPE,
p_fscry_id IN FSRQR_RailQuotationRate.fscry_id%TYPE,
p_fsrqr_tariffvolume IN FSRQR_RailQuotationRate.fsrqr_tariffvolume%TYPE,
p_fsrqr_volumemarkuptype IN FSRQR_RailQuotationRate.fsrqr_volumemarkuptype%TYPE,
p_fsrqr_volumemarkupvalue IN FSRQR_RailQuotationRate.fsrqr_volumemarkupvalue%TYPE,
p_fsrqr_volumesellingrate IN FSRQR_RailQuotationRate.fsrqr_volumesellingrate%TYPE,
p_fsrqr_tariffweight IN FSRQR_RailQuotationRate.fsrqr_tariffweight%TYPE,
p_fsrqr_weightmarkuptype IN FSRQR_RailQuotationRate.fsrqr_weightmarkuptype%TYPE,
p_fsrqr_weightmarkupvalue IN FSRQR_RailQuotationRate.fsrqr_weightmarkupvalue%TYPE,
p_fsrqr_weightsellingrate IN FSRQR_RailQuotationRate.fsrqr_weightsellingrate%TYPE,
p_fsbue_idcarrier IN FSRQR_RailQuotationRate.fsbue_idcarrier%TYPE,
p_fsofo_idsalesoffice IN FSRQR_RailQuotationRate.fsofo_idsalesoffice%TYPE,
p_fsrqr_isexportimport IN FSRQR_RailQuotationRate.fsrqr_isexportimport%TYPE,
p_fsrqr_remarks IN FSRQR_RailQuotationRate.fsrqr_remarks%TYPE,
p_fschg_inclusive IN FSRQR_RailQuotationRate.fsrqr_remarks%TYPE,
p_fsrqr_purgeyear IN FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_user_id IN FSRQR_RailQuotationRate.fsrqr_createdby%TYPE,
p_record_status IN FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_issuccess OUT FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE put_fsrqu_prc (
p_fsrqu_id IN OUT FSRQU_RailQuotationIntermodel.fsrqu_id%TYPE,
p_fsofo_id IN FSRQU_RailQuotationIntermodel.fsofo_id%TYPE,
p_fsrqh_id IN FSRQU_RailQuotationIntermodel.fsrqh_id%TYPE,
p_fsrqu_shipmenttype IN FSRQU_RailQuotationIntermodel.fsrqu_shipmenttype%TYPE,
p_fsrqu_ismultimode IN FSRQU_RailQuotationIntermodel.fsrqu_ismultimode%TYPE,
p_fsrqu_ismultistop IN FSRQU_RailQuotationIntermodel.fsrqu_ismultistop%TYPE,
p_fsloc_idfrom IN FSRQU_RailQuotationIntermodel.fsloc_idfrom%TYPE,
p_fsrqu_zipcodefrom IN FSRQU_RailQuotationIntermodel.fsrqu_zipcodefrom%TYPE,
p_fsloc_idto IN FSRQU_RailQuotationIntermodel.fsloc_idto%TYPE,
p_fsrqu_zipcodeto IN FSRQU_RailQuotationIntermodel.fsrqu_zipcodeto%TYPE,
p_fsrqu_modeoftransport IN FSRQU_RailQuotationIntermodel.fsrqu_modeoftransport%TYPE,
p_fsrqu_transit IN FSRQU_RailQuotationIntermodel.fsrqu_transit%TYPE,
p_fsrqu_transittype IN FSRQU_RailQuotationIntermodel.fsrqu_transittype%TYPE,
p_fsrqu_specialinstruction IN FSRQU_RailQuotationIntermodel.fsrqu_specialinstruction%TYPE,
p_fsrqu_fromlocationaddress IN FSRQU_RailQuotationIntermodel.fsrqu_fromlocationaddress%TYPE,
p_fsrqu_tolocationaddress IN FSRQU_RailQuotationIntermodel.fsrqu_tolocationaddress%TYPE,
p_fsrqu_locationtype IN FSRQU_RailQuotationIntermodel.fsrqu_locationtype%TYPE,
p_fsrqu_idparent IN FSRQU_RailQuotationIntermodel.fsrqu_idparent%TYPE,
p_fsrqu_purgeyear IN FSRQU_RailQuotationIntermodel.fsrqu_purgeyear%TYPE,
p_user_id IN FSRQU_RailQuotationIntermodel.fsrqu_createdby%TYPE,
p_record_status IN FSRQU_RailQuotationIntermodel.fsrqu_purgeyear%TYPE,
p_issuccess OUT FSRQU_RailQuotationIntermodel.fsrqu_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE put_fsrql_prc(
p_fsrql_id IN OUT FSRQL_RailQuotationEmail.fsrql_id%TYPE,
p_fsofo_id IN FSRQL_RailQuotationEmail.fsofo_id%TYPE,
p_fsrqh_id IN FSRQL_RailQuotationEmail.fsrqh_id%TYPE,
p_fsrql_email IN FSRQL_RailQuotationEmail.fsrql_email%TYPE,
p_fsrql_purgeyear IN FSRQL_RailQuotationEmail.fsrql_purgeyear%TYPE,
p_user_id IN FSRQL_RailQuotationEmail.fsrql_createdby%TYPE,
p_record_status IN FSRQL_RailQuotationEmail.fsrql_purgeyear%TYPE,
p_issuccess OUT FSRQL_RailQuotationEmail.fsrql_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list);
PROCEDURE put_statuschange_prc(
p_fsrqh_id IN OUT FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsrqs_id IN OUT FSRQS_RailQuOtationStatus.fsrqs_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsrqh_status IN FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_fsrqh_withdrawreason IN FSRQH_RailQuotationHeader.fsrqh_withdrawreason%TYPE,
p_user_id IN FSRQS_RailQuOtationStatus.fsrqs_createdby%TYPE,
p_record_status IN FSRQS_RailQuOtationStatus.fsrqs_status%TYPE,
p_issuccess OUT FSRQS_RailQuOtationStatus.fsrqs_status%TYPE,
p_message OUT FS_RailQuotation.t_list);
END FS_RailQuotation;
create or replace PACKAGE BODY FS_RailQuotation
AS
PROCEDURE getLov_reference_prc (
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_searchtext IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_reference_count OUT FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_reference OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_searchtext) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query :='SELECT NULL AS fsrqh_id ,
NULL AS fsrqh_referencenumber
FROM FSRQH_RailQuotationHeader fsrqh
WHEER 1=2 ' ;
ELSE
l_query :='SELECT fsrqh.fsrqh_id AS fsrqh_id ,
fsrqh.fsrqh_referencenumber AS fsrqh_referencenumber
FROM FSRQH_RailQuotationHeader fsrqh
WHERE(('''|| p_searchtext|| ''' IS NULL) OR
( (UPPER(fsrqh.fsrqh_referencenumber) LIKE '''|| UPPER (p_searchtext)|| '%'||''')
)) ';
l_query_cnt := 'SELECT COUNT(fsrqh_id) FROM (' || l_query || ') ';
p_reference_count :=0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_reference_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_reference FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getLov_reference_prc;
PROCEDURE getLov_copyreference_prc (
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_searchtext IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_page_index IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_page_size IN fsdcl_documentationchangelog.fsdcl_recordid%TYPE,
p_sort_field IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_sort_type IN fsdcl_documentationchangelog.fsdcl_tablename%TYPE,
p_reference_count OUT FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_reference OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_searchtext) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query :='SELECT NULL AS fsrqh_id ,
NULL AS fsrqh_referencenumber
FROM fsdul_dual fsdul
WHEER 1=2 ' ;
ELSE
l_query :='SELECT fsrqh.fsrqh_id AS fsrqh_id ,
fsrqh.fsrqh_referencenumber AS fsrqh_referencenumber,
partytype.fsgec_description AS Quotationpartytype,
fsrqh.fsrqh_validto AS fsrqh_validto,
fsgec_export.fsgec_description AS fsgec_export_description,
fsbue.fsbue_name AS Customername,
fsofo.fsofo_organizationname AS Partnername
FROM FSRQH_RailQuotationHeader fsrqh
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqh.fsbue_idcustomer)
LEFT JOIN fsofo_officeorganization fsofo ON (fsofo.fsofo_id=fsrqh.fsofo_idpartner)
JOIN FSGEC_GeneralCode partytype ON (partytype.fsgec_value=fsrqh.fsrqh_quotationpartytype AND partytype.fsgec_referencename=''QUOTATIONPARTYTYPE'')
JOIN fsgec_generalcode fsgec_export ON (fsgec_export.fsgec_referencename = ''BOOKINGTYPE'' AND fsgec_export.fsgec_value =fsrqh.fsrqh_isexportimport)
WHERE(('''|| p_searchtext|| ''' IS NULL) OR
( (UPPER(fsrqh.fsrqh_referencenumber) LIKE '''|| UPPER (p_searchtext)|| '%'||''')
)) ';
l_query_cnt := 'SELECT COUNT(fsrqh_id) FROM (' || l_query || ') ';
p_reference_count :=0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_reference_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_reference FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getLov_copyreference_prc;
PROCEDURE getLov_customerdetails_prc (
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsbue_id IN fsbue_businessentity.fsbue_id%TYPE,
p_customeraddress_list OUT FS_RailQuotation.t_list,
p_issuccess OUT fsbue_businessentity.fsbue_name%TYPE,
p_message OUT FS_RailQuotation.t_list)
IS
BEGIN
OPEN p_customeraddress_list FOR
SELECT fsbua.fsbua_id AS fsbua_id,
fsbua.fsbua_buildingname ||','||fsbua.fsbua_street||','||fsloc.fsloc_name||','||fscsd.fscsd_name||','||fscty.fscty_name||'-'||fszip.fszip_code AS fsbua_address
FROM FSBUA_BusinessEntityAddress fsbua
LEFT JOIN FSLOC_Location fsloc ON (fsloc.fsloc_id = fsbua.fsloc_id)
LEFT JOIN FSCTY_Country fscty ON (fscty.fscty_id=fsloc.fscty_id)
LEFT JOIN FSCSD_Countrysubdivision fscsd ON (fsloc.fscsd_id = fscsd.fscsd_id)
LEFT JOIN fszip_zipcode fszip ON (fszip.fszip_id = fsbua.fszip_id)
WHERE fsbua.fsbue_id=p_fsbue_id
AND fsbua.fsbua_addresstype='O';
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getLov_customerdetails_prc;
PROCEDURE getlist_fsrqh_prc ( --getlist for rail quotation
p_customer_id IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_quotationtype IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_validfrom IN FSRQH_RailQuotationHeader.fsrQH_validfrom%TYPE,
p_validto IN FSRQH_RailQuotationHeader.fsrQH_validto%TYPE,
p_status IN FSRQH_RailQuotationHeader.fsrQH_status%TYPE,
p_shipmenttype IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_referenceno IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fromstation IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_tostation IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_carrier_id IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_quotationparty IN FSRQH_RailQuotationHeader.fsrqh_quotationpartytype%TYPE,
p_partner IN FSRQH_RailQuotationHeader.fsofo_idpartner%TYPE,
p_salesoffice IN FSRQH_RailQuotationHeader.fsofo_idpartner%TYPE,
p_page_index IN NUMBER,
p_page_size IN NUMBER,
p_sort_field IN VARCHAR2,
p_sort_type IN VARCHAR2,
p_quotation_count OUT NUMBER,
p_quotation_list OUT FS_RailQuotation.t_list,
p_issuccess OUT VARCHAR2,
p_message OUT FS_RailQuotation.t_list)
IS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_status) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_shipmenttype) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_quotationtype) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_quotationparty) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query_cnt := 'SELECT 0 FROM FSDUL_Dual';
l_query := 'SELECT NULL AS fsrqh_id,
NULL AS customer_name,
NULL AS quotationtype_description,
NULL AS shipmenttype_description,
NULL AS fsrqh_referencenumber,
NULL AS carrier_name,
NULL AS from_station,
NULL AS to_station,
NULL AS fsrqh_validfrom,
NULL AS fsrqh_validto,
NULL AS fsgec_statusdescription,
NULL AS fsgec_incotermsdescription,
NULL AS fsgec_export_description
FROM FSDUL_Dual
WHERE 1=2 ';
EXECUTE IMMEDIATE l_query_cnt INTO p_quotation_count;
ELSE
l_query := 'SELECT fsrqh.fsrqh_id AS fsrqh_id,
fsbue.fsbue_name AS customer_name,
fsgec_quotationtype.fsgec_description AS quotationtype_description,
fsgec_shipmenttype.fsgec_description AS shipmenttype_description,
fsrqh.fsrqh_referencenumber AS fsrqh_referencenumber,
(SELECT listagg (DISTINCT fsbue_carrier.fsbue_name,'','' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqc.fsrqc_id)
FROM FSRQC_RailQuotationCarrier fsrqc
JOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsrqc.fsbue_idcarrier)
WHERE fsrqc.fsrqh_id=fsrqh.fsrqh_id
) AS carrier_name,
(SELECT listagg (DISTINCT fromstation.fsrat_name,'','' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqt.fsrqt_id)
FROM FSRQT_RailQuotationTransportStation fsrqt
JOIN FSRAT_Railwaystationmaster fromstation ON (fromstation.fsrat_id=fsrqt.fsrat_idfromstation)
WHERE fsrqt.fsrqh_id=fsrqh.fsrqh_id
) AS from_station,
(SELECT listagg (DISTINCT tostation.fsrat_name,'','' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqt.fsrqt_id)
FROM FSRQT_RailQuotationTransportStation fsrqt
JOIN FSRAT_Railwaystationmaster tostation ON (tostation.fsrat_id=fsrqt.fsrat_idtostation)
WHERE fsrqt.fsrqh_id=fsrqh.fsrqh_id
) AS to_station,
fsrqh.fsrqh_validfrom AS fsrqh_validfrom,
fsrqh.fsrqh_validto AS fsrqh_validto,
fsgec_status.fsgec_description AS fsgec_statusdescription,
fsgec_incoterms.fsgec_description AS fsgec_incotermsdescription,
fsgec_export.fsgec_description AS fsgec_export_description
FROM FSRQH_RailQuotationHeader fsrqh
JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqh.fsbue_idcustomer)
JOIN fsgec_generalcode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_referencename = ''QUOTATIONTYPE'' AND fsgec_quotationtype.fsgec_value = fsrqh.fsrqh_quotationtype )
JOIN fsgec_generalcode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_referencename = ''SHIPMENTTYPE'' AND fsgec_shipmenttype.fsgec_value = fsrqh.fsrqh_shipmenttype )
-- JOIN FSRQC_RailQuotationCarrier fsrqc ON (fsrqc.fsrqh_id=fsrqh.fsrqh_id)
-- jOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsrqc.fsbue_idcarrier)
JOIN fsgec_generalcode fsgec_status ON (fsgec_status.fsgec_referencename = ''QUOTATIONSTATUS'' AND fsgec_status.fsgec_value = fsrqh.fsrqh_status )
JOIN fsgec_generalcode fsgec_incoterms ON (fsgec_incoterms.fsgec_referencename = ''BOOKINGINCOTERMS'' AND fsgec_incoterms.fsgec_value =fsrqh.fsrqh_incoterms)
JOIN fsgec_generalcode fsgec_export ON (fsgec_export.fsgec_referencename = ''BOOKINGTYPE'' AND fsgec_export.fsgec_value =fsrqh.fsrqh_isexportimport)
WHERE ('''|| p_status||''' IS NULL OR fsrqh.fsrqh_status ='''|| p_status ||''' )
AND ( '''|| p_shipmenttype||''' IS NULL OR fsrqh.fsrqh_shipmenttype ='''|| p_shipmenttype ||''' )
AND ( '''|| p_quotationtype||''' IS NULL OR fsrqh.fsrqh_quotationtype = '''|| p_quotationtype ||''' )
AND ( '''|| p_customer_id||''' IS NULL OR fsrqh.fsbue_idcustomer = '''|| p_customer_id ||''' )
AND ( '''|| p_referenceno||''' IS NULL OR fsrqh.fsrqh_id = '''|| p_referenceno ||''' )
AND ( '''|| p_validfrom||''' IS NULL OR TRUNC(fsrqh.fsrqh_validfrom) >= '''|| TRUNC(p_validfrom) ||''')
AND ( '''|| p_validto||''' IS NULL OR TRUNC(fsrqh.fsrqh_validto) <= '''||TRUNC(p_validto)||''')
AND ( '''|| p_quotationparty||''' IS NULL OR fsrqh.fsrqh_quotationpartytype = '''||p_quotationparty||''')
AND ( '''|| p_partner||''' IS NULL OR fsrqh.fsofo_idpartner = '''||p_partner||''')
AND ( '''|| p_salesoffice||''' IS NULL OR fsrqh.fsofo_idsalesoffice = '''||p_salesoffice||''')
AND ( '''|| p_carrier_id||''' IS NULL OR ( EXISTS (
SELECT ''X''
FROM FSRQC_RailQuotationCarrier fsrqc
WHERE fsrqc.fsrqh_id=fsrqh.fsrqh_id
AND fsrqc.fsbue_idcarrier = '''|| p_carrier_id|| ''' )))
AND ( '''|| p_fromstation||''' IS NULL OR ( EXISTS (
SELECT ''X''
FROM FSRQT_RailQuotationTransportStation fsrqt_from
WHERE fsrqt_from.fsrqh_id=fsrqh.fsrqh_id
AND fsrqt_from.fsrat_idfromstation = '''|| p_fromstation|| ''' )))
AND ( '''|| p_tostation||''' IS NULL OR ( EXISTS (
SELECT ''X''
FROM FSRQT_RailQuotationTransportStation fsrqt_to
WHERE fsrqt_to.fsrqh_id=fsrqh.fsrqh_id
AND fsrqt_to.fsrat_idtostation = '''|| p_tostation|| ''' ))) ';
l_query_cnt := 'SELECT COUNT(fsrqh_id) FROM (' || l_query || ') ';
p_quotation_count := 0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_quotation_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
END IF;
OPEN p_quotation_list FOR l_query;
END IF;
p_issuccess := fs_cONstants.k_success;
OPEN p_message FOR
SELECT fs_cONstants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_cONstants.k_failure;
fs_exceptiON.raise_exceptiON;
END getlist_fsrqh_prc;
PROCEDURE Get_generaldetails_Prc ( --header edit
p_fsrqh_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_general_details OUT FS_RailQuotation.t_list,
p_route_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_general_details FOR
SELECT fsrqh.fsrqh_id AS fsrqh_id,
fsrqh.fsbue_idcustomer AS fsbue_idcustomer,
fsbue.fsbue_name AS customer_name,
fsrqh.fsrqh_quotationtype AS fsrqh_quotationtype,
fsgec_quotationtype.fsgec_description AS quotationtype_description,
fsrqh.fsofo_idpartner AS fsofo_idpartner,
fsofo_partner.fsofo_organizationname AS parter_name,
quotationpartytype.fsgec_description AS quotationpartytype_description ,
fsrqh.fsrqh_quotationpartytype AS fsrqh_quotationpartytype,
fsrqh.fsrqh_incoterms AS incoterms,
fsgec_incoterms.fsgec_description AS fsgec_incotermsdescription,
fsrqh.fsrqh_isexportimport AS export_import,
fsgec_export.fsgec_description AS fsgec_export_description,
fsrqh.fsrqh_shipmenttype AS fsrqh_shipmenttype,
fsgec_shipmenttype.fsgec_description AS shipmenttype_description,
fsrqh.fsrqh_minimumconfirmedquantity AS fsrqh_minimumconfirmedquantity,
fsrqh.fsrqh_minimumconfirmedquantitytype AS fsrqh_minimumconfirmedquantitytype,
fsgec_mcqtype.fsgec_description AS mcqtype_description,
fsrqh.fsrqh_validfrom AS fsrqh_validfrom,
fsrqh.fsrqh_validto AS fsrqh_validto,
fsrqh.fsrqh_customerdetails AS fsrqh_customerdetails,
fsrqh.fscry_idquotation AS fscry_idquotation,
fscry.fscry_code AS quotation_currency,
fscry.fscry_description AS quotation_currency_description,
(SELECT listagg (DISTINCT fsrqc.fsbue_idcarrier,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqc.fsrqc_id)
FROM FSRQC_RailQuotationCarrier fsrqc
WHERE fsrqc.fsrqh_id=fsrqh.fsrqh_id
) AS fsbue_idcarrier,
(SELECT listagg (DISTINCT fsbue.fsbue_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqc.fsrqc_id)
FROM FSRQC_RailQuotationCarrier fsrqc
JOIN fsbue_businessentity fsbue ON(fsbue.fsbue_id=fsrqc.fsbue_idcarrier)
WHERE fsrqc.fsrqh_id=fsrqh.fsrqh_id
) AS carrier_name,
-- fsrqc.fsbue_idcarrier AS fsbue_idcarrier,
-- fsbue_carrier.fsbue_name AS carrier_name,
fsrqh.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsofo.fsofo_organizationname AS sales_office,
(SELECT listagg (DISTINCT fsrqd.fsdlm_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqd.fsrqd_id)
FROM FSRQD_Railquotationdeal fsrqd
WHERE fsrqd.fsrqh_id=fsrqh.fsrqh_id
) AS deal,
(SELECT listagg (DISTINCT fsldm.fsdlm_referencenumber,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqd.fsrqd_id)
FROM FSRQD_Railquotationdeal fsrqd
JOIN FSDLM_Dealmanagement fsldm ON (fsldm.fsdlm_id=fsrqd.fsdlm_id)
WHERE fsrqd.fsrqh_id=fsrqh.fsrqh_id
) AS deal_id,
fsrqh.fsrqh_remarks AS fsrqh_remarks,
fsrqh.fsrqh_weight AS fsrqh_weight,
fsrqh.fsmea_idweight AS fsmea_idweight,
fsmea.fsmea_isocode AS fsmea_isocode,
fsrqh.fsrqh_volume AS fsrqh_volume,
fsrqh.fsrqh_isshowcarrier AS fsrqh_isshowcarrier
FROM FSRQH_RailQuotationHeader fsrqh
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqh.fsbue_idcustomer)
LEFT JOIN fsmea_measurement fsmea ON (fsmea.fsmea_id=fsrqh.fsmea_idweight)
LEFT JOIN FSOFO_Officeorganization fsofo_partner ON (fsofo_partner.fsofo_id=fsrqh.fsofo_idpartner)
JOIN fsgec_generalcode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_referencename = 'QUOTATIONTYPE' AND fsgec_quotationtype.fsgec_value = fsrqh.fsrqh_quotationtype )
JOIN fsgec_generalcode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_referencename = 'SHIPMENTTYPE' AND fsgec_shipmenttype.fsgec_value = fsrqh.fsrqh_shipmenttype )
LEFT JOIN fsgec_generalcode fsgec_mcqtype ON (fsgec_mcqtype.fsgec_referencename = 'QUOTATIONMCQ' AND fsgec_mcqtype.fsgec_value = fsrqh.fsrqh_minimumconfirmedquantitytype )
JOIN fsgec_generalcode fsgec_incoterms ON (fsgec_incoterms.fsgec_referencename = 'BOOKINGINCOTERMS' AND fsgec_incoterms.fsgec_value =fsrqh.fsrqh_incoterms)
JOIN fsgec_generalcode fsgec_export ON (fsgec_export.fsgec_referencename = 'BOOKINGTYPE' AND fsgec_export.fsgec_value =fsrqh.fsrqh_isexportimport)
JOIN fsgec_generalcode quotationpartytype ON (quotationpartytype.fsgec_referencename='QUOTATIONPARTYTYPE' AND quotationpartytype.fsgec_value=fsrqh.fsrqh_quotationpartytype )
--JOIN FSRQC_RailQuotationCarrier fsrqc ON (fsrqc.fsrqh_id=fsrqh.fsrqh_id)
--LEFT JOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsrqc.fsbue_idcarrier)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqh.fscry_idquotation)
LEFT JOIN FSOFO_Officeorganization fsofo ON (fsofo.fsofo_id=fsrqh.fsofo_idsalesoffice)
WHERE fsrqh.fsrqh_id=p_fsrqh_id;
OPEN p_route_details FOR
SELECT fsrqh.fsrqh_id AS fsrqh_id,
fsrqt.fsrqt_id AS fsrqt_id,
fsrqt.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsloc_orignplace.fsloc_name AS placeoforigin,
fsrqt.fsrat_idfromstation AS fsrat_idfromstation,
fromstation.fsrat_name AS from_station,
fsrqt.fsrat_idtostation AS fsrat_idtostation,
tostation.fsrat_name AS to_station,
fsrqt.fsloc_idplaceofdestination AS fsloc_idplaceofdestination,
fsloc_destinationplace.fsloc_name AS placeofdestination,
(SELECT listagg (DISTINCT fsrqe.fseqt_sizetype,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqe.fseqt_sizetype)
FROM T_FSRQE_RailQuotationEquipment fsrqe
WHERE fsrqe.fsrqt_id=fsrqt.fsrqt_id
) AS fseqt_sizetype,
(SELECT listagg (DISTINCT fscmg.fscmg_code,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqm.fsrqm_id)
FROM FSRQM_RailQuotationCommodity fsrqm
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fsrqm.fscmg_id)
WHERE fsrqm.fsrqt_id=fsrqt.fsrqt_id
) AS fscmg_code ,
(SELECT listagg (DISTINCT fsrqm.fscmg_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqm.fsrqm_id)
FROM FSRQM_RailQuotationCommodity fsrqm
WHERE fsrqm.fsrqt_id=fsrqt.fsrqt_id
) AS commodityid
FROM FSRQH_RailQuotationHeader fsrqh
JOIN FSRQT_RailQuotationTransportStation fsrqt ON (fsrqt.fsrqh_id=fsrqh.fsrqh_id)
JOIN FSRAT_Railwaystationmaster fromstation ON (fromstation.fsrat_id=fsrqt.fsrat_idfromstation)
JOIN FSRAT_Railwaystationmaster tostation ON (tostation.fsrat_id=fsrqt.fsrat_idtostation)
JOIN FSLOC_Location fsloc_orignplace ON (fsloc_orignplace.fsloc_id=fsrqt.fsloc_idplaceoforigin)
JOIN FSLOC_Location fsloc_destinationplace ON (fsloc_destinationplace.fsloc_id=fsrqt.fsloc_idplaceofdestination)
WHERE fsrqh.fsrqh_id=p_fsrqh_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_generaldetails_Prc;
PROCEDURE Get_rateretrive_Prc ( --SP to fetch charges details using rate retrive button
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_customer_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_shipmenttype IN FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_carrier IN fsbue_businessentity.fsbue_name%TYPE,
p_routedetails IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_header_details OUT FS_RailQuotation.t_list,
p_rate_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
v_route fsdcl_documentationchangelog.fsdcl_content%TYPE;
BEGIN
v_route:=REPLACE(p_routedetails,'\','');
OPEN p_header_details FOR
WITH route_details AS
(SELECT jt.originid,jt.Destinationid,jt.FromStationid,jt.ToStationid,jt.Sequence,
LISTAGG(DISTINCT jt.ContainerType, ',') WITHIN GROUP (ORDER BY 1) ContainerType,
LISTAGG(DISTINCT jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup
FROM
JSON_TABLE(v_route,'$[*]'
COLUMNS ( originid VARCHAR2(100) PATH '$.Orgin',
Destinationid VARCHAR2(100) PATH '$.Destination',
FromStationid VARCHAR2(100) PATH '$.From',
ToStationid VARCHAR2(100) PATH '$.To' ,
Sequence NUMBER PATH '$.Sequence',
NESTED PATH '$.ContainerType[*]'
COLUMNS (ContainerType VARCHAR2(100) PATH '$.Code'),
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.originid,jt.Destinationid,jt.FromStationid,jt.ToStationid,jt.Sequence)
SELECT fsrtt.fsrtt_id AS fsrtt_id,
fsrth.fsbue_idline AS fsbue_idline,
fsbue.fsbue_name AS carrier_name,
fsrtt.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsloc_orginplace.fsloc_name AS placeoforigin,
fsrtt.fsrat_idfromstation AS fsrat_idfromstation,
fromstation.fsrat_name AS fromstation,
fsrtt.fsrat_idtostation AS fsrat_idtostation,
tostation.fsrat_name AS tostation,
fsrtt.fsloc_idplaceofdestination AS fsloc_idplaceofdestination,
fsloc_destinationplace.fsloc_name AS destinationplace,
fsrtt.fsrtt_travellingtime AS fsrtt_travellingtime,
(SELECT listagg (DISTINCT fsrtf.fsrtf_dayoffrequency,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrtf.fsrtt_id)
FROM FSRTF_RailTariffTransportFrequency fsrtf
WHERE fsrtf.fsrtt_id=fsrtt.fsrtt_id
) AS fsrtf_dayoffrequency,
(SELECT listagg (DISTINCT fsgec_frequency.fsgec_description,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrtf.fsrtt_id)
FROM FSRTF_RailTariffTransportFrequency fsrtf
JOIN fsgec_generalcode fsgec_frequency ON (fsgec_frequency.fsgec_referencename = 'FREQUENCY' AND fsgec_frequency.fsgec_value = fsrtf.fsrtf_dayoffrequency)
WHERE fsrtf.fsrtt_id=fsrtt.fsrtt_id
) AS fsrtf_frequencydescription,
route_details.sequence AS route_sequence
FROM FSRTH_RailTariffHeader fsrth
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrth.fsbue_idline)
JOIN FSRTT_RailTariffTransportStation fsrtt ON (fsrtt.fsrth_id=fsrth.fsrth_id)
LEFT JOIN Fsloc_Location fsloc_orginplace ON (fsloc_orginplace.fsloc_id=fsrtt.fsloc_idplaceoforigin)
LEFT JOIN Fsloc_Location fsloc_destinationplace ON (fsloc_destinationplace.fsloc_id=fsrtt.fsloc_idplaceofdestination)
JOIN FSRAT_Railwaystationmaster fromstation ON (fromstation.fsrat_id=fsrtt.fsrat_idfromstation)
JOIN FSRAT_Railwaystationmaster tostation ON (tostation.fsrat_id=fsrtt.fsrat_idtostation)
JOIN route_details ON (NVL(fsrtt.fsloc_idplaceoforigin,0)=NVL(route_details.originid,0) AND fsrtt.fsrat_idfromstation=route_details.FromStationid
AND fsrtt.fsrat_idtostation=route_details.ToStationid AND NVL(fsrtt.fsloc_idplaceofdestination,0)=NVL(route_details.Destinationid,0))
WHERE fsrth.fsrth_shipmenttype = p_shipmenttype
AND (p_carrier IS NULL OR fsrth.fsbue_idline IN (SELECT REGEXP_SUBSTR (p_carrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_carrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_customer_id IS NULL OR EXISTS (SELECT 'X'
FROM FSRTB_RailTariffCustomer fsrtb
WHERE fsrtb.fsrth_id=fsrth.fsrth_id
AND fsrtb.fsbue_idcustomer= p_customer_id))
AND EXISTS (SELECT 'X'
FROM FSRTR_RailTariffRate fsrtr
WHERE fsrtr.fsrtt_id=fsrtt.fsrtt_id
AND (route_details.CommodityGroup IS NULL OR fsrtr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS CommodityGroup FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.ContainerType IS NULL OR fsrtr.fseqt_sizetype IN (SELECT REGEXP_SUBSTR (route_details.ContainerType, '[^,]+', 1,LEVEL) AS ContainerType FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.ContainerType,'[^,]+', 1, LEVEL) IS NOT NULL)))
AND (fsrth.fsrth_referencenumber,fsrth.fsrth_versionnumber) IN (SELECT fsrth.fsrth_referencenumber,MAX(fsrth.fsrth_versionnumber)
FROM fsrth_railtariffheader fsrth
GROUP BY fsrth.fsrth_referencenumber) ;
OPEN p_rate_details FOR
WITH route_details AS
(SELECT jt.originid,jt.Destinationid,jt.FromStationid,jt.ToStationid,jt.Sequence,
LISTAGG(DISTINCT jt.ContainerType, ',') WITHIN GROUP (ORDER BY 1) ContainerType,
LISTAGG(DISTINCT jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup
FROM
JSON_TABLE(v_route,'$[*]'
COLUMNS ( originid VARCHAR2(100) PATH '$.Orgin',
Destinationid VARCHAR2(100) PATH '$.Destination',
FromStationid VARCHAR2(100) PATH '$.From',
ToStationid VARCHAR2(100) PATH '$.To' ,
Sequence NUMBER PATH '$.Sequence',
NESTED PATH '$.ContainerType[*]'
COLUMNS (ContainerType VARCHAR2(100) PATH '$.Code'),
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.originid,jt.Destinationid,jt.FromStationid,jt.ToStationid,jt.Sequence)
SELECT fsrtr.fsrtr_id AS fsrtr_id,
fsrth.fsbue_idline AS fsbue_carrier,
fsrth.fsrth_referencenumber AS fsrth_referencenumber,
fsrtr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrtr.fseqt_sizetype AS fseqt_sizetype,
fsrtr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrtr.fsrtr_buyingrate AS fsrtr_buyingrate, --Minimum rate
fsrtr.fsrtr_buyingratemarkuptype AS fsrtr_buyingratemarkuptype,
markuptype.fsgec_description AS buyingmarkuptypedescription,
fsrtr.fsrtr_buyingratemarkupvalue AS fsrtr_buyingratemarkupvalue,
fsrtr.fsrtr_sellingrate AS fsrtr_sellingrate,
fsrtr.fsrtr_buyingweight AS fsrtr_buyingweight, --per ton
fsrtr.fsrtr_buyingweightmarkuptype AS fsrtr_buyingweightmarkuptype,
markuptype_weight.fsgec_description AS buyingmarkuptypeweight_description,
fsrtr.fsrtr_buyingweightmarkupvalue AS fsrtr_buyingweightmarkupvalue,
fsrtr.fsrtr_sellingweight AS fsrtr_sellingweight,
fsrtr.fsrtr_buyingvolume AS fsrtr_buyingvolume, --per cpm
fsrtr.fsrtr_buyingvolumemarkuptype AS fsrtr_buyingvolumemarkuptype,
markuptype_volume.fsgec_description AS buyingmarkuptypevolume_description,
fsrtr.fsrtr_buyingvolumemarkupvalue AS fsrtr_buyingvolumemarkupvalue,
fsrtr.fsrtr_sellingvolume AS fsrtr_sellingvolume,
fsrtr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fsrtr.fsrtr_remarks AS fsrtr_remarks,
CASE WHEN fsrtt.fsloc_idplaceoforigin IS NOT NULL AND fsrtt.fsloc_idplaceofdestination IS NULL THEN (SELECT fschg.fschg_code AS fschg_code
FROM fschg_chargemaster fschg
WHERE fschg.fschg_code =fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_PRE',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL ))
WHEN fsrtt.fsloc_idplaceoforigin IS NULL AND fsrtt.fsloc_idplaceofdestination IS NOT NULL THEN (SELECT fschg.fschg_code AS fschg_code
FROM fschg_chargemaster fschg
WHERE fschg.fschg_code =fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_ONC',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL ))
WHEN fsrtt.fsloc_idplaceoforigin IS NOT NULL AND fsrtt.fsloc_idplaceofdestination IS NOT NULL THEN (SELECT listagg (DISTINCT fschg.fschg_code,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fschg.fschg_id)
FROM fschg_chargemaster fschg
WHERE fschg.fschg_code IN (fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_ONC',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL ),
fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_PRE',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL ))
)
ELSE NULL END AS include,
CASE WHEN fsrtt.fsloc_idplaceoforigin IS NOT NULL AND fsrtt.fsloc_idplaceofdestination IS NULL THEN TO_CHAR((SELECT fschg.fschg_id AS fschg_id
FROM fschg_chargemaster fschg
WHERE fschg.fschg_code =fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_PRE',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL )))
WHEN fsrtt.fsloc_idplaceoforigin IS NULL AND fsrtt.fsloc_idplaceofdestination IS NOT NULL THEN TO_CHAR((SELECT fschg.fschg_id AS fschg_id
FROM fschg_chargemaster fschg
WHERE fschg.fschg_code =fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_ONC',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL )))
WHEN fsrtt.fsloc_idplaceoforigin IS NOT NULL AND fsrtt.fsloc_idplaceofdestination IS NOT NULL THEN TO_CHAR((SELECT listagg (DISTINCT fschg.fschg_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fschg.fschg_id)
FROM fschg_chargemaster fschg
WHERE fschg.fschg_code IN (fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_ONC',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL ),
fs_configuration.get_value_fnc (
p_fsofo_id => NULL,
p_fscon_referencename => 'TARIFFMANAGEMENT',
p_fscnp_parametercode => 'RAIL_PRE',
p_fscon_keyValue1 => NULL,
p_fscon_keyValue2 => NULL,
p_fscon_keyValue3 => NULL )))
)
ELSE NULL END AS includechargeid,
'T' AS Charge_Type,
fsrtt.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsrtt.fsrat_idfromstation AS fsrat_idfromstation,
fsrtt.fsrat_idtostation AS fsrat_idtostation,
fsrtt.fsloc_idplaceofdestination AS fsloc_idplaceofdestination
FROM FSRTH_RailTariffHeader fsrth
JOIN FSRTT_RailTariffTransportStation fsrtt ON (fsrtt.fsrth_id=fsrth.fsrth_id)
JOIN FSRTR_RailTariffRate fsrtr ON (fsrtr.fsrtt_id=fsrtt.fsrtt_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsrtr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsrtr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsrtr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrtr.fsrtr_buyingratemarkuptype )
LEFT JOIN FSGEC_GeneralCode markuptype_weight ON (markuptype_weight.fsgec_referencename='MARKUPTYPE' AND markuptype_weight.fsgec_value=fsrtr.fsrtr_buyingweightmarkuptype )
LEFT JOIN FSGEC_GeneralCode markuptype_volume ON (markuptype_volume.fsgec_referencename='MARKUPTYPE' AND markuptype_volume.fsgec_value=fsrtr.fsrtr_buyingvolumemarkuptype )
JOIN route_details ON (NVL(fsrtt.fsloc_idplaceoforigin,0)=NVL(route_details.originid,0) AND fsrtt.fsrat_idfromstation=route_details.FromStationid
AND fsrtt.fsrat_idtostation=route_details.ToStationid AND NVL(fsrtt.fsloc_idplaceofdestination,0)=NVL(route_details.Destinationid,0))
WHERE fsrth.fsrth_shipmenttype = p_shipmenttype
AND fschg.fschg_type='F'
AND (p_carrier IS NULL OR (CASE WHEN fsrth.fsrth_shipmenttype = 'F' THEN fsrth.fsbue_idline ELSE fsrth.fsofo_idsalesoffice END) IN (SELECT REGEXP_SUBSTR (p_carrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_carrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsrtr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS CommodityGroup FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.ContainerType IS NULL OR fsrtr.fseqt_sizetype IN (SELECT REGEXP_SUBSTR (route_details.ContainerType, '[^,]+', 1,LEVEL) AS ContainerType FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.ContainerType,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (p_customer_id IS NULL OR EXISTS (SELECT 'X'
FROM FSRTB_RailTariffCustomer fsrtb
WHERE fsrtb.fsrth_id=fsrth.fsrth_id
AND fsrtb.fsbue_idcustomer= p_customer_id))
AND (fsrth.fsrth_referencenumber,fsrth.fsrth_versionnumber) IN (SELECT fsrth.fsrth_referencenumber,MAX(fsrth.fsrth_versionnumber)
FROM fsrth_railtariffheader fsrth
GROUP BY fsrth.fsrth_referencenumber)
UNION ALL
SELECT fsrsr.fsrsr_id AS fsrtr_id,
fsrsr.fsbue_idcarrier AS fsbue_carrier,
NULL AS fsrth_referencenumber,
fsrsr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrsr.fseqt_sizetype AS fseqt_sizetype,
fsrsr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
NULL AS fsrtr_buyingrate,
fsrsr.fsrsr_calculationprocedure AS fsrtr_buyingratemarkuptype,
markuptype.fsgec_description AS buyingmarkuptypedescription,
fsrsr.fsrsr_value AS fsrtr_buyingratemarkupvalue,
fsrsr.fsrsr_rate AS fsrtr_sellingrate,
NULL AS fsrtr_buyingweight,
NULL AS fsrtr_buyingweightmarkuptype,
NULL AS buyingmarkuptypeweight_description,
NULL AS fsrtr_buyingweightmarkupvalue,
fsrsr.fsrsr_perton AS fsrtr_sellingweight,
NULL AS fsrtr_buyingvolume,
NULL AS fsrtr_buyingvolumemarkuptype,
NULL AS buyingmarkuptypevolume_description,
NULL AS fsrtr_buyingvolumemarkupvalue,
fsrsr.fsrsr_percbm AS fsrtr_sellingvolume,
fsrsr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fsrsr.fsrsr_remarks AS fsrtr_remarks,
NULL AS include,
NULL AS includechargeid,
'S' AS Charge_Type,
fsrst.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsrst.fsrat_idfromstation AS fsrat_idfromstation,
fsrst.fsrat_idtostation AS fsrat_idtostation,
fsrst.fsloc_idplaceofdestination AS fsloc_idplaceofdestination
FROM FSRST_Railsurchargetransportstation fsrst
JOIN FSRSR_Railsurchargerate fsrsr ON (fsrsr.fsrst_id=fsrst.fsrst_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsrsr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsrsr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsrsr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrsr.fsrsr_calculationprocedure )
JOIN route_details ON (NVL(fsrst.fsloc_idplaceoforigin,0)=NVL(route_details.originid,0) AND fsrst.fsrat_idfromstation=route_details.FromStationid
AND fsrst.fsrat_idtostation=route_details.ToStationid AND NVL(fsrst.fsloc_idplaceofdestination,0)=NVL(route_details.Destinationid,0))
WHERE fsrsr.fsrsr_shipmenttype = p_shipmenttype
AND fschg.fschg_type='S'
AND (p_carrier IS NULL OR fsrsr.fsbue_idcarrier IN (SELECT REGEXP_SUBSTR (p_carrier, '[^,]+', 1,LEVEL) AS carrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_carrier,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.CommodityGroup IS NULL OR fsrsr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS CommodityGroup FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL))
AND (route_details.ContainerType IS NULL OR fsrsr.fseqt_sizetype IN (SELECT REGEXP_SUBSTR (route_details.ContainerType, '[^,]+', 1,LEVEL) AS ContainerType FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.ContainerType,'[^,]+', 1, LEVEL) IS NOT NULL)) ;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_rateretrive_Prc;
PROCEDURE Get_localcharges_Prc ( --SP to fetch local charges details
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_customer_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_exportimport IN FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_shipmenttype IN FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_route IN fsdcl_documentationchangelog.fsdcl_content%TYPE,
p_rate_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_rate_details FOR
WITH route_details AS
(SELECT jt.originid,jt.Destinationid,jt.FromStationid,jt.ToStationid,jt.Sequence,
LISTAGG(jt.ContainerType, ',') WITHIN GROUP (ORDER BY 1) ContainerType,
LISTAGG(jt.CommodityGroup, ',') WITHIN GROUP (ORDER BY 1) CommodityGroup
FROM
JSON_TABLE(REPLACE(p_route,'\',''),'$[*]'
COLUMNS ( originid VARCHAR2(100) PATH '$.Orgin',
Destinationid VARCHAR2(100) PATH '$.Destination',
FromStationid VARCHAR2(100) PATH '$.From',
ToStationid VARCHAR2(100) PATH '$.To' ,
Sequence NUMBER PATH '$.Sequence',
NESTED PATH '$.ContainerType[*]'
COLUMNS (ContainerType VARCHAR2(100) PATH '$.Code'),
NESTED PATH '$.CommodityGroup[*]'
COLUMNS (CommodityGroup VARCHAR2(100) PATH '$.Id')
)
) jt
GROUP BY jt.originid,jt.Destinationid,jt.FromStationid,jt.ToStationid,jt.Sequence)
SELECT fslrr.fslrr_id AS fsrtr_id,
NULL AS fsbue_carrier,
fslrr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fslrr.fseqt_sizetype AS fseqt_sizetype,
fslrr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fslrr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fslrr.fslrr_amount AS amount,
fslrr.fslrr_isexportimport AS fslrr_isexportimport,
gec_export.fsgec_description AS gec_exportdescription,
fslrs.fsrat_idfrom AS fsrat_idfromstation,
fslrs.fsrat_idto AS fsrat_idtostation ,
route_details.sequence AS route_sequence
FROM FSLRS_Localchargerailstation fslrs
JOIN FSLRR_Localchargerailrate fslrr ON (fslrr.fslrr_uicardreference=fslrs.fslrs_uicardreference and fslrr.fslrr_uigroupingreference=fslrs.fslrs_uigroupingreference)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fslrr.fschg_id)
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fslrr.fscmg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fslrr.fscry_id)
JOIN FSGEC_GeneralCode gec_export ON (gec_export.fsgec_referencename='BOOKINGTYPE' AND gec_export.fsgec_value=fslrr.fslrr_isexportimport)
JOIN route_details ON ( fslrs.fsrat_idfrom=route_details.FromStationid AND fslrs.fsrat_idto=route_details.ToStationid)
WHERE fslrs.fsbue_idcustomer= p_customer_id
AND fslrr.fslrr_isexportimport = p_exportimport
AND fslrr.fslrr_chargetype = p_shipmenttype
AND fschg.fschg_type IN ('LI','LE')
AND route_details.CommodityGroup IS NULL OR fslrr.fscmg_id IN (SELECT REGEXP_SUBSTR (route_details.CommodityGroup, '[^,]+', 1,LEVEL) AS CommodityGroup FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.CommodityGroup,'[^,]+', 1, LEVEL) IS NOT NULL)
AND route_details.ContainerType IS NULL OR fslrr.fseqt_sizetype IN (SELECT REGEXP_SUBSTR (route_details.ContainerType, '[^,]+', 1,LEVEL) AS ContainerType FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (route_details.ContainerType,'[^,]+', 1, LEVEL) IS NOT NULL);
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_localcharges_Prc;
/*PROCEDURE Get_ratemanagement_Prc ( --charges details
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsprt_fromstation IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsprt_tostation IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsloc_origin IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsloc_destination IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_carrier_details OUT FS_RailQuotation.t_list,
p_freight_details OUT FS_RailQuotation.t_list,
p_surcharge_details OUT FS_RailQuotation.t_list,
p_localcharge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_carrier_details FOR
SELECT fsrtt.fsrtt_id AS fsrtt_id,
fsrth.fsbue_idline AS fsbue_idline,
fsbue.fsbue_name AS carrier_name,
fsrtt.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsloc_orginplace.fsloc_name AS placeoforigin,
fsrtt.fsrat_idfromstation AS fsrat_idfromstation,
fromstation.fsrat_name AS fromstation,
fsrtt.fsrat_idtostation AS fsrat_idtostation,
tostation.fsrat_name AS tostation,
fsrtt.fsloc_idplaceofdestination AS fsloc_idplaceofdestination,
fsloc_destinationplace.fsloc_name AS destinationplace,
fsrtt.fsrtt_travellingtime AS fsrtt_travellingtime,
(SELECT listagg (DISTINCT fsrtf.fsrtf_dayoffrequency,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrtf.fsrtt_id)
FROM FSRTF_RailTariffTransportFrequency fsrtf
WHERE fsrtf.fsrtt_id=fsrtt.fsrtt_id
) AS fsrtf_dayoffrequency
FROM FSRTH_RailTariffHeader fsrth
JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrth.fsbue_idline)
JOIN FSRTT_RailTariffTransportStation fsrtt ON (fsrtt.fsrth_id=fsrth.fsrth_id)
JOIN Fsloc_Location fsloc_orginplace ON (fsloc_orginplace.fsloc_id=fsrtt.fsloc_idplaceoforigin)
JOIN Fsloc_Location fsloc_destinationplace ON (fsloc_destinationplace.fsloc_id=fsrtt.fsloc_idplaceofdestination)
JOIN FSRAT_Railwaystationmaster fromstation ON (fromstation.fsrat_id=fsrtt.fsrat_idfromstation)
JOIN FSRAT_Railwaystationmaster tostation ON (tostation.fsrat_id=fsrtt.fsrat_idtostation)
WHERE fsrtt.fsloc_idplaceoforigin = p_fsloc_origin
AND fsrtt.fsrat_idfromstation = p_fsprt_fromstation
AND fsrtt.fsrat_idtostation = p_fsprt_tostation
AND fsrtt.fsloc_idplaceofdestination= p_fsloc_destination;
OPEN p_freight_details FOR
SELECT fsrtr.fsrtr_id AS fsrtr_id,
fsrtr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrtr.fseqt_sizetype AS fseqt_sizetype,
fsrtr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrtr.fsrtr_buyingrate AS fsrtr_buyingrate, --Minimum rate
fsrtr.fsrtr_buyingratemarkuptype AS fsrtr_buyingratemarkuptype,
markuptype.fsgec_description AS buyingmarkuptypedescription,
fsrtr.fsrtr_buyingratemarkupvalue AS fsrtr_buyingratemarkupvalue,
fsrtr.fsrtr_sellingrate AS fsrtr_sellingrate,
fsrtr.fsrtr_buyingweight AS fsrtr_buyingweight, --per ton
fsrtr.fsrtr_buyingweightmarkuptype AS fsrtr_buyingweightmarkuptype,
markuptype_weight.fsgec_description AS buyingmarkuptypeweight_description,
fsrtr.fsrtr_buyingweightmarkupvalue AS fsrtr_buyingweightmarkupvalue,
fsrtr.fsrtr_sellingweight AS fsrtr_sellingweight,
fsrtr.fsrtr_buyingvolume AS fsrtr_buyingvolume, --per cpm
fsrtr.fsrtr_buyingvolumemarkuptype AS fsrtr_buyingvolumemarkuptype,
markuptype_volume.fsgec_description AS buyingmarkuptypevolume_description,
fsrtr.fsrtr_buyingvolumemarkupvalue AS fsrtr_buyingvolumemarkupvalue,
fsrtr.fsrtr_sellingvolume AS fsrtr_sellingvolume,
fsrtr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fsrtr.fsrtr_remarks AS fsrtr_remarks,
NULL AS include
FROM FSRTT_RailTariffTransportStation fsrtt
JOIN FSRTR_RailTariffRate fsrtr ON (fsrtr.fsrtt_id=fsrtt.fsrtt_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsrtr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsrtr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsrtr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrtr.fsrtr_buyingratemarkuptype )
LEFT JOIN FSGEC_GeneralCode markuptype_weight ON (markuptype_weight.fsgec_referencename='MARKUPTYPE' AND markuptype_weight.fsgec_value=fsrtr.fsrtr_buyingweightmarkuptype )
LEFT JOIN FSGEC_GeneralCode markuptype_volume ON (markuptype_volume.fsgec_referencename='MARKUPTYPE' AND markuptype_volume.fsgec_value=fsrtr.fsrtr_buyingvolumemarkuptype )
WHERE fsrtt.fsloc_idplaceoforigin = p_fsloc_origin
AND fsrtt.fsrat_idfromstation = p_fsprt_fromstation
AND fsrtt.fsrat_idtostation = p_fsprt_tostation
AND fsrtt.fsloc_idplaceofdestination= p_fsloc_destination;
OPEN p_surcharge_details FOR
SELECT fsrsr.fsrsr_id AS fsrtr_id,
fsrsr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrsr.fseqt_sizetype AS fseqt_sizetype,
fsrsr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrsr.fsrsr_value AS surcharge_value,
fsrsr.fsrsr_calculationprocedure AS calc_proc,
markuptype.fsgec_description AS calc_procdescription,
fsrsr.fsrsr_rate AS amount, --for lcl shipment
fsrsr.fsrsr_perton AS fsrtr_sellingweight,
fsrsr.fsrsr_percbm AS fsrtr_sellingvolume,
fsrsr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fsrsr.fsrsr_remarks AS fsrtr_remarks
FROM FSRST_Railsurchargetransportstation fsrst
JOIN FSRSR_Railsurchargerate fsrsr ON (fsrsr.fsrst_id=fsrst.fsrst_id)
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsrsr.fschg_id)
JOIN fscmg_commoditygroup fscmg ON (fscmg.fscmg_id=fsrsr.fscmg_id)
JOIN fscry_currency fscry ON (fscry.fscry_id=fsrsr.fscry_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrsr.fsrsr_calculationprocedure )
WHERE fsrst.fsloc_idplaceoforigin = p_fsloc_origin
AND fsrst.fsrat_idfromstation = p_fsprt_fromstation
AND fsrst.fsrat_idtostation = p_fsprt_tostation
AND fsrst.fsloc_idplaceofdestination= p_fsloc_destination;
OPEN p_localcharge_details FOR
SELECT fslrr.fslrr_id AS fsrqr_id,
fslrr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fslrr.fslrr_basis AS charge_basis,
gec_basis.fsgec_description AS fslrr_basisdescription,
fslrr.fseqt_sizetype AS fseqt_sizetype,
fslrr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fslrr.fslrr_amount AS amount,
fslrr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fslrr.fslrr_isexportimport AS fslrr_isexportimport,
gec_export.fsgec_description AS gec_exportdescription
FROM FSLRS_Localchargerailstation fslrs
JOIN FSLRR_Localchargerailrate fslrr ON (fslrr.fslrs_id=fslrs.fslrs_id)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fslrr.fschg_id)
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fslrr.fscmg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fslrr.fscry_id)
JOIN FSGEC_GeneralCode gec_basis ON (gec_basis.fsgec_referencename='BASIS' AND gec_basis.fsgec_value=fslrr.fslrr_basis )
JOIN FSGEC_GeneralCode gec_export ON (gec_export.fsgec_referencename='BOOKINGTYPE' AND gec_export.fsgec_value=fslrr.fslrr_isexportimport)
WHERE fslrs.fsrat_idfrom = p_fsprt_fromstation
AND fslrs.fsrat_idto = p_fsprt_tostation;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_ratemanagement_Prc;
PROCEDURE Get_header_Prc ( --header edit
p_fsrqh_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_rate_details OUT FS_RailQuotation.t_list,
p_transport_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_rate_details FOR
SELECT fsrqh.fsrqh_id AS fsrqh_id,
fsrqh.fsbue_idcustomer AS fsbue_idcustomer,
fsbue.fsbue_name AS customer_name,
fsrqh.fsrqh_quotationtype AS fsrqh_quotationtype,
fsgec_quotationtype.fsgec_description AS quotationtype_description,
fsrqh.fsrqh_shipmenttype AS fsrqh_shipmenttype,
fsgec_shipmenttype.fsgec_description AS shipmenttype_description,
fsrqh.fsrqh_incoterms AS incoterms,
fsgec_incoterms.fsgec_description AS fsgec_incotermsdescription,
fsrqh.fsrqh_isexportimport AS export_import,
fsgec_export.fsgec_description AS fsgec_export_description,
fsrqh.fscry_idquotation AS fscry_idquotation,
fscry.fscry_code AS quotation_currency,
fscry.fscry_description AS quotation_currency_description,
fsrqh.fsrqh_referencenumber AS fsrqh_referencenumber,
fsrqh.fsrqh_validfrom AS fsrqh_validfrom,
fsrqh.fsrqh_validto AS fsrqh_validto,
fsrqh.fsrqh_status AS fsrqh_status,
fsgec_status.fsgec_description AS fsgec_statusdescription
FROM FSRQH_RailQuotationHeader fsrqh
JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqh.fsbue_idcustomer)
JOIN fsgec_generalcode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_referencename = 'QUOTATIONTYPE' AND fsgec_quotationtype.fsgec_value = fsrqh.fsrqh_quotationtype )
JOIN fsgec_generalcode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_referencename = 'SHIPMENTTYPE' AND fsgec_shipmenttype.fsgec_value = fsrqh.fsrqh_shipmenttype )
JOIN fsgec_generalcode fsgec_status ON (fsgec_status.fsgec_referencename = 'QUOTATIONSTATUS' AND fsgec_status.fsgec_value = fsrqh.fsrqh_status )
JOIN fsgec_generalcode fsgec_incoterms ON (fsgec_incoterms.fsgec_referencename = 'BOOKINGINCOTERMS' AND fsgec_incoterms.fsgec_value =fsrqh.fsrqh_incoterms)
JOIN fsgec_generalcode fsgec_export ON (fsgec_export.fsgec_referencename = 'BOOKINGTYPE' AND fsgec_export.fsgec_value =fsrqh.fsrqh_isexportimport)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqh.fscry_idquotation)
WHERE fsrqh.fsrqh_id=p_fsrqh_id;
OPEN p_transport_details FOR
SELECT fsrqh.fsrqh_id AS fsrqh_id,
fsrqc.fsbue_idcarrier AS fsbue_idcarrier,
fsbue_carrier.fsbue_name AS carrier_name,
fsrqt.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsloc_orignplace.fsloc_name AS placeoforigin,
fsrqt.fsrat_idfromstation AS fsrat_idfromstation,
fromstation.fsrat_name AS from_station,
fsrqt.fsrat_idtostation AS fsrat_idtostation,
tostation.fsrat_name AS to_station,
fsrqt.fsloc_idplaceofdestination AS fsloc_idplaceofdestination,
fsloc_destinationplace.fsloc_name AS placeofdestination,
FSRQT_Travellingtime AS transit_days,
FSRQT_DayofFrequency AS frequency
FROM FSRQH_RailQuotationHeader fsrqh
JOIN FSRQC_RailQuotationCarrier fsrqc ON (fsrqc.fsrqh_id=fsrqh.fsrqh_id)
jOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsrqc.fsbue_idcarrier)
JOIN FSRQT_RailQuotationTransportStation fsrqt ON (fsrqt.fsrqh_id=fsrqh.fsrqh_id)
JOIN FSRAT_Railwaystationmaster fromstation ON (fromstation.fsrat_id=fsrqt.fsrat_idfromstation)
JOIN FSRAT_Railwaystationmaster tostation ON (tostation.fsrat_id=fsrqt.fsrat_idtostation)
JOIN FSLOC_Location fsloc_orignplace ON (fsloc_orignplace.fsloc_id=fsrqt.fsloc_idplaceoforigin)
JOIN FSLOC_Location fsloc_destinationplace ON (fsloc_destinationplace.fsloc_id=fsrqt.fsloc_idplaceofdestination)
WHERE fsrqh.fsrqh_id=p_fsrqh_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_header_Prc;*/
PROCEDURE Getlist_charges_Prc ( --charges details
p_fsrqt_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_route IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_general_details OUT FS_RailQuotation.t_list,
p_header_details OUT FS_RailQuotation.t_list,
p_freight_details OUT FS_RailQuotation.t_list,
p_surcharge_details OUT FS_RailQuotation.t_list,
p_localcharge_details OUT FS_RailQuotation.t_list,
p_precarrige_details OUT FS_RailQuotation.t_list,
p_precarriegecharge_details OUT FS_RailQuotation.t_list,
p_oncarrige_details OUT FS_RailQuotation.t_list,
p_oncarriegecharge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_general_details FOR
SELECT fsrqh.fsrqh_id AS fsrqh_id,
fsrqh.fsbue_idcustomer AS fsbue_idcustomer,
fsbue.fsbue_name AS customer_name,
fsrqh.fsrqh_quotationtype AS fsrqh_quotationtype,
fsgec_quotationtype.fsgec_description AS quotationtype_description,
quotationpartytype.fsgec_description AS quotationpartytype_description ,
fsrqh.fsrqh_quotationpartytype AS fsrqh_quotationpartytype,
fsrqh.fsrqh_incoterms AS incoterms,
fsgec_incoterms.fsgec_description AS fsgec_incotermsdescription,
fsrqh.fsrqh_isexportimport AS export_import,
fsgec_export.fsgec_description AS fsgec_export_description,
fsrqh.fsrqh_shipmenttype AS fsrqh_shipmenttype,
fsgec_shipmenttype.fsgec_description AS shipmenttype_description,
fsrqh.fsrqh_validfrom AS fsrqh_validfrom,
fsrqh.fsrqh_validto AS fsrqh_validto,
fsrqh.fscry_idquotation AS fscry_idquotation,
fscry.fscry_code AS quotation_currency,
fscry.fscry_description AS quotation_currency_description,
fsrqh.fsrqh_isshowcarrier AS fsrqh_isshowcarrier,
fsrqh.fsrqh_status AS fsrqh_status,
fsgec_status.fsgec_description AS fsgec_statusdescription,
fsrqh.fsrqh_referencenumber AS fsrqh_referencenumber,
fsrqh.fsofo_idpartner AS fsofo_idpartner,
fsofo_partner.fsofo_organizationname AS parter_name,
fsrqh.fsrqh_minimumconfirmedquantity AS fsrqh_minimumconfirmedquantity,
fsrqh.fsrqh_minimumconfirmedquantitytype AS fsrqh_minimumconfirmedquantitytype,
fsgec_mcqtype.fsgec_description AS mcqtype_description,
fsrqh.fsrqh_customerdetails AS fsrqh_customerdetails,
(SELECT listagg (DISTINCT fsrqc.fsbue_idcarrier,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqc.fsrqc_id)
FROM FSRQC_RailQuotationCarrier fsrqc
WHERE fsrqc.fsrqh_id=fsrqh.fsrqh_id
) AS fsbue_idcarrier,
(SELECT listagg (DISTINCT fsbue.fsbue_name,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqc.fsrqc_id)
FROM FSRQC_RailQuotationCarrier fsrqc
JOIN fsbue_businessentity fsbue ON(fsbue.fsbue_id=fsrqc.fsbue_idcarrier)
WHERE fsrqc.fsrqh_id=fsrqh.fsrqh_id
) AS carrier_name,
fsrqh.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsofo.fsofo_organizationname AS sales_office,
(SELECT listagg (DISTINCT fsrqd.fsdlm_id,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqd.fsrqd_id)
FROM FSRQD_Railquotationdeal fsrqd
WHERE fsrqd.fsrqh_id=fsrqh.fsrqh_id
) AS deal,
(SELECT listagg (DISTINCT fsldm.fsdlm_referencenumber,',' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqd.fsrqd_id)
FROM FSRQD_Railquotationdeal fsrqd
JOIN FSDLM_Dealmanagement fsldm ON (fsldm.fsdlm_id=fsrqd.fsdlm_id)
WHERE fsrqd.fsrqh_id=fsrqh.fsrqh_id
) AS deal_id,
fsrqh.fsrqh_weight AS fsrqh_weight,
fsrqh.fsmea_idweight AS fsmea_idweight,
fsmea.fsmea_isocode AS fsmea_isocode,
fsrqh.fsrqh_volume AS fsrqh_volume
FROM FSRQH_RailQuotationHeader fsrqh
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqh.fsbue_idcustomer)
LEFT JOIN fsmea_measurement fsmea ON (fsmea.fsmea_id=fsrqh.fsmea_idweight)
LEFT JOIN FSOFO_Officeorganization fsofo_partner ON (fsofo_partner.fsofo_id=fsrqh.fsofo_idpartner)
JOIN fsgec_generalcode fsgec_quotationtype ON (fsgec_quotationtype.fsgec_referencename = 'QUOTATIONTYPE' AND fsgec_quotationtype.fsgec_value = fsrqh.fsrqh_quotationtype )
JOIN fsgec_generalcode fsgec_shipmenttype ON (fsgec_shipmenttype.fsgec_referencename = 'SHIPMENTTYPE' AND fsgec_shipmenttype.fsgec_value = fsrqh.fsrqh_shipmenttype )
JOIN fsgec_generalcode fsgec_incoterms ON (fsgec_incoterms.fsgec_referencename = 'BOOKINGINCOTERMS' AND fsgec_incoterms.fsgec_value =fsrqh.fsrqh_incoterms)
JOIN fsgec_generalcode fsgec_export ON (fsgec_export.fsgec_referencename = 'BOOKINGTYPE' AND fsgec_export.fsgec_value =fsrqh.fsrqh_isexportimport)
LEFT JOIN fsgec_generalcode fsgec_mcqtype ON (fsgec_mcqtype.fsgec_referencename = 'QUOTATIONMCQ' AND fsgec_mcqtype.fsgec_value = fsrqh.fsrqh_minimumconfirmedquantitytype )
JOIN fsgec_generalcode quotationpartytype ON (quotationpartytype.fsgec_referencename='QUOTATIONPARTYTYPE' AND quotationpartytype.fsgec_value=fsrqh.fsrqh_quotationpartytype )
JOIN fsgec_generalcode fsgec_status ON (fsgec_status.fsgec_referencename = 'QUOTATIONSTATUS' AND fsgec_status.fsgec_value = fsrqh.fsrqh_status )
--JOIN FSRQC_RailQuotationCarrier fsrqc ON (fsrqc.fsrqh_id=fsrqh.fsrqh_id)
--LEFT JOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsrqc.fsbue_idcarrier)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqh.fscry_idquotation)
LEFT JOIN FSOFO_Officeorganization fsofo ON (fsofo.fsofo_id=fsrqh.fsofo_idsalesoffice)
WHERE fsrqh.fsrqh_id=p_fsrqt_id;
OPEN p_header_details FOR
SELECT DISTINCT fsrqh.fsrqh_id AS fsrqh_id,
fsrqt.fsrqt_id AS fsrqt_id,
fsrqr.fsbue_idcarrier AS fsbue_idcarrier,
fsrqr.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsbue_carrier.fsbue_name AS carrier_name,
fsofo.fsofo_organizationname AS fsofo_organizationname,
fsrqt.fsloc_idplaceoforigin AS fsloc_idplaceoforigin,
fsloc_orignplace.fsloc_name AS placeoforigin,
fsrqt.fsrat_idfromstation AS fsrat_idfromstation,
fromstation.fsrat_name AS from_station,
fsrqt.fsrat_idtostation AS fsrat_idtostation,
tostation.fsrat_name AS to_station,
fsrqt.fsloc_idplaceofdestination AS fsloc_idplaceofdestination,
fsloc_destinationplace.fsloc_name AS placeofdestination,
fsrqt.fsrqt_travellingtime AS fsrqt_travellingtime,
fsrqt.fsrqt_dayoffrequency AS fsrqt_dayoffrequency,
fsgec_frequency.fsgec_description AS fsrqt_frequencydescription,
fsrqh.fsrqh_isshowcarrier AS fsrqh_isshowcarrier
FROM FSRQH_RailQuotationHeader fsrqh
JOIN FSRQT_RailQuotationTransportStation fsrqt ON (fsrqt.fsrqh_id=fsrqh.fsrqh_id)
JOIN FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqt_id=fsrqt.fsrqt_id)
LEFT JOIN FSBUE_Businessentity fsbue_carrier ON (fsbue_carrier.fsbue_id=fsrqr.fsbue_idcarrier)
LEFT JOIN FSOFO_Officeorganization fsofo ON (fsofo.fsofo_id=fsrqr.fsofo_idsalesoffice)
JOIN FSRAT_Railwaystationmaster fromstation ON (fromstation.fsrat_id=fsrqt.fsrat_idfromstation)
JOIN FSRAT_Railwaystationmaster tostation ON (tostation.fsrat_id=fsrqt.fsrat_idtostation)
LEFT JOIN fsgec_generalcode fsgec_frequency ON (fsgec_frequency.fsgec_referencename = 'FREQUENCY' AND fsgec_frequency.fsgec_value = fsrqt.fsrqt_dayoffrequency)
JOIN FSLOC_Location fsloc_orignplace ON (fsloc_orignplace.fsloc_id=fsrqt.fsloc_idplaceoforigin)
JOIN FSLOC_Location fsloc_destinationplace ON (fsloc_destinationplace.fsloc_id=fsrqt.fsloc_idplaceofdestination)
WHERE fsrqt.fsrqh_id=p_fsrqt_id;
OPEN p_freight_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqt.fsrqt_id AS fsrqt_id,
fsrqr.fschg_id AS fschg_id,
fsrqr.fsbue_idcarrier AS fsbue_idcarrier,
fsrqr.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsbue.fsbue_name AS carriername,
fsrqr.fsofo_idsalesoffice AS organizationname,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrqr.fsrqr_Tariffrate AS fsrqr_Tariffrate,
fsrqr.fsrqr_ratemarkuptype AS fsrqr_ratemarkuptype,
markuptype.fsgec_description AS ratemarkuptype_description,
fsrqr.fsrqr_ratemarkupvalue AS fsrqr_ratemarkupvalue,
fsrqr.fsrqr_sellingrate AS fsrqr_sellingrate,
fsrqr.fsrqr_tariffvolume AS fsrqr_tariffvolume,
fsrqr.fsrqr_volumemarkuptype AS fsrqr_volumemarkuptype,
markuptype_volume.fsgec_description AS markuptype_volumedescription,
fsrqr.fsrqr_volumemarkupvalue AS fsrqr_volumemarkupvalue,
fsrqr.fsrqr_volumesellingrate AS fsrqr_volumesellingrate,
fsrqr.fsrqr_tariffweight AS fsrqr_tariffweight,
fsrqr.fsrqr_weightmarkuptype AS fsrqr_weightmarkuptype,
markuptype_weight.fsgec_description AS markuptype_weightdescription,
fsrqr.fsrqr_weightmarkupvalue AS fsrqr_weightmarkupvalue,
fsrqr.fsrqr_weightsellingrate AS fsrqr_weightsellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
(SELECT listagg (DISTINCT fsrqi.fschg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqi.fsrqi_id)
FROM FSRQI_RailQuotationInclusiveCharge fsrqi
WHERE fsrqi.fsrqr_id=fsrqr.fsrqr_id
) AS inclusive_chargeid,
(SELECT listagg (DISTINCT fschg.fschg_code,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqi.fsrqi_id)
FROM FSRQI_RailQuotationInclusiveCharge fsrqi
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsrqi.fschg_id)
WHERE fsrqi.fsrqr_id=fsrqr.fsrqr_id
) AS inclusive_charge,
fsrqr.fsrqr_remarks AS fsrqr_remarks
FROM FSRQH_RailQuotationHeader fsrqh
JOIN FSRQT_RailQuotationTransportStation fsrqt ON (fsrqt.fsrqh_id=fsrqh.fsrqh_id)
JOIN FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqt_id=fsrqt.fsrqt_id)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fsrqr.fscmg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqr.fsbue_idcarrier)
LEFT JOIN fsofo_officeorganization fsofo ON (fsofo.fsofo_id=fsrqr.fsofo_idsalesoffice)
LEFT JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
LEFT JOIN FSGEC_GeneralCode markuptype_volume ON (markuptype_volume.fsgec_referencename='MARKUPTYPE' AND markuptype_volume.fsgec_value=fsrqr.fsrqr_volumemarkuptype )
LEFT JOIN FSGEC_GeneralCode markuptype_weight ON (markuptype_weight.fsgec_referencename='MARKUPTYPE' AND markuptype_weight.fsgec_value=fsrqr.fsrqr_weightmarkuptype )
WHERE fsrqt.fsrqh_id=p_fsrqt_id
AND fschg.fschg_type='F'
AND (p_route IS NULL OR fsrqt.fsrqt_id IN (SELECT REGEXP_SUBSTR (p_route, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_route,'[^,]+', 1, LEVEL) IS NOT NULL));
OPEN p_surcharge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqt.fsrqt_id AS fsrqt_id,
fsrqr.fsbue_idcarrier AS fsbue_idcarrier,
fsrqr.fsofo_idsalesoffice AS fsofo_idsalesoffice,
fsbue.fsbue_name AS carriername,
fsrqr.fsofo_idsalesoffice AS organizationname,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrqr.fsrqr_ratemarkuptype AS Calc_proc,
markuptype.fsgec_description AS calc_procdescription,
fsrqr.fsrqr_Tariffrate AS fsrqr_value,
fsrqr.fsrqr_sellingrate AS amount,
fsrqr.fsrqr_volumesellingrate AS fsrqr_volumesellingrate,
fsrqr.fsrqr_weightsellingrate AS fsrqr_weightsellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fsrqr.fsrqr_remarks AS fsrqr_remarks
FROM FSRQH_RailQuotationHeader fsrqh
JOIN FSRQT_RailQuotationTransportStation fsrqt ON (fsrqt.fsrqh_id=fsrqh.fsrqh_id)
JOIN FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqt_id=fsrqt.fsrqt_id)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fsrqr.fscmg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
LEFT JOIN fsbue_businessentity fsbue ON (fsbue.fsbue_id=fsrqr.fsbue_idcarrier)
LEFT JOIN fsofo_officeorganization fsofo ON (fsofo.fsofo_id=fsrqr.fsofo_idsalesoffice)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
WHERE fsrqt.fsrqh_id=p_fsrqt_id
AND fschg.fschg_type='S'
AND (p_route IS NULL OR fsrqt.fsrqt_id IN (SELECT REGEXP_SUBSTR (p_route, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_route,'[^,]+', 1, LEVEL) IS NOT NULL));
OPEN p_localcharge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqt.fsrqt_id AS fsrqt_id,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fsrqr_basis AS fsrqr_basis,
gec_basis.fsgec_description AS gec_basisdescription,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrqr.fsrqr_sellingrate AS amount,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
fsrqr.fsrqr_isexportimport AS export_import,
export.fsgec_description AS export_importdescription,
fsrqr.fsrqr_remarks AS fsrqr_remarks,
fsrqr.fsrqr_volumesellingrate AS fsrqr_volumesellingrate,
fsrqr.fsrqr_weightsellingrate AS fsrqr_weightsellingrate
FROM FSRQT_RailQuotationTransportStation fsrqt
JOIN FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqt_id=fsrqt.fsrqt_id)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fsrqr.fscmg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
JOIN FSGEC_GeneralCode gec_basis ON (gec_basis.fsgec_referencename='BASIS' AND gec_basis.fsgec_value=fsrqr.fsrqr_basis )
JOIN FSGEC_GeneralCode export ON (export.fsgec_referencename='BOOKINGTYPE' AND export.fsgec_value=fsrqr.fsrqr_isexportimport )
WHERE fsrqt.fsrqh_id=p_fsrqt_id
AND fschg.fschg_type IN ('LI','LE')
AND (p_route IS NULL OR fsrqt.fsrqt_id IN (SELECT REGEXP_SUBSTR (p_route, '[^,]+', 1,LEVEL) AS route_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_route,'[^,]+', 1, LEVEL) IS NOT NULL));
OPEN p_precarrige_details FOR
SELECT fsrqu.fsrqu_id AS fsrqu_id,
NVL(fsrqu.fsrqu_idparent,fsrqu.fsrqu_id) AS fsrqu_idparent,
fsrqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS from_location,
fsrqu.fsrqu_zipcodefrom AS fsrqu_zipcodefrom,
fsrqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS to_location,
fsrqu.fsrqu_zipcodeto AS fsrqu_zipcodeto,
fsrqu.fsrqu_modeoftransport AS fsrqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsgec_modeoftransportdescription,
fsrqu.fsrqu_transit AS fsrqu_transit,
fsrqu.fsrqu_transittype AS fsrqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsrqu.fsrqu_specialinstruction AS fsrqu_specialinstruction,
fsrqu.fsrqu_fromlocationaddress AS fsrqu_fromlocationaddress,
fsrqu.fsrqu_tolocationaddress AS fsrqu_tolocationaddress,
fsrqu.fsrqu_locationtype AS fsrqu_locationtype,
fsrqu.fsrqu_ismultimode AS fsrqu_ismultimode,
fsrqu.fsrqu_ismultistop AS fsrqu_ismultistop
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsrqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsrqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsrqu.fsrqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsrqu.fsrqu_transittype)
WHERE fsrqu.fsrqh_id=p_fsrqt_id
AND fsrqu.fsrqu_shipmenttype='P';
OPEN p_precarriegecharge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqr.fsrqu_id AS fsrqu_id,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fsrqr_weight AS fsrqr_weight,
fsrqr.fsmea_id AS fsmea_id,
fsmea.fsmea_code AS fsmea_code,
fsmea.fsmea_name AS fsmea_name,
fsrqr.fsrqr_volume AS fsrqr_volume,
fsrqr.fsrqr_Tariffrate AS fsrqr_Tariffrate,
fsrqr.fsrqr_ratemarkuptype AS fsrqr_ratemarkuptype,
markuptype.fsgec_description AS markuptype_description,
fsrqr.fsrqr_ratemarkupvalue AS fsrqr_ratemarkupvalue,
fsrqr.fsrqr_sellingrate AS fsrqr_sellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqu_id=fsrqu.fsrqu_id AND fsrqu.fsrqu_idparent IS NULL)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
JOIN FSMEA_Measurement fsmea ON (fsmea.fsmea_id=fsrqr.fsmea_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
WHERE fsrqu.fsrqh_id=p_fsrqt_id
AND fschg.fschg_type ='I'
AND fsrqu.fsrqu_shipmenttype='P';
OPEN p_oncarrige_details FOR
SELECT fsrqu.fsrqu_id AS fsrqu_id,
NVL(fsrqu.fsrqu_idparent,fsrqu.fsrqu_id) AS fsrqu_idparent,
fsrqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS from_location,
fsrqu.fsrqu_zipcodefrom AS fsrqu_zipcodefrom,
fsrqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS to_location,
fsrqu.fsrqu_zipcodeto AS fsrqu_zipcodeto,
fsrqu.fsrqu_modeoftransport AS fsrqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsgec_modeoftransportdescription,
fsrqu.fsrqu_transit AS fsrqu_transit,
fsrqu.fsrqu_transittype AS fsrqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsrqu.fsrqu_specialinstruction AS fsrqu_specialinstruction,
fsrqu.fsrqu_fromlocationaddress AS fsrqu_fromlocationaddress,
fsrqu.fsrqu_tolocationaddress AS fsrqu_tolocationaddress,
fsrqu.fsrqu_locationtype AS fsrqu_locationtype,
fsrqu.fsrqu_ismultimode AS fsrqu_ismultimode,
fsrqu.fsrqu_ismultistop AS fsrqu_ismultistop
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsrqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsrqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsrqu.fsrqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsrqu.fsrqu_transittype)
WHERE fsrqu.fsrqh_id=p_fsrqt_id
AND fsrqu.fsrqu_shipmenttype='O';
OPEN p_oncarriegecharge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqr.fsrqu_id AS fsrqu_id,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fsrqr_weight AS fsrqr_weight,
fsrqr.fsmea_id AS fsmea_id,
fsmea.fsmea_code AS fsmea_code,
fsmea.fsmea_name AS fsmea_name,
fsrqr.fsrqr_volume AS fsrqr_volume,
fsrqr.fsrqr_Tariffrate AS fsrqr_Tariffrate,
fsrqr.fsrqr_ratemarkuptype AS fsrqr_ratemarkuptype,
markuptype.fsgec_description AS markuptype_description,
fsrqr.fsrqr_ratemarkupvalue AS fsrqr_ratemarkupvalue,
fsrqr.fsrqr_sellingrate AS fsrqr_sellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqu_id=fsrqu.fsrqu_id AND fsrqu.fsrqu_idparent IS NULL)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
JOIN FSMEA_Measurement fsmea ON (fsmea.fsmea_id=fsrqr.fsmea_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
WHERE fsrqu.fsrqh_id=p_fsrqt_id
AND fschg.fschg_type ='I'
AND fsrqu.fsrqu_shipmenttype='O';
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Getlist_charges_Prc;
PROCEDURE Get_charges_Prc ( --charges details
p_fsrqr_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_charge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_charge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fsrqr_basis AS fsrqr_basis,
gec_basis.fsgec_description AS gec_basisdescription,
fsrqr.fscmg_id AS fscmg_id,
fscmg.fscmg_code AS fscmg_code,
fscmg.fscmg_description AS fscmg_description,
fsrqr.fsrqr_Tariffrate AS fsrqr_Tariffrate,
fsrqr.fsrqr_ratemarkuptype AS fsrqr_ratemarkuptype,
markuptype.fsgec_description AS ratemarkuptype_description,
fsrqr.fsrqr_ratemarkupvalue AS fsrqr_ratemarkupvalue,
fsrqr.fsrqr_sellingrate AS fsrqr_sellingrate,
fsrqr.fsrqr_tariffvolume AS fsrqr_tariffvolume,
fsrqr.fsrqr_volumemarkuptype AS fsrqr_volumemarkuptype,
markuptype_volume.fsgec_description AS markuptype_volumedescription,
fsrqr.fsrqr_volumemarkupvalue AS fsrqr_volumemarkupvalue,
fsrqr.fsrqr_volumesellingrate AS fsrqr_volumesellingrate,
fsrqr.fsrqr_tariffweight AS fsrqr_tariffweight,
fsrqr.fsrqr_weightmarkuptype AS fsrqr_weightmarkuptype,
markuptype_weight.fsgec_description AS markuptype_weightdescription,
fsrqr.fsrqr_weightmarkupvalue AS fsrqr_weightmarkupvalue,
fsrqr.fsrqr_weightsellingrate AS fsrqr_weightsellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description,
(SELECT listagg (DISTINCT fschg.fschg_code,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrqi.fsrqi_id)
FROM FSRQI_RailQuotationInclusiveCharge fsrqi
JOIN fschg_chargemaster fschg ON (fschg.fschg_id=fsrqi.fschg_id)
WHERE fsrqi.fsrqr_id=fsrqr.fsrqr_id
) AS inclusive_charge,
fsrqr.fsrqr_remarks AS fsrqr_remarks ,
NULL AS charge_basis,
fsrqr.fsrqr_isexportimport AS export_import
FROM FSRQR_RailQuotationRate fsrqr
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCMG_Commoditygroup fscmg ON ( fscmg.fscmg_id=fsrqr.fscmg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
JOIN FSGEC_GeneralCode gec_basis ON (gec_basis.fsgec_referencename='BASIS' AND gec_basis.fsgec_value=fsrqr.fsrqr_basis )
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
JOIN FSGEC_GeneralCode markuptype_volume ON (markuptype_volume.fsgec_referencename='MARKUPTYPE' AND markuptype_volume.fsgec_value=fsrqr.fsrqr_volumemarkuptype )
JOIN FSGEC_GeneralCode markuptype_weight ON (markuptype_weight.fsgec_referencename='MARKUPTYPE' AND markuptype_weight.fsgec_value=fsrqr.fsrqr_weightmarkuptype )
WHERE fsrqr.fsrqr_id=p_fsrqr_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_charges_Prc;
/*PROCEDURE Getlist_intermodel_Prc ( --intermodel details
p_fsrqh_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_precarrige_details OUT FS_RailQuotation.t_list,
p_precarriegecharge_details OUT FS_RailQuotation.t_list,
p_oncarrige_details OUT FS_RailQuotation.t_list,
p_oncarriegecharge_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_precarrige_details FOR
SELECT fsrqu.fsrqu_id AS fsrqu_id,
fsrqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS from_location,
fsrqu.fsrqu_zipcodefrom AS fsrqu_zipcodefrom,
fsrqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS to_location,
fsrqu.fsrqu_zipcodeto AS fsrqu_zipcodeto,
fsrqu.fsrqu_modeoftransport AS fsrqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsgec_modeoftransportdescription,
fsrqu.fsrqu_transit AS fsrqu_transit,
fsrqu.fsrqu_transittype AS fsrqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsrqu.fsrqu_specialinstruction AS fsrqu_specialinstruction,
fsrqu.fsrqu_fromlocationaddress AS fsrqu_fromlocationaddress,
fsrqu.fsrqu_tolocationaddress AS fsrqu_tolocationaddress,
fsrqu.fsrqu_locationtype AS fsrqu_locationtype
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsrqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsrqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsrqu.fsrqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsrqu.fsrqu_transittype)
WHERE fsrqu.fsrqh_id=p_fsrqh_id;
OPEN p_precarriegecharge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fsrqr_weight AS fsrqr_weight,
fsrqr.fsmea_id AS fsmea_id,
fsmea.fsmea_code AS fsmea_code,
fsmea.fsmea_name AS fsmea_name,
fsrqr.fsrqr_volume AS fsrqr_volume,
fsrqr.fsrqr_Tariffrate AS fsrqr_Tariffrate,
fsrqr.fsrqr_ratemarkuptype AS fsrqr_ratemarkuptype,
markuptype.fsgec_description AS markuptype_description,
fsrqr.fsrqr_ratemarkupvalue AS fsrqr_ratemarkupvalue,
fsrqr.fsrqr_sellingrate AS fsrqr_sellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN T_FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqu_id=fsrqu.fsrqu_id)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
JOIN FSMEA_Measurement fsmea ON (fsmea.fsmea_id=fsrqr.fsmea_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
WHERE fsrqu.fsrqh_id=p_fsrqh_id
AND fschg.fschg_type ='I';
OPEN p_oncarrige_details FOR
SELECT fsrqu.fsrqu_id AS fsrqu_id,
fsrqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS from_location,
fsrqu.fsrqu_zipcodefrom AS fsrqu_zipcodefrom,
fsrqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS to_location,
fsrqu.fsrqu_zipcodeto AS fsrqu_zipcodeto,
fsrqu.fsrqu_modeoftransport AS fsrqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsgec_modeoftransportdescription,
fsrqu.fsrqu_transit AS fsrqu_transit,
fsrqu.fsrqu_transittype AS fsrqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsrqu.fsrqu_specialinstruction AS fsrqu_specialinstruction,
fsrqu.fsrqu_fromlocationaddress AS fsrqu_fromlocationaddress,
fsrqu.fsrqu_tolocationaddress AS fsrqu_tolocationaddress,
fsrqu.fsrqu_locationtype AS fsrqu_locationtype
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsrqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsrqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsrqu.fsrqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsrqu.fsrqu_transittype)
WHERE fsrqu.fsrqh_id=p_fsrqh_id;
OPEN p_oncarriegecharge_details FOR
SELECT fsrqr.fsrqr_id AS fsrqr_id,
fsrqr.fschg_id AS fschg_id,
fschg.fschg_code AS fschg_code,
fschg.fschg_description AS fschg_description,
fsrqr.fseqt_sizetype AS fseqt_sizetype,
fsrqr.fsrqr_weight AS fsrqr_weight,
fsrqr.fsmea_id AS fsmea_id,
fsmea.fsmea_code AS fsmea_code,
fsmea.fsmea_name AS fsmea_name,
fsrqr.fsrqr_volume AS fsrqr_volume,
fsrqr.fsrqr_Tariffrate AS fsrqr_Tariffrate,
fsrqr.fsrqr_ratemarkuptype AS fsrqr_ratemarkuptype,
markuptype.fsgec_description AS markuptype_description,
fsrqr.fsrqr_ratemarkupvalue AS fsrqr_ratemarkupvalue,
fsrqr.fsrqr_sellingrate AS fsrqr_sellingrate,
fsrqr.fscry_id AS fscry_id,
fscry.fscry_code AS fscry_code,
fscry.fscry_description AS fscry_description
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN T_FSRQR_RailQuotationRate fsrqr ON (fsrqr.fsrqu_id=fsrqu.fsrqu_id)
JOIN FSCHG_ChargeMaster fschg ON (fschg.fschg_id=fsrqr.fschg_id)
JOIN FSCRY_Currency fscry ON (fscry.fscry_id=fsrqr.fscry_id)
JOIN FSMEA_Measurement fsmea ON (fsmea.fsmea_id=fsrqr.fsmea_id)
JOIN FSGEC_GeneralCode markuptype ON (markuptype.fsgec_referencename='MARKUPTYPE' AND markuptype.fsgec_value=fsrqr.fsrqr_ratemarkuptype )
WHERE fsrqu.fsrqh_id=p_fsrqh_id
AND fschg.fschg_type ='I';
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Getlist_intermodel_Prc;*/
PROCEDURE Get_intermodel_Prc ( --intermodel details
p_fsrqu_id IN FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_carrige_details OUT FS_RailQuotation.t_list,
p_issuccess OUT FSRTH_RailTariffHeader.fsrth_referencenumber %TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
OPEN p_carrige_details FOR
SELECT fsrqu.fsrqu_id AS fsrqu_id,
fsrqu.fsloc_idfrom AS fsloc_idfrom,
fsloc_fromlocation.fsloc_name AS from_location,
fsrqu.fsrqu_zipcodefrom AS fsrqu_zipcodefrom,
fsrqu.fsloc_idto AS fsloc_idto,
fsloc_tolocation.fsloc_name AS to_location,
fsrqu.fsrqu_zipcodeto AS fsrqu_zipcodeto,
fsrqu.fsrqu_modeoftransport AS fsrqu_modeoftransport,
fsgec_transportmode.fsgec_description AS fsgec_modeoftransportdescription,
fsrqu.fsrqu_transit AS fsrqu_transit,
fsrqu.fsrqu_transittype AS fsrqu_transittype,
fsgec_transittype.fsgec_description AS fsgec_transittypedescription,
fsrqu.fsrqu_specialinstruction AS fsrqu_specialinstruction,
fsrqu.fsrqu_fromlocationaddress AS fsrqu_fromlocationaddress,
fsrqu.fsrqu_tolocationaddress AS fsrqu_tolocationaddress,
fsrqu.fsrqu_locationtype AS fsrqu_locationtype,
fsrqu.fsrqu_ismultimode AS fsrqu_ismultimode,
fsrqu.fsrqu_ismultistop AS fsrqu_ismultistop
FROM FSRQU_RailQuotationIntermodel fsrqu
JOIN FSLOC_Location fsloc_fromlocation ON (fsloc_fromlocation.fsloc_id=fsrqu.fsloc_idfrom)
JOIN FSLOC_Location fsloc_tolocation ON (fsloc_tolocation.fsloc_id=fsrqu.fsloc_idto)
JOIN fsgec_generalcode fsgec_transportmode ON (fsgec_transportmode.fsgec_referencename = 'MODEOFTRANSPORT' AND fsgec_transportmode.fsgec_value = fsrqu.fsrqu_modeoftransport)
JOIN fsgec_generalcode fsgec_transittype ON (fsgec_transittype.fsgec_referencename = 'TRANSITTYPE' AND fsgec_transittype.fsgec_value = fsrqu.fsrqu_transittype)
WHERE fsrqu.fsrqu_id=p_fsrqu_id;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM dual;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_intermodel_Prc;
PROCEDURE put_fsrqh_prc(
p_fsrqh_id IN OUT FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsrqs_id IN OUT FSRQS_RailQuOtationStatus.fsrqs_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsbue_idcustomer IN FSRQH_RailQuotationHeader.fsbue_idcustomer%TYPE,
p_fsofo_idsalesoffice IN FSRQH_RailQuotationHeader.fsofo_idsalesoffice%TYPE,
p_fsrqh_quotationtype IN FSRQH_RailQuotationHeader.fsrqh_quotationtype%TYPE,
p_fsrqh_shipmenttype IN FSRQH_RailQuotationHeader.fsrqh_shipmenttype%TYPE,
p_fsrqh_mcq IN FSRQH_RailQuotationHeader.fsrqh_minimumconfirmedquantity%TYPE,
p_fsrqh_mcqtype IN FSRQH_RailQuotationHeader.fsrqh_minimumconfirmedquantitytype%TYPE,
p_fsrqh_referencenumber IN OUT FSRQH_RailQuotationHeader.fsrqh_referencenumber%TYPE,
p_fsrqh_referencedate IN FSRQH_RailQuotationHeader.fsrqh_referencedate%TYPE,
p_fsrqh_validfrom IN FSRQH_RailQuotationHeader.fsrqh_validfrom%TYPE,
p_fsrqh_validto IN FSRQH_RailQuotationHeader.fsrqh_validto%TYPE,
p_fsrqh_customerdetails IN FSRQH_RailQuotationHeader.fsrqh_customerdetails%TYPE,
p_fsrqh_incoterms IN FSRQH_RailQuotationHeader.fsrqh_incoterms%TYPE,
p_fsrqh_isexportimport IN FSRQH_RailQuotationHeader.fsrqh_isexportimport%TYPE,
p_fscry_idquotation IN FSRQH_RailQuotationHeader.fscry_idquotation%TYPE,
p_fsrqh_remarks IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fsrqh_status IN FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_fsrqc_id IN OUT FSRQC_RailQuotationCarrier.fsrqc_id%TYPE,
p_fsbue_idcarrier IN FSRQC_RailQuotationCarrier.fsbue_idcarrier%TYPE,
p_fsrqh_isshowcarrier IN FSRQH_RailQuotationHeader.fsrqh_isshowcarrier%TYPE,
p_fsrqh_quotationpartytype IN FSRQH_RailQuotationHeader.fsrqh_quotationpartytype%TYPE,
p_fsofo_idpartner IN FSRQH_RailQuotationHeader.fsofo_idpartner%TYPE,
p_fsrqh_weight IN FSRQH_RailQuotationHeader.fsrqh_weight%TYPE,
p_fsmea_idweight IN FSRQH_RailQuotationHeader.fsmea_idweight%TYPE,
p_fsrqh_volume IN FSRQH_RailQuotationHeader.fsrqh_volume%TYPE,
p_fsrqh_withdrawreason IN FSRQH_RailQuotationHeader.fsrqh_withdrawreason%TYPE,
p_fsdlm_id IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fsrqh_purgeyear IN FSRQH_RailQuotationHeader.fsrqh_purgeyear%TYPE,
p_user_id IN FSRQH_RailQuotationHeader.fsrqh_createdby%TYPE,
p_record_status IN FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_issuccess OUT FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
v_fsrqd_id FSRQD_RailQuotationDeal.fsrqd_id%TYPE;
v_fsrqh_referencenumber FSRQH_RailQuotationHeader.fsrqh_referencenumber%TYPE;
BEGIN
IF p_record_status =fs_constants.k_insert_status THEN
v_fsrqh_referencenumber :=NULL;
SELECT 'QHR'||LPAD(quotationrail_seq.NEXTVAL,7,0) INTO v_fsrqh_referencenumber
FROM fsdul_dual;
p_fsrqh_referencenumber := v_fsrqh_referencenumber;
END IF;
FSRQH_RailQuotationHeader_pkg.put_fsrqh_prc(
p_fsrqh_id => p_fsrqh_id ,
p_fsofo_id => p_fsofo_id ,
p_fsbue_idcustomer => p_fsbue_idcustomer ,
p_fsofo_idsalesoffice => p_fsofo_idsalesoffice ,
p_fsrqh_quotationtype => p_fsrqh_quotationtype ,
p_fsrqh_shipmenttype => p_fsrqh_shipmenttype ,
p_fsrqh_minimumconfirmedquantity => p_fsrqh_mcq ,
p_fsrqh_minimumconfirmedquantitytype => p_fsrqh_mcqtype ,
p_fsrqh_referencenumber => p_fsrqh_referencenumber ,
p_fsrqh_referencedate => p_fsrqh_referencedate ,
p_fsrqh_validfrom => p_fsrqh_validfrom ,
p_fsrqh_validto => p_fsrqh_validto ,
p_fsrqh_customerdetails => p_fsrqh_customerdetails ,
p_fsrqh_incoterms => p_fsrqh_incoterms ,
p_fsrqh_isexportimport => p_fsrqh_isexportimport ,
p_fscry_idquotation => p_fscry_idquotation ,
p_fsrqh_remarks => p_fsrqh_remarks ,
p_fsrqh_status => p_fsrqh_status ,
p_fsrqh_isshowcarrier => p_fsrqh_isshowcarrier ,
p_fsrqh_quotationpartytype => p_fsrqh_quotationpartytype ,
p_fsofo_idpartner => p_fsofo_idpartner ,
p_fsrqh_weight => p_fsrqh_weight ,
p_fsmea_idweight => p_fsmea_idweight ,
p_fsrqh_volume => p_fsrqh_volume ,
p_fsrqh_withdrawreason => p_fsrqh_withdrawreason ,
p_fsrqh_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message ) ;
IF p_issuccess =fs_constants.k_success THEN
IF p_record_status = fs_constants.k_insert_status THEN
IF p_fsdlm_id IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsdlm_id, '[^,]+', 1,LEVEL) AS fsdlm_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsdlm_id,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQD_RailQuotationDeal_pkg.put_fsrqd_prc(
p_fsrqd_id => v_fsrqd_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsdlm_id => i.fsdlm_id ,
p_fsrqd_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
ELSIF p_record_status = fs_constants.k_update_status THEN
DELETE FROM FSRQD_RailQuotationDeal
WHERE fsrqh_id=p_fsrqh_id;
IF p_fsdlm_id IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsdlm_id, '[^,]+', 1,LEVEL) AS fsdlm_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsdlm_id,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQD_RailQuotationDeal_pkg.put_fsrqd_prc(
p_fsrqd_id => v_fsrqd_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsdlm_id => i.fsdlm_id ,
p_fsrqd_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
END IF;
END IF;
IF p_issuccess=fs_constants.k_success AND p_record_status = fs_constants.k_insert_status AND p_fsbue_idcarrier IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS fsbue_idcarrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQC_RailQuotationCarrier_pkg.put_fsrqc_prc(
p_fsrqc_id => p_fsrqc_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsbue_idcarrier => i.fsbue_idcarrier ,
p_fsrqc_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
ELSIF p_issuccess=fs_constants.k_success AND p_record_status = fs_constants.k_update_status THEN
DELETE FROM FSRQC_RailQuotationCarrier WHERE fsrqh_id=p_fsrqh_id;
IF p_fsbue_idcarrier IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fsbue_idcarrier, '[^,]+', 1,LEVEL) AS fsbue_idcarrier FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsbue_idcarrier,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQC_RailQuotationCarrier_pkg.put_fsrqc_prc(
p_fsrqc_id => p_fsrqc_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsbue_idcarrier => i.fsbue_idcarrier ,
p_fsrqc_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
END IF;
FSRQS_RailQuOtationStatus_pkg.put_fsrqs_prc(
p_fsrqs_id => p_fsrqs_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsrqs_status => p_fsrqh_status ,
p_fsrqs_changedby => p_user_id ,
p_fsrqs_changedon => SYSDATE ,
p_fsrqs_remarks => NULL ,
p_fsrqs_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message ) ;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrqh_prc;
PROCEDURE put_fsrqt_prc(
p_fsrqt_id IN OUT FSRQT_RailQuotationTransportStation.fsrqt_id%TYPE,
p_fsofo_id IN FSRQT_RailQuotationTransportStation.fsofo_id%TYPE,
p_fsrqh_id IN FSRQT_RailQuotationTransportStation.fsrqh_id%TYPE,
p_fsloc_idplaceoforigin IN FSRQT_RailQuotationTransportStation.fsloc_idplaceoforigin%TYPE,
p_fsrat_idfromstation IN FSRQT_RailQuotationTransportStation.fsrat_idfromstation%TYPE,
p_fsrat_idtostation IN FSRQT_RailQuotationTransportStation.fsrat_idtostation%TYPE,
p_fsloc_idplaceofdestination IN FSRQT_RailQuotationTransportStation.fsloc_idplaceofdestination%TYPE,
p_fsrqt_travellingtime IN FSRQT_RailQuotationTransportStation.fsrqt_travellingtime%TYPE,
p_fsrqt_dayoffrequency IN FSRQT_RailQuotationTransportStation.fsrqt_dayoffrequency%TYPE,
p_fseqt_sizetype IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fscmg_id IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_routeexist IN FSRQH_RailQuotationHeader.fsrqh_remarks%TYPE,
p_fsrqt_purgeyear IN FSRQT_RailQuotationTransportStation.fsrqt_purgeyear%TYPE,
p_user_id IN FSRQT_RailQuotationTransportStation.fsrqt_createdby%TYPE,
p_record_status IN FSRQT_RailQuotationTransportStation.fsrqt_purgeyear%TYPE,
p_issuccess OUT FSRQT_RailQuotationTransportStation.fsrqt_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
v_fsrqe_id FSRQE_RailQuotationEquipment.fsrqe_id%TYPE;
v_fsrqm_id FSRQM_RailQuotationCommodity.fsrqm_id%TYPE;
BEGIN
IF p_record_status=fs_constants.k_update_status AND p_routeexist='Y' AND p_fsrqt_id IS NOT NULL THEN
UPDATE FSRQI_RailQuotationInclusiveCharge FSRQI SET FSRQI.FSRQI_lastupdatedby=p_user_id,FSRQI.FSRQI_lastupdatedon=SYSDATE
WHERE FSRQI.FSRQR_ID IN (SELECT FSRQR.FSRQR_ID FROM FSRQR_RailQuotationRate FSRQR WHERE FSRQR.fsrqt_id=p_fsrqt_id);
DELETE FROM FSRQI_RailQuotationInclusiveCharge FSRQI WHERE FSRQI.FSRQR_ID IN (SELECT FSRQR.FSRQR_ID FROM FSRQR_RailQuotationRate FSRQR WHERE FSRQR.fsrqt_id=p_fsrqt_id);
UPDATE FSRQR_RailQuotationRate FSRQR SET FSRQR.FSRQR_lastupdatedby=p_user_id,FSRQR.FSRQR_lastupdatedon=SYSDATE
WHERE FSRQR.fsrqt_id=p_fsrqt_id;
DELETE FROM FSRQR_RailQuotationRate FSRQR WHERE FSRQR.fsrqt_id=p_fsrqt_id;
END IF;
FSRQT_RailQuotationTransportStation_pkg.put_fsrqt_prc(
p_fsrqt_id => p_fsrqt_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsloc_idplaceoforigin => p_fsloc_idplaceoforigin ,
p_fsrat_idfromstation => p_fsrat_idfromstation ,
p_fsrat_idtostation => p_fsrat_idtostation ,
p_fsloc_idplaceofdestination => p_fsloc_idplaceofdestination ,
p_fsrqt_travellingtime => p_fsrqt_travellingtime,
p_fsrqt_dayoffrequency => p_fsrqt_dayoffrequency,
p_fsrqt_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
IF p_issuccess =fs_constants.k_success AND p_record_status = fs_constants.k_insert_status THEN
IF p_fseqt_sizetype IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fseqt_sizetype, '[^,]+', 1,LEVEL) AS fseqt_sizetype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fseqt_sizetype,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQE_RailQuotationEquipment_pkg.put_fsrqe_prc(
p_fsrqe_id => v_fsrqe_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqt_id => p_fsrqt_id ,
p_fseqt_sizetype => i.fseqt_sizetype ,
p_fsrqe_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
ELSIF p_issuccess =fs_constants.k_success AND p_record_status = fs_constants.k_update_status THEN
DELETE FROM FSRQE_RailQuotationEquipment
WHERE fsrqt_id=p_fsrqt_id;
IF p_fseqt_sizetype IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fseqt_sizetype, '[^,]+', 1,LEVEL) AS fseqt_sizetype FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fseqt_sizetype,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQE_RailQuotationEquipment_pkg.put_fsrqe_prc(
p_fsrqe_id => v_fsrqe_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqt_id => p_fsrqt_id ,
p_fseqt_sizetype => i.fseqt_sizetype ,
p_fsrqe_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
END IF;
IF p_issuccess =fs_constants.k_success AND p_record_status = fs_constants.k_insert_status THEN
IF p_fscmg_id IS NOT NULL THEN
FOR j IN (SELECT REGEXP_SUBSTR (p_fscmg_id, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fscmg_id,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQM_RailQuotationCommodity_pkg.put_fsrqm_prc(
p_fsrqm_id => v_fsrqm_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqt_id => p_fsrqt_id ,
p_fscmg_id => j.fscmg_id ,
p_fsrqm_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
ELSIF p_issuccess =fs_constants.k_success AND p_record_status = fs_constants.k_update_status THEN
DELETE FROM FSRQM_RailQuotationCommodity
WHERE fsrqt_id=p_fsrqt_id;
IF p_fscmg_id IS NOT NULL THEN
FOR j IN (SELECT REGEXP_SUBSTR (p_fscmg_id, '[^,]+', 1,LEVEL) AS fscmg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fscmg_id,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQM_RailQuotationCommodity_pkg.put_fsrqm_prc(
p_fsrqm_id => v_fsrqm_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqt_id => p_fsrqt_id ,
p_fscmg_id => j.fscmg_id ,
p_fsrqm_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrqt_prc;
PROCEDURE put_fsrqr_prc(
p_fsrqr_id IN OUT FSRQR_RailQuotationRate.fsrqr_id%TYPE,
p_fsofo_id IN FSRQR_RailQuotationRate.fsofo_id%TYPE,
p_fsrqt_id IN FSRQR_RailQuotationRate.fsrqt_id%TYPE,
p_fschg_id IN FSRQR_RailQuotationRate.fschg_id%TYPE,
p_fslrr_id IN FSRQR_RailQuotationRate.fslrr_id%TYPE,
p_fsrqr_basis IN FSRQR_RailQuotationRate.fsrqr_basis%TYPE,
p_fseqt_sizetype IN FSRQR_RailQuotationRate.fseqt_sizetype%TYPE,
p_fscmg_id IN FSRQR_RailQuotationRate.fscmg_id%TYPE,
p_fsrtr_id IN FSRQR_RailQuotationRate.fsrtr_id%TYPE,
p_fsrsr_id IN FSRQR_RailQuotationRate.fsrsr_id%TYPE,
p_fsrqu_id IN FSRQR_RailQuotationRate.fsrqu_id%TYPE,
p_fsrqr_weight IN FSRQR_RailQuotationRate.fsrqr_weight%TYPE,
p_fsmea_id IN FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_fsrqr_volume IN FSRQR_RailQuotationRate.fsrqr_volume%TYPE,
p_fsrqr_Tariffrate IN FSRQR_RailQuotationRate.fsrqr_Tariffrate%TYPE,
p_fsrqr_ratemarkuptype IN FSRQR_RailQuotationRate.fsrqr_ratemarkuptype%TYPE,
p_fsrqr_ratemarkupvalue IN FSRQR_RailQuotationRate.fsrqr_ratemarkupvalue%TYPE,
p_fsrqr_sellingrate IN FSRQR_RailQuotationRate.fsrqr_sellingrate%TYPE,
p_fscry_id IN FSRQR_RailQuotationRate.fscry_id%TYPE,
p_fsrqr_tariffvolume IN FSRQR_RailQuotationRate.fsrqr_tariffvolume%TYPE,
p_fsrqr_volumemarkuptype IN FSRQR_RailQuotationRate.fsrqr_volumemarkuptype%TYPE,
p_fsrqr_volumemarkupvalue IN FSRQR_RailQuotationRate.fsrqr_volumemarkupvalue%TYPE,
p_fsrqr_volumesellingrate IN FSRQR_RailQuotationRate.fsrqr_volumesellingrate%TYPE,
p_fsrqr_tariffweight IN FSRQR_RailQuotationRate.fsrqr_tariffweight%TYPE,
p_fsrqr_weightmarkuptype IN FSRQR_RailQuotationRate.fsrqr_weightmarkuptype%TYPE,
p_fsrqr_weightmarkupvalue IN FSRQR_RailQuotationRate.fsrqr_weightmarkupvalue%TYPE,
p_fsrqr_weightsellingrate IN FSRQR_RailQuotationRate.fsrqr_weightsellingrate%TYPE,
p_fsbue_idcarrier IN FSRQR_RailQuotationRate.fsbue_idcarrier%TYPE,
p_fsofo_idsalesoffice IN FSRQR_RailQuotationRate.fsofo_idsalesoffice%TYPE,
p_fsrqr_isexportimport IN FSRQR_RailQuotationRate.fsrqr_isexportimport%TYPE,
p_fsrqr_remarks IN FSRQR_RailQuotationRate.fsrqr_remarks%TYPE,
p_fschg_inclusive IN FSRQR_RailQuotationRate.fsrqr_remarks%TYPE,
p_fsrqr_purgeyear IN FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_user_id IN FSRQR_RailQuotationRate.fsrqr_createdby%TYPE,
p_record_status IN FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_issuccess OUT FSRQR_RailQuotationRate.fsrqr_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
CURSOR cur_measurement IS
SELECT fsmea.fsmea_id AS fsmea_id
FROM fsmea_measurement fsmea
WHERE fsmea.fsmea_isocode = p_fsmea_id ;
v_fsmea_id FSRQR_RailQuotationRate.fsmea_id%TYPE;
v_fsrqi_id FSRQR_RailQuotationRate.fsrqr_id%TYPE;
BEGIN
OPEN cur_measurement;
FETCH cur_measurement INTO v_fsmea_id;
CLOSE cur_measurement;
IF p_record_status!=fs_constants.k_delete_status THEN
FSRQR_RailQuotationRate_pkg.put_fsrqr_prc(
p_fsrqr_id => p_fsrqr_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqt_id => p_fsrqt_id ,
p_fschg_id => p_fschg_id ,
p_fslrr_id => p_fslrr_id ,
p_fsrqr_basis => p_fsrqr_basis ,
p_fseqt_sizetype => p_fseqt_sizetype ,
p_fscmg_id => p_fscmg_id ,
p_fsrtr_id => p_fsrtr_id ,
p_fsrsr_id => p_fsrsr_id ,
p_fsrqu_id => p_fsrqu_id ,
p_fsrqr_weight => p_fsrqr_weight ,
p_fsmea_id => v_fsmea_id ,
p_fsrqr_volume => p_fsrqr_volume ,
p_fsrqr_Tariffrate => p_fsrqr_Tariffrate ,
p_fsrqr_ratemarkuptype => p_fsrqr_ratemarkuptype ,
p_fsrqr_ratemarkupvalue => p_fsrqr_ratemarkupvalue ,
p_fsrqr_sellingrate => p_fsrqr_sellingrate ,
p_fscry_id => p_fscry_id ,
p_fsrqr_tariffvolume => p_fsrqr_tariffvolume ,
p_fsrqr_volumemarkuptype => p_fsrqr_volumemarkuptype ,
p_fsrqr_volumemarkupvalue => p_fsrqr_volumemarkupvalue ,
p_fsrqr_volumesellingrate => p_fsrqr_volumesellingrate ,
p_fsrqr_tariffweight => p_fsrqr_tariffweight ,
p_fsrqr_weightmarkuptype => p_fsrqr_weightmarkuptype ,
p_fsrqr_weightmarkupvalue => p_fsrqr_weightmarkupvalue ,
p_fsrqr_weightsellingrate => p_fsrqr_weightsellingrate ,
p_fsbue_idcarrier => p_fsbue_idcarrier ,
p_fsofo_idsalesoffice => p_fsofo_idsalesoffice ,
p_fsrqr_isexportimport => p_fsrqr_isexportimport ,
p_fsrqr_remarks => p_fsrqr_remarks ,
p_fsrqr_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
IF p_issuccess=fs_constants.k_success AND p_record_status=fs_constants.k_insert_status THEN
IF p_fschg_inclusive IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fschg_inclusive, '[^,]+', 1,LEVEL) AS fschg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fschg_inclusive,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQI_RailQuotationInclusiveCharge_PKG.put_fsrqi_prc(
p_fsrqi_id => v_fsrqi_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqr_id => p_fsrqr_id ,
p_fschg_id => i.fschg_id ,
p_fsrqi_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
END IF;
ELSIF p_issuccess=fs_constants.k_success AND p_record_status=fs_constants.k_update_status THEN
DELETE FROM FSRQI_RailQuotationInclusiveCharge WHERE fsrqr_id=p_fsrqr_id;
IF p_fschg_inclusive IS NOT NULL THEN
FOR i IN (SELECT REGEXP_SUBSTR (p_fschg_inclusive, '[^,]+', 1,LEVEL) AS fschg_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fschg_inclusive,'[^,]+', 1, LEVEL) IS NOT NULL) LOOP
FSRQI_RailQuotationInclusiveCharge_PKG.put_fsrqi_prc(
p_fsrqi_id => v_fsrqi_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqr_id => p_fsrqr_id ,
p_fschg_id => i.fschg_id ,
p_fsrqi_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END LOOP;
END IF;
END IF;
ELSIF p_record_status!=fs_constants.k_delete_status THEN
BEGIN
FOR i IN (SELECT FSRQI.fsrqi_id AS fsrqi_id
FROM FSRQI_RailQuotationInclusiveCharge FSRQI
WHERE FSRQI.fsrqr_id=p_fsrqr_id) LOOP
FSRQI_RailQuotationInclusiveCharge_PKG.put_fsrqi_prc_del(
p_fsrqi_id => i.fsrqi_id,
p_user_id => p_user_id,
p_issuccess => p_issuccess,
p_message => p_message);
END LOOP;
IF p_issuccess=fs_constants.k_success THEN
FSRQR_RailQuotationRate_pkg.put_fsrqr_prc_del(
p_fsrqr_id => p_fsrqr_id,
p_user_id => p_user_id,
p_issuccess => p_issuccess,
p_message => p_message);
END IF;
END;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrqr_prc;
PROCEDURE put_fsrqu_prc (
p_fsrqu_id IN OUT FSRQU_RailQuotationIntermodel.fsrqu_id%TYPE,
p_fsofo_id IN FSRQU_RailQuotationIntermodel.fsofo_id%TYPE,
p_fsrqh_id IN FSRQU_RailQuotationIntermodel.fsrqh_id%TYPE,
p_fsrqu_shipmenttype IN FSRQU_RailQuotationIntermodel.fsrqu_shipmenttype%TYPE,
p_fsrqu_ismultimode IN FSRQU_RailQuotationIntermodel.fsrqu_ismultimode%TYPE,
p_fsrqu_ismultistop IN FSRQU_RailQuotationIntermodel.fsrqu_ismultistop%TYPE,
p_fsloc_idfrom IN FSRQU_RailQuotationIntermodel.fsloc_idfrom%TYPE,
p_fsrqu_zipcodefrom IN FSRQU_RailQuotationIntermodel.fsrqu_zipcodefrom%TYPE,
p_fsloc_idto IN FSRQU_RailQuotationIntermodel.fsloc_idto%TYPE,
p_fsrqu_zipcodeto IN FSRQU_RailQuotationIntermodel.fsrqu_zipcodeto%TYPE,
p_fsrqu_modeoftransport IN FSRQU_RailQuotationIntermodel.fsrqu_modeoftransport%TYPE,
p_fsrqu_transit IN FSRQU_RailQuotationIntermodel.fsrqu_transit%TYPE,
p_fsrqu_transittype IN FSRQU_RailQuotationIntermodel.fsrqu_transittype%TYPE,
p_fsrqu_specialinstruction IN FSRQU_RailQuotationIntermodel.fsrqu_specialinstruction%TYPE,
p_fsrqu_fromlocationaddress IN FSRQU_RailQuotationIntermodel.fsrqu_fromlocationaddress%TYPE,
p_fsrqu_tolocationaddress IN FSRQU_RailQuotationIntermodel.fsrqu_tolocationaddress%TYPE,
p_fsrqu_locationtype IN FSRQU_RailQuotationIntermodel.fsrqu_locationtype%TYPE,
p_fsrqu_idparent IN FSRQU_RailQuotationIntermodel.fsrqu_idparent%TYPE,
p_fsrqu_purgeyear IN FSRQU_RailQuotationIntermodel.fsrqu_purgeyear%TYPE,
p_user_id IN FSRQU_RailQuotationIntermodel.fsrqu_createdby%TYPE,
p_record_status IN FSRQU_RailQuotationIntermodel.fsrqu_purgeyear%TYPE,
p_issuccess OUT FSRQU_RailQuotationIntermodel.fsrqu_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
FSRQU_RailQuotationIntermodel_pkg.put_fsrqu_prc(
p_fsrqu_id => p_fsrqu_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsrqu_shipmenttype => p_fsrqu_shipmenttype ,
p_fsrqu_ismultimode => p_fsrqu_ismultimode ,
p_fsrqu_ismultistop => p_fsrqu_ismultistop ,
p_fsloc_idfrom => p_fsloc_idfrom ,
p_fsrqu_zipcodefrom => p_fsrqu_zipcodefrom ,
p_fsloc_idto => p_fsloc_idto ,
p_fsrqu_zipcodeto => p_fsrqu_zipcodeto ,
p_fsrqu_modeoftransport => p_fsrqu_modeoftransport ,
p_fsrqu_transit => p_fsrqu_transit ,
p_fsrqu_transittype => p_fsrqu_transittype ,
p_fsrqu_specialinstruction => p_fsrqu_specialinstruction ,
p_fsrqu_fromlocationaddress => p_fsrqu_fromlocationaddress ,
p_fsrqu_tolocationaddress => p_fsrqu_tolocationaddress ,
p_fsrqu_locationtype => p_fsrqu_locationtype ,
p_fsrqu_idparent => p_fsrqu_idparent ,
p_fsrqu_purgeyear => TO_CHAR(SYSDATE,'YYYY') ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrqu_prc;
PROCEDURE put_fsrql_prc(
p_fsrql_id IN OUT FSRQL_RailQuotationEmail.fsrql_id%TYPE,
p_fsofo_id IN FSRQL_RailQuotationEmail.fsofo_id%TYPE,
p_fsrqh_id IN FSRQL_RailQuotationEmail.fsrqh_id%TYPE,
p_fsrql_email IN FSRQL_RailQuotationEmail.fsrql_email%TYPE,
p_fsrql_purgeyear IN FSRQL_RailQuotationEmail.fsrql_purgeyear%TYPE,
p_user_id IN FSRQL_RailQuotationEmail.fsrql_createdby%TYPE,
p_record_status IN FSRQL_RailQuotationEmail.fsrql_purgeyear%TYPE,
p_issuccess OUT FSRQL_RailQuotationEmail.fsrql_purgeyear%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
FSRQL_RailQuotationEmail_pkg.put_fsrql_prc(
p_fsrql_id => p_fsrql_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsrql_email => p_fsrql_email ,
p_fsrql_purgeyear => p_fsrql_purgeyear ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrql_prc;
PROCEDURE put_statuschange_prc(
p_fsrqh_id IN OUT FSRQH_RailQuotationHeader.fsrqh_id%TYPE,
p_fsrqs_id IN OUT FSRQS_RailQuOtationStatus.fsrqs_id%TYPE,
p_fsofo_id IN FSRQH_RailQuotationHeader.fsofo_id%TYPE,
p_fsrqh_status IN FSRQH_RailQuotationHeader.fsrqh_status%TYPE,
p_fsrqh_withdrawreason IN FSRQH_RailQuotationHeader.fsrqh_withdrawreason%TYPE,
p_user_id IN FSRQS_RailQuOtationStatus.fsrqs_createdby%TYPE,
p_record_status IN FSRQS_RailQuOtationStatus.fsrqs_status%TYPE,
p_issuccess OUT FSRQS_RailQuOtationStatus.fsrqs_status%TYPE,
p_message OUT FS_RailQuotation.t_list)
AS
BEGIN
UPDATE FSRQH_RailQuotationHeader fsrqh
SET fsrqh.fsrqh_status=p_fsrqh_status , fsrqh.fsrqh_withdrawreason= p_fsrqh_withdrawreason,fsrqh.fsrqh_lastupdatedby=p_user_id,fsrqh.fsrqh_lastupdatedon=SYSDATE
WHERE fsrqh.fsrqh_id=p_fsrqh_id
AND fsrqh.fsofo_id=p_fsofo_id;
FSRQS_RailQuOtationStatus_pkg.put_fsrqs_prc(
p_fsrqs_id => p_fsrqs_id ,
p_fsofo_id => p_fsofo_id ,
p_fsrqh_id => p_fsrqh_id ,
p_fsrqs_status => p_fsrqh_status ,
p_fsrqs_changedby => p_user_id ,
p_fsrqs_changedon => SYSDATE ,
p_fsrqs_remarks => NULL ,
p_fsrqs_purgeyear => TO_CHAR(SYSDATE,'YYYY'),
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message ) ;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_statuschange_prc;
END FS_RailQuotation;
create or replace PACKAGE /*FS-240120-01*/ FS_RoleManagement
AUTHID DEFINER
AS
/*
-------------------------------------------------------------------------------------------------------------------------------------------
Modification History
------------------------------------------------------------------------------------------------------------------------------------------
|| Version When Who What
|| ---------------------------------------------------------------------------------------------------------------------------------------
|| FS-240120-01 24-Jan-2020 Praveen Kumar.D FS_RoleManagement - This package contains procedures of Uesr Access Details.
-------------------------------------------------------------------------------------------------------------------------------------------
*/
TYPE t_list IS REF CURSOR;
PROCEDURE getlov_processlist_prc ( -- For listing all process list
p_processlist_list OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE getlov_fsprc_prc ( -- For listing module and menu
p_fsprc_id IN fsprc_process.fsprc_id%TYPE,
p_programgroup_list OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE getlov_fsfgr_prc (
p_fsusr_id IN fsusr_user.fsusr_id%TYPE, -- For Component LOV (feature rights)
p_fsofo_id IN fsofo_officeorganization.fsofo_id%TYPE,
p_fsprc_id IN fsprc_process.fsprc_id%TYPE,
p_get_featuregrantlist OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE getlist_fsrol_prc ( -- Search for user
p_search IN fsofo_officeorganization.fsofo_organizationname%TYPE,
p_page_index IN fsofo_officeorganization.fsofo_id%TYPE,
p_page_size IN fsofo_officeorganization.fsofo_id%TYPE,
p_sort_field IN fsofo_officeorganization.fsofo_organizationname%TYPE,
p_sort_type IN fsofo_officeorganization.fsofo_organizationname%TYPE,
p_userrole_count OUT fsofo_officeorganization.fsofo_id%TYPE,
p_userrole_list OUT FS_RoleManagement.t_list,
p_issuccess OUT fsofo_officeorganization.fsofo_organizationname%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE Get_fsugr_PRC ( -- TO Get Module and Menu
p_fsrol_id IN fsrol_role.fsrol_id%TYPE,
p_roledetails OUT FS_RoleManagement.t_list,
p_rights_details OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE Get_menuorcomponent_PRC ( -- (TO Get component based on Module and menu OR TO Get menu based on Module)
p_fsprcmodule_id IN fsrol_role.fsrol_description%TYPE,
p_fsprcmenu_id IN fsrol_role.fsrol_description%TYPE,
p_fsfeacomponent_id IN fsrol_role.fsrol_description%TYPE,
p_component_details OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE put_fsrol_prc (
p_fsrol_id IN OUT FSROL_Role.fsrol_id%TYPE,
p_fsrol_classification IN FSROL_Role.fsrol_classification%TYPE,
p_fsrol_code IN FSROL_Role.fsrol_code%TYPE,
p_fsrol_description IN FSROL_Role.fsrol_description%TYPE,
p_fsrol_validfrom IN FSROL_Role.fsrol_validfrom%TYPE,
p_fsrol_validto IN FSROL_Role.fsrol_validto%TYPE,
p_user_id IN FSROL_Role.fsrol_createdby%TYPE,
p_record_status IN FSROL_Role.fsrol_code%TYPE,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE put_fsfrg_prc(
p_fsrol_id IN fsrol_role.fsrol_id%TYPE,
p_fsrpf_id IN OUT FSRPF_Roleprocessfeaturelink.fsrpf_id%TYPE,
p_fsprc_id IN fsprc_process.fsprc_id%TYPE,
p_fsrpl_id IN OUT FSRPL_RoleProcessLink.fsrpl_id%TYPE,
p_fsfea_id IN fsfea_feature.fsfea_id%TYPE,
p_fsfrg_id IN fsfrg_featurerights.fsfrg_id%TYPE,
p_fsrpf_isactive IN FSRPF_Roleprocessfeaturelink.fsrpf_isactive%TYPE, ---Y - Yes,N - No
p_fsfrg_value IN fsfrg_featurerights.fsfrg_value%TYPE, --W -Write,R-Read
--p_fsfrg_isdefault IN fsfrg_featurerights.fsfrg_isdefault%TYPE,
p_user_id IN fsfrg_featurerights.fsfrg_createdby%TYPE,
p_record_status IN FSROL_Role.fsrol_code%TYPE,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
PROCEDURE put_fsrol_prc_del(
p_fsrol_id IN fsrol_role.fsrol_id%TYPE,
p_user_id IN fsfrg_featurerights.fsfrg_createdby%TYPE,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list);
END FS_RoleManagement;
create or replace PACKAGE BODY FS_RoleManagement
AS
PROCEDURE getlov_processlist_prc (
p_processlist_list OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
AS
BEGIN
OPEN p_processlist_list FOR
SELECT fsprc.fsprc_id AS fsprc_id ,
fsprc.fsprc_code AS fsprc_code ,
fsprc.fsprc_name AS fsprc_name ,
fsprc.fsprc_description AS fsprc_description ,
fsprc.fsprc_level AS fsprc_level ,
fsprc.fsprc_idparent AS fsprc_idparent ,
fsprc.fsprc_url AS fsprc_url ,
fsprc.fsprc_displayorder AS fsprc_displayorder ,
fsprc.fsprc_isactive AS fsprc_isactive
FROM fsprc_process fsprc;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getlov_processlist_prc;
PROCEDURE getlov_fsprc_prc (
p_fsprc_id IN fsprc_process.fsprc_id%TYPE,
p_programgroup_list OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
IS
BEGIN
OPEN p_programgroup_list FOR
SELECT fsprc.fsprc_id AS fsprc_id,
fsprc.fsprc_code AS fsprc_code,
fsprc.fsprc_name AS fsprc_name
FROM fsprc_process fsprc
WHERE fsprc_isactive ='Y'
AND (( p_fsprc_id IS NULL AND fsprc.fsprc_idparent IS NULL) OR
( p_fsprc_id IS NOT NULL AND fsprc.fsprc_idparent = p_fsprc_id));
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getlov_fsprc_prc;
PROCEDURE getlov_fsfgr_prc (
p_fsusr_id IN fsusr_user.fsusr_id%TYPE,
p_fsofo_id IN fsofo_officeorganization.fsofo_id%TYPE,
p_fsprc_id IN fsprc_process.fsprc_id%TYPE,
p_get_featuregrantlist OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
IS
BEGIN
OPEN p_get_featuregrantlist FOR
SELECT fsfea1.fsprc_id AS fsprc_id,
fsfea1.fsfea_id AS fsfea_id,
fsfea1.fsfea_code AS fsfea_code,
fsfea1.fsfea_description AS fsfea_description,
(SELECT listagg (DISTINCT fsfrg1.fsfrg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg1.fsfrg_id)
FROM fsfrg_featurerights fsfrg1
WHERE (fsfrg1.fsfea_id=fsfea1.fsfea_id)
) AS fsfrg_id,
(SELECT listagg (DISTINCT fsfrg1.fsfrg_value,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg1.fsfrg_value)
FROM fsfrg_featurerights fsfrg1
WHERE (fsfrg1.fsfea_id=fsfea1.fsfea_id)
) AS fsfrg_value,
fs_constants.k_defaultvalue AS default_flag
FROM fsfea_feature fsfea1
JOIN fsprc_process fsprc ON(fsprc.fsprc_id=fsfea1.fsprc_id)
WHERE fsfea1.fsprc_id = p_fsprc_id
AND fsfea1.fsfea_code <> fsprc.fsprc_code;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getlov_fsfgr_prc;
PROCEDURE getlist_fsrol_prc (
p_search IN fsofo_officeorganization.fsofo_organizationname%TYPE,
p_page_index IN fsofo_officeorganization.fsofo_id%TYPE,
p_page_size IN fsofo_officeorganization.fsofo_id%TYPE,
p_sort_field IN fsofo_officeorganization.fsofo_organizationname%TYPE,
p_sort_type IN fsofo_officeorganization.fsofo_organizationname%TYPE,
p_userrole_count OUT fsofo_officeorganization.fsofo_id%TYPE,
p_userrole_list OUT FS_RoleManagement.t_list,
p_issuccess OUT fsofo_officeorganization.fsofo_organizationname%TYPE,
p_message OUT FS_RoleManagement.t_list)
IS
l_query CLOB;
l_query_cnt CLOB;
BEGIN
IF FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_search) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_field) = 'Y' OR
FS_SECURITY.SQL_INJECTION_CHECK_FNC (p_sort_type) = 'Y'
THEN
l_query_cnt := 'SELECT 0 FROM FSDUL_Dual';
l_query := 'SELECT NULL AS fsrol_id,
NULL AS fsrol_code,
NULL AS fsrol_description,
NULL AS fsrol_validfrom,
NULL AS fsrol_validto
FROM FSDUL_Dual
WHERE 1=2 ';
EXECUTE IMMEDIATE l_query_cnt INTO p_userrole_count;
OPEN p_userrole_list FOR l_query;
ELSE
IF p_search IS NULL THEN
l_query := 'SELECT fsrol.fsrol_id AS fsrol_id ,
fsrol.fsrol_code AS fsrol_code ,
fsrol.fsrol_description AS fsrol_description ,
fsrol.fsrol_validfrom AS fsrol_validfrom ,
fsrol.fsrol_validto AS fsrol_validto
FROM FSROL_Role fsrol
WHERE fsrol.fsrol_classification =''U''';
ELSE
l_query := 'SELECT fsrol.fsrol_id AS fsrol_id ,
fsrol.fsrol_code AS fsrol_code ,
fsrol.fsrol_description AS fsrol_description ,
fsrol.fsrol_validfrom AS fsrol_validfrom ,
fsrol.fsrol_validto AS fsrol_validto
FROM FSROL_Role fsrol
WHERE fsrol.fsrol_classification =''U''
AND ( UPPER(fsrol.fsrol_code) like '''||'%'|| UPPER(p_search)|| '%'||'''
OR UPPER(fsrol.fsrol_description) like '''||'%'|| UPPER(p_search)|| '%'||''' ) ';
END IF;
l_query_cnt := 'SELECT COUNT(fsrol_id) FROM (' || l_query || ') ';
p_userrole_count := 0;
IF p_page_index > 0 THEN
EXECUTE IMMEDIATE l_query_cnt INTO p_userrole_count;
l_query := l_query || ' order by ';
l_query := l_query || p_sort_field;
l_query := l_query || ' ';
l_query := l_query || p_sort_type;
l_query := l_query || ' offset ( ('|| p_page_index|| ' - 1) * '|| p_page_size|| ') rows fetch next '|| p_page_size|| ' rows only ';
ELSE
l_query := l_query || ' order by fsrol.fsrol_createdon desc';
END IF;
OPEN p_userrole_list FOR l_query;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_Dual;
EXCEPTION
WHEN OTHERS THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END getlist_fsrol_prc;
PROCEDURE Get_fsugr_PRC (
p_fsrol_id IN fsrol_role.fsrol_id%TYPE,
p_roledetails OUT FS_RoleManagement.t_list,
p_rights_details OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
IS
BEGIN
OPEN p_roledetails FOR
SELECT fsrol.fsrol_id AS fsrol_id,
fsrol.fsrol_code AS fsrol_code,
fsrol.fsrol_description AS fsrol_description,
fsrol.fsrol_validfrom AS fsrol_validfrom,
fsrol.fsrol_validto AS fsrol_validto,
(SELECT listagg (DISTINCT fsprc.fsprc_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsprc.fsprc_id)
FROM fsprc_process fsprcparent
JOIN fsprc_process fsprc ON (fsprc.fsprc_id=fsprcparent.fsprc_idparent)
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsprc_id=fsprcparent.fsprc_id)
WHERE fsrpl.fsrol_id=fsrol.fsrol_id
) AS module_id ,
(SELECT listagg (DISTINCT fsprc.fsprc_name,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsprc.fsprc_name)
FROM fsprc_process fsprcparent
JOIN fsprc_process fsprc ON (fsprc.fsprc_id=fsprcparent.fsprc_idparent)
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsprc_id=fsprcparent.fsprc_id)
WHERE fsrpl.fsrol_id=fsrol.fsrol_id
) AS module_name ,
(SELECT listagg (DISTINCT fsprc.fsprc_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsprc.fsprc_id)
FROM fsprc_process fsprc
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsprc_id=fsprc.fsprc_id)
WHERE fsrpl.fsrol_id=fsrol.fsrol_id
) AS menu_id,
(SELECT listagg (DISTINCT fsprc.fsprc_name,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsprc.fsprc_name)
FROM fsprc_process fsprc
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsprc_id=fsprc.fsprc_id)
WHERE fsrpl.fsrol_id=fsrol.fsrol_id
) AS menu_name ,
(SELECT listagg (DISTINCT fsfea.fsfea_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea.fsfea_id)
FROM fsprc_process fsprc
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsprc_id=fsprc.fsprc_id)
JOIN fsfea_feature fsfea ON (fsfea.fsprc_id=fsprc.fsprc_id)
JOIN fsfrg_featurerights fsfrg ON (fsfrg.fsfea_id=fsfea.fsfea_id OR fsfrg.fsprc_id=fsprc.fsprc_id)
WHERE fsrpl.fsrol_id=fsrol.fsrol_id
) AS component_id,
(SELECT listagg (DISTINCT fsfea.fsfea_description,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea.fsfea_description)
FROM fsprc_process fsprc
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsprc_id=fsprc.fsprc_id)
JOIN fsfea_feature fsfea ON (fsfea.fsprc_id=fsprc.fsprc_id)
JOIN fsfrg_featurerights fsfrg ON (fsfrg.fsfea_id=fsfea.fsfea_id OR fsfrg.fsprc_id=fsprc.fsprc_id)
WHERE fsrpl.fsrol_id=fsrol.fsrol_id
) AS component_name
FROM Fsrol_role fsrol
WHERE fsrol.fsrol_id= p_fsrol_id;
OPEN p_rights_details FOR
SELECT DISTINCT fsprcparent.fsprc_id AS moduleid,
fsprcparent.fsprc_code AS modulecode,
fsprcparent.fsprc_name AS modulename,
fsprc.fsprc_id AS menuid,
fsprc.fsprc_code AS menucode,
fsprc.fsprc_name AS menuname,
fsprc.fsprc_isreadonly AS fsprc_isreadonly,
fsrpl.fsrpl_id AS fsrpl_id,
/*fsfea.fsfea_id AS fsfea_id,
fsfea.fsfea_code AS fsfea_code,
fsfea.fsfea_description AS fsfea_description,*/
(SELECT listagg (DISTINCT fsfea1.fsfea_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea1.fsfea_id)
FROM fsfea_feature fsfea1
WHERE fsfea1.fsprc_id=fsprc.fsprc_id
AND fsfea1.fsfea_id =fsfea.fsfea_id
AND fsfea1.fsfea_code<>fsprc.fsprc_code
) AS fsfea_id,
(SELECT listagg (DISTINCT fsfea1.fsfea_code,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea1.fsfea_id)
FROM fsfea_feature fsfea1
WHERE fsfea1.fsprc_id=fsprc.fsprc_id
AND fsfea1.fsfea_id =fsfea.fsfea_id
AND fsfea1.fsfea_code<>fsprc.fsprc_code
) AS fsfea_code,
(SELECT listagg (DISTINCT fsfea1.fsfea_description,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea1.fsfea_id)
FROM fsfea_feature fsfea1
WHERE fsfea1.fsprc_id=fsprc.fsprc_id
AND fsfea1.fsfea_id =fsfea.fsfea_id
AND fsfea1.fsfea_code<>fsprc.fsprc_code
) AS fsfea_description,
fsprc.fsprc_idparent AS fsprc_idparent,
(SELECT * FROM (SELECT listagg (DISTINCT fsfrg.fsfrg_value,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg.fsfrg_value)
FROM fsrpl_roleprocesslink fsrpl
JOIN fsrpf_roleprocessfeaturelink fsrpf ON (fsrpf.fsrpl_id=fsrpl.fsrpl_id )
JOIN fsfrg_featurerights fsfrg ON ( fsfrg.fsfrg_id=fsrpf.fsfrg_id)
WHERE fsrpl.fsprc_id=fsprc.fsprc_id
AND fsrpl.fsrol_id =fsrol.fsrol_id
)) AS fsfrg_value,
(SELECT listagg (DISTINCT fsrpf.fsrpf_isactive,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrpf.fsrpf_isactive)
FROM fsfrg_featurerights fsfrg
JOIN fsrpf_roleprocessfeaturelink fsrpf ON (fsrpf.fsrpl_id = fsrpl.fsrpl_id AND fsrpf.fsfrg_id = fsfrg.fsfrg_id)
WHERE fsfrg.fsfea_id=fsfea.fsfea_id
AND fsfrg.fsprc_id=fsprc.fsprc_id
) AS fsfrg_isdefault,
(SELECT * FROM (SELECT listagg (DISTINCT fsfrg.fsfrg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg.fsfrg_value)
FROM fsfrg_featurerights fsfrg
WHERE fsfrg.fsfea_id=fsfea.fsfea_id
AND fsfrg.fsprc_id=fsprc.fsprc_id
)) AS fsfrg_id,
(SELECT listagg (DISTINCT fsrpf.fsrpf_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsrpf.fsrpf_id)
FROM fsfrg_featurerights fsfrg
JOIN fsrpf_roleprocessfeaturelink fsrpf ON (fsrpf.fsrpl_id = fsrpl.fsrpl_id AND fsrpf.fsfrg_id = fsfrg.fsfrg_id)
WHERE fsfrg.fsfea_id=fsfea.fsfea_id
AND fsfrg.fsprc_id=fsprc.fsprc_id
) AS fsrpf_id
FROM Fsrol_role fsrol
LEFT JOIN fsuro_userrole fsuro ON (fsuro.fsrol_id=fsrol.fsrol_id)
LEFT JOIN fsusr_user fsusr ON (fsusr.fsusr_id=fsuro.fsusr_id)
JOIN fsrpl_roleprocesslink fsrpl ON (fsrpl.fsrol_id = fsrol.fsrol_id)
JOIN fsprc_process fsprc ON (fsprc.fsprc_id = fsrpl.fsprc_id)
JOIN fsprc_process fsprcparent ON (fsprcparent.fsprc_id = fsprc.fsprc_idparent)
LEFT JOIN fsfea_feature fsfea ON (fsfea.fsprc_id=fsprc.fsprc_id)
WHERE fsrol.fsrol_id = p_fsrol_id
ORDER BY fsprc.fsprc_idparent;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_fsugr_PRC;
PROCEDURE Get_menuorcomponent_PRC (
p_fsprcmodule_id IN fsrol_role.fsrol_description%TYPE,
p_fsprcmenu_id IN fsrol_role.fsrol_description%TYPE,
p_fsfeacomponent_id IN fsrol_role.fsrol_description%TYPE,
p_component_details OUT FS_RoleManagement.t_list,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
AS
BEGIN
IF p_fsprcmodule_id IS NOT NULL AND p_fsprcmenu_id IS NULL THEN
OPEN p_component_details FOR
SELECT fsprc_module.fsprc_id AS module_id,
fsprc_module.fsprc_code AS module_code,
fsprc_module.fsprc_name AS module_name,
fsprc.fsprc_id AS menu_id,
fsprc.fsprc_code AS menu_code,
fsprc.fsprc_name AS menu_name,
NULL AS fsfea_id,
NULL AS fsfea_code,
NULL AS fsfea_description,
(SELECT * FROM (SELECT listagg (DISTINCT fsfrg.fsfrg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg.fsfrg_value)
FROM fsfea_feature fsfea
JOIN fsfrg_featurerights fsfrg ON (fsfea.fsfea_id=fsfrg.fsfea_id)
WHERE fsfrg.fsprc_id=fsprc.fsprc_id
)) AS fsfrg_id,
'R' AS isdefault_access,
'Y' AS isactive,
fsprc.fsprc_isreadonly AS fsprc_isreadonly
FROM fsprc_process fsprc
JOIN fsprc_process fsprc_module ON (fsprc_module.fsprc_id=fsprc.fsprc_idparent)
WHERE fsprc_module.fsprc_isactive ='Y'
AND (p_fsprcmodule_id IS NOT NULL AND fsprc.fsprc_idparent IN (SELECT REGEXP_SUBSTR (p_fsprcmodule_id, '[^,]+', 1,LEVEL) AS module_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsprcmodule_id,'[^,]+', 1, LEVEL) IS NOT NULL));
ELSIF p_fsprcmodule_id IS NOT NULL AND p_fsprcmenu_id IS NOT NULL AND p_fsfeacomponent_id IS NULL THEN
OPEN p_component_details FOR
SELECT fsprc_module.fsprc_id AS module_id,
fsprc_module.fsprc_code AS module_code,
fsprc_module.fsprc_name AS module_name,
fsprc_menu.fsprc_id AS menu_id,
fsprc_menu.fsprc_code AS menu_code,
fsprc_menu.fsprc_name AS menu_name,
/* fsfea.fsfea_id AS fsfea_id,
fsfea.fsfea_code AS fsfea_code,
fsfea.fsfea_description AS fsfea_description,*/
(SELECT listagg (DISTINCT fsfea1.fsfea_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea1.fsfea_id)
FROM fsfea_feature fsfea1
WHERE fsfea1.fsprc_id=fsprc_menu.fsprc_id
AND fsfea1.fsfea_id =fsfea.fsfea_id
AND fsfea1.fsfea_code<>fsprc_menu.fsprc_code
) AS fsfea_id,
(SELECT listagg (DISTINCT fsfea1.fsfea_code,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea1.fsfea_id)
FROM fsfea_feature fsfea1
WHERE fsfea1.fsprc_id=fsprc_menu.fsprc_id
AND fsfea1.fsfea_id =fsfea.fsfea_id
AND fsfea1.fsfea_code<>fsprc_menu.fsprc_code
) AS fsfea_code,
(SELECT listagg (DISTINCT fsfea1.fsfea_description,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfea1.fsfea_id)
FROM fsfea_feature fsfea1
WHERE fsfea1.fsprc_id=fsprc_menu.fsprc_id
AND fsfea1.fsfea_id =fsfea.fsfea_id
AND fsfea1.fsfea_code<>fsprc_menu.fsprc_code
) AS fsfea_description,
(SELECT * FROM (SELECT listagg (DISTINCT fsfrg.fsfrg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg.fsfrg_value)
FROM fsfrg_featurerights fsfrg
WHERE fsfrg.fsfea_id=fsfea.fsfea_id
AND fsfrg.fsprc_id=fsprc_menu.fsprc_id
)) AS fsfrg_id,
'R' AS isdefault_access,
'Y' AS isactive,
fsprc_menu.fsprc_isreadonly AS fsprc_isreadonly
FROM fsprc_process fsprc_module
JOIN fsprc_process fsprc_menu ON (fsprc_menu.fsprc_idparent=fsprc_module.fsprc_id)
JOIN fsfea_feature fsfea ON (fsfea.fsprc_id=fsprc_menu.fsprc_id)
JOIN fsfrg_featurerights fsfrg ON (fsfrg.fsfea_id=fsfea.fsfea_id AND fsfrg.fsprc_id=fsprc_menu.fsprc_id)
WHERE fsprc_menu.fsprc_isactive ='Y'
AND fsfrg.fsfrg_isdefault='Y'
AND (p_fsprcmodule_id IS NULL OR fsprc_menu.fsprc_idparent =p_fsprcmodule_id)
AND (p_fsprcmenu_id IS NOT NULL AND fsprc_menu.fsprc_id IN (SELECT REGEXP_SUBSTR (p_fsprcmenu_id, '[^,]+', 1,LEVEL) AS menu_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsprcmenu_id,'[^,]+', 1, LEVEL) IS NOT NULL));
ELSIF p_fsprcmodule_id IS NOT NULL AND p_fsprcmenu_id IS NOT NULL AND p_fsfeacomponent_id IS NOT NULL THEN
OPEN p_component_details FOR
SELECT fsprc_module.fsprc_id AS module_id,
fsprc_module.fsprc_code AS module_code,
fsprc_module.fsprc_name AS module_name,
fsprc_menu.fsprc_id AS menu_id,
fsprc_menu.fsprc_code AS menu_code,
fsprc_menu.fsprc_name AS menu_name,
fsfea.fsfea_id AS fsfea_id,
fsfea.fsfea_code AS fsfea_code,
fsfea.fsfea_description AS fsfea_description,
(SELECT * FROM (SELECT listagg (DISTINCT fsfrg.fsfrg_id,', ' ON overflow TRUNCATE WITH COUNT)
within GROUP (ORDER BY fsfrg.fsfrg_value)
FROM fsfrg_featurerights fsfrg
WHERE fsfrg.fsfea_id=fsfea.fsfea_id
AND fsfrg.fsprc_id=fsprc_menu.fsprc_id)
) AS fsfrg_id,
'R' AS isdefault_access,
'Y' AS isactive,
fsprc_menu.fsprc_isreadonly AS fsprc_isreadonly
FROM fsprc_process fsprc_module
JOIN fsprc_process fsprc_menu ON (fsprc_menu.fsprc_idparent=fsprc_module.fsprc_id)
JOIN fsfea_feature fsfea ON (fsfea.fsprc_id=fsprc_menu.fsprc_id)
JOIN fsfrg_featurerights fsfrg ON (fsfrg.fsfea_id=fsfea.fsfea_id AND fsfrg.fsprc_id=fsprc_menu.fsprc_id)
WHERE fsprc_menu.fsprc_isactive ='Y'
AND fsfrg.fsfrg_isdefault='Y'
AND (p_fsprcmodule_id IS NULL OR fsprc_menu.fsprc_idparent =p_fsprcmodule_id)
AND (p_fsprcmenu_id IS NULL OR fsprc_menu.fsprc_id =p_fsprcmenu_id)
AND (p_fsfeacomponent_id IS NOT NULL AND fsfea.fsfea_id IN (SELECT REGEXP_SUBSTR (p_fsfeacomponent_id, '[^,]+', 1,LEVEL) AS menu_id FROM FSDUL_DUAL
CONNECT BY REGEXP_SUBSTR (p_fsfeacomponent_id,'[^,]+', 1, LEVEL) IS NOT NULL));
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END Get_menuorcomponent_PRC;
PROCEDURE put_fsrol_prc (
p_fsrol_id IN OUT FSROL_Role.fsrol_id%TYPE,
p_fsrol_classification IN FSROL_Role.fsrol_classification%TYPE,
p_fsrol_code IN FSROL_Role.fsrol_code%TYPE,
p_fsrol_description IN FSROL_Role.fsrol_description%TYPE,
p_fsrol_validfrom IN FSROL_Role.fsrol_validfrom%TYPE,
p_fsrol_validto IN FSROL_Role.fsrol_validto%TYPE,
p_user_id IN FSROL_Role.fsrol_createdby%TYPE,
p_record_status IN FSROL_Role.fsrol_code%TYPE,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
AS
BEGIN
FSROL_Role_pkg.put_fsrol_prc
(
p_fsrol_id => p_fsrol_id ,
p_fsrol_classification => p_fsrol_classification ,
p_fsrol_code => p_fsrol_code ,
p_fsrol_description => p_fsrol_description ,
p_fsrol_validfrom => p_fsrol_validfrom ,
p_fsrol_validto => p_fsrol_validto ,
p_fsrol_isdeleted => fs_constants.k_isnonactive,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrol_prc;
PROCEDURE put_fsfrg_prc(
p_fsrol_id IN fsrol_role.fsrol_id%TYPE,
p_fsrpf_id IN OUT FSRPF_Roleprocessfeaturelink.fsrpf_id%TYPE,
p_fsprc_id IN fsprc_process.fsprc_id%TYPE,
p_fsrpl_id IN OUT FSRPL_RoleProcessLink.fsrpl_id%TYPE,
p_fsfea_id IN fsfea_feature.fsfea_id%TYPE,
p_fsfrg_id IN fsfrg_featurerights.fsfrg_id%TYPE,
p_fsrpf_isactive IN FSRPF_Roleprocessfeaturelink.fsrpf_isactive%TYPE,
p_fsfrg_value IN fsfrg_featurerights.fsfrg_value%TYPE,
--p_fsfrg_isdefault IN fsfrg_featurerights.fsfrg_isdefault%TYPE,
p_user_id IN fsfrg_featurerights.fsfrg_createdby%TYPE,
p_record_status IN FSROL_Role.fsrol_code%TYPE,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
AS
BEGIN
IF p_record_status= fs_constants.k_insert_status THEN
IF p_fsprc_id IS NOT NULL THEN
FSRPL_RoleProcessLink_pkg.put_fsrpl_prc(
p_fsrpl_id => p_fsrpl_id ,
p_fsrol_id => p_fsrol_id ,
p_fsprc_id => p_fsprc_id ,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message
);
END IF;
IF p_fsfrg_id IS NOT NULL THEN
FSRPF_Roleprocessfeaturelink_pkg.put_fsrpf_prc
(
p_fsrpf_id => p_fsrpf_id ,
p_fsrpl_id => p_fsrpl_id ,
p_fsfrg_id => p_fsfrg_id ,
p_fsrpf_isactive => p_fsrpf_isactive,
p_user_id => p_user_id ,
p_record_status => p_record_status ,
p_issuccess => p_issuccess ,
p_message => p_message );
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
ELSIF p_record_status= fs_constants.k_update_status THEN
IF p_fsprc_id IS NOT NULL THEN
UPDATE FSRPF_Roleprocessfeaturelink SET fsrpf_lastupdatedby =p_user_id , fsrpf_lastupdatedon = SYSDATE
WHERE fsrpl_id =p_fsrpl_id;
DELETE FROM FSRPF_Roleprocessfeaturelink WHERE fsrpl_id=p_fsrpl_id;
FSRPL_RoleProcessLink_pkg.put_fsrpl_prc(
p_fsrpl_id => p_fsrpl_id ,
p_fsrol_id => p_fsrol_id ,
p_fsprc_id => p_fsprc_id ,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_update_status ,
p_issuccess => p_issuccess ,
p_message => p_message);
END IF;
IF p_fsfrg_id IS NOT NULL THEN
FSRPF_Roleprocessfeaturelink_pkg.put_fsrpf_prc
(
p_fsrpf_id => p_fsrpf_id ,
p_fsrpl_id => p_fsrpl_id ,
p_fsfrg_id => p_fsfrg_id ,
p_fsrpf_isactive => p_fsrpf_isactive,
p_user_id => p_user_id ,
p_record_status => fs_constants.k_insert_status,
p_issuccess => p_issuccess ,
p_message => p_message );
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
ELSIF p_record_status= fs_constants.k_delete_status THEN
UPDATE FSRPF_Roleprocessfeaturelink SET fsrpf_lastupdatedby=p_user_id,fsrpf_lastupdatedon=SYSDATE
WHERE fsrpl_id =p_fsrpl_id;
UPDATE FSRPL_RoleProcessLink
SET FSRPL_LastUpdatedBy=p_user_id,FSRPL_LastUpdatedOn=SYSDATE
WHERE fsrol_id=p_fsrol_id AND FSRPL_ID= p_fsrpl_id;
DELETE FROM FSRPF_Roleprocessfeaturelink WHERE fsrpl_id = p_fsrpl_id;
DELETE FROM FSRPL_RoleProcessLink WHERE fsrol_id =p_fsrol_id AND FSRPL_ID= p_fsrpl_id;
COMMIT;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
END IF;
EXCEPTION
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsfrg_prc;
PROCEDURE put_fsrol_prc_del(
p_fsrol_id IN fsrol_role.fsrol_id%TYPE,
p_user_id IN fsfrg_featurerights.fsfrg_createdby%TYPE,
p_issuccess OUT FSROL_Role.fsrol_code%TYPE,
p_message OUT FS_RoleManagement.t_list)
AS
CURSOR user_link_chk IS
SELECT 'Y'
FROM FSURO_Userrole
WHERE fsrol_id=p_fsrol_id;
e_childkeyfound EXCEPTION;
PRAGMA exception_init (e_childkeyfound, -2292);
v_userlink_flag VARCHAR2(10);
BEGIN
v_userlink_flag :=NULL;
OPEN user_link_chk;
FETCH user_link_chk INTO v_userlink_flag;
CLOSE user_link_chk;
IF NVL(v_userlink_flag,'N') ='N' THEN
UPDATE FSRPL_RoleProcessLink
SET FSRPL_LastUpdatedBy=p_user_id,FSRPL_LastUpdatedOn=SYSDATE
WHERE FSROL_ID=p_fsrol_id;
UPDATE FSRPF_Roleprocessfeaturelink SET fsrpf_lastupdatedby=p_user_id,fsrpf_lastupdatedon=SYSDATE
WHERE fsrpl_id IN (
SELECT FSRPL_ID FROM FSRPL_Roleprocesslink WHERE FSROL_ID=p_fsrol_id);
UPDATE FSROL_Role fsrol SET fsrol.FSROL_LASTUPDATEDBY= p_user_id,fsrol.FSROL_LASTUPDATEDON = SYSDATE
WHERE fsrol_id =p_fsrol_id;
UPDATE FSBUR_Businessentityrole fsbur SET fsbur.fsbur_lastupdatedby= p_user_id,fsbur.fsbur_lastupdatedon = SYSDATE
WHERE fsrol_id =p_fsrol_id;
DELETE FROM FSRPF_Roleprocessfeaturelink WHERE FSRPL_ID IN (
SELECT FSRPL_ID FROM FSRPL_Roleprocesslink WHERE FSROL_ID=p_fsrol_id);
DELETE FROM FSRPL_RoleProcessLink WHERE FSROL_ID=p_fsrol_id;
DELETE from FSBUR_Businessentityrole fsbur WHERE fsrol_id = p_fsrol_id;
DELETE FROM FSROL_Role fsrol WHERE FSROL_ID=p_fsrol_id;
ELSE
UPDATE FSROL_Role fsrol SET fsrol.FSROL_LASTUPDATEDBY= p_user_id,fsrol.FSROL_LASTUPDATEDON = SYSDATE
WHERE fsrol_id =p_fsrol_id;
DELETE FROM FSROL_Role fsrol WHERE FSROL_ID=p_fsrol_id;
END IF;
p_issuccess := fs_constants.k_success;
OPEN p_message FOR
SELECT fs_constants.k_success_msgcode AS msg_code,
NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN e_childkeyfound THEN
p_issuccess := fs_constants.k_failure;
OPEN p_message FOR
SELECT fs_message.fsrol_code2 AS msg_code,
fs_message.fsrol_desc2 AS msg_value
FROM FSDUL_DUAL;
WHEN OTHERS
THEN
p_issuccess := fs_constants.k_failure;
fs_exception.raise_exception;
END put_fsrol_prc_del;
END FS_RoleManagement;
create or replace PACKAGE FSCTY_Country_PKG
AS
/*
---------------------------------------------------------------------------------------------------------------------------------
MODIFICATION HISTORY
--------------------------------------------------------------------------------------------------------------------------------
|| VERSION WHEN WHO WHAT
|| -----------------------------------------------------------------------------------------------------------------------------
|| FS-241219-01 24-Dec-2019 PraveenKumar. D Country entity Package Created.
--------------------------------------------------------------------------------------------------------------------------------
*/
TYPE t_list IS REF CURSOR;
PROCEDURE put_fscty_prc(
P_fscty_id IN OUT fscty_country.fscty_id%TYPE,
P_fscty_code IN fscty_country.fscty_code%TYPE,
P_fscty_name IN fscty_country.fscty_name%TYPE,
P_fscty_timezoneadjustmenthr IN fscty_country.fscty_timezoneadjustmenthr%TYPE,
P_fscty_timezoneadjustmentmin IN fscty_country.fscty_timezoneadjustmentmin%TYPE,
P_fscry_idbase IN fscty_country.fscry_idbase%TYPE,
p_fscry_idancillary IN fscty_country.fscry_idancillary%TYPE,
p_fscty_nationality IN fscty_country.fscty_nationality%TYPE,
p_fscty_issubdivisionused IN fscty_country.fscty_issubdivisionused%TYPE,
p_fscty_iszipcodeused IN fscty_country.fscty_iszipcodeused%TYPE,
p_fscty_validfrom IN fscty_country.fscty_validfrom%TYPE,
p_fscty_validto IN fscty_country.fscty_validto%TYPE,
p_fscty_remarks IN fscty_country.fscty_remarks%TYPE,
p_fscty_isdeleted IN fscty_country.fscty_isdeleted%TYPE,
p_fscty_issynchronized IN fscty_country.fscty_issynchronized%TYPE,
p_user_id IN fscty_country.fscty_createdby%TYPE,
p_record_status IN fscty_country.fscty_code%TYPE,
p_issuccess OUT fscty_country.fscty_code%TYPE,
p_message OUT FSCTY_Country_PKG.t_list);
PROCEDURE put_fscty_prc_del(
P_fscty_id IN fscty_country.fscty_id%TYPE,
p_user_id IN fscty_country.fscty_lastupdatedby%type,
p_issuccess OUT fscty_country.fscty_code%TYPE,
p_message OUT FSCTY_Country_PKG.t_list);
END FSCTY_Country_PKG;
/
create or replace PACKAGE BODY FSCTY_Country_PKG
AS
PROCEDURE put_fscty_prc(
P_fscty_id IN OUT fscty_country.fscty_id%TYPE,
P_fscty_code IN fscty_country.fscty_code%TYPE,
P_fscty_name IN fscty_country.fscty_name%TYPE,
P_fscty_timezoneadjustmenthr IN fscty_country.fscty_timezoneadjustmenthr%TYPE,
P_fscty_timezoneadjustmentmin IN fscty_country.fscty_timezoneadjustmentmin%TYPE,
P_fscry_idbase IN fscty_country.fscry_idbase%TYPE,
p_fscry_idancillary IN fscty_country.fscry_idancillary%TYPE,
p_fscty_nationality IN fscty_country.fscty_nationality%TYPE,
p_fscty_issubdivisionused IN fscty_country.fscty_issubdivisionused%TYPE,
p_fscty_iszipcodeused IN fscty_country.fscty_iszipcodeused%TYPE,
p_fscty_validfrom IN fscty_country.fscty_validfrom%TYPE,
p_fscty_validto IN fscty_country.fscty_validto%TYPE,
p_fscty_remarks IN fscty_country.fscty_remarks%TYPE,
p_fscty_isdeleted IN fscty_country.fscty_isdeleted%TYPE,
p_fscty_issynchronized IN fscty_country.fscty_issynchronized%TYPE,
p_user_id IN fscty_country.fscty_createdby%TYPE,
p_record_status IN fscty_country.fscty_code%TYPE,
p_issuccess OUT fscty_country.fscty_code%TYPE,
p_message OUT FSCTY_Country_PKG.t_list)
IS
e_parent_key_notfound EXCEPTION;
PRAGMA EXCEPTION_INIT (e_parent_key_notfound, -2291);
BEGIN
IF p_record_status = FS_CONSTANTS.k_insert_status THEN
INSERT
INTO fscty_country
(
fscty_code ,
fscty_name ,
fscty_timezoneadjustmenthr ,
fscty_timezoneadjustmentmin ,
fscry_idbase ,
fscry_idancillary ,
fscty_nationality ,
fscty_issubdivisionused ,
fscty_iszipcodeused ,
fscty_validfrom ,
fscty_validto ,
fscty_remarks ,
fscty_isdeleted ,
fscty_issynchronized ,
fscty_createdby ,
fscty_createdon)
VALUES
(
p_fscty_code ,
p_fscty_name ,
p_fscty_timezoneadjustmenthr ,
p_fscty_timezoneadjustmentmin ,
p_fscry_idbase ,
p_fscry_idancillary ,
p_fscty_nationality ,
p_fscty_issubdivisionused ,
p_fscty_iszipcodeused ,
p_fscty_validfrom ,
p_fscty_validto ,
p_fscty_remarks ,
p_fscty_isdeleted ,
p_fscty_issynchronized ,
p_user_id ,
SYSDATE
)
RETURNING fscty_id
INTO P_fscty_id;
ELSIF p_record_status = FS_CONSTANTS.k_update_status THEN
UPDATE fscty_country
SET fscty_code = p_fscty_code ,
fscty_name = p_fscty_name ,
fscty_timezoneadjustmenthr = p_fscty_timezoneadjustmenthr ,
fscty_timezoneadjustmentmin = p_fscty_timezoneadjustmentmin ,
fscry_idbase = p_fscry_idbase ,
fscry_idancillary = p_fscry_idancillary ,
fscty_nationality = p_fscty_nationality ,
fscty_issubdivisionused = p_fscty_issubdivisionused ,
fscty_iszipcodeused = p_fscty_iszipcodeused ,
fscty_validfrom = p_fscty_validfrom ,
fscty_validto = p_fscty_validto ,
fscty_remarks = p_fscty_remarks ,
fscty_lastupdatedby = p_user_id,
fscty_lastupdatedon = SYSDATE
WHERE fscty_id = P_fscty_id;
END IF;
p_issuccess := FS_CONSTANTS.k_success;
OPEN p_message FOR
SELECT FS_CONSTANTS.k_success_msgcode AS msg_code,NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN dup_val_on_index THEN
p_issuccess := FS_CONSTANTS.k_failure;
OPEN p_message FOR
SELECT FS_MESSAGE.FSCTY_CODE1 AS msg_code,FS_MESSAGE.FSCTY_DESC1 AS msg_value
FROM FSDUL_DUAL;
WHEN e_parent_key_notfound THEN
p_issuccess := FS_CONSTANTS.k_failure;
OPEN p_message FOR
SELECT FS_MESSAGE.FSCTY_CODE2 AS msg_code,FS_MESSAGE.FSCTY_DESC2 AS msg_value
FROM FSDUL_DUAL;
WHEN OTHERS THEN
p_issuccess := FS_CONSTANTS.k_failure;
FS_EXCEPTION.raise_exception;
END put_fscty_prc;
PROCEDURE put_fscty_prc_del(
P_fscty_id IN fscty_country.fscty_id%TYPE,
p_user_id IN fscty_country.fscty_lastupdatedby%type,
p_issuccess OUT fscty_country.fscty_code%TYPE,
p_message OUT FSCTY_Country_PKG.t_list)
IS
e_childkeyfound EXCEPTION;
PRAGMA EXCEPTION_INIT (e_childkeyfound, -2292);
BEGIN
UPDATE fscty_country
SET fscty_isdeleted = FS_CONSTANTS.k_isactive ,
fscty_lastupdatedby = p_user_id ,
fscty_lastupdatedon = SYSDATE
WHERE fscty_id = P_fscty_id;
DELETE fsrgc_regioncountry
WHERE fscty_id = P_fscty_id;
DELETE fscty_country
WHERE fscty_id = P_fscty_id;
p_issuccess:= FS_CONSTANTS.k_success;
OPEN p_message FOR
SELECT FS_CONSTANTS.k_success_msgcode AS msg_code,NULL AS msg_value
FROM FSDUL_DUAL;
EXCEPTION
WHEN e_childkeyfound THEN
p_issuccess := FS_CONSTANTS.k_failure;
OPEN p_message FOR
SELECT FS_MESSAGE.FSCRF_CODE1 AS msg_code,
FS_MESSAGE.FSCRF_DESC1 AS msg_value
FROM FSDUL_DUAL;
WHEN OTHERS THEN
p_issuccess := FS_CONSTANTS.k_failure;
FS_EXCEPTION.raise_exception;
END put_fscty_prc_del;
END FSCTY_Country_PKG;
/
Day 1
Day 2
Day 3