Exemplo n.º 1
0
 public DeclarationSocialValue(Byte statement, WorkSocialTerms summarize, TAmountDec totalBase, Byte foreigner) : base((ResultCode)ArticleResultCode.RESULT_VALUE_DECLARATION_SOCIAL)
 {
     this.StatementType = statement;
     this.SummarizeType = summarize;
     this.ForeignerType = foreigner;
     this.SocialAnnuity = totalBase;
 }
        public void Should_Return_Valid_Result_Stream()
        {
            WorkRelationTerms TEST_CONTRACT_TYPE = WorkRelationTerms.WORKTERM_EMPLOYMENT_1;

            WorkHealthTerms TEST_HEALTH_TYPE = WorkHealthTerms.HEALTH_TERM_EMPLOYMENT;

            WorkSocialTerms TEST_SOCIAL_TYPE = WorkSocialTerms.SOCIAL_TERM_EMPLOYMENT;

            ITargetValues contractValues = TargetValueBuilder.CreateContractEmplTermValues(
                TEST_CONTRACT_TYPE, TEST_HEALTH_TYPE, TEST_SOCIAL_TYPE, null, null);

            ITargetValues positionValues = TargetValueBuilder.CreatePositionEmplTermValues(null, null);

            ITargetValues positionSalary = TargetValueBuilder.CreateSalaryBaseValues(10000m);

            ITargetValues emptyValues = TargetValueBuilder.CreateEmptyValues();

            ITargetStream targets = TargetStream.CreateEmptyStream().
                                    AddNewContractsTarget(ConfigSetCzArticleName.REF_CONTRACT_EMPL_TERM, contractValues, testConfig).
                                    AddNewPositionsTarget(ConfigSetCzArticleName.REF_POSITION_EMPL_TERM, positionValues, testConfig).
                                    AddTargetIntoPosition(ConfigSetCzArticleName.REF_SALARY_BASE, positionSalary, testConfig).
                                    AddTargetIntoPosition(ConfigSetCzArticleName.REF_INCOME_GROSS, emptyValues, testConfig);

            IEngineProfile testProfile = testEngine.BuildEngineProfile(testPeriod);

            IProcessService testModule = ProcessServiceModule.CreateModule(targets, testConfig, testProfile, serviceLog);

            IResultStream results = testModule.EvaluateTargetsToResults();

            serviceLog.CloseLogStream();

            Assert.AreEqual(0, results.Results().Keys.Count);
        }
        public IArticleResult AddIncomeInsSocialValue(WorkSocialTerms summarize, TAmountDec related, TAmountDec exclude)
        {
            IArticleResultValues value = new IncomeInsSocialValue(summarize, related, exclude);

            ResultValues = ResultValues.Concat(value);

            return(this);
        }
        public IArticleResult AddDeclarationSocialValue(Byte statement, WorkSocialTerms summarize, TAmountDec totalBase, Byte foreigner)
        {
            IArticleResultValues value = new DeclarationSocialValue(statement, summarize, totalBase, foreigner);

            ResultValues = ResultValues.Concat(value);

            return(this);
        }
Exemplo n.º 5
0
        public TAmountDec ExcludeGeneralIncomes(Period evalPeriod, WorkSocialTerms summarize,
                                                TAmountDec includeIncome, TAmountDec excludeIncome)
        {
            TAmountDec totalIncome = decimal.Zero;

            switch (summarize)
            {
            case WorkSocialTerms.SOCIAL_TERM_EMPLOYMENT:
            case WorkSocialTerms.SOCIAL_TERM_SMALL_EMPL:
            case WorkSocialTerms.SOCIAL_TERM_SHORT_MEET:
            case WorkSocialTerms.SOCIAL_TERM_SHORT_DENY:
                totalIncome = decimal.Add(totalIncome, excludeIncome);
                break;
            }
            return(totalIncome);
        }
Exemplo n.º 6
0
        public void Should_return_FALSE_for_Participation_when_WorkTerm_is_Employment_With_Small_Work_and_Income_is_2_499_CZK()
        {
            IEnginesHistory <ISocialEngine> engines = SocialEnginesHistory.CreateEngines();

            ISocialEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_EMPLOYMENT_1;

            WorkSocialTerms termOfSocial = WorkSocialTerms.SOCIAL_TERM_SMALL_EMPL;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 2499m;
            decimal testTotalTaxIncome = 2499m;

            bool resultValue = engine.ParticipateSocialIncome(testPeriod,
                                                              termOfWork, termOfSocial, testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(false, resultValue);
        }
Exemplo n.º 7
0
        public void Should_return_FALSE_for_Participation_when_WorkTerm_is_AgreementTasks_and_Income_is_9_999_CZK()
        {
            IEnginesHistory <ISocialEngine> engines = SocialEnginesHistory.CreateEngines();

            ISocialEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_CONTRACTER_T;

            WorkSocialTerms termOfSocial = WorkSocialTerms.SOCIAL_TERM_EMPLOYMENT;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 9999m;
            decimal testTotalTaxIncome = 9999m;

            bool resultValue = engine.ParticipateSocialIncome(testPeriod,
                                                              termOfWork, termOfSocial, testContractIncome, testWorkTermIncome, testTotalTaxIncome);

            Assert.AreEqual(false, resultValue);
        }
Exemplo n.º 8
0
        public void Should_Throw_EngineException_when_WorkTerm_is_Employment_With_Short_Work_Deny_and_Income_is_2_499_CZK()
        {
            IEnginesHistory <ISocialEngine> engines = SocialEnginesHistory.CreateEngines();

            ISocialEngine engine = engines.ResolveEngine(testPeriod);

            WorkRelationTerms termOfWork = WorkRelationTerms.WORKTERM_EMPLOYMENT_1;

            WorkSocialTerms termOfSocial = WorkSocialTerms.SOCIAL_TERM_SHORT_DENY;

            decimal testContractIncome = 0m;
            decimal testWorkTermIncome = 2499m;
            decimal testTotalTaxIncome = 2499m;

            TestDelegate testDelegateCode = () => {
                engine.ParticipateSocialIncome(testPeriod,
                                               termOfWork, termOfSocial, testContractIncome, testWorkTermIncome, testTotalTaxIncome);
            };

            Assert.Throws <EngineServicePeriodException> (testDelegateCode);
        }
        private void CopyTargetsToResults(ITargetValues targetValues)
        {
            if (targetValues == null)
            {
                return;
            }

            __contractType = targetValues.ContractType();

            __healthWorkType = targetValues.HealthWorkType();

            __socialWorkType = targetValues.SocialWorkType();

            __dateFrom = targetValues.DateFrom();

            __dateEnds = targetValues.DateEnds();

            __timesheetWeekly = targetValues.TimesheetWeekly();

            __workdaysWeekly = targetValues.WorkdaysWeekly();

            __timesheetWorked = targetValues.TimesheetWorked();

            __timesheetAbsent = targetValues.TimesheetAbsent();

            __amountMonthly = targetValues.AmountMonthly();

            __codeInterests = targetValues.CodeInterests();

            __codeResidency = targetValues.CodeResidency();

            __codeMandatory = targetValues.CodeMandatory();

            __codeStatement = targetValues.CodeStatement();

            __codeHandicaps = targetValues.CodeHandicaps();

            __codeCardinals = targetValues.CodeCardinals();
        }
Exemplo n.º 10
0
        public TargetValues(WorkRelationTerms contract, WorkHealthTerms healthType, WorkSocialTerms socialType,
                            DateTime?dateFrom, DateTime?dateEnds, Int32 timeWeekly, Int32 daysWeekly, Int32 timeWorked, Int32 timeAbsent,
                            decimal amountMonthly, uint interests, uint residency, uint mandatory, uint statement, uint handicaps, uint cardinals)
        {
            __contractType = contract;

            __healthWorkType = healthType;

            __socialWorkType = socialType;

            __dateFrom = dateFrom;

            __dateEnds = dateEnds;

            __timesheetWeekly = timeWeekly;

            __workdaysWeekly = daysWeekly;

            __timesheetWorked = timeWorked;

            __timesheetAbsent = timeAbsent;

            __amountMonthly = amountMonthly;

            __codeInterests = interests;

            __codeResidency = residency;

            __codeMandatory = mandatory;

            __codeStatement = statement;

            __codeHandicaps = handicaps;

            __codeCardinals = cardinals;
        }
Exemplo n.º 11
0
 public InsDeclarationSocialSource(Byte statementType, WorkSocialTerms summarizeType, TAmountDec totalYearBase)
 {
     StatementType = statementType;
     SummarizeType = summarizeType;
     TotalYearBase = totalYearBase;
 }
Exemplo n.º 12
0
 public static ITargetValues CreateContractEmplTermValues(WorkRelationTerms contract,
                                                          WorkHealthTerms healthType, WorkSocialTerms socialType,
                                                          DateTime?dateFrom, DateTime?dateEnds)
 {
     return(new TargetValues(contract, healthType, socialType,
                             dateFrom, dateEnds, NULL_TIME_WEEKLY, NULL_DAYS_WEEKLY, NULL_TIME_WORKED, NULL_TIME_ABSENT,
                             NULL_AMOUNT_MONTHLY,
                             NULL_CODE_INTERESTS, NULL_CODE_RESIDENCY, NULL_CODE_MANDATORY, NULL_CODE_STATEMENT, NULL_CODE_HANDICAPS, NULL_CODE_CARDINALS));
 }
        public override bool ParticipateSocialIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkSocialTerms socialTerm,
                                                     decimal contractIncome, decimal workTermIncome, decimal totalInsIncome)
        {
            bool workTermAgreementTasks = (workTerm == WorkRelationTerms.WORKTERM_CONTRACTER_T);

            if (workTermAgreementTasks)
            {
                return(ParticipateAgreementTasks(period, contractIncome, workTermIncome, totalInsIncome));
            }
            else
            {
                switch (socialTerm)
                {
                case WorkSocialTerms.SOCIAL_TERM_EMPLOYMENT:
                    return(ParticipateEmployment(period, contractIncome, workTermIncome, totalInsIncome));

                case WorkSocialTerms.SOCIAL_TERM_SMALL_EMPL:
                    return(ParticipateSmallRange(period, contractIncome, workTermIncome, totalInsIncome));

                case WorkSocialTerms.SOCIAL_TERM_SHORT_MEET:
                    return(ParticipateShortWorkMeet(period, contractIncome, workTermIncome, totalInsIncome));

                case WorkSocialTerms.SOCIAL_TERM_SHORT_DENY:
                    return(ParticipateShortWorkDeny(period, contractIncome, workTermIncome, totalInsIncome));

                default:
                    return(true);
                }
            }
        }
        // Participation Selectors

        public bool PartakeHealthIncome(Period period, WorkEmployTerms employTerm, WorkSocialTerms healthTerm,
                                        decimal contracterIncome, decimal employmentIncome, decimal summaryIncome)
        {
            return(true);
        }
Exemplo n.º 15
0
 public InsDeclarationSocialSource(Byte statementType, WorkSocialTerms summarizeType)
 {
     StatementType = statementType;
     SummarizeType = summarizeType;
 }
Exemplo n.º 16
0
 public abstract bool ParticipateSocialIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkSocialTerms socialTerm,
                                              decimal contractIncome, decimal workTermIncome, decimal totalInsIncome);
 public override bool ParticipateSocialIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkSocialTerms socialTerm,
                                              decimal contractIncome, decimal workTermIncome, decimal totalInsIncome)
 {
     return(false);
 }
Exemplo n.º 18
0
 public InsDeclarationSocialSource()
 {
     StatementType = 0;
     SummarizeType = WorkSocialTerms.SOCIAL_TERM_EMPLOYMENT;
 }
Exemplo n.º 19
0
 public IncomeInsSocialValue(WorkSocialTerms summarize, TAmountDec realted, TAmountDec exclude) : base((ResultCode)ArticleResultCode.RESULT_VALUE_INCOME_SUM_SOCIAL)
 {
     this.SummarizeType = summarize;
     this.IncomeRelated = realted;
     this.IncomeExclude = exclude;
 }