/*
         *
         * Frontend page: Fee Page
         * Title: get fees by selected date
         * Designed: Nadeeka
         * User story:
         * Developed: Nadeeka
         * Date created: 4/21/2016
         *
         */

        public ActionResult PayFeesForSelectedDueDate(DateTime dueDate, string type)
        {
            LoanSetupStep1 loanDetails = new LoanSetupStep1();

            loanDetails = (new LoanSetupAccess()).GetLoanDetailsByLoanCode(Session["loanCode"].ToString());     // take the loan detail of selected loan
            // pass the loan details to the view
            ViewBag.loanDetails = loanDetails;

            FeeAccess   feeAccess = new FeeAccess();
            List <Fees> lstFee    = feeAccess.GetFeesByDueDate(loanDetails.loanId, dueDate, type); // get fees list by duedate and type of fee
            FeesModel   feeModel  = new FeesModel();

            feeModel.FeeModelList = new List <Fees>();
            feeModel.Type         = type;

            // if list exists, add to model and session for searching
            if (lstFee != null && lstFee.Count > 0)
            {
                feeModel.FeeModelList.AddRange(lstFee);
                Session["feeList"] = feeModel.FeeModelList;
            }

            // return partial view of selected fee page
            return(PartialView(feeModel));
        }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            FeesModel feesModel = db.FeesModels.Find(id);

            db.FeesModels.Remove(feesModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        private async void Delete(object obj)
        {
            areaView.getdata();
            Areamodel = areaView.AreaData;

            var dfs = Areamodel.Where(vc => vc.ParkFeesId == SelectedFess.ParkFeesId).Count();

            if (dfs > 0)
            {
                Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                Visibility = true;
                Message    = "Restricted action ! data used  ";
                var cs = await delayid();

                if (cs)
                {
                    Visibility = false;
                }
                return;
            }
            else
            {
                var data = _services.deleteData(SelectedFess.ParkFeesId);

                if (data)
                {
                    FeesModel fe = new FeesModel();
                    getFeesData();
                    Coloring   = new SolidColorBrush(Color.FromRgb(46, 204, 113));
                    Visibility = true;
                    Message    = "data berhasil di hapus";
                    FeesVal    = "";
                    var cs = await delayid();

                    if (cs)
                    {
                        Visibility = false;
                    }
                    return;
                }
                else
                {
                    Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                    Visibility = true;
                    Message    = " data gagal di hapus ";
                    var cs = await delayid();

                    if (cs)
                    {
                        Visibility = false;
                    }
                    return;
                }
            }
        }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "Id,Class_Id,TotalFees")] FeesModel feesModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(feesModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Class_Id = new SelectList(db.ClassMasterModels, "Id", "ClassName", feesModel.Class_Id);
     return(View(feesModel));
 }
Exemple #5
0
        public ActionResult Create([Bind(Include = "Id,Class_Id,TotalFees")] FeesModel feesModel)
        {
            if (ModelState.IsValid)
            {
                db.FeesModels.Add(feesModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Class_Id = new SelectList(db.ClassMasterModels, "Id", "ClassName", feesModel.Class_Id);
            return(View(feesModel));
        }
Exemple #6
0
        // GET: FeesModels/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FeesModel feesModel = db.FeesModels.Find(id);

            if (feesModel == null)
            {
                return(HttpNotFound());
            }
            return(View(feesModel));
        }
Exemple #7
0
        // GET: FeesModels/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FeesModel feesModel = db.FeesModels.Find(id);

            if (feesModel == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Class_Id = new SelectList(db.ClassMasterModels, "Id", "ClassName", feesModel.Class_Id);
            return(View(feesModel));
        }
Exemple #8
0
        public static bool Update(FeesModel sellOrderModel, List <FeesDetailModel> sellOrderDetailModellList, out string strMsg)
        {
            bool isSucc = false;//是否添加成功
            //定义变量
            string remark = string.Empty;

            strMsg = "";
            try
            {
                isSucc = FeesDBHelper.Update(sellOrderModel, sellOrderDetailModellList, out strMsg);;
                //设置操作成功标识
                //remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            catch
            {
                ////输出日志
                //SellLogCommon.WriteSystemLog(ex, LogInfo.LogType.SYSTEM, LogInfo.SystemLogKind.SYSTEM_ERROR, ConstUtil.MODULE_ID_SELLORDER_ADD);
                ////设置操作成功标识
                //remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //SellLogCommon.InsertLog(sellOrderModel.OrderNo, ConstUtil.MODULE_ID_SELLORDER_ADD, ConstUtil.CODING_RULE_TABLE_SELLORDER, remark, ConstUtil.LOG_PROCESS_UPDATE);
            return(isSucc);
        }
Exemple #9
0
 public static DataTable ExportFeesBySearch(string CompanyCD, FeesModel FeesM, string DateBegin, string DateEnd, string PriceB, string PriceE)
 {
     return(FeesDBHelper.ExportFeesBySearch(CompanyCD, FeesM, DateBegin, DateEnd, PriceB, PriceE));
 }
Exemple #10
0
 public static bool ConfirmFees(string OrderNO, FeesModel FeesM, List <FeesDetailModel> FeesDetailM, out string strMsg)
 {
     return(FeesDBHelper.ConfirmFees(OrderNO, FeesM, FeesDetailM, out strMsg));
 }
Exemple #11
0
 public static DataTable GetFeesBySearch(string CompanyCD, FeesModel FeesM, string DateBegin, string DateEnd, string PriceB, string PriceE, int pageIndex, int pageCount, string ord, ref int TotalCount)
 {
     return(FeesDBHelper.GetFeesBySearch(CompanyCD, FeesM, DateBegin, DateEnd, PriceB, PriceE, pageIndex, pageCount, ord, ref TotalCount));
 }
        /*
         *
         * Frontend page: Fee Page
         * Title: get fees by selected date
         * Designed: Nadeeka
         * User story:
         * Developed: Nadeeka
         * Date created: 4/25/2016
         *
         */

        public ActionResult SearchFee(string identificationNumber, string year, string make, string vehicleModel, FeesModel CurtailmentList)
        {
            List <Fees> SearchList = new List <Fees>();

            // if fee list exists on session
            if (Session["feeList"] != null)
            {
                List <Fees> feeModel = (List <Fees>)Session["feeList"];

                // if atleast one searching criteria matches -- do search
                if (((!string.IsNullOrEmpty(identificationNumber)) || (!string.IsNullOrEmpty(year)) || (!string.IsNullOrEmpty(make)) || (!string.IsNullOrEmpty(vehicleModel))))
                {
                    //search through list of elements
                    Search sc = new Search();

                    SearchList = sc.GetSearchFeeList(feeModel, identificationNumber.Trim().ToLower(), year.Trim().ToLower(), make.Trim().ToLower(), vehicleModel.Trim().ToLower()); // take filtered elements
                    // pass the list to view
                    return(PartialView(SearchList));
                }

                // if no searching criteria matched -- retunt empty list
                else
                {
                    return(PartialView(SearchList));
                }
            }

            // if fee list not exist on session -- return empty list
            else
            {
                return(PartialView(SearchList));
            }
        }
        private async void AddData(object obj)
        {
            //_katmodel.KategoriHall = Katname;
            //_katmodel.katNumber = Katnumber;



            if (string.IsNullOrEmpty(FeesVal))
            {
                Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                Visibility = true;
                Message    = " Input wajib di isi ";
                var cs = await delayid();

                if (cs)
                {
                    Visibility = false;
                }
            }
            else
            {
                if (!Regex.IsMatch(FeesVal, "[0-9]"))
                {
                    Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                    Visibility = true;
                    Message    = " Input wajib berupa nomor ";
                    var cs = await delayid();

                    if (cs)
                    {
                        Visibility = false;
                    }
                    return;
                }


                FeesData = (ObservableCollection <FeesModel>)obj;

                var cvd = FeesData.Where(cv => cv.FeesValue.ToString() == FeesVal).Count();

                Console.WriteLine(cvd);

                if (cvd < 1)
                {
                    var dataadd = _services.insertData(Convert.ToInt32(FeesVal));
                    if (dataadd)
                    {
                        FeesModel fe = new FeesModel();
                        getFeesData();
                        Coloring   = new SolidColorBrush(Color.FromRgb(46, 204, 113));
                        Visibility = true;
                        Message    = "data berhasil disimpan";
                        FeesVal    = "";
                        var cs = await delayid();

                        if (cs)
                        {
                            Visibility = false;
                        }
                    }
                    else
                    {
                        Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                        Visibility = true;
                        Message    = "data gagal disimpan";
                        FeesVal    = "";
                        var cs = await delayid();

                        if (cs)
                        {
                            Visibility = false;
                        }
                    }
                }
                else
                {
                    Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                    Visibility = true;
                    Message    = "data sudah ada";
                    FeesVal    = "";
                    var cs = await delayid();

                    if (cs)
                    {
                        Visibility = false;
                    }
                }
            }
        }
        private async void Saveedit(object obj)
        {
            if (!Regex.IsMatch(FeesVal.ToString(), "[0-9]"))
            {
                Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                Visibility = true;
                Message    = " Input wajib berupa nomor ";
                var cs = await delayid();

                if (cs)
                {
                    Visibility = false;
                }
                return;
            }

            if (FeesVal.Equals(0))
            {
                Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                Visibility = true;
                Message    = " Input wajib di isi ";
                var cs = await delayid();

                if (cs)
                {
                    Visibility = false;
                }
            }
            else
            {
                FeesData = (ObservableCollection <FeesModel>)obj;

                var dft = FeesData.Where(vf => vf.FeesValue.ToString() == FeesVal).Count();

                if (dft >= 0)
                {
                    var dataadd = _services.EditSave(ids, Convert.ToInt32(FeesVal));
                    if (dataadd)
                    {
                        FeesModel fe = new FeesModel();
                        getFeesData();
                        Coloring   = new SolidColorBrush(Color.FromRgb(46, 204, 113));
                        Visibility = true;
                        Message    = "data berhasil disimpan";
                        FeesVal    = "";
                        var cs = await delayid();

                        if (cs)
                        {
                            Visibility = false;
                        }
                    }
                    else
                    {
                        Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                        Visibility = true;
                        Message    = "data gagal disimpan";
                        FeesVal    = "";
                        var cs = await delayid();

                        if (cs)
                        {
                            Visibility = false;
                        }
                    }
                }
                else
                {
                    Coloring   = new SolidColorBrush(Color.FromRgb(231, 76, 60));
                    Visibility = true;
                    Message    = "data sudah ada";
                    FeesVal    = "";
                    var cs = await delayid();

                    if (cs)
                    {
                        Visibility = false;
                    }
                }
            }
        }
        protected void FillLoanReleaseStatement(int id, int oldestDisId)
        {
            decimal loanbalance = 0;

            var formDetail = FormDetail.GetByPaymentId(id);
            imgSignature.ImageUrl = formDetail.Signature;

            var query = (from d in ObjectContext.DisbursementViewLists
                        join p in ObjectContext.Payments on d.DisbursementId equals p.Id
                        where d.DisbursementId == id
                        select new { customerId = p.ProcessedToPartyRoleId, customer = d.DisbursedTo, paymentAmount = p.TotalAmount, disbursedate = p.TransactionDate }).FirstOrDefault();
            int customerId = (int)query.customerId;
            decimal deductions = 0M;
            var agreementId = int.Parse(hdnAgreementId.Value.ToString());
            var loanAccount = ObjectContext.FinancialAccounts.FirstOrDefault(entity => entity.AgreementId == agreementId).LoanAccount;

            lblName.Text = query.customer;
            lblBorrowerName.Text = query.customer.ToUpper();

            var customer = PartyRole.GetById(customerId);
            if (customer.Customer != null)
            {
                var customerClassification = customer.Customer.CurrentClassification;
                lblStationNo.Text = customerClassification.ClassificationType.StationNumber;
            }
            FillPendingLoans(id,loanAccount.FinancialAccountId);

            //var oldestDisbursementId =

            var ParentPayment = ObjectContext.Payments.FirstOrDefault(entity => entity.ParentPaymentId == oldestDisId && entity.SpecificPaymentType.Id == SpecificPaymentType.FeePaymentType.Id);
            var totalFees = 0M;
            DateTime paymentTransitionDateTime = DateTime.Now;

            if (ParentPayment != null)
            {
                var loanParentPayment = ObjectContext.Payments.FirstOrDefault(entity => entity.ParentPaymentId == ParentPayment.Id && entity.SpecificPaymentType.Id == SpecificPaymentType.LoanPaymentType.Id);
                var feeParentPayment = ObjectContext.Payments.FirstOrDefault(entity => entity.ParentPaymentId == ParentPayment.Id && entity.SpecificPaymentType.Id == SpecificPaymentType.FeePaymentType.Id);

                //for loan payments
                if (loanParentPayment != null)
                {
                        loanbalance = loanParentPayment.TotalAmount;
                        lblTotalPreviousLoan.Text = loanbalance.ToString("N");
                        deductions += loanbalance;

                }

                //for fee payments
                if (feeParentPayment != null)
                {

                    var feePayments = ObjectContext.FeePayments.Where(entity => entity.PaymentId == feeParentPayment.Id);
                    List<FeesModel> feeModel = new List<FeesModel>();
                    if (feePayments.Count() != 0)
                    {
                        foreach (var items in feePayments)
                        {
                            FeesModel fee = new FeesModel();
                            fee.Fees = items.Particular;
                            fee.Amount = items.FeeAmount;
                            feeModel.Add(fee);
                        }
                    }
                    totalFees = feeModel.Sum(entity => entity.Amount);
                    lblTotalFees.Text = totalFees.ToString("N");
                    deductions += totalFees;
                    grdFees.DataSource = feeModel.ToList();
                    grdFees.DataBind();
                }

            }

            //var paymentDate = (from ldv in ObjectContext.LoanDisbursementVcrs.Where(entity => entity.AgreementId == agreementId)
            //                   join lpa in ObjectContext.PaymentApplications.OrderBy(entity => entity.PaymentId) on ldv.Id equals lpa.LoanDisbursementVoucherId
            //                   join p in ObjectContext.Payments on lpa.PaymentId equals p.Id
            //                   where p.ParentPaymentId == null && lpa.AmountApplied == query.paymentAmount
            //                   select new {
            //                       Date = p.EntryDate,
            //                       LDVId = ldv.Id
            //                   }).OrderByDescending(entity => entity.Date).FirstOrDefault();

            //var voucherStatus = ObjectContext.DisbursementVcrStatus.Where(entity => (entity.DisbursementVoucherStatTypId == DisbursementVcrStatusEnum.PendingType.Id
            //                        || entity.DisbursementVoucherStatTypId == DisbursementVcrStatusEnum.PartiallyDisbursedType.Id)
            //                        && entity.TransitionDateTime < paymentDate.Date
            //                        && entity.LoanDisbursementVoucherId == paymentDate.LDVId).OrderByDescending(entity => entity.TransitionDateTime).FirstOrDefault();

            //if(voucherStatus!=null)paymentTransitionDateTime = voucherStatus.TransitionDateTime;
            //var agreement = ObjectContext.Agreements.FirstOrDefault(entity => entity.Id == agreementId);
            //var amortization = ObjectContext.AmortizationSchedules.SingleOrDefault(entity => entity.AgreementId == agreementId && entity.DateGenerated == paymentTransitionDateTime);
            //if(amortization == null)
            //    amortization = ObjectContext.AmortizationSchedules.SingleOrDefault(entity => entity.AgreementId == agreementId && entity.DateGenerated < paymentTransitionDateTime);

            var ammortization = ObjectContext.AmortizationSchedules.Where(entity => entity.AgreementId == agreementId).OrderBy(entity => entity.DateGenerated).FirstOrDefault();
            if (ammortization != null)
            {
                var principalLoan = loanAccount.LoanAmount;
                lblNetAmountReceived.Text = (principalLoan - deductions).ToString("N");
                lblTotalDeductions.Text = deductions.ToString("N");
                lblGranted.Text = query.disbursedate.ToString("MMMM dd, yyyy");
                lblPrincipalAmount.Text = principalLoan.ToString("N");
                lblToStartOn.Text = ammortization.PaymentStartDate.ToString("MMMM dd, yyyy");

            }
        }