Tuesday, 7 June 2016

FinancialYear and Quarter



Financial Year :

Form Methods: 



Class declaration:
public class FormRun extends ObjectRun
{
     str  Quarter;
     str  FY;
}

 ---------------------------
display str FYYear()
{
    return FY;
}

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


display str Quarter()
{
    return Quarter;
}
  -------------------------

Form > Data Source > filed Modified :

public void modified()
{
    int         a;
    TransDate   B;
    TransDate   transDate;
    ;
    a = mthOfYr(financialYear.DateMt);
    B = financialYear.DateMt;//dayOfYr(financialYear.DateMt);

    if(a >= 1 && a <= 3)
    {
        Quarter = "Q4";
        QuarterStr.text(Quarter);     //Variable From Form Field
    }
    else if (a >= 4 && a <= 6)
    {
        Quarter = "Q1";
        QuarterStr.text(Quarter);
    }
    else if (a >= 7 && a <= 9)
    {
        Quarter = "Q2";
        QuarterStr.text(Quarter);
    }
    else if (a >= 10 && a <= 12)
    {
        Quarter = "Q3";
        QuarterStr.text(Quarter);
    }
    // Financial Year Need to incorporate
    if(B >= mkDate(01,04,2013) && B <= mkDate(01,03,2014))
    {
        FY = "FY13-14";
        FYYearStr.text(FY);    // Variable from form fields
    }
    else if(B >= mkDate(01,04,2014) && B <= mkDate(01,03,2015))
    {
        FY = "FY14-15";
        FYYearStr.text(FY);
    }
    else if(B >= mkDate(01,04,2015) && B <= mkDate(01,03,2016))
    {
        FY = "FY15-16";
        FYYearStr.text(FY);
    }
    else if(B >= mkDate(01,04,2016) && B <= mkDate(01,03,2017))
    {
        FY = "FY16-17";
        FYYearStr.text(FY);
    }

    // super();
}

No comments:

Post a Comment