Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

he system must contain tables such as Items(itemNo,ItemName,Price,total_quantity, catNo) InvoiceDeatail (invoiceNo,ItemNo, paidPrice, quantity) . create getItemTotalPrice function which to return quantity* paidPrice. procedure to add

image text in transcribed
he system must contain tables such as Items(itemNo,ItemName,Price,total_quantity, catNo) InvoiceDeatail (invoiceNo,ItemNo, paidPrice, quantity) . create getItemTotalPrice function which to return quantity* paidPrice. procedure to add Invoice detail AddInvoiceDeatail(invoiceNo,itemName,quantity). This method start by validating the existing of the current invoiceNO by call function checkExistinglnvoice(invoiceNo1) so if this invoice exists then we will start checking the existing of item name by call getltemNo(itemName1) which will return itemNo if the item name is exists else it will return - 1 if this item not exists in items then if exists we call getlemPrice(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 checkExistinglnvoiceltem(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 it's the same scenario of added new items . the system will display a message that one item :item name has been added successfully 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 with AI-Powered 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

Students also viewed these Databases questions