Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create database package pointOfSal which contain the following H. procedure to add Invoice detail AddInvoiceDeatail ( invoiceNo,itemName ,quantity ) . This method start by validating

Create database package pointOfSal which contain the following
H. procedure to add Invoice detail AddInvoiceDeatail(invoiceNo,itemName,quantity). This method start by validating the existing of the current invoiceNO by call function checkExistingInvoice(invoiceNo1) so if this invoice exists then we will start checking the existing of item name by call getItemNo(itemName1) which will return itemNo if the item name is exists else it will return -1 ifthis item not exists in items then if exists we call getItemPrice(itemNo1) function to return item price.

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

5. What are some tips for writing a sales proposal? (LO 17-5)

Answered: 1 week ago

Question

What magazine and ads did you choose to examine?

Answered: 1 week ago