Specification for Write Docket - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Specification for Write Docket

Description:

We've seen the docket and know it needs to be filled. To fill the docket, we need to: ... endif. First Draft Spec for creating a docket (1 of 3) MakeCustomerOrder ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 10
Provided by: poby4
Category:

less

Transcript and Presenter's Notes

Title: Specification for Write Docket


1
Specification for Write Docket
  • From Joes Yard

2
Requirements
  • Weve seen the docket and know it needs to be
    filled.
  • To fill the docket, we need to
  • Generate a docket number
  • Repeatedly
  • Add an orderline
  • Until the customer is finished.
  • Generate total
  • Confirm payment.
  • Write docket to data store.
  • End and commit.

3
Generate a docket number
  • Take the previous number generated.
  • Add one to it.
  • This is the new docket number

4
Add an orderline
  • Take in a stock code
  • Check the data store to see if its a valid stock
    code
  • If so,
  • Display description
  • Accept stockquantity
  • Check stock amount against quantity required.
  • If stockamount gt stock required
  • Allocate this stock
  • Else
  • Reject orderline

5
Allocate stock
  • Subtract quantity required from stock level
  • Update stock table
  • If stock level lt reorder level
  • Reorder stock
  • endif

6
(No Transcript)
7
First Draft Spec for creating a docket (1 of 3)
  • MakeCustomerOrder
  • GenerateDocket (COrderNo)
  • Accept Stock_code
  • Repeat
  • AllocateStock(Stockcode, return status)
  • If status 0
  • Add new CORderline(stockcode, quantity, corderno)
    to COrderline data store
  • End-if
  • Accept Stock_Code
  • Until Stock_code
  • Generate OrderTotal
  • Accept Payment
  • If Payment OrderTotal
  • Update (COrder(Corderno) with details
  • Commit all updates
  • Else
  • Rollback all adds and updates
  • End-if
  • End

8
2 of 3
  • Generate (COrderNo of type CORderno in COrder
    Datastore)
  • Retrieve last Corder from Data store COrder
  • Add 1 to COrderNo
  • Add new COrder (COrderNo, ,,,,,) to COrder data
    store
  • Return (COrderNo)
  • Add_COrderline (Stock code, status)
  • Status 0 Add worked, Status 1 Add failed
  • Status 0
  • Retrieve stock with code StockCode from Data
    store Stock
  • If failed
  • Set status 1
  • Display Error no such code
  • Else
  • Accept quantity
  • If quantity gt stockLevel
  • Subtract quantity from stockLevel
  • Update Stock Data store
  • If StockLevel lt ReorderLevel
  • Call ReorderStock(StockCode)

9
3 of 3
  • ReorderStock(StockCode)
  • Retrieve stock.supplierId for stock code from
    data store stock
  • Retrieve SOrderNo from SOrder for SupplierId
    where OrderDate is Null
  • If not
  • Get latest SOrder from SOrder Data Store
  • Add 1 to SOrderNo
  • Add new SORder (SOrderNo, SupplierId) for
    SupplierId Stock.SupplierId
  • End if
  • Enter supply quantity
  • Add Sorderline (SorderNo, StockCode,
    SupplyQuantity)
  • Commit
  • End
Write a Comment
User Comments (0)
About PowerShow.com