예제 #1
0
    public bool UpdateFeeDeviation(long paId, long pfId, FeeDeviationPayableFeeView objFD, string paLockKey)
    {
        PaymentAdviceManager pMgr = new PaymentAdviceManager(paId, paLockKey);

        pMgr.UpdateFeeDeviation(objFD);

        return true;
    }
예제 #2
0
        public void UpdateFeeDeviation(FeeDeviationPayableFeeView obj)
        {
            if (_CurrentPaymentAdvice == null)
                throw new ApasInvaidOperationException(
                "Invalid Operation: Select a payment advice before updating fee deviations");

            IPayableFee objPF;
            FeeDeviationPayableFee tempFD;
            decimal payableFee;
            objPF = CurrentPaymentAdvice.GetClassFeeById(obj.IdPayableFee);
            if (objPF == null)
            {
                objPF = CurrentPaymentAdvice.GetOtherFeeById(obj.IdPayableFee);
                payableFee = 0;
            }
            else
            {
                payableFee = ((ClassFee)objPF).FeeBeforeDeviations;
            }

            if (objPF == null)
            {
                throw new ApasObjectNotFoundException(
                "Invalid Operation: Requested Payable Fee Id:" + obj.IdPayableFee + " is not found.");
            }

            if (objPF.FeeDeviations.TryGetValue(obj.FeeDeviation.Id, out tempFD))
            {
                //tempFD.Value = obj.Value;
                //reverse compute value from net value
                tempFD.ReverseComputeValue(obj.NetValue, payableFee);
                tempFD.IsRecurring = obj.IsRecurring ? 1 : 0;
                tempFD.Save();

                //update ClassFee values
                objPF.ComputeDynamicFields(CurrentPaymentAdvice);
                objPF.Save();

                //log
                CurrentPaymentAdvice.LastAction = "Edit Fee Deviation";
                CurrentPaymentAdvice.LastModifiedBy =
                    ApasAccessControlManager.GetCurrentInstance().LogonUser.Id;
                CurrentPaymentAdvice.LastModifiedTime = DateTime.Now;
                CurrentPaymentAdvice.Save();

            }
            else
            {
                throw new ApasObjectNotFoundException(
                  "Invalid Operation: Requested Fee Deviation Id:" + obj.FeeDeviation.Id + " is not found.");
            }
        }
예제 #3
0
        public FeeDeviationPayableFeeView ConvertFeeDeviationPayableFee(FeeDeviationPayableFee input, decimal feePayable)
        {
            FeeDeviationPayableFeeView output = new FeeDeviationPayableFeeView();
            output.FeeDeviation =
                ConvertFeeDeviation(input.GetAssociatedFeeDeviation());
            output.IdPayableFee = input.IdPayableFee;
            output.IsRecurring = (input.IsRecurring==1);
            output.Type = input.Type;
            output.Value = input.Value;

            output.NetValue = input.ComputeNetDeviation(feePayable);//write out the exact amount. browser will display both exact amount and rounded amount

            return output;
        }