/*
 * Author       : sampleapps
 * Generated on : 23-Nov-2009 00:33:43
 * Version      : 3.0
 */
application "Compute Rate on User Input"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Home
    {
        form  Work_Order
        {
            displayname  =  "Work Order"
            
            must  have  rate
            (
                type  =  USD
                defaultvalue  =  0.00  
                width  =  20
                on user input
                {
                    if (input.hours  !=  null)
                    {
                        input.amount = (input.rate  *  input.hours);
                    }
                }
            )

            must  have  hours
            (
                type  =  decimal
                defaultvalue  =  0.00
                width  =  20
                on user input
                {
                    if (input.rate  !=  null)
                    {
                        input.amount = (input.rate  *  input.hours);
                    }
                }
            )

            must  have  amount
            (
                type  =  USD
                defaultvalue  =  0.00  
                width  =  20
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Work_Order_View
        {
            displayname = "Work Order View"
            show  all  rows  from  Work_Order 
            (
                rate
                hours
                amount
            )
            options
            (
                display rows = 100
            )
        }

    }

}
