Question
pls use oracle PL/sql command line ------ Q1 ) Create a complete project using SQL/PLSQL program ing language to achieve the following requirement to develop
pls use oracle PL/sql command line
------
Q1) Create a complete project using SQL/PLSQL programing language to achieve the following requirement to develop point of sale system which allow the Employee to add customer invoice which contain his/her invoice information such as customer name, employee name who create this invoice which contain invoice date and total price with its related purchased items which contain quantity and price for each item in customer invoice.
Follow these requirements
Employee (employeeNo,employeeName,job) ,branch(No,Name), Customer(customerNo,costomerName,gender) ,
,Invoice (employeeNo,customerNo,total price ,invoiceNo,InvoiceDate,branchNo )
InvoiceDeatail contain List Of Purchase Items contain detail information related to the invoice (invoiceNo,ItemNo, paidPrice, quantity) . create getItemTotalPrice function which to return quantity*paidPrice .
then the procedure will check from the exists of customername,employeeName,BranchName by calling there check existsing function for each name and if all of them are exists then a new record will be created with total price equel to zero and the invoceno will be generated using method getNextInvoiceNo() which return the maximum +1 , then the method will display the message one record has been created with invoice No:show the generated invoiceNo her in this message else display a specific message that show the customer or employee or branch name doesnt exist please re-enter correct names .
After that if invoiceNo and ItemNO valid and exists before then the procedure will check the existsing if itemno of this invoiceNO not exists before by call checkExistingInvoiceItem(invoiceNo1,itemNo1) so this itemNo will be added to this invoiceNO in table InvoiceDeatail and the transaction related to adding this record as follow :
New record contain invoiceNo with i itemNo,paidprice, and quantity it will be added to InvoiceDeatail table then The total price for this invoice it will be increased by using this formula (quantity* price ) related to current item then the total price of invoice it will be increase, after that the item total quantity in items table will be decrease for this itemNO related to this itemNO in InvoiceDeatail . but if this itemNo exists before in this InvoiceNo then instead of insert new recorde with the new quantity in InvoiceDeatail table then the quantity it will be updated in for that item added before and the rest of logic related to increase the invoice total price and decrease item quantity from items table its the same scenario of added new items . the system will display a message that one item :item name has been addedsuccessfully else the message will display there is no item has this name: parameter item name .
checkExistingInvoiceItem(invoiceNo,itemNo) which will return exists if this item was sell in this invoice or not exists if not was sell. After that the procedure will call getitemInvoiceQuantity(invoiceNo,itemNo) ,getitemInvoicepaidprice(invoiceNo,itemNo) for existingitem in this invoice , then this function it will return the quantity for this item was sell to customer in this invoicethen the procedure will increase the total_quantity for this item in items table ,then it will decrease the total price related to this invoice by this formula {total price =total price (quantity*price)} .finaly after make updates then the invoiceNo with its itemNo and its quantity and paid price it will be inserted in InvoiceDeatail_delted_History table with deletion transaction date , after that then the item invoice record it will be deleted from InvoiceDeatail table related to this invoice item and message one record deleted successfully will be display to the user .
then it will list all item information (item name,quantity, price ,total price) from invoiceDetail
view related to this invoice .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started