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); } } }
public override bool WithholdTaxableIncome(MonthPeriod period, bool isStatementSign, bool isResidentCzech, WorkRelationTerms workTerm, decimal contractIncome, decimal workTermIncome, decimal totalTaxIncome) { bool notSignedStatement = (!isStatementSign); if (notSignedStatement) { bool agreementTasksTerm = (workTerm == WorkRelationTerms.WORKTERM_CONTRACTER_T); bool agreementIncomeMax = (workTermIncome < PeriodMaximumIncomeToApplyWithholdTax(period)); if (agreementTasksTerm && agreementIncomeMax) { return(true); } bool statutoryTasksTerm = (workTerm == WorkRelationTerms.WORKTERM_STATUTORY__Q); bool foreignTaxResident = (!isResidentCzech); if (statutoryTasksTerm && foreignTaxResident) { return(true); } } return(false); }
public override bool ParticipateHealthIncome(MonthPeriod period, WorkRelationTerms workTerm, WorkHealthTerms healthTerm, decimal contractIncome, decimal workTermIncome, decimal totalInsIncome) { bool workTermAgreementTasks = (workTerm == WorkRelationTerms.WORKTERM_CONTRACTER_T); if (workTermAgreementTasks) { return(ParticipateAgreementTasks(period, contractIncome, workTermIncome, totalInsIncome)); } else { switch (healthTerm) { case WorkHealthTerms.HEALTH_TERM_EMPLOYMENT: return(ParticipateEmployment(period, contractIncome, workTermIncome, totalInsIncome)); case WorkHealthTerms.HEALTH_TERM_AGREE_WORK: case WorkHealthTerms.HEALTH_TERM_AGREE_TASK: case WorkHealthTerms.HEALTH_TERM_OUT_EMPLOY: return(ParticipateOutOfEmployment(period, contractIncome, workTermIncome, totalInsIncome)); default: return(true); } } }
public decimal ParticipHealthSelector(MonthPeriod period, bool insParticip, decimal valResult) { if (insParticip) { return(valResult); } return(0m); }
public decimal SubjectHealthSelector(MonthPeriod period, bool insSubject, bool insArticle, decimal valResult) { if (insSubject && insArticle) { return(valResult); } return(0m); }
public virtual Int32 PeriodMandatoryBasis(MonthPeriod period, bool isMinBaseRequired) { if (isMinBaseRequired) { return(PeriodMandatoryBasis(period)); } return(0); }
// EmployerContribution public decimal EmployerContribution(MonthPeriod period, bool negSuppress, decimal generalBasis, decimal mandatoryEmpee, decimal mandatoryEmper) { decimal compoundFactor = PeriodCompoundFactor(period); Int32 resultPaymentValue = EmployerContributionWithFactor(generalBasis, mandatoryEmpee, mandatoryEmper, compoundFactor); return(resultPaymentValue); }
public void Should_Compare_Different_Periods_AsEqual_When_2014_02() { MonthPeriod testPeriodOne = new MonthPeriod(testPeriodCodeFeb); MonthPeriod testPeriodTwo = new MonthPeriod(testPeriodCodeFeb); Assert.AreEqual(testPeriodOne, testPeriodTwo); }
public override Int32 PeriodMandatoryBasis(MonthPeriod period) { if (period.Year() == 2013 && period.Month() < 8) { return(HealthProperties2013.BASIS_MANDATORY_FROM_01_TO_07); } return(Guides().MandatoryBasis()); }
// WithholdTax public decimal WithholdTaxSelector(MonthPeriod period, bool withholdSubject, decimal valResult) { if (withholdSubject) { return(valResult); } return(0m); }
private SpanOfYears SpanFromEngines(MonthPeriod period) { ICollection <SpanOfYears> sortedHistory = Engines.Keys.OrderBy(x => x).ToArray(); SpanOfYears validSpan = sortedHistory.FirstOrDefault((x) => (period.Year() >= x.YearFrom && period.Year() <= x.YearUpto)); return(validSpan); }
// ChildrenAllowance public Int32 StatementChildrenAllowance(MonthPeriod period, bool isStatementSign, byte inPerOrder, bool disabChildren) { if (isStatementSign) { return(PeriodChildrenAllowance(period, inPerOrder, disabChildren)); } return(0); }
public void GenerateQuotas(MonthPeriod pMonth, int pYear) { //Se valida que ya no exista otro periodo igual if ((from p in this.iGeneratedPeriodDAO.GetAll() where p.Month == pMonth.ToString() & p.Year == pYear select p).Count() > 0) throw new BusinessException("El perÃodo que se desea generar ya ha sido generado"); //Genero las cuotas this.iQuotaDAO.GenerateQuotas(pMonth, pYear); }
// PayerBasicAllowance public Int32 StatementPayerBasicAllowance(MonthPeriod period, bool isStatementSign, bool isResidentCzech) { if (isStatementSign) { return(PeriodPayerBasicAllowance(period)); } return(0); }
public decimal BasisGeneralAdapted(MonthPeriod period, bool negSuppress, decimal valResult) { decimal adaptedResult = SocialOperations.DecSuppressNegative(negSuppress, valResult); decimal roundedResult = SocialOperations.DecRoundUp(adaptedResult); return(roundedResult); }
public decimal SubjectTaxingSelector(MonthPeriod period, bool taxSubject, bool taxArticle, decimal valResult) { if (taxSubject && taxArticle) { return(valResult); } return(0m); }
// ChildrenRebate public Int32 StatementChildrenRebate(MonthPeriod period, Int32 advancesTax, Int32 payerRebate, Int32 childrenAllowance) { decimal claimsValue = childrenAllowance; Int32 rebateValue = TaxingOperations.RebateResult(advancesTax, payerRebate, claimsValue); return(rebateValue); }
public decimal AdvancesTaxSelector(MonthPeriod period, bool advancesSubject, decimal valResult) { if (advancesSubject) { return(valResult); } return(0m); }
// AdvancesSolidaryBasis public decimal AdvancesSolidaryBasis(MonthPeriod period, decimal taxableIncome) { decimal solidaryLimit = PeriodMinimumIncomeToApplySolidaryIncrease(period); decimal solidaryBasis = Math.Max(0, taxableIncome - solidaryLimit); return(solidaryBasis); }
// PayerDisabAllowance public Int32 StatementPayerDisabAllowance(MonthPeriod period, bool isStatementSign, byte inDegree) { if (isStatementSign) { return(PeriodPayerDisabilityAllowance(period, inDegree)); } return(0); }
// StatementPayerStudyAllowance public Int32 StatementPayerStudyAllowance(MonthPeriod period, bool isStatementSign) { if (isStatementSign) { return(PeriodStudyingAllowance(period)); } return(0); }
public static Int32[] TimesheetAbsence(MonthPeriod period, Int32[] absenceSchedule, uint dayOrdFrom, uint dayOrdEnds) { int periodDaysCount = period.DaysInMonth(); Int32[] monthSchedule = Enumerable.Range(1, periodDaysCount). Select((x) => (SecondsFromScheduleSeq(period, absenceSchedule, x, dayOrdFrom, dayOrdEnds))).ToArray(); return(monthSchedule); }
public IEngineProfile BuildEngineProfile(MonthPeriod period) { IPeriodEngine periodEngine = HistoryOfPeriod.ResolveEngine(period); ITaxingEngine taxingEngine = HistoryOfTaxing.ResolveEngine(period); IHealthEngine healthEngine = HistoryOfHealth.ResolveEngine(period); ISocialEngine socialEngine = HistoryOfSocial.ResolveEngine(period); return(new EngineProfile(period, periodEngine, taxingEngine, healthEngine, socialEngine)); }
private bool ParticipateSmallRange(MonthPeriod period, decimal contractIncome, decimal workTermIncome, decimal totalInsIncome) { decimal marginalIncome = PeriodMarginalIncomeEmployment(period); if (workTermIncome < marginalIncome) { return(false); } return(true); }
private bool ParticipateAgreementTasks(MonthPeriod period, decimal contractIncome, decimal workTermIncome, decimal totalInsIncome) { decimal marginalIncome = PeriodMarginalIncomeAgreeTasks(period); if (workTermIncome < marginalIncome) { return(false); } return(true); }
public void Should_return_SocialEngine2012_for_ClassNameEngine_when_Year_2012() { IEnginesHistory <ISocialEngine> engines = SocialEnginesHistory.CreateEngines(); MonthPeriod period2012 = new MonthPeriod(2012, 1); ISocialEngine engine2012 = engines.ResolveEngine(period2012); Assert.AreEqual(FULL_CLASS_NAME_2012, engine2012.GetType().ToString()); }
// AdvancesRegularyTax public Int32 AdvancesRegularyTax(MonthPeriod period, decimal generalBasis) { decimal advancesFactor = PeriodAdvancesFactor(period); decimal advancesResult = TaxingOperations.DecFactorResult(generalBasis, advancesFactor); Int32 taxRegulary = TaxingOperations.IntRoundUp(advancesResult); return(taxRegulary); }
public void Should_return_HealthEngine2011_for_ClassNameEngine_when_Year_2011() { IEnginesHistory <IHealthEngine> engines = HealthEnginesHistory.CreateEngines(); MonthPeriod period2011 = new MonthPeriod(2011, 1); IHealthEngine engine2011 = engines.ResolveEngine(period2011); Assert.AreEqual(FULL_CLASS_NAME_2011, engine2011.GetType().ToString()); }
// AdvancesSolidaryTax public Int32 AdvancesSolidaryTax(MonthPeriod period, decimal solidaryBasis) { decimal solidaryFactor = PeriodSolidaryFactor(period); decimal solidaryResult = TaxingOperations.DecFactorResult(solidaryBasis, solidaryFactor); Int32 taxSolidary = TaxingOperations.IntRoundUp(solidaryResult); return(taxSolidary); }
// StatementPayerTaxRebate public Int32 StatementPayerTaxRebate(MonthPeriod period, Int32 advancesTax, Int32 payerAllowance, Int32 disabAllowance, Int32 studyAllowance) { decimal rebateApply = 0m; decimal claimsValue = payerAllowance + disabAllowance + studyAllowance; Int32 rebateValue = TaxingOperations.RebateResult(advancesTax, rebateApply, claimsValue); return(rebateValue); }
// WithholdTax public Int32 WithholdResultTax(MonthPeriod period, decimal generalBasis) { decimal withholdFactor = PeriodWithholdFactor(period); decimal withholdResult = TaxingOperations.DecFactorResult(generalBasis, withholdFactor); Int32 taxRegulary = TaxingOperations.IntRoundUp(withholdResult); return(taxRegulary); }
public static void GenerateQuotas(MonthPeriod pMonth, int pYear) { iQuotaSvc.GenerateQuotas(pMonth, pYear); }
private static int GetPeriodFromEnum(MonthPeriod period) { switch (period) { case MonthPeriod.Monthly: return 1; case MonthPeriod.Quarterly: return 3; case MonthPeriod.HalfYearly: return 6; case MonthPeriod.Yearly: return 12; default: throw new InvalidOperationException(); } }