Example usage for org.apache.commons.lang3.mutable MutableDouble doubleValue

List of usage examples for org.apache.commons.lang3.mutable MutableDouble doubleValue

Introduction

In this page you can find the example usage for org.apache.commons.lang3.mutable MutableDouble doubleValue.

Prototype

@Override
public double doubleValue() 

Source Link

Document

Returns the value of this MutableDouble as a double.

Usage

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dTermCredits(View mSAProf, String InternalEntityStructure, String InternalAttribStructure,
        Integer GetOrSetFlag) {/*from ww  w .  j  ava  2 s . c o  m*/
    zVIEW mSAProf2 = new zVIEW();
    //:DECIMAL dAmount 
    double dAmount = 0.0;
    int RESULT = 0;
    double dTempDecimal_0 = 0.0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:CreateViewFromView ( mSAProf2, mSAProf )
        CreateViewFromView(mSAProf2, mSAProf);

        //:dAmount = 0
        dAmount = 0;
        //:// Sum PeriodTransApplied where they credits, not charges.
        //:FOR EACH mSAProf2.PeriodTransApplied WHERE mSAProf2.PeriodSATransactionCode.Type = "R" 
        RESULT = mSAProf2.cursor("PeriodTransApplied").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            if (CompareAttributeToString(mSAProf2, "PeriodSATransactionCode", "Type", "R") == 0) {
                //://WHERE mSAProf2.StudentAccountTransApplied.Amount > 0
                //:dAmount = dAmount + mSAProf2.PeriodTransApplied.Amount 
                {
                    MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                    GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf2, "PeriodTransApplied", "Amount");
                    dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                }
                dAmount = dAmount + dTempDecimal_0;
            }

            RESULT = mSAProf2.cursor("PeriodTransApplied").setNextContinue().toInt();
            ;
        }

        //:END 
        //:DropView( mSAProf2 ) 
        DropView(mSAProf2);
        //:StoreValueInRecord( mSAProf, InternalEntityStructure, 
        //:                    InternalAttribStructure, dAmount, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dAmount, 0);
        break;
    //:   /* end zDERIVED_GET */
    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:      /* end zDERIVED_SET */
    //:END   /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dTermCreditsNoCashD(View mSAProf, String InternalEntityStructure,
        String InternalAttribStructure, Integer GetOrSetFlag) {
    zVIEW mSAProf2 = new zVIEW();
    //:DECIMAL dAmount 
    double dAmount = 0.0;
    int RESULT = 0;
    double dTempDecimal_0 = 0.0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:CreateViewFromView ( mSAProf2, mSAProf )
        CreateViewFromView(mSAProf2, mSAProf);

        //:dAmount = 0
        dAmount = 0;//from   www. j av a2s  .  c o m
        //:// Sum PeriodTransApplied where they credits, not charges.
        //:// Do not include the cash discount transaction.
        //:FOR EACH mSAProf2.PeriodTransApplied WHERE mSAProf2.PeriodSATransactionCode.Type = "R" 
        RESULT = mSAProf2.cursor("PeriodTransApplied").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            if (CompareAttributeToString(mSAProf2, "PeriodSATransactionCode", "Type", "R") == 0) {
                //:IF mSAProf2.PeriodSATransactionCode.TransactionCode != "CASHDISC" 
                if (CompareAttributeToString(mSAProf2, "PeriodSATransactionCode", "TransactionCode",
                        "CASHDISC") != 0) {
                    //:dAmount = dAmount + mSAProf2.PeriodTransApplied.Amount 
                    {
                        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                        GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf2, "PeriodTransApplied", "Amount");
                        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                    }
                    dAmount = dAmount + dTempDecimal_0;
                }

            }

            RESULT = mSAProf2.cursor("PeriodTransApplied").setNextContinue().toInt();
            ;
            //:END
        }

        //:END 
        //:DropView( mSAProf2 ) 
        DropView(mSAProf2);
        //:StoreValueInRecord( mSAProf, InternalEntityStructure, 
        //:                    InternalAttribStructure, dAmount, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dAmount, 0);
        break;
    //:   /* end zDERIVED_GET */
    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:      /* end zDERIVED_SET */
    //:END   /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dCreditsEnComp(View mSAProf, String InternalEntityStructure, String InternalAttribStructure,
        Integer GetOrSetFlag) {/*from  ww w.  j  av a 2s . co  m*/
    zVIEW mSAProf2 = new zVIEW();
    //:DECIMAL dTotalCredits 
    double dTotalCredits = 0.0;
    int RESULT = 0;
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:// Total the credit hours that will be billable. Note that a Class dropped after the
        //:// Dropped Date for the Term will be added here.
        //:CreateViewFromView ( mSAProf2, mSAProf )
        CreateViewFromView(mSAProf2, mSAProf);
        //:NAME VIEW mSAProf2 "mSAProf2"
        SetNameForView(mSAProf2, "mSAProf2", null, zLEVEL_TASK);
        //:dTotalCredits = 0
        dTotalCredits = 0;
        //:FOR EACH mSAProf2.TermEnrolled 
        RESULT = mSAProf2.cursor("TermEnrolled").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mSAProf2.TermEnrolled.Status ="T"  OR mSAProf2.TermEnrolled.Status ="C" 
            if (CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "T") == 0
                    || CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "C") == 0) {
                //:dTotalCredits = dTotalCredits + mSAProf2.TermEnrolled.CreditHours 
                {
                    MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                    GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf2, "TermEnrolled", "CreditHours");
                    dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                }
                dTotalCredits = dTotalCredits + dTempDecimal_0;
                //:ELSE
            } else {
                //:IF mSAProf2.TermEnrolled.Status ="D" OR mSAProf2.TermEnrolled.Status ="W" 
                if (CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "D") == 0
                        || CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "W") == 0) {
                    //:IF mSAProf2.TermEnrolled.DroppedDate > mSAProf2.PeriodCollegeTerm.AddDropDeadlineDate 
                    if (CompareAttributeToAttribute(mSAProf2, "TermEnrolled", "DroppedDate", mSAProf2,
                            "PeriodCollegeTerm", "AddDropDeadlineDate") > 0) {
                        //:dTotalCredits = dTotalCredits + mSAProf2.TermEnrolled.CreditHours
                        {
                            MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
                            GetDecimalFromAttribute(md_dTempDecimal_1, mSAProf2, "TermEnrolled", "CreditHours");
                            dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
                        }
                        dTotalCredits = dTotalCredits + dTempDecimal_1;
                    }

                    //:END
                }

                //:END
            }

            RESULT = mSAProf2.cursor("TermEnrolled").setNextContinue().toInt();
            ;
            //:END
        }

        //:END
        //:DropView( mSAProf2 ) 
        DropView(mSAProf2);
        //:StoreValueInRecord( mSAProf, InternalEntityStructure, 
        //:                    InternalAttribStructure, dTotalCredits, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dTotalCredits, 0);
        break;
    //:   /* end zDERIVED_GET */
    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:      /* end zDERIVED_SET */
    //:END   /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dCreditsDirectedStudy(View mSAProf, String InternalEntityStructure,
        String InternalAttribStructure, Integer GetOrSetFlag) {
    zVIEW mSAProf2 = new zVIEW();
    //:DECIMAL dTotalCredits 
    double dTotalCredits = 0.0;
    int RESULT = 0;
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:// Total the Directed Study credit hours that will be billable. Note that a Class dropped after the
        //:// Dropped Date for the Term will be added here.
        //:CreateViewFromView ( mSAProf2, mSAProf )
        CreateViewFromView(mSAProf2, mSAProf);
        //:NAME VIEW mSAProf2 "mSAProf2"
        SetNameForView(mSAProf2, "mSAProf2", null, zLEVEL_TASK);
        //:dTotalCredits = 0
        dTotalCredits = 0;//from   w  w w.j a  v  a 2 s  .  co  m
        //:FOR EACH mSAProf2.TermEnrolled 
        RESULT = mSAProf2.cursor("TermEnrolled").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mSAProf2.TermClass.DirectedStudyFlag = "Y"
            if (CompareAttributeToString(mSAProf2, "TermClass", "DirectedStudyFlag", "Y") == 0) {
                //:IF mSAProf2.TermEnrolled.Status ="T"  OR mSAProf2.TermEnrolled.Status ="C" 
                if (CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "T") == 0
                        || CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "C") == 0) {
                    //:dTotalCredits = dTotalCredits + mSAProf2.TermEnrolled.CreditHours 
                    {
                        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                        GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf2, "TermEnrolled", "CreditHours");
                        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                    }
                    dTotalCredits = dTotalCredits + dTempDecimal_0;
                    //:ELSE
                } else {
                    //:IF mSAProf2.TermEnrolled.Status ="D" OR mSAProf2.TermEnrolled.Status ="W" 
                    if (CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "D") == 0
                            || CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "W") == 0) {
                        //:IF mSAProf2.TermEnrolled.DroppedDate > mSAProf2.PeriodCollegeTerm.AddDropDeadlineDate 
                        if (CompareAttributeToAttribute(mSAProf2, "TermEnrolled", "DroppedDate", mSAProf2,
                                "PeriodCollegeTerm", "AddDropDeadlineDate") > 0) {
                            //:dTotalCredits = dTotalCredits + mSAProf2.TermEnrolled.CreditHours
                            {
                                MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
                                GetDecimalFromAttribute(md_dTempDecimal_1, mSAProf2, "TermEnrolled",
                                        "CreditHours");
                                dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
                            }
                            dTotalCredits = dTotalCredits + dTempDecimal_1;
                        }

                        //:END
                    }

                    //:END
                }

                //:END
            }

            RESULT = mSAProf2.cursor("TermEnrolled").setNextContinue().toInt();
            ;
            //:END
        }

        //:END
        //:DropView( mSAProf2 ) 
        DropView(mSAProf2);
        //:StoreValueInRecord( mSAProf, InternalEntityStructure, 
        //:                    InternalAttribStructure, dTotalCredits, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dTotalCredits, 0);
        break;
    //:   /* end zDERIVED_GET */
    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:      /* end zDERIVED_SET */
    //:END   /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dCreditsInternship(View mSAProf, String InternalEntityStructure,
        String InternalAttribStructure, Integer GetOrSetFlag) {
    zVIEW mSAProf2 = new zVIEW();
    //:DECIMAL dTotalCredits 
    double dTotalCredits = 0.0;
    int RESULT = 0;
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:// Total the Internship credit hours that will be billable. Note that a Class dropped after the
        //:// Dropped Date for the Term will be added here.
        //:CreateViewFromView ( mSAProf2, mSAProf )
        CreateViewFromView(mSAProf2, mSAProf);
        //:NAME VIEW mSAProf2 "mSAProf2"
        SetNameForView(mSAProf2, "mSAProf2", null, zLEVEL_TASK);
        //:dTotalCredits = 0
        dTotalCredits = 0;// ww w.j a  v  a 2 s .  co  m
        //:FOR EACH mSAProf2.TermEnrolled 
        RESULT = mSAProf2.cursor("TermEnrolled").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mSAProf2.TermCourse.InternshipFlag = "Y"
            if (CompareAttributeToString(mSAProf2, "TermCourse", "InternshipFlag", "Y") == 0) {
                //:IF mSAProf2.TermEnrolled.Status ="T"  OR mSAProf2.TermEnrolled.Status ="C" 
                if (CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "T") == 0
                        || CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "C") == 0) {
                    //:dTotalCredits = dTotalCredits + mSAProf2.TermEnrolled.CreditHours 
                    {
                        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                        GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf2, "TermEnrolled", "CreditHours");
                        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                    }
                    dTotalCredits = dTotalCredits + dTempDecimal_0;
                    //:ELSE
                } else {
                    //:IF mSAProf2.TermEnrolled.Status ="D" OR mSAProf2.TermEnrolled.Status ="W" 
                    if (CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "D") == 0
                            || CompareAttributeToString(mSAProf2, "TermEnrolled", "Status", "W") == 0) {
                        //:IF mSAProf2.TermEnrolled.DroppedDate > mSAProf2.PeriodCollegeTerm.AddDropDeadlineDate 
                        if (CompareAttributeToAttribute(mSAProf2, "TermEnrolled", "DroppedDate", mSAProf2,
                                "PeriodCollegeTerm", "AddDropDeadlineDate") > 0) {
                            //:dTotalCredits = dTotalCredits + mSAProf2.TermEnrolled.CreditHours
                            {
                                MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
                                GetDecimalFromAttribute(md_dTempDecimal_1, mSAProf2, "TermEnrolled",
                                        "CreditHours");
                                dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
                            }
                            dTotalCredits = dTotalCredits + dTempDecimal_1;
                        }

                        //:END
                    }

                    //:END
                }

                //:END
            }

            RESULT = mSAProf2.cursor("TermEnrolled").setNextContinue().toInt();
            ;
            //:END
        }

        //:END
        //:DropView( mSAProf2 ) 
        DropView(mSAProf2);
        //:StoreValueInRecord( mSAProf, InternalEntityStructure, 
        //:                    InternalAttribStructure, dTotalCredits, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dTotalCredits, 0);
        break;
    //:   /* end zDERIVED_GET */
    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:      /* end zDERIVED_SET */
    //:END   /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dTotalPerPeriodRegApp(View mSAProf, String InternalEntityStructure,
        String InternalAttribStructure, Integer GetOrSetFlag) {
    zVIEW mFAProf = new zVIEW();
    //:VIEW mFAProf2 BASED ON LOD mFAProf
    zVIEW mFAProf2 = new zVIEW();
    //:DECIMAL dAmount 
    double dAmount = 0.0;
    int RESULT = 0;
    int lTempInteger_0 = 0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:// This is same as dRegistrationDisbAmountApproved attribute in mFAProf.
        //:dAmount = 0
        dAmount = 0;/*from w  w  w . ja v a 2  s.  co m*/
        //:GET VIEW mFAProf NAMED "mFAProf"
        RESULT = GetViewByName(mFAProf, "mFAProf", mSAProf, zLEVEL_TASK);
        //:IF RESULT >= 0
        if (RESULT >= 0) {
            //:CreateViewFromView( mFAProf2, mFAProf )
            CreateViewFromView(mFAProf2, mFAProf);
            //:NAME VIEW mFAProf2 "mFAProf2"
            SetNameForView(mFAProf2, "mFAProf2", null, zLEVEL_TASK);
            //:SET CURSOR FIRST mFAProf2.CollegeTerm WITHIN mFAProf2.FinAidProfile 
            //:           WHERE mFAProf2.CollegeTerm.ID = mSAProf.PeriodCollegeTerm.ID
            {
                MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0);
                GetIntegerFromAttribute(mi_lTempInteger_0, mSAProf, "PeriodCollegeTerm", "ID");
                lTempInteger_0 = mi_lTempInteger_0.intValue();
            }
            RESULT = mFAProf2.cursor("CollegeTerm").setFirst("ID", lTempInteger_0, "FinAidProfile").toInt();
            //:IF RESULT >= zCURSOR_SET
            if (RESULT >= zCURSOR_SET) {
                //:dAmount = mFAProf2.PerProfileFinAidAwardPeriod.dRegistrationDisbAmountApproved
                {
                    MutableDouble md_dAmount = new MutableDouble(dAmount);
                    GetDecimalFromAttribute(md_dAmount, mFAProf2, "PerProfileFinAidAwardPeriod",
                            "dRegistrationDisbAmountApproved");
                    dAmount = md_dAmount.doubleValue();
                }
            }

            //:END
            //:DropView( mFAProf2 )
            DropView(mFAProf2);
        }

        //:END

        //:StoreValueInRecord( mSAProf,InternalEntityStructure,
        //:                    InternalAttribStructure, dAmount, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dAmount, 0);
        break;
    //:/* end zDERIVED_GET */
    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:     /* end zDERIVED_SET */
    //:END  /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_BuildCashDiscountTran(View mSAProf) {
    zVIEW mSAProfT = new zVIEW();
    //:DECIMAL CashDiscountAmount
    double CashDiscountAmount = 0.0;
    //:SHORT   nRC
    int nRC = 0;/*from   www  . j  av  a  2 s  . c o m*/
    int lTempInteger_0 = 0;
    double dTempDecimal_0 = 0.0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    int lTempInteger_3 = 0;
    zVIEW vTempViewVar_0 = new zVIEW();
    int RESULT = 0;
    int lTempInteger_4 = 0;
    int lTempInteger_5 = 0;

    //:// Generate a Cash Discount SA Transaction for the College Term identified. Replace any current
    //:// Cash Discount SA Transaction for the Term, unless it has been posted.

    //:IF mSAProf.BillingPeriod DOES NOT EXIST
    lTempInteger_0 = CheckExistenceOfEntity(mSAProf, "BillingPeriod");
    if (lTempInteger_0 != 0) {
        //:RETURN -1
        if (8 == 8)
            return (-1);
    }

    //:END

    //:// Determine Cash Discount. Note the amount is made negative here for generation of the SA Transaction.
    //:CashDiscountAmount = 0 - mSAProf.BillingPeriod.dPotentialCashDiscount
    {
        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
        GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf, "BillingPeriod", "dPotentialCashDiscount");
        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
    }
    CashDiscountAmount = 0 - dTempDecimal_0;

    //:// Get new mSAProf for creating CASHDISC Transaction.
    //:ACTIVATE mSAProfT WHERE mSAProfT.StudentAccountProfile.ID = mSAProf.StudentAccountProfile.ID 
    {
        MutableInt mi_lTempInteger_1 = new MutableInt(lTempInteger_1);
        GetIntegerFromAttribute(mi_lTempInteger_1, mSAProf, "StudentAccountProfile", "ID");
        lTempInteger_1 = mi_lTempInteger_1.intValue();
    }
    //:       RESTRICTING mSAProfT.StudentAccountTransApplied      TO mSAProfT.SATransactionCode.TransactionCode = "CASHDISC" AND 
    //:                                                               mSAProfT.AppliedBillingPeriodTerm.ID = mSAProf.PeriodCollegeTerm.ID 
    {
        MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
        GetIntegerFromAttribute(mi_lTempInteger_2, mSAProf, "PeriodCollegeTerm", "ID");
        lTempInteger_2 = mi_lTempInteger_2.intValue();
    }
    //:       RESTRICTING mSAProfT.BillingPeriod                   TO mSAProfT.BillingPeriod.ID = mSAProf.BillingPeriod.ID 
    {
        MutableInt mi_lTempInteger_3 = new MutableInt(lTempInteger_3);
        GetIntegerFromAttribute(mi_lTempInteger_3, mSAProf, "BillingPeriod", "ID");
        lTempInteger_3 = mi_lTempInteger_3.intValue();
    }
    //:       RESTRICTING mSAProf.PeriodTransApplied               TO mSAProf.PeriodTransApplied.ID = 0
    //:       RESTRICTING mSAProfT.Student                         TO mSAProfT.Student.ID = 0
    //:       RESTRICTING mSAProfT.TermOfMealPlan                  TO mSAProfT.TermOfMealPlan.ID = 0
    //:       RESTRICTING mSAProfT.SASubAccount                    TO mSAProfT.SASubAccount.ID = 0
    //:       RESTRICTING mSAProfT.StudentAccountHistoricalProfile TO mSAProfT.StudentAccountHistoricalProfile.ID = 0
    omSAProf_fnLocalBuildQual_25(mSAProf, vTempViewVar_0, lTempInteger_1, lTempInteger_2, lTempInteger_3);
    RESULT = ActivateObjectInstance(mSAProfT, "mSAProf", mSAProf, vTempViewVar_0, zSINGLE);
    DropView(vTempViewVar_0);
    //:NAME VIEW mSAProfT "mSAProfDiscount"
    SetNameForView(mSAProfT, "mSAProfDiscount", null, zLEVEL_TASK);

    //:// Check if existing discount exists. 
    //:// If it does and is for the same amount, do nothing.
    //:// If it does but is for a different amount, delete it.

    //:IF mSAProfT.StudentAccountTransApplied EXISTS 
    lTempInteger_4 = CheckExistenceOfEntity(mSAProfT, "StudentAccountTransApplied");
    if (lTempInteger_4 == 0) {
        //:IF mSAProfT.StudentAccountTransApplied.Amount = CashDiscountAmount
        if (CompareAttributeToDecimal(mSAProfT, "StudentAccountTransApplied", "Amount",
                CashDiscountAmount) == 0) {
            //:RETURN 
            if (8 == 8)
                return (0);
            //:ELSE 
        } else {
            //:IF mSAProfT.StudentAccountTransApplied.DatePosted != ""
            if (CompareAttributeToString(mSAProfT, "StudentAccountTransApplied", "DatePosted", "") != 0) {
                //:RETURN 
                if (8 == 8)
                    return (0);
                //:ELSE
            } else {
                //:DELETE ENTITY mSAProfT.StudentAccountTransApplied 
                RESULT = DeleteEntity(mSAProfT, "StudentAccountTransApplied", zPOS_NEXT);
            }

            //:END
        }

        //:END
    }

    //:END

    //:// Generate Cash Discount Transaction.
    //:nRC = GenerateUpdateCharge( mSAProfT, 
    //:                            mSAProfT.PeriodCollegeTerm.ID,
    //:                            3152,   // CASHDISC TransactionCode ID
    //:                            CashDiscountAmount, "", "", "" )
    {
        MutableInt mi_lTempInteger_5 = new MutableInt(lTempInteger_5);
        GetIntegerFromAttribute(mi_lTempInteger_5, mSAProfT, "PeriodCollegeTerm", "ID");
        lTempInteger_5 = mi_lTempInteger_5.intValue();
    }
    nRC = omSAProf_GenerateUpdateCharge(mSAProfT, lTempInteger_5, 3152, CashDiscountAmount, "", "", "");
    //:IF nRC = 0
    if (nRC == 0) {
        //:AcceptSubobject( mSAProfT, "StudentAccountTransApplied" )
        AcceptSubobject(mSAProfT, "StudentAccountTransApplied");
    }

    //:END

    //:COMMIT mSAProfT
    RESULT = CommitObjectInstance(mSAProfT);
    //:DropObjectInstance( mSAProfT )
    DropObjectInstance(mSAProfT);
    return (0);
    //    
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_GenerateReverseCharge(View mSAProf) {
    zVIEW wXferO = new zVIEW();
    int RESULT = 0;
    //:VIEW mSAProf2   BASED ON LOD  mSAProf
    zVIEW mSAProf2 = new zVIEW();
    //:VIEW mBatEdit   BASED ON LOD  mBatEdit
    zVIEW mBatEdit = new zVIEW();
    //:VIEW mSAChrgT   BASED ON LOD  mSAChrgT 
    zVIEW mSAChrgT = new zVIEW();
    //:VIEW lSATermLST BASED ON LOD  lTermLST
    zVIEW lSATermLST = new zVIEW();
    //:VIEW mSARuleS   BASED ON LOD  mSARuleS
    zVIEW mSARuleS = new zVIEW();
    //:INTEGER nRC 
    int nRC = 0;/*from w w w  . j  a va 2s . com*/
    //:DECIMAL dAmount 
    double dAmount = 0.0;
    //:STRING ( 18 ) szDate
    String szDate = null;
    //:STRING ( 4 )  szYear
    String szYear = null;
    int lTempInteger_0 = 0;
    zVIEW vTempViewVar_0 = new zVIEW();
    zVIEW vTempViewVar_1 = new zVIEW();
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;

    RESULT = GetViewByName(wXferO, "wXferO", mSAProf, zLEVEL_TASK);

    //:szDate = wXferO.Root.dCurrentDate 
    {
        MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0);
        StringBuilder sb_szDate;
        if (szDate == null)
            sb_szDate = new StringBuilder(32);
        else
            sb_szDate = new StringBuilder(szDate);
        GetVariableFromAttribute(sb_szDate, mi_lTempInteger_0, 'S', 19, wXferO, "Root", "dCurrentDate", "", 0);
        lTempInteger_0 = mi_lTempInteger_0.intValue();
        szDate = sb_szDate.toString();
    }
    //:ACTIVATE mBatEdit 
    //:   WHERE mBatEdit.BatchEditList.BatchEditDate = szDate
    //:     AND mBatEdit.BatchEditList.Posted = ""
    omSAProf_fnLocalBuildQual_6(mSAProf, vTempViewVar_0, szDate);
    RESULT = ActivateObjectInstance(mBatEdit, "mBatEdit", mSAProf, vTempViewVar_0, zSINGLE);
    DropView(vTempViewVar_0);
    //:IF RESULT > 0 
    if (RESULT > 0) {
        //:NAME VIEW mBatEdit "mBatEdit" 
        SetNameForView(mBatEdit, "mBatEdit", null, zLEVEL_TASK);
        //:ELSE 
    } else {
        //:ACTIVATE mBatEdit EMPTY 
        RESULT = ActivateEmptyObjectInstance(mBatEdit, "mBatEdit", mSAProf, zSINGLE);
        //:CREATE ENTITY mBatEdit.BatchEditList
        RESULT = CreateEntity(mBatEdit, "BatchEditList", zPOS_AFTER);
        //:mBatEdit.BatchEditList.BatchEditDate = szDate 
        SetAttributeFromString(mBatEdit, "BatchEditList", "BatchEditDate", szDate);
        //:COMMIT mBatEdit
        RESULT = CommitObjectInstance(mBatEdit);
        //:DropView( mBatEdit )
        DropView(mBatEdit);

        //:ACTIVATE mBatEdit 
        //:   WHERE mBatEdit.BatchEditList.BatchEditDate = szDate
        //:     AND mBatEdit.BatchEditList.Posted = ""
        omSAProf_fnLocalBuildQual_7(mSAProf, vTempViewVar_1, szDate);
        RESULT = ActivateObjectInstance(mBatEdit, "mBatEdit", mSAProf, vTempViewVar_1, zSINGLE);
        DropView(vTempViewVar_1);
        //:NAME VIEW mBatEdit "mBatEdit" 
        SetNameForView(mBatEdit, "mBatEdit", null, zLEVEL_TASK);
    }

    //:END

    //:CreateViewFromView( mSAProf2, mSAProf )
    CreateViewFromView(mSAProf2, mSAProf);

    //:CREATE ENTITY mSAProf.StudentAccountTransApplied
    RESULT = CreateEntity(mSAProf, "StudentAccountTransApplied", zPOS_AFTER);
    //:INCLUDE mSAProf.SATransactionCode    FROM mSAProf2.SATransactionCode 
    RESULT = IncludeSubobjectFromSubobject(mSAProf, "SATransactionCode", mSAProf2, "SATransactionCode",
            zPOS_AFTER);
    //:INCLUDE mSAProf.DebitGLChartEntry FROM mSAProf2.DebitGLChartEntry 
    RESULT = IncludeSubobjectFromSubobject(mSAProf, "DebitGLChartEntry", mSAProf2, "DebitGLChartEntry",
            zPOS_AFTER);
    //:INCLUDE mSAProf.CreditGLChartEntry FROM mSAProf2.CreditGLChartEntry 
    RESULT = IncludeSubobjectFromSubobject(mSAProf, "CreditGLChartEntry", mSAProf2, "CreditGLChartEntry",
            zPOS_AFTER);
    //:IF mSAProf2.AppliedBillingPeriod EXISTS
    lTempInteger_1 = CheckExistenceOfEntity(mSAProf2, "AppliedBillingPeriod");
    if (lTempInteger_1 == 0) {
        //:INCLUDE mSAProf.AppliedBillingPeriod FROM mSAProf2.AppliedBillingPeriod 
        RESULT = IncludeSubobjectFromSubobject(mSAProf, "AppliedBillingPeriod", mSAProf2,
                "AppliedBillingPeriod", zPOS_AFTER);
    }

    //:END
    //:SetMatchingAttributesByName( mSAProf,  "StudentAccountTransApplied", 
    //:                             mSAProf2, "StudentAccountTransApplied", zSET_NOTNULL )
    SetMatchingAttributesByName(mSAProf, "StudentAccountTransApplied", mSAProf2, "StudentAccountTransApplied",
            zSET_NOTNULL);
    //:mSAProf.StudentAccountTransApplied.DatePosted = ""
    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "DatePosted", "");
    //:mSAProf.StudentAccountTransApplied.Posted     = ""
    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "Posted", "");
    //:mSAProf.StudentAccountTransApplied.Journal    = "ADJ"
    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "Journal", "ADJ");
    //:mSAProf.StudentAccountTransApplied.DateSentGL = ""
    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "DateSentGL", "");
    //:dAmount = mSAProf2.StudentAccountTransApplied.Amount 
    {
        MutableDouble md_dAmount = new MutableDouble(dAmount);
        GetDecimalFromAttribute(md_dAmount, mSAProf2, "StudentAccountTransApplied", "Amount");
        dAmount = md_dAmount.doubleValue();
    }
    //:dAmount = dAmount * -1
    dAmount = dAmount * -1;
    //:mSAProf.StudentAccountTransApplied.Amount = dAmount 
    SetAttributeFromDecimal(mSAProf, "StudentAccountTransApplied", "Amount", dAmount);

    //:// Tie original Transaction to reversal entry and set date for 1098 generation.
    //:szDate = mSAProf2.StudentAccountTransApplied.TransactionDate
    {
        MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
        StringBuilder sb_szDate;
        if (szDate == null)
            sb_szDate = new StringBuilder(32);
        else
            sb_szDate = new StringBuilder(szDate);
        GetVariableFromAttribute(sb_szDate, mi_lTempInteger_2, 'S', 19, mSAProf2, "StudentAccountTransApplied",
                "TransactionDate", "", 0);
        lTempInteger_2 = mi_lTempInteger_2.intValue();
        szDate = sb_szDate.toString();
    }
    //:szYear = szDate
    {
        StringBuilder sb_szYear;
        if (szYear == null)
            sb_szYear = new StringBuilder(32);
        else
            sb_szYear = new StringBuilder(szYear);
        ZeidonStringCopy(sb_szYear, 1, 0, szDate, 1, 0, 5);
        szYear = sb_szYear.toString();
    }
    //:mSAProf.StudentAccountTransApplied.Tx1098_RefundAppliedYear = szYear
    SetAttributeFromString(mSAProf, "StudentAccountTransApplied", "Tx1098_RefundAppliedYear", szYear);
    //:INCLUDE mSAProf.AdjustedSATransApplied FROM mSAProf2.StudentAccountTransApplied
    RESULT = IncludeSubobjectFromSubobject(mSAProf, "AdjustedSATransApplied", mSAProf2,
            "StudentAccountTransApplied", zPOS_AFTER);

    //:SetAttributeFromCurrentDateTime( mSAProf, "StudentAccountTransApplied", "DateEntered" )
    {
        ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mSAProf);
        m_ZGLOBAL1_Operation.SetAttributeFromCurrentDateTime(mSAProf, "StudentAccountTransApplied",
                "DateEntered");
        // m_ZGLOBAL1_Operation = null;  // permit gc  (unnecessary)
    }
    //:SetAttributeFromCurrentDateTime( mSAProf, "StudentAccountTransApplied", "TransactionDate" )
    {
        ZGLOBAL1_Operation m_ZGLOBAL1_Operation = new ZGLOBAL1_Operation(mSAProf);
        m_ZGLOBAL1_Operation.SetAttributeFromCurrentDateTime(mSAProf, "StudentAccountTransApplied",
                "TransactionDate");
        // m_ZGLOBAL1_Operation = null;  // permit gc  (unnecessary)
    }

    //:DropView( mSAProf2 )
    DropView(mSAProf2);
    return (0);
    //    
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_dPotentialCashDiscount(View mSAProf, String InternalEntityStructure,
        String InternalAttribStructure, Integer GetOrSetFlag) {
    zVIEW mSAChrgT = new zVIEW();
    //:VIEW lSATrnSh BASED ON LOD lSATrnSh
    zVIEW lSATrnSh = new zVIEW();
    //:DECIMAL dDiscountRate 
    double dDiscountRate = 0.0;
    //:DECIMAL dCashDiscount
    double dCashDiscount = 0.0;
    //:DECIMAL dTotalEligibleCharges
    double dTotalEligibleCharges = 0.0;
    int lTempInteger_0 = 0;
    zVIEW vTempViewVar_0 = new zVIEW();
    int RESULT = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    zVIEW vTempViewVar_1 = new zVIEW();
    double dTempDecimal_0 = 0.0;
    double dTempDecimal_1 = 0.0;

    //:CASE GetOrSetFlag
    switch (GetOrSetFlag) {
    //:OF zDERIVED_GET:
    case zDERIVED_GET:

        //:// Determine the potential Cash Discount by adding up those charges for the Period that qualify
        //:// and multiplying them by the Discount Rate for the Term.
        //:// If no Discount Rate exists, don't compute a Cash Discount.

        //:// Don't calculate if it already exists.
        //:IF mSAProf.BillingPeriod.wPotentialCashDiscount != "" 
        if (CompareAttributeToString(mSAProf, "BillingPeriod", "wPotentialCashDiscount", "") != 0) {
            //:dCashDiscount = mSAProf.BillingPeriod.wPotentialCashDiscount 
            {//from  ww w.  j  av a2 s.c  om
                MutableDouble md_dCashDiscount = new MutableDouble(dCashDiscount);
                GetDecimalFromAttribute(md_dCashDiscount, mSAProf, "BillingPeriod", "wPotentialCashDiscount");
                dCashDiscount = md_dCashDiscount.doubleValue();
            }
            //:ELSE
        } else {
            //:// Activate the Discount Rate for the Term.
            //:ACTIVATE mSAChrgT WHERE mSAChrgT.SATransactionCode.TransactionCode = "CASHDISC"
            //:     RESTRICTING mSAChrgT.SATransactionTerm TO mSAChrgT.CollegeTerm.ID = mSAProf.PeriodCollegeTerm.ID 
            {
                MutableInt mi_lTempInteger_0 = new MutableInt(lTempInteger_0);
                GetIntegerFromAttribute(mi_lTempInteger_0, mSAProf, "PeriodCollegeTerm", "ID");
                lTempInteger_0 = mi_lTempInteger_0.intValue();
            }
            omSAProf_fnLocalBuildQual_23(mSAProf, vTempViewVar_0, lTempInteger_0);
            RESULT = ActivateObjectInstance(mSAChrgT, "mSAChrgT", mSAProf, vTempViewVar_0, zSINGLE);
            DropView(vTempViewVar_0);
            //:NAME VIEW mSAChrgT "mSAChrgTDiscount"
            SetNameForView(mSAChrgT, "mSAChrgTDiscount", null, zLEVEL_TASK);
            //:IF mSAChrgT.SATransactionTerm DOES NOT EXIST
            lTempInteger_1 = CheckExistenceOfEntity(mSAChrgT, "SATransactionTerm");
            if (lTempInteger_1 != 0) {
                //:DropObjectInstance( mSAChrgT )
                DropObjectInstance(mSAChrgT);
                //:RETURN -1
                if (8 == 8)
                    return (-1);
            }

            //:END
            //:dDiscountRate = mSAChrgT.SATransactionTerm.Amount
            {
                MutableDouble md_dDiscountRate = new MutableDouble(dDiscountRate);
                GetDecimalFromAttribute(md_dDiscountRate, mSAChrgT, "SATransactionTerm", "Amount");
                dDiscountRate = md_dDiscountRate.doubleValue();
            }

            //:// Activate list of Transactions for the current BillingPeriod that are eligible for a discount.
            //:ACTIVATE lSATrnSh Multiple WHERE lSATrnSh.BillingPeriod.ID = mSAProf.BillingPeriod.ID 
            //:                             AND lSATrnSh.SATransactionCode.EligibleForCashDiscount = "Y"
            {
                MutableInt mi_lTempInteger_2 = new MutableInt(lTempInteger_2);
                GetIntegerFromAttribute(mi_lTempInteger_2, mSAProf, "BillingPeriod", "ID");
                lTempInteger_2 = mi_lTempInteger_2.intValue();
            }
            omSAProf_fnLocalBuildQual_24(mSAProf, vTempViewVar_1, lTempInteger_2);
            RESULT = ActivateObjectInstance(lSATrnSh, "lSATrnSh", mSAProf, vTempViewVar_1, zMULTIPLE);
            DropView(vTempViewVar_1);
            //:NAME VIEW lSATrnSh "lSATrnSh"
            SetNameForView(lSATrnSh, "lSATrnSh", null, zLEVEL_TASK);
            //:dTotalEligibleCharges = 0
            dTotalEligibleCharges = 0;
            //:FOR EACH lSATrnSh.StudentAccountTransApplied 
            RESULT = lSATrnSh.cursor("StudentAccountTransApplied").setFirst().toInt();
            while (RESULT > zCURSOR_UNCHANGED) {
                //:dTotalEligibleCharges = dTotalEligibleCharges + lSATrnSh.StudentAccountTransApplied.Amount 
                {
                    MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                    GetDecimalFromAttribute(md_dTempDecimal_0, lSATrnSh, "StudentAccountTransApplied",
                            "Amount");
                    dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                }
                dTotalEligibleCharges = dTotalEligibleCharges + dTempDecimal_0;
                RESULT = lSATrnSh.cursor("StudentAccountTransApplied").setNextContinue().toInt();
                ;
            }

            //:END
            //:            
            //:// Cash Discount is (Total Eligible Transactions - Approved Aid) * .03
            //:dCashDiscount = ( dTotalEligibleCharges - mSAProf.BillingPeriod.dRegistrationDisbAmountApproved ) * dDiscountRate
            {
                MutableDouble md_dTempDecimal_1 = new MutableDouble(dTempDecimal_1);
                GetDecimalFromAttribute(md_dTempDecimal_1, mSAProf, "BillingPeriod",
                        "dRegistrationDisbAmountApproved");
                dTempDecimal_1 = md_dTempDecimal_1.doubleValue();
            }
            dCashDiscount = (dTotalEligibleCharges - dTempDecimal_1) * dDiscountRate;
            //:IF dCashDiscount < 0
            if (dCashDiscount < 0) {
                //:dCashDiscount = 0
                dCashDiscount = 0;
            }

            //:END

            //:// Save it in case it is recomputed.
            //:mSAProf.BillingPeriod.wPotentialCashDiscount = dCashDiscount
            SetAttributeFromDecimal(mSAProf, "BillingPeriod", "wPotentialCashDiscount", dCashDiscount);

            //:DropObjectInstance( lSATrnSh )
            DropObjectInstance(lSATrnSh);
            //:DropObjectInstance( mSAChrgT )
            DropObjectInstance(mSAChrgT);
        }

        //:END

        //:StoreValueInRecord( mSAProf, InternalEntityStructure, 
        //:                    InternalAttribStructure, dCashDiscount, 0 )
        StoreValueInRecord(mSAProf, InternalEntityStructure, InternalAttribStructure, dCashDiscount, 0);
        break;
    //:   
    //:   /* end zDERIVED_GET */

    //:OF zDERIVED_SET:
    case zDERIVED_SET:
        break;
    }

    //:   /* end zDERIVED_SET */
    //:END   /* case */
    return (0);
    // END
}

From source file:com.quinsoft.zencas.mSAProf_Object.java

public int omSAProf_SetupSAProfForYear(View mSAProf, int nCollegeYearID, int nCollegeTermID) {
    zVIEW mUser = new zVIEW();
    //:DECIMAL TotalCredits
    double TotalCredits = 0.0;
    //:INTEGER CurrentTermID
    int CurrentTermID = 0;
    //:INTEGER CollegeTermID
    int CollegeTermID = 0;
    int lTempInteger_0 = 0;
    int RESULT = 0;
    int lTempInteger_1 = 0;
    int lTempInteger_2 = 0;
    double dTempDecimal_0 = 0.0;

    //:IF mSAProf.StudentAccountTransApplied EXISTS 
    lTempInteger_0 = CheckExistenceOfEntity(mSAProf, "StudentAccountTransApplied");
    if (lTempInteger_0 == 0) {
        //:OrderEntityForView( mSAProf, "StudentAccountTransApplied", "TransactionDate D" )
        OrderEntityForView(mSAProf, "StudentAccountTransApplied", "TransactionDate D");
    }//from  www .ja  v a2  s . c o m

    //:END

    //:SET CURSOR FIRST mSAProf.BillingPeriod 
    //:   WHERE mSAProf.PeriodCollegeTerm.ID = nCollegeTermID  
    RESULT = mSAProf.cursor("BillingPeriod").setFirst().toInt();
    if (RESULT > zCURSOR_UNCHANGED) {
        while (RESULT > zCURSOR_UNCHANGED
                && (CompareAttributeToInteger(mSAProf, "PeriodCollegeTerm", "ID", nCollegeTermID) != 0)) {
            RESULT = mSAProf.cursor("BillingPeriod").setNextContinue().toInt();
            ;
        }

    }

    //:IF RESULT >= zCURSOR_SET  
    if (RESULT >= zCURSOR_SET) {
        //:SET CURSOR FIRST mSAProf.PeriodCollegeTerm  
        //:   WHERE mSAProf.PeriodCollegeTerm.ID = nCollegeTermID  
        RESULT = mSAProf.cursor("PeriodCollegeTerm").setFirst("ID", nCollegeTermID).toInt();
        //:ELSE 
    } else {
        //:SET CURSOR FIRST mSAProf.BillingPeriod 
        //:   WHERE mSAProf.PeriodCollegeYear.ID = nCollegeYearID  
        RESULT = mSAProf.cursor("BillingPeriod").setFirst().toInt();
        if (RESULT > zCURSOR_UNCHANGED) {
            while (RESULT > zCURSOR_UNCHANGED
                    && (CompareAttributeToInteger(mSAProf, "PeriodCollegeYear", "ID", nCollegeYearID) != 0)) {
                RESULT = mSAProf.cursor("BillingPeriod").setNextContinue().toInt();
                ;
            }

        }

        //:IF RESULT < zCURSOR_SET  
        if (RESULT < zCURSOR_SET) {
            //:SET CURSOR FIRST mSAProf.BillingPeriod // in this case only
            RESULT = mSAProf.cursor("BillingPeriod").setFirst().toInt();
        }

        //:END 
        //:SET CURSOR FIRST mSAProf.PeriodCollegeTerm // in this case only
        RESULT = mSAProf.cursor("PeriodCollegeTerm").setFirst().toInt();
    }

    //:END

    //:FOR EACH mSAProf.PeriodCollegeTerm
    RESULT = mSAProf.cursor("PeriodCollegeTerm").setFirst().toInt();
    while (RESULT > zCURSOR_UNCHANGED) {
        //:TotalCredits = 0
        TotalCredits = 0;
        //:CollegeTermID = mSAProf.PeriodCollegeTerm.ID
        {
            MutableInt mi_CollegeTermID = new MutableInt(CollegeTermID);
            GetIntegerFromAttribute(mi_CollegeTermID, mSAProf, "PeriodCollegeTerm", "ID");
            CollegeTermID = mi_CollegeTermID.intValue();
        }
        //:FOR EACH mSAProf.Enrolled 
        RESULT = mSAProf.cursor("Enrolled").setFirst().toInt();
        while (RESULT > zCURSOR_UNCHANGED) {
            //:IF mSAProf.RegisteredCollegeTerm EXISTS
            lTempInteger_1 = CheckExistenceOfEntity(mSAProf, "RegisteredCollegeTerm");
            if (lTempInteger_1 == 0) {
                //:CurrentTermID = mSAProf.RegisteredCollegeTerm.ID
                {
                    MutableInt mi_CurrentTermID = new MutableInt(CurrentTermID);
                    GetIntegerFromAttribute(mi_CurrentTermID, mSAProf, "RegisteredCollegeTerm", "ID");
                    CurrentTermID = mi_CurrentTermID.intValue();
                }
                //:ELSE
            } else {
                //:IF mSAProf.CurrentCollegeTerm EXISTS 
                lTempInteger_2 = CheckExistenceOfEntity(mSAProf, "CurrentCollegeTerm");
                if (lTempInteger_2 == 0) {
                    //:CurrentTermID = mSAProf.CurrentCollegeTerm.ID
                    {
                        MutableInt mi_CurrentTermID = new MutableInt(CurrentTermID);
                        GetIntegerFromAttribute(mi_CurrentTermID, mSAProf, "CurrentCollegeTerm", "ID");
                        CurrentTermID = mi_CurrentTermID.intValue();
                    }
                    //:ELSE 
                } else {
                    //:CurrentTermID = 0
                    CurrentTermID = 0;
                }

                //:END
            }

            //:END
            //://IF CurrentTermID = CollegeTermID OR CurrentTermID = 0
            //:IF CurrentTermID = CollegeTermID     // Modified from above by Don C on 8/16/06
            if (CurrentTermID == CollegeTermID) {
                //:IF mSAProf.Enrolled.Status = "T" OR mSAProf.Enrolled.Status = "C" 
                if (CompareAttributeToString(mSAProf, "Enrolled", "Status", "T") == 0
                        || CompareAttributeToString(mSAProf, "Enrolled", "Status", "C") == 0) {
                    //:TotalCredits = TotalCredits + mSAProf.Enrolled.CreditHours  
                    {
                        MutableDouble md_dTempDecimal_0 = new MutableDouble(dTempDecimal_0);
                        GetDecimalFromAttribute(md_dTempDecimal_0, mSAProf, "Enrolled", "CreditHours");
                        dTempDecimal_0 = md_dTempDecimal_0.doubleValue();
                    }
                    TotalCredits = TotalCredits + dTempDecimal_0;
                    //:INCLUDE mSAProf.TermEnrolled FROM mSAProf.Enrolled
                    RESULT = IncludeSubobjectFromSubobject(mSAProf, "TermEnrolled", mSAProf, "Enrolled",
                            zPOS_AFTER);
                }

                //:END
            }

            RESULT = mSAProf.cursor("Enrolled").setNextContinue().toInt();
            ;
            //:END
        }

        RESULT = mSAProf.cursor("PeriodCollegeTerm").setNextContinue().toInt();
        ;
        //:END
    }

    //:END

    //:// if the student's admin div uses cohorts then it is not by year, there is just one SA Profile at all
    //:LocateCurrentRoom( mSAProf )
    omSAProf_LocateCurrentRoom(mSAProf);
    //:LocateMealPlan( mSAProf )
    omSAProf_LocateMealPlan(mSAProf);
    //:RETURN 0
    return (0);
    // END
}