} //End public void setMONTHS_TUNGGAKAN()

        private Reportin_tunggakanVM mapMONTHLY_SPP_BACKUP(Reportin_tunggakanVM poTUNGGAKAN, ClassleveldetailVM poCLASSLEVEL, Installment_indetailVM poINST)
        {
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn = poTUNGGAKAN;

            //Init Calc Variable
            decimal?nTRN_QTY       = 12;
            decimal?nTRN_PRICE     = poCLASSLEVEL.CLASSLEVEL_SPP;
            decimal?nTRN_AMOUNT    = 0;
            Byte?   nCURRENT_MONTH = this.SYSINFO.SYSMONTH_SEQNO;

            if (poINST != null)
            {
                //QTY
                if (poINST.INST_QTY != null)
                {
                    decimal?nMONTH_TUNGGAKAN = (decimal?)(nCURRENT_MONTH - 1) - poINST.INST_QTY;
                    if (nMONTH_TUNGGAKAN > 0)
                    {
                        nTRN_QTY = nMONTH_TUNGGAKAN;
                    }
                } //End if (oINST.INST_QTY != null)
                //PRICE
                if (poINST.INST_PRICEBASE != null)
                {
                    nTRN_PRICE = poINST.INST_PRICEBASE;
                }
            } //End if (oINST != null)
            //CALC QTY X PRICE
            nTRN_AMOUNT = nTRN_QTY * nTRN_PRICE;

            vReturn.TRN_AMOUNT_SPP = nTRN_AMOUNT;
            return(vReturn);
        } //End private Reportin_tunggakanVM mapMONTHLY_SPP(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES, Installment_indetailVM poINST)
        } //End private Reportin_tunggakanVM mapMONTHLY_SCLUB(Reportin_tunggakanVM poTUNGGAKAN, StudentdetailVM poSTUDENT, ClassleveldetailVM poCLASSLEVEL, TrintypedetailVM poTRINTYPES)

        private Reportin_tunggakanVM mapMONTHLY_OTHER(Reportin_tunggakanVM poTUNGGAKAN, Installment_indetailVM poINST)
        {
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn = mapMONTHLY(poTUNGGAKAN, poINST);
            return(vReturn);
        } //End private Reportin_tunggakanVM mapMONTHLY_OTHER(Reportin_tunggakanVM poTUNGGAKAN, Installment_indetailVM poINST)
        } //End private Reportin_tunggakanVM mapMONTHLY_EKSKUL(Reportin_tunggakanVM poTUNGGAKAN, StudentdetailVM poSTUDENT, ClassleveldetailVM poCLASSLEVEL, TrintypedetailVM poTRINTYPES)

        private Reportin_tunggakanVM mapMONTHLY_SCLUB(Reportin_tunggakanVM poTUNGGAKAN, Installment_indetailVM poINST)
        {
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn = mapMONTHLY(poTUNGGAKAN, poINST);
            return(vReturn);
        } //End private Reportin_tunggakanVM mapMONTHLY_SCLUB(Reportin_tunggakanVM poTUNGGAKAN, StudentdetailVM poSTUDENT, ClassleveldetailVM poCLASSLEVEL, TrintypedetailVM poTRINTYPES)
        } //End private Reportin_tunggakanVM mapMONTHLY_SPP(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES, Installment_indetailVM poINST)

        private Reportin_tunggakanVM mapMONTHLY(Reportin_tunggakanVM poTUNGGAKAN, Installment_indetailVM poINST)
        {
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn = poTUNGGAKAN;

            //Init Calc Variable
            decimal?nTRN_QTY    = 0;
            decimal?nTRN_PRICE  = 0;
            decimal?nTRN_AMOUNT = mapMONTHLY_CALC(poINST, nTRN_QTY, nTRN_PRICE);

            vReturn.TRN_AMOUNT_SPP = nTRN_AMOUNT;
            return(vReturn);
        } //End private Reportin_tunggakanVM mapMONTHLY(Reportin_tunggakanVM poTUNGGAKAN, Installment_indetailVM poINST)
        } //End private decimal? mapMONTHLY_CALC(Installment_indetailVM poINST, decimal? pnTRN_QTY, decimal? pnTRN_PRICE)

        private Reportin_tunggakanVM mapMONTHLY_SPP(Reportin_tunggakanVM poTUNGGAKAN, ClassleveldetailVM poCLASSLEVEL, Installment_indetailVM poINST)
        {
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn = poTUNGGAKAN;

            //Init Calc Variable
            decimal?nTRN_QTY    = 12;
            decimal?nTRN_PRICE  = poCLASSLEVEL.CLASSLEVEL_SPP;
            decimal?nTRN_AMOUNT = mapMONTHLY_CALC(poINST, nTRN_QTY, nTRN_PRICE);

            vReturn.TRN_AMOUNT_SPP = nTRN_AMOUNT;
            return(vReturn);
        } //End private Reportin_tunggakanVM mapMONTHLY_SPP(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES, Installment_indetailVM poINST)
        }     //End public void executeReport_TUNGGAKAN()

        //METHOD-CALC
        private Reportin_tunggakanVM calcTUNGGAKAN
            (Reportin_tunggakanVM poTUNGGAKAN, StudentdetailVM poSTUDENT, ClassleveldetailVM poCLASSLEVEL, TrintypedetailVM poTRINTYPES)
        {
            Boolean isCheck = true;
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn = poTUNGGAKAN;
            Installment_indetailVM oINST = this.INSTALLMENTS_TUNGGAKAN.
                                           Where(fld => fld.INST_TYPEID == poTRINTYPES.ID &&
                                                 fld.STUDENT_ID == poSTUDENT.ID).SingleOrDefault();

            //SPP
            if ((poTRINTYPES.ID == valFLAG.FLAG_TRINTYPE_SPP) && (isCheck))
            {
                isCheck = false;
                //Map Tunggakan
                vReturn = mapMONTHLY_SPP(poTUNGGAKAN, poCLASSLEVEL, oINST);
            } //End if (poTRINTYPES.ID == valFLAG.FLAG_TRINTYPE_SPP)
            //EKSKUL
            if ((poTRINTYPES.ID == valFLAG.FLAG_TRINTYPE_EKSKUL) && (isCheck))
            {
                isCheck = false;
                //Map Tunggakan
                vReturn = mapMONTHLY_EKSKUL(poTUNGGAKAN, oINST);
            } //End if (poTRINTYPES.ID == valFLAG.FLAG_TRINTYPE_EKSKUL)
            //SCLUB
            if ((poTRINTYPES.ID == valFLAG.FLAG_TRINTYPE_SCLUB) && (isCheck))
            {
                isCheck = false;
                //Map Tunggakan
                vReturn = mapMONTHLY_SCLUB(poTUNGGAKAN, oINST);
            } //End if (poTRINTYPES.ID == valFLAG.FLAG_TRINTYPE_SCLUB)
            //OTHER
            if (isCheck)
            {
                isCheck = false;
                //Map Tunggakan
                vReturn = mapMONTHLY_OTHER(poTUNGGAKAN, oINST);
            } //End if (isCheck)


            return(vReturn);
        } //End private Reportin_tunggakanVM calcTUNGGAKAN(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES)
        } //End private Reportin_tunggakanVM calcTUNGGAKAN(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES)

        private Reportin_tunggakanVM sumTUNGGAKAN(Reportin_tunggakanVM poTUNGGAKAN)
        {
            Reportin_tunggakanVM vReturn = poTUNGGAKAN;


            vReturn.TRN_AMOUNT =
                vReturn.TRN_AMOUNT_SPP +
                vReturn.TRN_AMOUNT_EKSKUL +
                vReturn.TRN_AMOUNT_MIDGANJIL +
                vReturn.TRN_AMOUNT_MIDGENAP +
                vReturn.TRN_AMOUNT_SEMGANJIL +
                vReturn.TRN_AMOUNT_SEMGENAP +
                vReturn.TRN_AMOUNT_DU +
                vReturn.TRN_AMOUNT_UAT +
                vReturn.TRN_AMOUNT_UPANGKAL +
                vReturn.TRN_AMOUNT_PRAKERIN;

            return(vReturn);
        } //End private Reportin_tunggakanVM sumTUNGGAKAN(Reportin_tunggakanVM poTUNGGAKAN)
        } //End public void prepareReport_TUNGGAKAN()

        public void executeReport_TUNGGAKAN()
        {
            //PREPARE REPORT
            this.prepareReport_TUNGGAKAN();
            //INIT CLASSLEVEL FOR CALCULATION DATA
            ClassleveldetailVM itemCLASSLEVEL = null;

            //START LOOP REPORTS
            Boolean isNEW = true;

            foreach (var itemSTUDENT in this.STUDENTS)
            {
                if (itemSTUDENT.ID == 1696)
                {
                    isNEW = true;
                }

                //RESET FOR STUDENT LOOP
                isNEW = true;
                //INIT itemTUNGGAKAN
                Reportin_tunggakanVM itemTUNGGAKAN = null;
                //GET CLASSLEVEL BY STUDENT (TODO: REFACTOR BY MODIFY DBVIEW
                itemCLASSLEVEL = CLASSLEVELS.Where(fld => fld.ID == itemSTUDENT.CLASSLEVEL_ID).SingleOrDefault();
                foreach (var itemTRINTYPE in this.TRINTYPES)
                {
                    if (isNEW)
                    {
                        isNEW         = false;
                        itemTUNGGAKAN = new Reportin_tunggakanVM();
                        itemTUNGGAKAN = initMAP(itemSTUDENT);
                    } //End if (isNEW)

                    itemTUNGGAKAN = this.calcTUNGGAKAN(itemTUNGGAKAN, itemSTUDENT, itemCLASSLEVEL, itemTRINTYPE);
                } //End foreach (var item2 in this.TRINTYPES)
                itemTUNGGAKAN = this.sumTUNGGAKAN(itemTUNGGAKAN);

                if (itemTUNGGAKAN.TRN_AMOUNT > 0)
                {
                    TUNGGAKAN.Add(itemTUNGGAKAN);
                }
            } //End foreach (var item in this.STUDENTS)
        }     //End public void executeReport_TUNGGAKAN()
        } //End private Reportin_tunggakanVM sumTUNGGAKAN(Reportin_tunggakanVM poTUNGGAKAN)

        //METHOD-MAP-INIT
        private Reportin_tunggakanVM initMAP(StudentdetailVM poSTUDENT)
        {
            Reportin_tunggakanVM vReturn = new Reportin_tunggakanVM();

            vReturn.ID         = poSTUDENT.ID;
            vReturn.STUDENT_ID = poSTUDENT.ID;
            vReturn.NAME       = poSTUDENT.NAME;
            vReturn.NIS        = poSTUDENT.NIS;

            vReturn.TRN_AMOUNT_SPP       = 0;
            vReturn.TRN_AMOUNT_EKSKUL    = 0;
            vReturn.TRN_AMOUNT_MIDGANJIL = 0;
            vReturn.TRN_AMOUNT_MIDGENAP  = 0;
            vReturn.TRN_AMOUNT_SEMGANJIL = 0;
            vReturn.TRN_AMOUNT_SEMGENAP  = 0;
            vReturn.TRN_AMOUNT_DU        = 0;
            vReturn.TRN_AMOUNT_UAT       = 0;
            vReturn.TRN_AMOUNT_UPANGKAL  = 0;
            vReturn.TRN_AMOUNT_PRAKERIN  = 0;
            vReturn.TRN_AMOUNT           = 0;

            return(vReturn);
        } //End private Reportin_tunggakanVM mapMONTHLY(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES, Installment_indetailVM poINST)
Example #10
0
        } //End private Reportin_tunggakanVM mapMONTHLY_OTHER(Reportin_tunggakanVM poTUNGGAKAN, Installment_indetailVM poINST)

        //METHOD-MAP-OTHER
        private Reportin_tunggakanVM mapOTHER(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES, Installment_indetailVM poINST)
        {
            Reportin_tunggakanVM vReturn = null;

            return(vReturn);
        } //End private Reportin_tunggakanVM mapOTHER(StudentdetailVM poSTUDENT, TrintypedetailVM poTRINTYPES, Installment_indetailVM poINST)