/*
 * Author       : template
 * Generated on : 23-Nov-2009 06:25:00
 * Version      : 3.0
 */
application "Expense Tracker"
{
    type = public
    allow html = true
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Income_and_Expense
    {
        displayname = "Income and Expense"
        form  Income_and_Expense1
        {
            displayname  =  "Income and Expense"
            
            plain
            (
                type  =  plaintext
                value = "<span class=\"zoho-plaintext\" id=\"autogen_name:autogen_name__comp\" type=\"plaintext\"><span style=\"font-weight: bold;\">Enter Income Details<br></span>......................................................................................................</span>\n"
            )

            date1
            (
                displayname  =  "Date"
                type  =  date
            )

            Income
            (
                type  =  USD
                width  =  20
            )

            plain1
            (
                type  =  plaintext
                value = "<span class=\"zoho-plaintext\" id=\"autogen_name:autogen_name_1__comp\" type=\"plaintext\"><span style=\"font-weight: bold;\"><br><br>Enter Expense Details</span><br>......................................................................................................</span>\n"
            )

            Spent_for
            (
                displayname  =  "Spent for"
                type  =  picklist
                values  =  {"Family (All)",   "Edward",   "Susan",   "Kevin",   "Donna"}
            )

            Category
            (
                type  =  picklist
                values  =  New_Category.Category_Name
            )

            Date2
            (
                displayname  =  "Date"
                type  =  date
            )

            Paid_to
            (
                displayname  =  "Paid to"
                type  =  picklist
                values  =  {"Capital One",   "Dollar General",   "Westedge",   "Gas Station",   "Pizza Hut",   "The Kroger Co."}
            )

            Payment_Method
            (
                displayname  =  "Payment Method"
                type  =  picklist
                values  =  {"Visa",   "Cash",   "Checks",   "MasterCard"}
            )

            plain2
            (
                type  =  plaintext
                value = "<span class=\"zoho-plaintext\" id=\"autogen_name:autogen_name_2__comp\" type=\"plaintext\">Add Income and Expense details.</span>\n"
            )

            Amount
            (
                type  =  USD
                width  =  20
            )

            Notes
            (
                type  =  textarea
            )

            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  Expenses1
        {
            displayname = "Expenses"
            show  all  rows  from  Income_and_Expense1 
            (
                date1 as "Date"
                Income
                Spent_for as "Spent for"
                Category
                Date2 as "Date"
                Paid_to as "Paid to"
                Payment_Method as "Payment Method"
                Amount
                Notes
            )
            options
            (
                display rows = 100
            )
        }

    }

    section Category
    {
        list  Category_List
        {
            displayname = "Category List"
            show  all  rows  from  New_Category 
            (
                Category_Name as "Category Name"
                Alotted_Budget_apprx_ as "Allotted Budget (apprx)", display total
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

        form  New_Category
        {
            displayname  =  "New Expense Category"
            
            must  have  Category_Name
            (
                displayname  =  "Category Name"
                type  =  text
                width  =  30
                maxchar  =  30
            )

            Alotted_Budget_apprx_
            (
                displayname  =  "Allotted Budget (apprx)"
                type  =  USD
                decimalplace  =  0
            )

            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"
                    )
                }
            }
        }

    }

    section Reports
    {
    }

}
