=a!formLayout( label: "TV Production Budget Entry Form", instructions: "Use this form to complete the budget for approval. ", firstColumnContents: { a!sectionLayout( label: "Budget Details", firstColumnContents: { a!textField( label: "TV Production Name", labelPosition: "ABOVE", value: ri!TVP_App_Budget.tvpName, saveInto: ri!TVP_App_Budget.tvpName, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!textField( label: "Shoot Type", labelPosition: "ABOVE", value: ri!TVP_App_Budget.type, saveInto: {ri!TVP_App_Budget.type}, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!textField( label: "Location", labelPosition: "ABOVE", value: ri!TVP_App_Budget.location, saveInto: ri!TVP_App_Budget.location, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!dateField( label: "Start Shoot", labelPosition: "ABOVE", value: ri!TVP_App_Budget.shootStartDate, saveInto: ri!TVP_App_Budget.shootStartDate, validations: {} ) }, secondColumnContents: { a!integerField( label: "# of Episodes", labelPosition: "ABOVE", value: ri!TVP_App_Budget.numberOfEpisodes, saveInto: ri!TVP_App_Budget.numberOfEpisodes, refreshAfter: "UNFOCUS", validations: {} ), a!textField( label: "Shoot Format", labelPosition: "ABOVE", value: ri!TVP_App_Budget.shootFormat, saveInto: ri!TVP_App_Budget.shootFormat, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!dateField( label: "Budget Dated", labelPosition: "ABOVE", value: today(), saveInto: ri!TVP_App_Budget.budgetDate, required: true, validations: {} ), a!dateField( label: "Wrap Date", labelPosition: "ABOVE", value: ri!TVP_App_Budget.wrapDate, saveInto: ri!TVP_App_Budget.wrapDate, required: true, validations: {} ) } ), a!sectionLayout( label: "Total Gross Budget", firstColumnContents: { a!floatingPointField( label: "ATL Total", labelPosition: "ABOVE", value: ri!TVP_App_Budget.atlTotal, saveInto: ri!TVP_App_Budget.atlTotal, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "Post Prod", labelPosition: "ABOVE", value: ri!TVP_App_Budget.postProd, saveInto: ri!TVP_App_Budget.postProd, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "Amort", labelPosition: "ABOVE", value: ri!TVP_App_Budget.amort, saveInto: ri!TVP_App_Budget.amort, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "Diversity Writer", labelPosition: "ABOVE", instructions: "", value: ri!TVP_App_Budget.diversityWriter, saveInto: ri!TVP_App_Budget.diversityWriter, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "TOTAL GROSS BUDGET $", labelPosition: "ADJACENT", instructions: "Sum of the above fields", value: rule!TVP_App_Budget_CalculateGrossBudget(ri!TVP_App_Budget), saveinto: {{ri!TVP_App_Budget.totalGrossBudget}}, refreshAfter: "UNFOCUS", required: true, readonly: false, disabled: true, validations: { null }, align: "LEFT" ) }, secondColumnContents: { a!dropdownField( label: "Currency", labelPosition: "ABOVE", placeholderLabel: "--- Select a Value ---", choiceLabels: {"USD", "CAD"}, choiceValues: {0, 1}, value: ri!currencyValue, saveInto: ri!currencyValue, required: true, validations: {} ), a!floatingPointField( label: "BTL Total", labelPosition: "ABOVE", value: ri!TVP_App_Budget.btlTotal, saveInto: ri!TVP_App_Budget.btlTotal, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "Other", labelPosition: "ABOVE", value: ri!TVP_App_Budget.other, saveInto: ri!TVP_App_Budget.other, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "Agency Fee", labelPosition: "ABOVE", value: ri!TVP_App_Budget.agencyFee, saveInto: ri!TVP_App_Budget.agencyFee, refreshAfter: "UNFOCUS", required: true, validations: {} ) }, iscollapsible: true ), a!sectionLayout( label: "Net Budget", firstColumnContents: { a!floatingPointField( label: "TOTAL GROSS BUDGET $", labelPosition: "ADJACENT", instructions: "Total Gross Budget from the Section Above.", value: rule!TVP_App_Budget_CalculateGrossBudget(ri!TVP_App_Budget), saveInto: {}, refreshAfter: "UNFOCUS", readonly: false, disabled: true, validations: {}, align: "LEFT" ), a!floatingPointField( label: "NET BUDGET NO COMPLETION COSTS $", labelPosition: "ADJACENT", instructions: "Total Gross Budget - Tax Credit", value: rule!TVP_App_Budget_CalculateGrossBudget(ri!TVP_App_Budget)-ri!TVP_App_Budget.taxCredit, saveInto: ri!TVP_App_Budget.netBudgetAfterTax, refreshAfter: "UNFOCUS", readonly: false, disabled: true, validations: {} ), a!floatingPointField( label: "NET BUDGET AFTER BREAKAGE $", labelPosition: "ADJACENT", instructions: "Total Gross Budget - Tax Credit - Breakage", value: rule!TVP_App_Budget_CalculateGrossBudget(ri!TVP_App_Budget)-ri!TVP_App_Budget.taxCredit-ri!TVP_App_Budget.breakage, refreshAfter: "UNFOCUS", readonly: false, disabled: true, validations: {}, align: "LEFT" ) }, secondColumnContents: { a!floatingPointField( label: "Tax Credit", labelPosition: "ABOVE", instructions: " ", value: ri!TVP_App_Budget.taxCredit, saveInto: ri!TVP_App_Budget.taxCredit, refreshAfter: "UNFOCUS", required: true, validations: {} ), a!floatingPointField( label: "Breakage", labelPosition: "ABOVE", instructions: "", value: ri!TVP_App_Budget.breakage, saveInto: ri!TVP_App_Budget.breakage, refreshAfter: "UNFOCUS", required: true, readonly: false, validations: {} ), a!fileUploadField( label: "Supporting Document", target: cons!TVP_MainFolderId, value: ri!uploadedDoc, saveInto: { ri!uploadedDoc }, required: true ) }, iscollapsible: true ), a!sectionLayout( label: "Select Approvers", firstColumnContents: { a!pickerFieldUsers( label: cons!TVP_ApproverTitles[1], labelPosition: "ADJACENT", value: loggedInUser(), saveInto: ri!approverList[1], required: true, readonly: false, validations: {} ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[2], labelPosition: "ADJACENT", instructions: "", rootgroup: cons!TVP_folderId_prodOpsUCP, selectionvalue: ri!TVP_App_Budget.approver2, selectionsaveinto: ri!approverList[2], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[3], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_postProd, selectionvalue: ri!TVP_App_Budget.approver3, selectionsaveinto: ri!approverList[3], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[4], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_UCPfinanceOps, selectionsaveinto: ri!approverList[4], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[5], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_businessAffairs, selectionsaveinto: ri!approverList[5], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[6], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_evpProduction, selectionsaveinto: ri!approverList[6], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[7], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_evpCurrentProg, selectionsaveinto: ri!approverList[7], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[8], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_cfoUcp, selectionsaveinto: ri!approverList[8], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[9], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_evpCableEntBa, selectionsaveinto: ri!approverList[9], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[10], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_presChiefCoUcp, selectionsaveinto: ri!approverList[10], height: "SHORT" ), a!userBrowserFieldColumns( label: cons!TVP_ApproverTitles[11], labelPosition: "ADJACENT", rootgroup: cons!TVP_folderId_chairmanNBCU, selectionsaveinto: ri!approverList[11], height: "SHORT" ) }, secondColumnContents: {} ) }, secondColumnContents: {}, buttons: a!buttonLayout( primaryButtons: { a!buttonWidgetSubmit( label: "Submit", style: "PRIMARY", confirmmessage: "Are you sure you want to submit this budget for email approval?", saveInto: {}, skipvalidation: false ) }, secondaryButtons: { a!buttonWidgetSubmit( label: "Cancel", style: "NORMAL", value: true, saveInto: ri!cancel, skipValidation: true ), a!buttonWidgetSubmit( label: "Save", style: "PRIMARY", value: true, saveInto: ri!resubmit, skipValidation: true ) } ), validations: {} )