Zoho Deluge Useful Codes - 2

HTML Snippet for Dashboard

<%{

title = "BWI Impact Statistics";

className = "BWI_impact_statistics";

rec_list = BWI_impact_statistics[ID != 0];

%>

<style>

h2{

text-align:center;

}

.<%=className%>{

width:100%;

margin:1rem auto;

width:98%;

border:1px solid #edeef1;

}

.<%=className%>, .<%=className%> td, .<%=className%> th{

border-bottom:1px solid #edeef1;

border-collapse: collapse;

font-size:.95rem;

}

.<%=className%> th{

border-top:1px solid #edeef1;

}

.<%=className%> td, .<%=className%> th{

padding:.3rem .4rem;

text-align:center;

}

.<%=className%> th{

background-color:#f0f5fa;

}

</style>

<h2><%=title%></h2>

<table class=<%=className%>>

<tr>

<th>Batch</th>

<th>Target</th>

<th>Estimate</th>

<th>Achieved</th>

<th>Variance</th>

</tr>

<%

for each  rec in rec_list

{

%>

<tr>

<td><%=rec.Batch%></td>

<td><b><%=rec.Target%> <b></td>

<td><b><%=rec.Estimate%> <b></td>

<td><b><%=rec.Actual%> <b></td>

<td><b><%=rec.Variance%> <b></td>

</tr>

<%

}

%>

</table>

<%

}%>


-------------------------------------------------------------------------------------

<%{

title = "Reach Achieved in Millions";

className = "Reach_Achieved_in_Millions";

rec_list = Reach_achieved[ID != 0];

%>

<style>

h2{

text-align:center;

}

.<%=className%>{

width:100%;

margin:1rem auto;

width:98%;

border:1px solid #edeef1;

}

.<%=className%>, .<%=className%> td, .<%=className%> th{

border-bottom:1px solid #edeef1;

border-collapse: collapse;

font-size:.95rem;

}

.<%=className%> th{

border-top:1px solid #edeef1;

}

.<%=className%> td, .<%=className%> th{

padding:.3rem .4rem;

text-align:center;

}

.<%=className%> th{

background-color:#f0f5fa;

}

</style>

<h2><%=title%></h2>

<table class=<%=className%>>

<tr>

<th>Quarter</th>

<th>Achived in Millions</th>

</tr>

<%

for each  rec in rec_list

{

%>

<tr>

<td><b><%=rec.Quarter_on_Quarter%><b></td>

<td><%=rec.Achieved_in_millinons%></td>

</tr>

<%

}

%>

</table>

<%

}%>

-----------------------------------------------------------------------------------------------------------------------------

<%{

title = "LFA Status";

className = "LFA_Status";

rec_list = LFA_Form[ID != 0];

%>

<style>

    h2 {

        text-align: center;

    }


    .<%=className%> {

        width: 100%;

        margin: 1rem auto;

        width: 98%;

        border: 1px solid #edeef1;

    }


    .<%=className%>,

    .<%=className%> td,

    .<%=className%> th {

        border: 1px solid #edeef1; /* Add visible border */

        border-collapse: collapse;

        font-size: 0.95rem;

    }


    .<%=className%> th {

        border-top: 1px solid #edeef1;

    }


    .<%=className%> td,

    .<%=className%> th {

        padding: 0.3rem 0.4rem;

        text-align: center;

    }


    .<%=className%> th {

        background-color: #f0f5fa;

    }

</style>


<h2><%=title%></h2>

<table class=<%=className%>>

<tr>

<th>Project Name</th>

<th>LFA Status</th>

<th>Consultant</th>

<th>Senior Consultant</th>

<th>PMO</th>

</tr>

<%

for each  rec in rec_list

{

%>

<tr>

<td><b><%=rec.Project_Name%><b></td>

<td><%=rec.LFA_status%></td>

<td><%=rec.Escalation_Matrix.Project_Tracking.Resident.Name%></td>

<td><%=rec.Escalation_Matrix.Project_Tracking.Senior_Resident.Name%></td>

<td><%=rec.Escalation_Matrix.Project_Tracking.PMO.Name%></td>

</tr>

<%

}

%>

</table>

<%


}%>


Clarification Form>Created or Edited>Successful form submission>Redirect to NPO report

fet = Employee_Master[Email == zoho.loginuserid];

if(fet.count() == 0)

{

if(input.DIY != null)

{

diy_fet = DIY[ID == input.DIY];

if(diy_fet.Accept_Terms_and_Conditions == false)

{

openUrl("#Report:DIY_NPO_Report","same window");

}

}

if(input.DEEP_L1 != null)

{

deep_l1_fet = DEEP_L1[ID == input.DEEP_L1];

if(deep_l1_fet.Accept_Terms_and_Conditions == false)

{

openUrl("#Report:DEEP_L1_NPO_Report","same window");

}

}

if(input.DEEP_L2 != null)

{

deep_l2_fet = DEEP_L2[ID == input.DEEP_L2];

if(deep_l2_fet.Accept_Terms_and_Conditions == false)

{

openUrl("#Report:DEEP_L2_NPO_Report","same window");

}

}

}


DIY>Created or Edited>Load of the form>set_country

input.Registered_Address.country = "India";

DIY>Created or Edited>Load of the form>Sourcing Comments

if(zoho.loginuserid == "sourcing.1@gandhifellowship.org" || zoho.loginuserid == "sourcing.2@gandhifellowship.org")

{

//if(zoho.loginuserid == "syedaleem@hotmail.com")

show Sourcing_Comments;

}

else

{

hide Sourcing_Comments;

}


DIY>Created or Edited>Validations on form submission>On Validate Script

if(input.Accept_Terms_and_Conditions == true)

{

null_list = {""," ","null","Null","NULL",null};

if(input.PAN == "Yes" && Form_Status != "Draft")

{

if(input.PAN_Number in null_list || input.Upload_Pan in null_list)

{

alert(PAN_Number,"Kindly provide the PAN Number and Upload the PAN Doc");

cancel submit;

}

}

if(input.Registration_Certificate == "Yes")

{

if(input.Registration_Certificate_Number in null_list || input.Upload_Registration_Certificate_Number in null_list)

{

alert(Registration_Certificate_Number,"Kindly provide the Registration Certificate Number and Upload the Registration Certificate Doc");

cancel submit;

}

}

if(input.Renewed_80G_Number == "Yes")

{

if(input.Enter_Renewed_80G_Number in null_list || input.Upload_Renewed_80G_Number in null_list)

{

alert(Enter_Renewed_80G_Number,"Kindly provide the 80G Number and Upload the 80G Doc");

cancel submit;

}

}

if(input.Renewed_12A == "Yes")

{

if(input.Renewed_12A_Number in null_list || input.Upload_Renewed_12A_Number in null_list)

{

alert(Renewed_12A_Number,"Kindly provide the 12A Number and Upload the 12A Doc");

cancel submit;

}

}

if(input.FCRA == "Yes")

{

if(input.Enter_FCRA_Number in null_list || input.Upload_FCRA in null_list)

{

alert(Enter_FCRA_Number,"Kindly provide the FCRA Number and Upload the FCRA Doc");

cancel submit;

}

}

/*if(input.Availability_of_Audited_Financial_Statements_For_Previous_2_Years == "Yes")

{

if(input.Audited_Financial_Statements_For_Year_Before_Last_Year in null_list)

{

alert(Audited_Financial_Statements_For_Year_Before_Last_Year,"Kindly upload the Audited Financial Statements For Year Before Last Year Doc");

cancel submit;

}

}

if(input.Availability_of_Audited_Financial_Statements_For_Previous_2_Years == "Yes")

{

if(input.Audited_Financial_Statements_For_Year_Before_Last_Year in null_list || input.Audited_Financial_Statements_For_Last_Year in null_list)

{

alert(Audited_Financial_Statements_For_Year_Before_Last_Year,"Kindly upload the Audited Financial Statements For Year Before Last Year and Audited Financial Statements For Last Year Doc");

cancel submit;

}

}*/

/*if(input.Availability_of_Annual_Reports_For_Previous_2_Years == "Yes")

{

if(input.Availability_of_Annual_Reports_For_Year_Before_Last_Year in null_list || input.Availability_of_Annual_Reports_For_Last_Year in null_list)

{

alert(Availability_of_Annual_Reports_For_Year_Before_Last_Year,"Kindly upload the Availability of Annual Reports For Year Before Last Year and Availability of Annual Reports For Last Year Doc");

cancel submit;

}

}

if(input.Compliant_with_Income_Tax_Return_Filing_For_Previous_2_Years == "Yes")

{

if(input.Income_Tax_Return_Filing_For_Year_Before_Last_Year in null_list || input.Income_Tax_Return_Filing_For_Last_Year in null_list)

{

alert(Income_Tax_Return_Filing_For_Year_Before_Last_Year,"Kindly upload the Income Tax Return Filing For Year Before Last Year and Income Tax Return Filing For Last Year Doc");

cancel submit;

}

}*/

/*if(input.Signature in null_list)

{

alert(Signature,"Signature field cannot be empty, once the terms and condition are accepted.");

cancel submit;

}*/

if(input.Legal_Name_If_Different_From_Above.isEmpty())

{

alert(Legal_Name_If_Different_From_Above,"This field cannot be empty.");

cancel submit;

}

if(input.A4_Year_Of_Establishment.isEmpty())

{

alert(A4_Year_Of_Establishment,"This field cannot be empty.");

cancel submit;

}

if(input.Registered_Address.isEmpty())

{

alert(Registered_Address,"This field cannot be empty.");

cancel submit;

}

if(input.PAN.isEmpty())

{

alert(PAN,"This field cannot be empty.");

cancel submit;

}

if(input.Registration_Certificate.isEmpty())

{

alert(Registration_Certificate,"This field cannot be empty.");

cancel submit;

}

if(input.Renewed_80G_Number.isEmpty())

{

alert(Renewed_80G_Number,"This field cannot be empty.");

cancel submit;

}

if(input.Renewed_12A.isEmpty())

{

alert(Renewed_12A,"This field cannot be empty.");

cancel submit;

}

if(input.FCRA.isEmpty())

{

alert(FCRA,"This field cannot be empty.");

cancel submit;

}

if(input.Availability_of_Audited_Financial_Statements_For_Previous_2_Years.isEmpty())

{

alert(Availability_of_Audited_Financial_Statements_For_Previous_2_Years,"This field cannot be empty.");

cancel submit;

}

if(input.Compliant_with_Income_Tax_Return_Filing_For_Previous_2_Years.isEmpty())

{

alert(Compliant_with_Income_Tax_Return_Filing_For_Previous_2_Years,"This field cannot be empty.");

cancel submit;

}

if(input.Nominated_Person_Name.isEmpty())

{

alert(Nominated_Person_Name,"This field cannot be empty.");

cancel submit;

}

for each  rec in input.Section_B_Team_Details

{

if(rec.Role == "Details of NPO Nominated Person")

{

if(rec.Phone_Number.isEmpty())

{

alert "NPO nominated person phone number field cannot be empty.";

cancel submit;

}

if(rec.Email_ID.isEmpty())

{

alert "NPO nominated person email cannot be empty.";

cancel submit;

}

}

}

if(input.Educational_Qualification_Of_Nominated_Person.isEmpty())

{

alert(Educational_Qualification_Of_Nominated_Person,"This field cannot be empty.");

cancel submit;

}

if(input.Total_work_experience_in_years.isEmpty())

{

alert(Total_work_experience_in_years,"This field cannot be empty.");

cancel submit;

}

if(input.Vintage_in_Organisation_years_and_role.isEmpty())

{

alert(Vintage_in_Organisation_years_and_role,"This field cannot be empty.");

cancel submit;

}

if(input.Has_Good_Communication_Skills.isEmpty())

{

alert(Has_Good_Communication_Skills,"This field cannot be empty.");

cancel submit;

}

if(input.Has_familiarity_with_technology.isEmpty())

{

alert(Has_familiarity_with_technology,"This field cannot be empty.");

cancel submit;

}

if(input.Has_Deep_Understanding_About_The_Program_Function_Related_To_Bwi_Project.isEmpty())

{

alert(Has_Deep_Understanding_About_The_Program_Function_Related_To_Bwi_Project,"This field cannot be empty.");

cancel submit;

}

if(input.Attach_NPO_Nominated_resource_person_Bio1.isEmpty())

{

alert(Attach_NPO_Nominated_resource_person_Bio1,"This field cannot be empty.");

cancel submit;

}

//Impact Statistics

isCompleteReach = false;

isCompleteImpact = false;

for each  impact in input.Key_Indicators_Restructured

{

if(impact.Indicator == "Impact" && impact.Indicator_Measured not in null_list && impact.FY1_Past1 != null && impact.FY2_Past_2 != null && impact.FY3_CY_Provisional != null && impact.FY4_Projected_1 != null && impact.FY5_Projected_2 != null)

{

isCompleteReach = true;

}

if(impact.Indicator == "Reach" && impact.Indicator_Measured.trim() not in null_list && impact.FY1_Past1 != null && impact.FY2_Past_2 != null && impact.FY3_CY_Provisional != null && impact.FY4_Projected_1 != null && impact.FY5_Projected_2 != null)

{

isCompleteImpact = true;

}

}

if(isCompleteReach == false || isCompleteImpact == false)

{

alert 'Please enter all details for reach and atleast one for impact indicator in C9.Impact Statisctics to continue.';

cancel submit;

}

//DIY End Beneficiary

isCompleteProcessBeneficiary = false;

isCompleteReachBeneficiary = false;

for each  beneficiary in input.DIY_End_Beneficiary_Restructured

{

if(beneficiary.Indicator == "Process Transformation" && beneficiary.Indicator_Measured.trim() not in null_list && beneficiary.FY3_CY_Projected != null && beneficiary.FY4_Projected_1 != null && beneficiary.FY5_Projected_2 != null)

{

isCompleteProcessBeneficiary = true;

}

if(beneficiary.Indicator == "Reach" && beneficiary.Indicator_Measured.trim() not in null_list && beneficiary.FY3_CY_Projected != null && beneficiary.FY4_Projected_1 != null && beneficiary.FY5_Projected_2 != null)

{

isCompleteReachBeneficiary = true;

}

}

if(isCompleteProcessBeneficiary == false || isCompleteReachBeneficiary == false)

{

alert 'Please enter all details for reach and atleast one for Process Transformation Indicator in D6. DIY End Beneficiary.';

cancel submit;

}

}


DIY>Created or Edited>Successful form submission>On Submit Script

//Section B - Hidden //C8_Annual_Income_Hidden //C9_Reach_Hidden

// info "Hi";

for each  rec in input.Section_B_Team_Details

{

if(rec.SL_No = 1)

{

input.Applicant_Filling_Form = ifnull(rec.Name,"");

input.Applicant_Designation = ifnull(rec.Designation,"");

input.Applicant_Email = ifnull(rec.Email_ID,"");

input.Applicant_Mobile = ifnull(rec.Phone_Number,"");

}

else if(rec.SL_No = 2)

{

input.NPO_Head_Name = ifnull(rec.Name,"");

input.NPO_Head_Designation = ifnull(rec.Designation,"");

input.NPO_Head_Email = ifnull(rec.Email_ID,"");

input.NPO_Head_Mobile = ifnull(rec.Phone_Number,"");

}

else if(rec.SL_No = 3)

{

input.Champion_Name = ifnull(rec.Name,"");

input.Champion_Designation = ifnull(rec.Designation,"");

input.Champion_Email = ifnull(rec.Email_ID,"");

input.Champion_Mobile = ifnull(rec.Phone_Number,"");

}

else if(rec.SL_No = 4)

{

input.Nominated_Person_Name1 = ifnull(rec.Name,"");

input.Nominated_Person_Designation = ifnull(rec.Designation,"");

input.Nominated_Person_Email = ifnull(rec.Email_ID,"");

input.Nominated_Person_Phone = ifnull(rec.Phone_Number,"");

}

}

for each  rec2 in input.Funding_Details

{

if(rec2.Details == "Annual Income (In Cr)")

{

input.AI_FY1_Past1 = ifnull(rec2.FY1_Past1,0).toNumber();

input.AI_FY2_Past2 = ifnull(rec2.FY2_Past2,0).toNumber();

input.AI_FY3_CY_Provisional = ifnull(rec2.FY3_CY_Provisional,0).toNumber();

input.AI_FY4_Projected1 = ifnull(rec2.FY4_Projected1,0).toNumber();

input.AI_FY5_Projected2 = ifnull(rec2.FY5_Projected2,0).toNumber();

if((input.AI_FY2_Past2 + input.AI_FY1_Past1) / 2 != 0)

{

input.Avg_Budget_Past = ifnull((input.AI_FY3_CY_Provisional - (input.AI_FY2_Past2 + input.AI_FY1_Past1) / 2) / ((input.AI_FY2_Past2 + input.AI_FY1_Past1) / 2).round(2),0) * 100;

}

if(input.AI_FY3_CY_Provisional != 0)

{

input.Avg_Budget_Growth = ifnull((((input.AI_FY4_Projected1 + input.AI_FY5_Projected2) / 2 - input.AI_FY3_CY_Provisional) / input.AI_FY3_CY_Provisional).round(2),0) * 100;

}

}

}

for each  rec3 in input.Key_Indicators_Restructured

{

if(rec3.Indicator == "Reach")

{

input.Reach_FY1_Past_1 = ifnull(rec3.FY1_Past1,0).toNumber();

input.Reach_FY2_Past_2 = ifnull(rec3.FY2_Past_2,0).toNumber();

input.Reach_FY3_CY_Provisional = ifnull(rec3.FY3_CY_Provisional,0).toNumber();

input.Reach_FY4_Projected = ifnull(rec3.FY4_Projected_1,0).toNumber();

input.Reach_FY5_Projected_2 = ifnull(rec3.FY5_Projected_2,0).toNumber();

if((input.Reach_FY1_Past_1 + input.Reach_FY2_Past_2) / 2 != 0)

{

input.Avg_Beneficiary_Past = ifnull((input.Reach_FY3_CY_Provisional - (input.Reach_FY1_Past_1 + input.Reach_FY2_Past_2) / 2) / ((input.Reach_FY1_Past_1 + input.Reach_FY2_Past_2) / 2).round(2),0) * 100;

}

if(input.Reach_FY3_CY_Provisional != 0)

{

input.Avg_Beneficiary_Growth = ifnull((((input.Reach_FY1_Past_1 + input.Reach_FY2_Past_2) / 2 - input.Reach_FY3_CY_Provisional) / input.Reach_FY3_CY_Provisional).round(2),0) * 100;

}

}

}

// info input.Applicant_Filling_Form;

----------------------------------------------------------------------------------------------------------------------------
null_list = {""," ","null","Null","NULL",null};
if(input.Org_Risk_Assessment not in null_list && input.Infra_Challenges not in null_list && input.Project_Sustainability not in null_list && input.Project_Risk_Assessment not in null_list && input.Project_Fitment not in null_list && input.Communication_and_Comprehension not in null_list && input.Resource_Fitment not in null_list && input.Eagerness_Drive_Adoption not in null_list && input.IT_Savvy not in null_list && input.MOU_Sent == false)
{
for each  rec1 in input.Funding_Details
{
if(rec1.Details == "Annual Income (In Cr)")
{
input.Budget_Year_2_Years = ifnull(rec1.FY1_Past1,0);
input.Budget_Year_1_Years = ifnull(rec1.FY2_Past2,0);
input.Budget_Year = ifnull(rec1.FY3_CY_Provisional,0);
input.Budget_Year_1_Years1 = ifnull(rec1.FY4_Projected1,0);
input.Budget_Year_2_Years1 = ifnull(rec1.FY5_Projected2,0);
}
}
input.Beneficiary_Key_Indicators = input.Key_Indicators_Restructured.Indicator_Measured.getall();
for each  rec2 in input.Key_Indicators_Restructured
{
if(rec2.Indicator == "Reach")
{
input.Beneficiary_Reach_2_Years = rec2.FY1_Past1;
input.Beneficiary_Reach_1_Years = rec2.FY2_Past_2;
input.Beneficiary_Reach = rec2.FY3_CY_Provisional;
input.Beneficiary_Reach_1_Years1 = rec2.FY4_Projected_1;
input.Beneficiary_Reach_2_Years1 = rec2.FY5_Projected_2;
}
}
for each  rec3 in input.DIY_End_Beneficiary_Restructured
{
if(rec3.Indicator == "Reach")
{
input.Total_Project_End_Beneficiary_reach = ifnull(rec3.FY3_CY_Projected,0);
input.Total_Project_End_Beneficiary_reach_1_Years = ifnull(rec3.FY4_Projected_1,0);
input.Total_Project_End_Beneficiary_reach_2_Years = ifnull(rec3.FY5_Projected_2,0);
// input.Beneficiary_P1_CY = input.DIY_End_Beneficiary_Restructured.sum(FY3_CY_Projected);
// input.Beneficiary_P1_Projected_1 = input.DIY_End_Beneficiary_Restructured.sum(FY4_Projected_1);
// input.Beneficiary_P1_Projected_2 = input.DIY_End_Beneficiary_Restructured.sum(FY5_Projected_2);
input.Beneficiary_P1_CY = ifnull(rec3.FY3_CY_Projected,0);
input.Beneficiary_P1_Projected_1 = ifnull(rec3.FY4_Projected_1,0);
input.Beneficiary_P1_Projected_2 = ifnull(rec3.FY5_Projected_2,0);
}
}
//--------------------------------------------------------------------------------------------------------------------------------
input.Average_Budget_Past = ifnull((input.Budget_Year - (input.Budget_Year_2_Years + input.Budget_Year_1_Years) / 2) / ((input.Budget_Year_2_Years + input.Budget_Year_1_Years) / 2).round(2),0) * 100;
input.Average_Budget_Growth = ifnull((((input.Budget_Year_2_Years1 + input.Budget_Year_1_Years1) / 2 - input.Budget_Year) / input.Budget_Year).round(2),0) * 100;
input.Budget_Growth_Current = ifnull(input.Budget_Year,0);
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Average_Budget_Past <= 0)
{
input.Past_Budget_Points = 0;
}
else if(input.Average_Budget_Past > 0 && input.Average_Budget_Past < 5)
{
input.Past_Budget_Points = 1;
}
else if(input.Average_Budget_Past >= 5 && input.Average_Budget_Past < 25)
{
input.Past_Budget_Points = 2;
}
else if(input.Average_Budget_Past >= 25)
{
input.Past_Budget_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Average_Budget_Growth <= 0)
{
input.Budget_Growth_Points = 0;
}
else if(input.Average_Budget_Growth > 0 && input.Average_Budget_Growth < 5)
{
input.Budget_Growth_Points = 1;
}
else if(input.Average_Budget_Growth >= 5 && input.Average_Budget_Growth < 25)
{
input.Budget_Growth_Points = 2;
}
else if(input.Average_Budget_Growth >= 25)
{
input.Budget_Growth_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Budget_Growth_Current < 1)
{
input.Budget_Current_Points = 0;
}
else if(input.Budget_Growth_Current >= 1 && input.Budget_Growth_Current < 3)
{
input.Budget_Current_Points = 1;
}
else if(input.Budget_Growth_Current >= 3 && input.Budget_Growth_Current < 6)
{
input.Budget_Current_Points = 2;
}
else if(input.Budget_Growth_Current >= 6)
{
input.Budget_Current_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
input.Average_Beneficiary_Past = ifnull((input.Beneficiary_Reach - (input.Beneficiary_Reach_2_Years + input.Beneficiary_Reach_1_Years) / 2) / ((input.Beneficiary_Reach_2_Years + input.Beneficiary_Reach_1_Years) / 2),0) * 100;
input.Average_Beneficiary_Growth = ifnull(((input.Beneficiary_Reach_1_Years1 + input.Beneficiary_Reach_2_Years1) / 2 - input.Beneficiary_Reach) / input.Beneficiary_Reach,0) * 100;
input.Average_Beneficiary_P1_Growth = ifnull(((input.Beneficiary_P1_Projected_1 + input.Beneficiary_P1_Projected_2) / 2 - input.Beneficiary_P1_CY) / input.Beneficiary_P1_CY,0);
input.Beneficiary_Reach_Current = ifnull(input.Beneficiary_Reach,0);
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Average_Beneficiary_Past <= 0)
{
input.Beneficiary_Past_Points = 0;
}
else if(input.Average_Beneficiary_Past > 0 && input.Average_Beneficiary_Past < 5)
{
input.Beneficiary_Past_Points = 1;
}
else if(input.Average_Beneficiary_Past >= 5 && input.Average_Beneficiary_Past < 25)
{
input.Beneficiary_Past_Points = 2;
}
else if(input.Average_Beneficiary_Past >= 25)
{
input.Beneficiary_Past_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Average_Beneficiary_Growth <= 0)
{
input.Beneficiary_Growth_Points = 0;
}
else if(input.Average_Beneficiary_Growth > 0 && input.Average_Beneficiary_Growth < 5)
{
input.Beneficiary_Growth_Points = 1;
}
else if(input.Average_Beneficiary_Growth >= 5 && input.Average_Beneficiary_Growth < 25)
{
input.Beneficiary_Growth_Points = 2;
}
else if(input.Average_Beneficiary_Growth >= 25)
{
input.Beneficiary_Growth_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Beneficiary_Reach_Current < 10000)
{
input.Beneficiary_Current_Points = 0;
}
else if(input.Beneficiary_Reach_Current >= 10000 && input.Beneficiary_Reach_Current < 25000)
{
input.Beneficiary_Current_Points = 1;
}
else if(input.Beneficiary_Reach_Current >= 25000 && input.Beneficiary_Reach_Current < 50000)
{
input.Beneficiary_Current_Points = 2;
}
else if(input.Beneficiary_Reach_Current >= 50000)
{
input.Beneficiary_Current_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
average_project_beneficiary_growth_percent = ifnull(((input.Total_Project_End_Beneficiary_reach_1_Years + input.Total_Project_End_Beneficiary_reach_2_Years) / 2 - input.Total_Project_End_Beneficiary_reach) / input.Total_Project_End_Beneficiary_reach,0);
//--------------------------------------------------------------------------------------------------------------------------------
if(input.No_Of_States_Present_In1 >= 1 && input.No_Of_States_Present_In1 <= 2)
{
input.States_Points = 1;
}
else if(input.No_Of_States_Present_In1 >= 3 && input.No_Of_States_Present_In1 <= 5)
{
input.States_Points = 2;
}
else if(input.No_Of_States_Present_In1 > 5)
{
input.States_Points = 3;
}
else
{
input.States_Points = 0;
}
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Total_Employee <= 10)
{
input.Team_Strength_Points = 0;
}
else if(input.Total_Employee >= 11 && input.Total_Employee <= 30)
{
input.Team_Strength_Points = 1;
}
else if(input.Total_Employee >= 31 && input.Total_Employee <= 50)
{
input.Team_Strength_Points = 2;
}
else if(input.Total_Employee >= 51)
{
input.Team_Strength_Points = 3;
}
//--------------------------------------------------------------------------------------------------------------------------------
input.Org = ifnull(ifnull(input.Past_Budget_Points.toNumber(),0) + ifnull(input.Budget_Growth_Points.toNumber(),0) + ifnull(input.Budget_Current_Points.toNumber(),0) + ifnull(input.Beneficiary_Past_Points.toNumber(),0) + ifnull(input.Beneficiary_Growth_Points.toNumber(),0) + ifnull(input.Beneficiary_Current_Points.toNumber(),0) + ifnull(input.States_Points.toNumber(),0) + ifnull(input.Team_Strength_Points.toNumber(),0) + ifnull(input.Org_Risk_Assessment.toNumber(),0),0) / 27 * 100;
input.Product = ifnull(input.Infra_Challenges.toNumber() + input.Project_Sustainability.toNumber() + input.Project_Risk_Assessment.toNumber() + input.Project_Fitment.toNumber(),0) / 12 * 100;
input.Resource = ifnull(input.Communication_and_Comprehension.toNumber() + input.Resource_Fitment.toNumber() + input.IT_Savvy.toNumber(),0) / 9 * 100;
input.NPO_Points = ifnull((input.Org.toNumber() + input.Product.toNumber() + input.Resource.toNumber()) / 3,0);
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Budget_Growth_Current < 10000000)
{
input.F_Range = "Upto 1";
}
else if(input.Budget_Growth_Current >= 10000000 && input.Budget_Growth_Current < 40000000)
{
input.F_Range = "1-4";
}
else if(input.Budget_Growth_Current >= 40000000 && input.Budget_Growth_Current < 100000000)
{
input.F_Range = "4-10";
}
else if(input.Budget_Growth_Current >= 10000000 && input.Budget_Growth_Current < 20000000)
{
input.F_Range = "10-20";
}
//--------------------------------------------------------------------------------------------------------------------------------
if(input.Beneficiary_Reach_Current < 10000)
{
input.F_Range = "Below 10K";
}
else if(input.Beneficiary_Reach_Current >= 10000 && input.Beneficiary_Reach_Current < 50000)
{
input.F_Range = "10-50K";
}
else if(input.Beneficiary_Reach_Current >= 50000 && input.Beneficiary_Reach_Current < 100000)
{
input.F_Range = "50k-1L";
}
else if(input.Beneficiary_Reach_Current >= 100000)
{
input.F_Range = "Above 1L";
}
}
//--------------------------------------------------------------------------------------------------------------------------------
// input.Beneficiary_P1_CY = input.DIY_End_Beneficiary_Restructured.sum(FY3_CY_Projected);
// input.Beneficiary_P1_Projected_1 = input.DIY_End_Beneficiary_Restructured.sum(FY4_Projected_1);
// input.Beneficiary_P1_Projected_2 = input.DIY_End_Beneficiary_Restructured.sum(FY5_Projected_2);
if(input.Action_field = "MOU Sent" && input.MOU_Signed_Date.isempty())
{
input.MOU_Signed = true;
input.MOU_Signed_Date = zoho.currentdate;
emp_fet = Employee_Master[Role == "Sourcing Admin"].Email.getAll();
sendmail
[
from :zoho.adminuserid
to :emp_fet
subject :"MOU Sign by " + input.Name_Of_Organisation
message :"<a href=\"https://creatorapp.zoho.com" + zoho.appuri + "#Report:DIY_SA_Report?ID=" + input.ID + "\">Click to View</a>"
]
}
if(input.Action_field = "MOU Sent For Counter Sign" && input.MOU_Counter_Signed_Date.isempty())
{
input.MOU_Counter_Signed = true;
input.MOU_Counter_Signed_Date = zoho.currentdate;
}
input.Action_field = "";

-----------------------------------------------------------------------------------------------------------------------------

if(input.Accept_Terms_and_Conditions == true)
{
input.Form_Status = "Submitted";
input.Portal_User_Email_ID = zoho.loginuserid;
emp_fet = Employee_Master[Role == "Sourcing Admin"].Email.getAll();
sendmail
[
from :zoho.adminuserid
to :emp_fet
subject :"DIY Submitted by " + input.Name_Of_Organisation
message :"<a href=\"https://creatorapp.zoho.com" + zoho.appuri + "#Report:DIY_SA_Report?ID=" + input.ID + "\">Click to View</a>"
]
if(input.Clarification_raised == "Clarification Raised")
{
input.Clarification_raised = "Clarification Sorted";
}
}

-----------------------------------------------------------------------------------------------------------------------------

fet = Employee_Master[Email == zoho.loginuserid];
if(fet.count() == 0)
{
openUrl("#Report:DIY_NPO_Report","same window");
}

-----------------------------------------------------------------------------------------------------------------------------

null_list = {""," ","null","Null","NULL",null};
if(input.Org_Risk_Assessment not in null_list && input.Infra_Challenges not in null_list && input.Project_Sustainability not in null_list && input.Project_Risk_Assessment not in null_list && input.Project_Fitment not in null_list && input.Communication_and_Comprehension not in null_list && input.Resource_Fitment not in null_list && input.Eagerness_Drive_Adoption not in null_list && input.IT_Savvy not in null_list && input.MOU_Sent == false)
{
input.Org = ifnull(ifnull(input.Past_Budget_Points.toNumber(),0) + ifnull(input.Budget_Growth_Points.toNumber(),0) + ifnull(input.Budget_Current_Points.toNumber(),0) + ifnull(input.Beneficiary_Past_Points.toNumber(),0) + ifnull(input.Beneficiary_Growth_Points.toNumber(),0) + ifnull(input.Beneficiary_Current_Points.toNumber(),0) + ifnull(input.States_Points.toNumber(),0) + ifnull(input.Team_Strength_Points.toNumber(),0) + ifnull(input.Org_Risk_Assessment.toNumber(),0),0) / 27 * 100;
input.Product = ifnull(input.Infra_Challenges.toNumber() + input.Project_Sustainability.toNumber() + input.Project_Risk_Assessment.toNumber() + input.Project_Fitment.toNumber(),0) / 12 * 100;
input.Resource = ifnull(input.Communication_and_Comprehension.toNumber() + input.Resource_Fitment.toNumber() + input.IT_Savvy.toNumber(),0) / 9 * 100;
input.NPO_Points = ifnull((input.Org.toNumber() + input.Product.toNumber() + input.Resource.toNumber()) / 3,0);
}

-----------------------------------------------------------------------------------------------------------------------------

Expression of Interest Form>Created or Edited>Load of the form>Hide Sections

hide Details_Of_Alternate_Contact;

-----------------------------------------------------------------------------------------------------------------------------

Task Extension Request Form>Created or Edited>Successful form submission>On Submit Script

if(input.Status == "Accepted By SR" && PMO_Approval_Required == false)
{
task_list_fet = Task_List[ID == input.Task_List];
task_list_fet.Old_End_Date=task_list_fet.End_Date;
task_list_fet.End_Date=input.End_Date;
sendmail
[
from :zoho.adminuserid
to :input.Added_User.Email
subject :"Extension Request for the task : " + task_list_fet.Task.Task_Name + " has been accepted by " + Employee_Master[Email == zoho.loginuserid].Name
message :"<a href=\"https://betterworldinitiative.zohocreatorportal.com/#Report:Task_Lists_Report?ID=" + input.ID + "\">Click To View Record</a>"
]
}
else if(input.Status == "Accepted By SR" && PMO_Approval_Required == true)
{
task_list_fet = Task_List[ID == input.Task_List];
sendmail
[
from :zoho.adminuserid
to :input.PMO.Email
subject :"Extension Request for the task : " + task_list_fet.Task.Task_Name + " has been accepted by " + Employee_Master[Email == zoho.loginuserid].Name
message :"Extension Request has been approve by SR. kindly proceed with your approval.<a href=\"https://creatorapp.zoho.com" + zoho.appuri + "#Report:All_Task_Lists_Report?ID=" + input.ID + "\">Click To View Record</a>"
]
}
else if(input.Status == "Accepted By PMO" && PMO_Approval_Required == true)
{
task_list_fet = Task_List[ID == input.Task_List];
task_list_fet.Old_End_Date=task_list_fet.End_Date;
task_list_fet.End_Date=input.End_Date;
sendmail
[
from :zoho.adminuserid
to :input.Added_User.Email
subject :"Extension Request for the task : " + task_list_fet.Task.Task_Name + " has been accepted by " + Employee_Master[Email == zoho.loginuserid].Name
message :"<a href=\"https://betterworldinitiative.zohocreatorportal.com/#Report:Task_Lists_Report?ID=" + input.ID + "\">Click To View Record</a>"
]
}
else
{
task_list_fet = Task_List[ID == input.Task_List];
sendmail
[
from :zoho.adminuserid
to :input.Added_User.Email
subject :"Extension Request for the task : " + task_list_fet.Task.Task_Name + " has been rejected by " + Employee_Master[Email == zoho.loginuserid].Name
message :"<a href=\"https://betterworldinitiative.zohocreatorportal.com/#Report:Task_Lists_Report?ID=" + input.ID + "\">Click To View Record</a>"
]
}








































Comments