private void tsmEarningType_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (TabPage _tab in this.tbcNSites_V.TabPages)
                {
                    if (_tab.Text == "EarningType List")
                    {
                        tbcNSites_V.SelectedTab = _tab;
                        return;
                    }
                }

                EarningType       _EarningType = new EarningType();
                Type              _Type        = typeof(EarningType);
                ListFormPayrollUI _ListForm    = new ListFormPayrollUI((object)_EarningType, _Type);
                TabPage           _ListFormTab = new TabPage();
                _ListFormTab.ImageIndex = 24;
                _ListForm.ParentList    = this;
                displayControlOnTab(_ListForm, _ListFormTab);
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "tsmEarningType_Click");
                em.ShowDialog();
                return;
            }
        }
Beispiel #2
0
        protected PeriodisedRequiredPaymentEvent CreateRequiredPaymentEvent(EarningType earningType, int transactionType, bool holdBackCompletionPayment)
        {
            if (holdBackCompletionPayment)
            {
                return(new CompletionPaymentHeldBackEvent());
            }

            switch (earningType)
            {
            case EarningType.CoInvested:
                return(new CalculatedRequiredCoInvestedAmount
                {
                    OnProgrammeEarningType = (OnProgrammeEarningType)transactionType,
                });

            case EarningType.Incentive:
                return(new CalculatedRequiredIncentiveAmount
                {
                    Type = (IncentivePaymentType)transactionType,
                });

            case EarningType.Levy:
                return(new CalculatedRequiredLevyAmount
                {
                    OnProgrammeEarningType = (OnProgrammeEarningType)transactionType,
                });
            }

            throw new NotImplementedException($"Could not create required payment for earning type: {earningType}");
        }
 public EarningTypeDetailUI()
 {
     InitializeComponent();
     lId           = "";
     lOperation    = GlobalVariables.Operation.Add;
     loEarningType = new EarningType();
 }
Beispiel #4
0
        public PeriodisedRequiredPaymentEvent Create(EarningType earningType, int transactionType)
        {
            switch (earningType)
            {
            case EarningType.CoInvested:
                return(new CalculatedRequiredCoInvestedAmount
                {
                    OnProgrammeEarningType = (OnProgrammeEarningType)transactionType,
                });

            case EarningType.Incentive:
                return(new CalculatedRequiredIncentiveAmount
                {
                    Type = (IncentivePaymentType)transactionType,
                });

            case EarningType.Levy:
                return(new CalculatedRequiredLevyAmount
                {
                    OnProgrammeEarningType = (OnProgrammeEarningType)transactionType,
                });

            default:
                throw new InvalidOperationException($"Unknown earning type found: {earningType:G}. Cannot create the PeriodisedRequiredPaymentEvent.");
            }
        }
 public EarningTypeDetailUI(string[] pRecords)
 {
     InitializeComponent();
     lId           = "";
     lOperation    = GlobalVariables.Operation.Edit;
     loEarningType = new EarningType();
     lRecords      = pRecords;
 }
            public void ThenRequiredPaymentHasEarningTypeOfInput(EarningType expectedEarningType)
            {
                testEarning.EarningType = expectedEarningType;

                var actual = sut.GetRequiredPayments(testEarning, paymentHistory);

                actual.Single().EarningType.Should().Be(expectedEarningType);
            }
Beispiel #7
0
        public Payment(decimal amount, DateTime paymentDate, EarningType earningType)
        {
            if (amount <= 0)
            {
                throw new ArgumentException("Amount must be greater than 0", nameof(amount));
            }

            Amount      = amount;
            PaymentDate = paymentDate;
            EarningType = earningType;
        }
Beispiel #8
0
        public void Then_the_PaymentLineDescription_is_constructed_as_expected(EarningType earningType, string hashedLegalEntityId, long uln, string expected)
        {
            var payment = _fixture.Build <PaymentDto>()
                          .With(x => x.EarningType, earningType)
                          .With(x => x.HashedLegalEntityId, hashedLegalEntityId)
                          .With(x => x.ULN, uln)
                          .Create();

            var paymentRequest = payment.Map(false);

            paymentRequest.PaymentLineDescription.Should().Be(expected);
        }
Beispiel #9
0
        public PeriodisedRequiredPaymentEvent Create(EarningType earningType, int transactionType)
        {
            PeriodisedRequiredPaymentEvent paymentEvent = null;

            switch (earningType)
            {
            case EarningType.CoInvested:
                if (IsValidPaymentType <OnProgrammeEarningType>(transactionType))
                {
                    paymentEvent = new CalculatedRequiredCoInvestedAmount
                    {
                        OnProgrammeEarningType = (OnProgrammeEarningType)transactionType,
                    };
                }

                break;

            case EarningType.Incentive:
                if (IsValidPaymentType <IncentivePaymentType>(transactionType))
                {
                    paymentEvent = new CalculatedRequiredIncentiveAmount
                    {
                        Type = (IncentivePaymentType)transactionType,
                    };
                }

                break;

            case EarningType.Levy:
                if (IsValidPaymentType <OnProgrammeEarningType>(transactionType))
                {
                    paymentEvent = new CalculatedRequiredLevyAmount
                    {
                        OnProgrammeEarningType = (OnProgrammeEarningType)transactionType,
                    };
                }

                break;

            default:
                throw new InvalidOperationException(
                          $"Unknown earning type found: {earningType:G}. Cannot create the PeriodisedRequiredPaymentEvent.");
            }

            if (paymentEvent == null)
            {
                logger.LogError(
                    $"Invalid EarningType and TransactionType combination: EarningType: {earningType:G}, TransactionType: {transactionType}");
            }

            return(paymentEvent);
        }
Beispiel #10
0
        public static string GetDescription(this EarningType e)
        {
            switch (e)
            {
            case EarningType.MonthyBenefit:
                return("Benefício Mensal");

            case EarningType.Benefit:
                return("Benefício");

            default:
                return("Desconhecido");
            }
        }
Beispiel #11
0
        FundingSourceType ConvertToFundingSource(EarningType earningType)
        {
            switch (earningType)
            {
            case EarningType.CoInvested:
                return(FundingSourceType.CoInvestedSfa);

            case EarningType.Levy:
                return(FundingSourceType.Levy);

            case EarningType.Incentive:
                return(FundingSourceType.FullyFundedSfa);
            }
            throw new ApplicationException($"Unknown earning type: {earningType}");
        }
Beispiel #12
0
        public Payment(decimal amount, DateTime paymentDate, EarningType earningType, IEnumerable <BreakInLearning> breaksInLearning)
        {
            if (amount <= 0)
            {
                throw new ArgumentException("Amount must be greater than 0", nameof(amount));
            }

            Amount      = amount;
            PaymentDate = paymentDate;
            EarningType = earningType;

            foreach (var breakInLearning in breaksInLearning)
            {
                if (PaymentDate >= breakInLearning.StartDate)
                {
                    PaymentDate = PaymentDate.AddDays(breakInLearning.Days);
                }
            }
        }
 internal static PendingPayment New(
     Guid id,
     Account account,
     Guid apprenticeshipIncentiveId,
     decimal amount,
     DateTime dueDate,
     DateTime calculatedDate,
     EarningType earningType)
 {
     return(new PendingPayment(new PendingPaymentModel
     {
         Id = id,
         Account = account,
         ApprenticeshipIncentiveId = apprenticeshipIncentiveId,
         Amount = amount,
         CalculatedDate = calculatedDate,
         DueDate = dueDate,
         EarningType = earningType
     },
                               true));
 }
Beispiel #14
0
        public void EarningsFromASingleFundingSourceReturnRequiredPaymentsFromTheSameSource(EarningType testType)
        {
            var sut = new RefundService();

            var expectedAmount = -123.2m;

            var actual = sut.GetRefund(expectedAmount, new List <Payment>
            {
                new Payment
                {
                    Amount                    = -1 * expectedAmount,
                    FundingSource             = ConvertToFundingSource(testType),
                    SfaContributionPercentage = 1m,
                }
            });

            actual.Where(x => x.EarningType == testType).Should().HaveCount(1);
            actual.Single().Amount.Should().Be(expectedAmount);
            actual.Single().SfaContributionPercentage.Should().Be(1);
        }
Beispiel #15
0
 public string updateEarningType([FromBody] EarningType pEarningType)
 {
     return(loEarningType.updateEarningType(pEarningType));
 }
Beispiel #16
0
 public string insertEarningType([FromBody] EarningType pEarningType)
 {
     return(loEarningType.insertEarningType(pEarningType));
 }