Exemple #1
0
 /// <summary>مفهوم اضافه کارساعتي تعطيل</summary>
 /// <param name="Result"></param>this.ConceptCalculateDate
 /// <remarks>شناسه اين مفهوم در تعاريف بعدي شصت و چهار-64 درنظر گرفته شده است</remarks>
 public override void C4009(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value < 1)
     {
         ((PairableScndCnpValue)Result).AddPairs(this.DoConcept(4001));
     }
 }
        /// <summary>مفهوم غيبت خالص ساعتي</summary>
        /// <param name="Result"></param>
        /// <remarks>شناسه اين مفهوم در تعاريف بعدي سي و شش-36 درنظر گرفته شده است</remarks>
        public override void C3001(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            Result.Value = 0;
            PairableScndCnpValue.ClearPairsValue(Result);
            ProceedTraffic proceedTraffic = this.Person.GetProceedTraficByDate(this.ConceptCalculateDate);

            if (proceedTraffic.IsFilled && this.DoConcept(1090).Value == 0 && this.DoConcept(2005).Value == 0 && this.DoConcept(1091).Value == 0 &&
                this.DoConcept(2026).Value == 0)
            {
                if (this.Person.GetShiftByDate(this.ConceptCalculateDate).ShiftType != ShiftTypesEnum.OVERTIME)
                {
                    if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value > 0 && proceedTraffic != null && (proceedTraffic.HasHourlyItem || (!proceedTraffic.HasHourlyItem && !proceedTraffic.HasDailyItem)))
                    {
                        ((PairableScndCnpValue)Result).AddPairs(Operation.Differance(this.Person.GetShiftByDate(this.ConceptCalculateDate), proceedTraffic));
                    }
                    else if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value > 0 && proceedTraffic == null)
                    {
                        ((PairableScndCnpValue)Result).AppendPairs(this.Person.GetShiftByDate(this.ConceptCalculateDate).Pairs);
                    }
                    else
                    {
                        Result.Value = 0;
                    }
                }
                else
                {
                    Result.Value = 0;
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// تاخیر تبدیل شده به مرخصی ماهانه
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        ///

        public override void C1004(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            //طبق توافق صورت گرفته در اینجا تنها داشتن مجوز ملاک مقداردهی مرخصی استحقاقی روزانه است
            int leaveInDay = this.DoConcept(1001).Value > this.DoConcept(6).Value&& this.DoConcept(6).Value > 0
                                 ? this.DoConcept(6).Value
                                 : this.DoConcept(1001).Value;

            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.DailyEstehghaghiLeave));

            //طبق درخواست این سازمان در صورت حضور مرخصی روزانه داده نمیشود
            if (permit != null && permit.Value == 1 && this.DoConcept(1).Value == 0)
            {
                int   demandLeave = this.Person.GetRemainLeave(this.ConceptCalculateDate);
                float dev         = 1;

                if (this.DoConcept(1113).Value > 0)
                {
                    if (this.DoConcept(7).Value > 0)
                    {
                        dev = (float)this.DoConcept(6).Value / (float)this.DoConcept(7).Value;
                    }
                }
                dev = dev < 1 ? 1 : dev;

                if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value > 0 || this.DoConcept(1021).Value == 1)
                {
                    if (dev * leaveInDay > demandLeave && this.DoConcept(1098).Value == 0)
                    {
                        //تبدیل مرخصی استحقاقی به مرخصی بی حقوق در صورت عدم طلب
                        if (this.DoConcept(1014).Value == 1)
                        {
                            this.DoConcept(1066).Value = 1;
                        }
                    }
                    else
                    {
                        Result.Value = (int)dev;
                        if (Result.Value < dev)
                        {
                            float remain = dev - Result.Value;
                            ((PairableScndCnpValue)this.DoConcept(1002)).IncreaseValue((int)(remain * leaveInDay));
                            //((PairableScndCnpValue)this.DoConcept(3028)).DecreasePairFromFirst(this.DoConcept(1002).Value);
                            //((PairableScndCnpValue)this.DoConcept(3001)).DecreasePairFromFirst(this.DoConcept(1002).Value);
                            //this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031);
                        }
                        this.Person.AddUsedLeave(this.ConceptCalculateDate, (int)(dev * leaveInDay), permit);
                    }
                }
                //else
                //{
                //    //مرخصی قطعی در روزغیرکاری
                //    if (this.DoConcept(1021).Value == 1)
                //    {
                //        //حتی اگر طلب نداشته باشد باید منفی شود
                //        Result.Value = 1;
                //        this.Person.AddUsedLeave(this.ConceptCalculateDate, leaveInDay, permit);
                //    }
                //}
            }
        }
        /// <summary>مفهوم اضافه کاراول وقت</summary>
        /// <param name="Result"></param>
        /// <remarks>شناسه اين مفهوم در تعاريف بعدي شصت و دو-62 درنظر گرفته شده است</remarks>
        //public override void C4008(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        //{

        //    int i = 0;
        //    ((PairableScndCnpValue)Result).ClearPairs();
        //    PairableScndCnpValue unionResult = (PairableScndCnpValue)this.DoConcept(1);
        //    PairableScndCnpValue validLeave = new PairableScndCnpValue();
        //    ((PairableScndCnpValue)validLeave ).AddPairs(Operation.Differance (unionResult,
        //                                                 this.Person.GetShiftByDate(this.ConceptCalculateDate)).Pairs);
        //    PairableScndCnpValue overTime = (PairableScndCnpValue)this.DoConcept(4002);
        //    BaseShift shift = this.Person.GetShiftByDate(this.ConceptCalculateDate);

        //    if (shift != null && shift.PairCount > 0)
        //    {
        //        IPair shiftPair = shift.Pairs.OrderBy(x => x.From).First();
        //        if (shift.PastedPairs.From == shiftPair.From)
        //        {

        //            while (i <= overTime.PairCount - 1)
        //            {
        //                if (shiftPair.From > overTime.PairPart(i).From)
        //                {
        //                    ((PairableScndCnpValue)Result).AppendPair(overTime.PairPart(i));
        //                }
        //                i++;
        //            }
        //        }
        //    }


        //}


        /// <summary>مفهوم اضافه کار  ساعتی جمعه کاری </summary>
        /// <param name="Result"></param>
        public override void C4046(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            ((PairableScndCnpValue)Result).ClearPairs();
            if (this.ConceptCalculateDate.DayOfWeek == DayOfWeek.Friday)
            {
                PairableScndCnpValue     unionResult  = new PairableScndCnpValue();
                PairableScndCnpValuePair unionResult2 = new PairableScndCnpValuePair();
                PairableScndCnpValuePair unionResult3 = new PairableScndCnpValuePair();
                unionResult2.From = 1440;
                unionResult2.To   = 2880;
                unionResult3.From = 1;
                unionResult3.To   = 1439;

                ((PairableScndCnpValue)Result).AddPairs(Operation.Intersect(
                                                            Operation.Differance(this.DoConcept(1),
                                                                                 this.Person.GetShiftByDate(this.ConceptCalculateDate)
                                                                                 ), Operation.Intersect(this.DoConcept(4002), unionResult3)));

                ((PairableScndCnpValue)Result).AppendPairs(Operation.Intersect(this.DoConcept(4002), this.DoConcept(2004)));
                //((PairableScndCnpValue)Result).AppendPairs();

                if (this.DoConcept(4002, this.RuleCalculateDate.AddDays(-1)).Value > 0)
                {
                    unionResult = (PairableScndCnpValue)this.DoConcept(4002, this.RuleCalculateDate.AddDays(-1));
                    ((PairableScndCnpValue)Result).AppendPairs(Operation.Intersect(unionResult, unionResult2));
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// مرخصی نیم روز
        /// مرخصی روزانه ای که تا حد مشخصی از غیبت را پوشش میدهد و د هر صورت به میزان مشخص از
        /// مانده مرخصی کسر میگردد
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public virtual void C1501(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            ((PairableScndCnpValue)Result).ClearPairs();
            PairableScndCnpValue validLeave  = new PairableScndCnpValue();
            PairableScndCnpValue AbsentLeave = new PairableScndCnpValue();
            Permit    permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(150));
            BaseShift shift  = this.Person.GetShiftByDate(this.ConceptCalculateDate);

            if (shift != null && shift.PairCount > 0 && permit.Value > 0)
            {
                // ساعات نیم روز سوال گردد

                IPair firstHalf  = new PairableScndCnpValuePair(shift.PastedPairs.From, 11 * 60 + 30);
                IPair secondHalf = new PairableScndCnpValuePair(10 * 60 + 45, shift.PastedPairs.To);

                if (Operation.Intersect(firstHalf, this.DoConcept(3028)).Value > Operation.Intersect(secondHalf, this.DoConcept(3028)).Value)
                {
                    this.Person.AddUsedLeave(this.ConceptCalculateDate, firstHalf.Value, permit);
                    //((PairableScndCnpValue)Result).AddPair(firstHalf);
                    Result.Value = 1;
                    ((PairableScndCnpValue)this.DoConcept(3028)).AddPairs(Operation.Differance(this.DoConcept(3028), firstHalf));
                    ((PairableScndCnpValue)this.DoConcept(3001)).AddPairs(this.DoConcept(3028));
                }
                else
                {
                    this.Person.AddUsedLeave(this.ConceptCalculateDate, secondHalf.Value, permit);
                    //((PairableScndCnpValue)Result).AddPair(secondHalf);
                    Result.Value = 1;
                    ((PairableScndCnpValue)this.DoConcept(3028)).AddPairs(Operation.Differance(this.DoConcept(3028), secondHalf));
                    ((PairableScndCnpValue)this.DoConcept(3001)).AddPairs(this.DoConcept(3028));
                }

                this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031);
            }
        }
Exemple #6
0
        /// <summary>
        /// ماموریت آموزشی
        /// شامل اضافه کار نمیشود
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public override void C2014(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            ((PairableScndCnpValue)Result).Pairs.Clear();
            PairableScndCnpValue validMission  = new PairableScndCnpValue();
            PairableScndCnpValue AbsentMission = new PairableScndCnpValue();
            Permit    permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.HourDuty2));
            BaseShift shift  = this.Person.GetShiftByDate(this.ConceptCalculateDate);

            if (shift != null && shift.PairCount > 0)
            {
                #region بررسی غیبت ها

                AbsentMission.AddPairs(Operation.Intersect(permit, this.DoConcept(3028)));

                ((PairableScndCnpValue)this.DoConcept(3028)).AddPairs(Operation.Differance(this.DoConcept(3028), AbsentMission));
                ((PairableScndCnpValue)this.DoConcept(3001)).AddPairs(Operation.Differance(this.DoConcept(3001), AbsentMission));
                ((PairableScndCnpValue)Result).AppendPairs(AbsentMission);

                #endregion
            }
            else//روز تعطیل
            {
                ((PairableScndCnpValue)Result).AppendPairs(permit.Pairs);
            }

            this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031);
        }
 /// <summary>مفهوم مجموع ماموريت روزانه</summary>
 /// <param name="Result"></param>
 /// <remarks>شناسه اين مفهوم در تعاريف بعدي سي و چهار-4 درنظر گرفته شده است</remarks>
 public override void C2005(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     Result.Value  = 0;
     Result.Value  = this.DoConcept(2031).Value;
     Result.Value += this.DoConcept(2032).Value;
     Result.Value += this.DoConcept(2033).Value;
     Result.Value += this.DoConcept(2034).Value;
 }
 /// <summary>مفهوم ماموریت روزانه تعطیل_روز غیرکاری، تعطیل رسمی و غیررسمی</summary>
 /// <param name="Result"></param>
 public void C2502(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     if (EngEnvironment.HasCalendar(this.ConceptCalculateDate, "1", "2") ||
         this.Person.GetShiftByDate(this.ConceptCalculateDate).Value == 0)
     {
         Result.Value = this.DoConcept(2003).Value;
     }
 }
 /// <summary>مفهوم اضافه کارساعتی تعطیل_روز غیرکاری، تعطیل رسمی و غیررسمی</summary>
 /// <param name="Result"></param>
 public void C4501(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     if (EngEnvironment.HasCalendar(this.ConceptCalculateDate, "1", "2") ||
         this.Person.GetShiftByDate(this.ConceptCalculateDate).Value == 0)
     {
         ((PairableScndCnpValue)Result).AddPairs(((PairableScndCnpValue)this.DoConcept(4001)).Pairs);
     }
 }
Exemple #10
0
 /// <summary>
 /// حضور در روز
 /// اگر حضور داشته باشد , یک میشود
 /// </summary>
 /// <param name="Result"></param>
 /// <param name="MyConcept"></param>
 public virtual void C501(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     Result.Value = 0;
     if (this.DoConcept(1).Value > 0)
     {
         Result.Value = 1;
     }
 }
 public override void C2031(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     base.C2031(Result, MyConcept);
     if (Result.Value > 0 && this.Person.GetShiftByDate(this.ConceptCalculateDate).Value == 0)
     {
         this.DoConcept(2503).Value = 1;
     }
 }
        /// <summary>
        /// اضافه کار خالص شده ماهانه
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public virtual void C4502(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            PersistedScndCnpPrdValue tmp = this.Person.GetPeriodicScndCnpValue(Result, this.ConceptCalculateDate);

            Result.Value           = tmp.Value;
            Result.FromDate        = tmp.FromDate;
            Result.ToDate          = tmp.ToDate;
            Result.CalculationDate = this.ConceptCalculateDate;
        }
Exemple #13
0
 /// <summary>مفهوم مجموع ماموريت ساعتي</summary>
 /// جدا کردن ماموریت 2019 و 2021
 /// <param name="Result"></param>
 public override void C2023(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     PairableScndCnpValue.AddPairsToScndCnpValue(this.DoConcept(2004), Result);
     //PairableScndCnpValue.AppendPairsToScndCnpValue(this.DoConcept(2019), Result);
     PairableScndCnpValue.AppendPairsToScndCnpValue(this.DoConcept(2020), Result);
     //PairableScndCnpValue.AppendPairsToScndCnpValue(this.DoConcept(2021), Result);
     PairableScndCnpValue.AppendPairsToScndCnpValue(this.DoConcept(2022), Result);
     this.DoConcept(13);//در قانون مربوطه باید اضافه گردد
     this.DoConcept(2).Value += Operation.Intersect(this.Person.GetShiftByDate(this.ConceptCalculateDate), Result).Value;
 }
Exemple #14
0
 /// <summary>مفهوم اضافه کارساعتي مجاز</summary>
 /// <param name="Result"></param>
 /// <remarks>شناسه اين مفهوم در تعاريف بعدي یکصدو بیست و پنج-125 درنظر گرفته شده است</remarks>
 public virtual void C4002(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     ((PairableScndCnpValue)Result).AddPairs(
         Operation.Differance(
             Operation.Differance(this.DoConcept(4001), this.DoConcept(4017)),
             this.DoConcept(4009)
             )
         );
     ((PairableScndCnpValue)Result).AddPairs(Operation.Differance(Result, this.DoConcept(5002)));
 }
Exemple #15
0
 /// <summaryمفهوم مجموع مرخصی باحقوق روزانه </summary>
 /// <param name="Result"></param>
 public override void C1096(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     Result.Value  = 0;
     Result.Value += this.DoConcept(1029).Value;
     Result.Value += this.DoConcept(1031).Value;
     Result.Value += this.DoConcept(1033).Value;
     Result.Value += this.DoConcept(1035).Value;
     Result.Value += this.DoConcept(1037).Value;
     Result.Value += this.DoConcept(1502).Value;
     Result.Value += this.DoConcept(1504).Value;
 }
Exemple #16
0
        /// <summary>مفهوم مرخصي با حقوق خالص روزانه_151</summary>
        /// <param name="Result"></param>
        public virtual void C1504(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(151));

            //Result.Value = permit != null && permit.Value == 1 ? 1 : 0;
            if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value > 0
                ||
                this.DoConcept(1021).Value == 1)
            {
                Result.Value = permit != null && permit.Value == 1 ? 1 : 0;
            }
        }
Exemple #17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public override void C1002(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            ((PairableScndCnpValue)Result).ClearPairs();
            //120 precard : مرخصی نیم روز
            Permit halfDayPermit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(120));
            Permit hourlyLeave   = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.HourLeave1));

            if (halfDayPermit.ID > 0 && halfDayPermit.PairCount > 0)
            {
                PairableScndCnpValue PermitInShift = new PairableScndCnpValue();
                int demandLeave = 0;
                PairableScndCnpValue absence = (PairableScndCnpValue)this.DoConcept(3028);
                int absenceDuration          = 0;
                int maxLeave = 3 * 60 + 30;
                foreach (PairableScndCnpValuePair pair in absence.Pairs)
                {
                    if (absenceDuration >= maxLeave)
                    {
                        break;
                    }
                    int pairValue = pair.Value;
                    if (absenceDuration + pair.Value > maxLeave)
                    {
                        pairValue = maxLeave - absenceDuration;
                        //absenceDuration = maxLeave;
                    }

                    demandLeave = this.Person.GetRemainLeave(this.ConceptCalculateDate);
                    if (demandLeave < pairValue && this.DoConcept(1098).Value == 0)
                    {
                        pairValue = demandLeave;
                    }

                    this.Person.AddUsedLeave(this.ConceptCalculateDate, pairValue, halfDayPermit);

                    absenceDuration += pairValue;
                }

                IList <IPair> pairList = absence.DecreasePairFromFirst(absenceDuration);
                ((PairableScndCnpValue)this.DoConcept(3001)).DecreasePairFromFirst(absenceDuration);
                foreach (IPair pair in pairList)
                {
                    ((PairableScndCnpValue)Result).AppendPair(pair);
                }

                this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031);
            }
            if (hourlyLeave.ID > 0 && hourlyLeave.PairCount > 0)
            {
                base.C1002(Result, MyConcept);
            }
        }
        /// <summary>مفهوم تاخير خالص ساعتي</summary>
        /// <param name="Result"></param>
        /// <remarks>شناسه اين مفهوم در تعاريف بعدي چهل و دو-42 درنظر گرفته شده است</remarks>
        public virtual void C3010(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            Result.Value = 0;
            PairableScndCnpValue.ClearPairsValue(Result);
            ProceedTraffic proceedTraffic = Person.GetProceedTraficByDate(this.ConceptCalculateDate);

            this.DoConcept(3038).Value = 0;
            if (this.DoConcept(1090).Value == 0 && this.DoConcept(2005).Value == 0 && this.DoConcept(1091).Value == 0)
            {
                PairableScndCnpValue absent = (PairableScndCnpValue)this.DoConcept(3001);
                BaseShift            shift  = this.Person.GetShiftByDate(this.ConceptCalculateDate);

                if (absent != null && shift != null && absent.PairCount != 0 && shift.PairCount != 0)
                {
                    if (proceedTraffic != null && proceedTraffic.Pairs.Where(x => x.IsFilled).Count() > 0 &&
                        Operation.Intersect(this.Person.GetShiftByDate(this.ConceptCalculateDate), proceedTraffic).Value > 0)
                    {
                        IPair pair = proceedTraffic.Pairs.Where(x => x.IsFilled).OrderBy(x => x.From).First();
                        //ShiftPair firstShiftPair = shift.Pairs.OrderBy(x => x.From).First();
                        foreach (ShiftPair shiftPair in shift.Pairs.OrderBy(x => x.From).ToList())
                        {
                            PairableScndCnpValue p = Operation.Intersect(shiftPair, absent);
                            if (p.PairCount > 0 && p.Pairs.OrderBy(x => x.From).Last().To ==
                                shiftPair.To)
                            {
                                //PairableScndCnpValue val = Operation.Differance(p.Pairs.OrderBy(x => x.From).First(), pair);
                                PairableScndCnpValue.AppendPairToScndCnpValue(p.Pairs.Last(), Result);
                                this.DoConcept(3038).Value += 1;
                                //break;
                            }
                        }
                    }
                    else
                    {
                        //در نظر گرفتن کل غیبت
                        foreach (ShiftPair shiftPair in shift.Pairs.OrderBy(x => x.From).ToList())
                        {
                            PairableScndCnpValue p = Operation.Intersect(shiftPair, absent);
                            if (p.PairCount > 0 && p.Pairs.OrderBy(x => x.From).First().From ==
                                shiftPair.From)
                            {
                                PairableScndCnpValue.AppendPairToScndCnpValue(p.Pairs.OrderBy(x => x.From).First(), Result);
                                this.DoConcept(3038).Value += 1;
                            }
                        }
                    }
                }
            }
        }
Exemple #19
0
        /// <summary>
        /// آف دکتر
        /// کسر از اضافه کار
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public virtual void C1503(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            ((PairableScndCnpValue)Result).ClearPairs();

            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(154));

            if (permit.Value > 0)
            {
                ((PairableScndCnpValue)this.DoConcept(3028)).ClearPairs();
                ((PairableScndCnpValue)this.DoConcept(3029)).ClearPairs();
                ((PairableScndCnpValue)this.DoConcept(3030)).ClearPairs();
                ((PairableScndCnpValue)this.DoConcept(3031)).ClearPairs();
                this.DoConcept(3004).Value = 0;
                Result.Value = 1;
            }
        }
Exemple #20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        //public override void C1002(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        //{
        //    ((PairableScndCnpValue)Result).ClearPairs();
        //    Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.HourLeave1));
        //    PairableScndCnpValue permitPairs = new PairableScndCnpValue();
        //    int demandLeave = 0;
        //    int leavePieceCount = this.DoConcept(1092).Value;

        //    #region محاسبه مجوزهای داخل شیفتی که محدودیت های تعداد و مقدار برای آنها اعمال شده باشد

        //    BaseShift shift = this.Person.GetShiftByDate(this.ConceptCalculateDate);
        //    foreach (PermitPair permitPair in permit.Pairs)
        //    {
        //        PairableScndCnpValue pairsInShift = Operation.Intersect(permitPair, shift);

        //        permitPairs.AppendPair(permitPair);
        //        //if (this.DoConcept(1099).Value == 0)
        //        //{
        //        //    PermitInShift.AppendPairs(pairsInShift.Pairs);
        //        //}
        //        //else
        //        //{
        //        //    PermitInShift.AppendPair(permitPair);
        //        //}
        //    }

        //    #endregion

        //    #region بررسی مقدار طلب بمنظور تبدیل مجوز مرخصی به مرخصی

        //    demandLeave = this.Person.GetRemainLeave(this.ConceptCalculateDate);
        //    if (permitPairs.Value > 0 && (permitPairs.Value > demandLeave && this.DoConcept(1098).Value == 0))
        //    {
        //        PairableScndCnpValue removedPairs = permitPairs.DecreasePairFromLast(permitPairs.Value - demandLeave);
        //        //تبدیل مرخصی استحقاقی به مرخصی بی حقوق در صورت عدم طلب
        //        if (this.DoConcept(1014).Value == 1)
        //        {
        //            ((PairableScndCnpValue)this.DoConcept(3028)).AddPairs(Operation.Differance(this.DoConcept(3028), removedPairs));
        //            ((PairableScndCnpValue)this.DoConcept(3001)).AddPairs(Operation.Differance(this.DoConcept(3001), removedPairs));

        //            this.DoConcept(1056).Value += removedPairs.PairValues;
        //        }
        //    }

        //    #endregion

        //    if (permitPairs.Value > 0)
        //    {
        //        if (this.DoConcept(1099).Value == 0)
        //        {
        //            ((PairableScndCnpValue)Result).AppendPairs(Operation.Intersect(this.DoConcept(3028), permitPairs));
        //            this.Person.AddUsedLeave(this.ConceptCalculateDate,
        //                                     Operation.Intersect(this.DoConcept(3028), permitPairs).Value, permit);
        //        }
        //        else
        //        {
        //            ((PairableScndCnpValue)Result).AppendPairs(permitPairs);
        //            this.Person.AddUsedLeave(this.ConceptCalculateDate,
        //                                     Operation.Intersect(permitPairs, permitPairs).Value, permit);
        //        }
        //        ((PairableScndCnpValue)this.DoConcept(3028)).AddPairs(Operation.Differance(this.DoConcept(3028), permitPairs));
        //        ((PairableScndCnpValue)this.DoConcept(3001)).AddPairs(Operation.Differance(this.DoConcept(3001), permitPairs));
        //        this.DoConcept(1092).Value = leavePieceCount;

        //        this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031);
        //    }
        //}

        /// <summary>
        /// مرخصی روزانه با توجه به مفهوم مرخصی در روز
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        //public override void C1004(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        //{
        //    int leaveInDay = this.DoConcept(1001).Value;

        //    Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.DailyEstehghaghiLeave));
        //    if (permit != null && permit.Value == 1)
        //    {
        //        if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value > 0)
        //        {
        //            int demandLeave = this.Person.GetRemainLeave(this.ConceptCalculateDate);
        //            if (leaveInDay > demandLeave && this.DoConcept(1098).Value == 0)
        //            {
        //                //تبدیل مرخصی استحقاقی به مرخصی بی حقوق در صورت عدم طلب
        //                if (this.DoConcept(1014).Value == 1)
        //                {
        //                    this.DoConcept(1066).Value = 1;
        //                }
        //            }
        //            else
        //            {
        //                Result.Value = 1;
        //                this.Person.AddUsedLeave(this.ConceptCalculateDate, leaveInDay, permit);
        //            }
        //        }
        //        else
        //        {
        //            //مرخصی قطعی در روزغیرکاری
        //            if (this.DoConcept(1021).Value == 1)
        //            {
        //                //حتی اگر طلب نداشته باشد باید منفی شود
        //                Result.Value = 1;
        //                this.Person.AddUsedLeave(this.ConceptCalculateDate, leaveInDay, permit);
        //            }
        //        }
        //    }
        //}

        /// <summary>مفهوم مرخصی بیماری بی حقوق خالص روزانه_31 </summary>
        /// <param name="Result"></param>
        public override void C1063(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            //طبق درخواست مانا مرخصی روزانه ای که در روزهای 5 شنبه گرفته میشود باید روزانه شود نه ساعتی
            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.DailyNoSallaryIllnessLeave1));

            if (permit != null && permit.Value == 1)
            {
                Result.Value = 1;
                this.DoConcept(3003).Value = 0;
                //Result.FromDate =
                //Result.ToDate = this.ConceptCalculateDate;
            }
            else
            {
                Result.Value = 0;
            }
        }
 /// <summary>مفهوم رست </summary>
 /// <param name="Result"></param>
 public void C1501(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     //Result.Value = 0;
     if (this.DoConcept(3004).Value == 1 || this.DoConcept(3028).Value > 5 * HourMin)
     {
         Permit rest = this.Person.GetPermitByDate(this.RuleCalculateDate, EngEnvironment.GetPrecard(202));
         if (rest != null && rest.Value == 1)
         {
             this.DoConcept(1501).Value = 1;
             this.DoConcept(4).Value    = 1;
             this.DoConcept(2).Value    = 0;// this.Person.GetShiftByDate(this.RuleCalculateDate).PairValues;
             this.DoConcept(6).Value    = 0;
             this.DoConcept(3004).Value = 0;
             ((PairableScndCnpValue)this.DoConcept(3028)).ClearPairs();
         }
     }
 }
Exemple #22
0
        /// <summary>
        /// بی حقوق ساعتی - مرخصی قطعی لحاظ نگردد
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public override void C1055(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            ((PairableScndCnpValue)Result).Pairs.Clear();
            PairableScndCnpValue validLeave  = new PairableScndCnpValue();
            PairableScndCnpValue AbsentLeave = new PairableScndCnpValue();
            Permit    permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.NoSallaryHourLeave1));
            BaseShift shift  = this.Person.GetShiftByDate(this.ConceptCalculateDate);

            if (shift != null && shift.PairCount > 0 && permit.Value > 0)
            {
                #region بررسی غیبت ها
                PairableScndCnpValue intersect = Operation.Intersect(permit, this.DoConcept(3028));
                if (intersect != null && intersect.Value > 0)//در این حالت به میزان عدم حضور لحاظ گردد
                {
                    AbsentLeave.AddPairs(intersect);
                }
                else
                {
                    AbsentLeave.AddPairs(permit.Pairs.ToList <IPair>());
                }
                if (AbsentLeave.Value > this.DoConcept(1501).Value)
                {
                    int usedValue = 0;
                    for (int i = 0; i < AbsentLeave.PairCount; i++)
                    {
                        int notAllow = (usedValue + AbsentLeave.Pairs[i].Value) - this.DoConcept(1501).Value;
                        notAllow = notAllow < 0 ? 0 : notAllow;
                        int allow = AbsentLeave.Pairs[i].Value - notAllow;
                        allow      = allow < 0 ? 0 : allow;
                        usedValue += allow;
                        if (notAllow > 0)
                        {
                            AbsentLeave.Pairs[i] = new PairableScndCnpValuePair(AbsentLeave.Pairs[i].From, AbsentLeave.Pairs[i].From + allow);
                        }
                    }
                }
                ((PairableScndCnpValue)this.DoConcept(3028)).AddPairs(Operation.Differance(this.DoConcept(3028), AbsentLeave));
                ((PairableScndCnpValue)this.DoConcept(3001)).AddPairs(Operation.Differance(this.DoConcept(3001), AbsentLeave));
                ((PairableScndCnpValue)Result).AppendPairs(AbsentLeave);

                #endregion

                this.ReCalculate(this.ConceptCalculateDate, 3008, 3010, 3014, 3029, 3030, 3031);
            }
        }
Exemple #23
0
 /// <summary>مفهوم مجموع انواع مرخصی روزانه که به آنها حقوق تعلق میگیرد
 /// </summary>
 /// <param name="Result"></param>
 public override void C1090(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     //انواع مرخصی که به آنها حقوق تعلق میگیرد
     Result.Value  = 0;
     Result.Value += this.DoConcept(1005).Value;
     Result.Value += this.DoConcept(1010).Value;
     Result.Value += this.DoConcept(1029).Value;
     Result.Value += this.DoConcept(1031).Value;
     Result.Value += this.DoConcept(1033).Value;
     Result.Value += this.DoConcept(1035).Value;
     Result.Value += this.DoConcept(1037).Value;
     Result.Value += this.DoConcept(1502).Value;
     Result.Value += this.DoConcept(1504).Value;
     if (Result.Value > 0)
     {
         this.DoConcept(2).Value = this.Person.GetShiftByDate(this.RuleCalculateDate).Value;
     }
 }
Exemple #24
0
        /// <summary>
        /// دکتر صنعت ماهانه
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public virtual void C1504(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            PersistedScndCnpPrdValue tmp = this.Person.GetPeriodicScndCnpValue(Result, this.ConceptCalculateDate);

            Result.Value           = tmp.Value;
            Result.FromDate        = tmp.FromDate;
            Result.ToDate          = tmp.ToDate;
            Result.CalculationDate = this.ConceptCalculateDate;
            if (Result.Value > 0)
            {
                if (this.DoConcept(4005).Value > 0)
                {
                    this.DoConcept(4005).Value -= (Result.Value * 5 * 60);
                    if (this.DoConcept(4005).Value <= 0)
                    {
                        this.DoConcept(4005).Value = 1;
                    }
                }
            }
        }
        /// <summary>
        /// مجوز مرخصی کارگاهی
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public virtual void C1501(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            Result.Value = 0;
            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(127));

            if (permit != null && permit.Value == 1)
            {
                if (!EngEnvironment.HasCalendar(this.ConceptCalculateDate, "3"))
                {
                    Result.Value = 1;
                }
                if (this.DoConcept(3028).Value > 0)
                {
                    ((PairableScndCnpValue)this.DoConcept(3028)).ClearPairs();
                }
                if (this.DoConcept(3004).Value > 0)
                {
                    this.DoConcept(3004).Value = 0;
                }
            }
        }
Exemple #26
0
        /// <summary>مفهوم مرخصي استحقاقي خالص روزانه</summary>
        /// <param name="Result"></param>
        /// <remarks>شناسه اين مفهوم در تعاريف بعدي بيست و دو-22 درنظر گرفته شده است</remarks>
        public override void C1004(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            //طبق توافق صورت گرفته در اینجا تنها داشتن مجوز ملاک مقداردهی مرخصی استحقاقی روزانه است
            int leaveInDay = this.DoConcept(1001).Value;

            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.DailyEstehghaghiLeave));

            if (permit != null && permit.Value == 1)
            {
                if (this.Person.GetShiftByDate(this.ConceptCalculateDate).Value > 0)
                {
                    int demandLeave = this.Person.GetRemainLeave(this.ConceptCalculateDate);
                    if (leaveInDay > demandLeave)
                    {
                        //تبدیل مرخصی استحقاقی به مرخصی بی حقوق در صورت عدم طلب
                        if (this.DoConcept(1014).Value == 1)
                        {
                            this.DoConcept(1066).Value = 1;
                        }
                    }
                    else
                    {
                        Result.Value = 1;
                        this.Person.AddUsedLeave(this.ConceptCalculateDate, leaveInDay, permit);
                    }
                }
                else
                {
                    //مرخصی قطعی در روزغیرکاری
                    if (this.DoConcept(1021).Value == 1)
                    {
                        //حتی اگر طلب نداشته باشد باید منفی شود
                        Result.Value = 1;
                        this.Person.AddUsedLeave(this.ConceptCalculateDate, leaveInDay, permit);
                    }
                }
            }
        }
 /// <summary>
 ///  اضافه کار خالص شده
 /// </summary>
 /// <param name="Result"></param>
 /// <param name="MyConcept"></param>
 public virtual void C4501(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     Result.Value = 0;
 }
Exemple #28
0
        /// <summary>
        /// مرخصی روزانه در صورتی اعمال شود که شخص زیر 4 ساعت حضور داشته باشد
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        //public override void C1004(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        //{
        //    if (this.DoConcept(1).Value <= 4 * 60)
        //    {
        //        base.C1004(Result, MyConcept);
        //    }
        //}

        /// <summary>
        /// مرخصی استعلاجی روزانه
        /// </summary>
        /// <param name="Result"></param>
        /// <param name="MyConcept"></param>
        public override void C1009(BaseScndCnpValue Result, SecondaryConcept MyConcept)
        {
            Permit permit = this.Person.GetPermitByDate(this.ConceptCalculateDate, EngEnvironment.GetPrecard(Precards.DailyEstelagiLeave));

            if (permit != null && permit.Value == 1)
            {
                PairableScndCnpValue tmpResult  = new PairableScndCnpValue();
                PairableScndCnpValue LeaveShift = ((PairableScndCnpValue)this.DoConcept(1116));
                int hour = 0;
                if (LeaveShift.PairCount == 1 && LeaveShift.Pairs.First().To >= LeaveShift.Pairs.First().From)
                {
                    if (this.DoConcept(6).Value > 0)
                    {
                        if (this.DoConcept(6).Value < LeaveShift.Pairs.First().From)
                        {
                            tmpResult.AddPairs(this.Person.GetShiftByDate(this.ConceptCalculateDate).Pairs.ToList <IPair>());
                        }
                        else if (this.DoConcept(6).Value >= LeaveShift.Pairs.First().From&& this.DoConcept(6).Value <= LeaveShift.Pairs.First().To)
                        {
                            tmpResult.Value = 1;
                        }
                        else//greater
                        {
                            int dev1 = 0;
                            if (this.DoConcept(3028).Value > 0)
                            {
                                dev1 = this.DoConcept(3028).Value / LeaveShift.Pairs.First().To;
                                hour = this.DoConcept(3028).Value % LeaveShift.Pairs.First().To;
                            }
                            else
                            {
                                dev1 = this.DoConcept(6).Value / LeaveShift.Pairs.First().To;
                                hour = this.DoConcept(6).Value % LeaveShift.Pairs.First().To;
                            }

                            if (hour >= LeaveShift.Pairs.First().From)
                            {
                                dev1++;
                                hour = 0;
                            }
                            tmpResult.Value = (int)dev1;
                        }
                    }
                    else//استعلاجی در روز تعطیل هم لحاظ میگردد
                    {
                        tmpResult.Value = 1;
                    }
                }
                else
                {
                    float dev = 1;

                    if (this.DoConcept(1113).Value > 0)
                    {
                        if (this.DoConcept(7).Value > 0)
                        {
                            dev = (float)this.DoConcept(6).Value / (float)this.DoConcept(7).Value;
                        }
                    }
                    dev = dev < 1 ? 1 : dev;


                    tmpResult.Value = (int)dev;
                    if (Result.Value < dev)
                    {
                        hour = (int)dev - tmpResult.Value;
                    }
                }


                Result.Value = tmpResult.Value;
                if (Result.Value > 0)
                {
                    ((PairableScndCnpValue)this.DoConcept(3028)).ClearPairs();
                    ((PairableScndCnpValue)this.DoConcept(3029)).ClearPairs();
                    ((PairableScndCnpValue)this.DoConcept(3030)).ClearPairs();
                    ((PairableScndCnpValue)this.DoConcept(3031)).ClearPairs();
                }
            }
        }
 /// <summary>
 ///  مرخصی کارگاهی
 /// </summary>
 /// <param name="Result"></param>
 /// <param name="MyConcept"></param>
 public virtual void C1503(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     Result.Value = this.DoConcept(1501).Value;
 }
 /// <summary>
 /// ماموریت روزانه تعطیل
 /// </summary>
 /// <param name="Result"></param>
 /// <param name="MyConcept"></param>
 public void C2503(BaseScndCnpValue Result, SecondaryConcept MyConcept)
 {
     Result.Value = 0;
 }