Ejemplo n.º 1
0
        public ActionResult CashOutReceipt(int invId, int agNoteId = 0)
        {
            ViewBag.CashRecTitle = "Cash Out Receipt";
            ViewBag.PaymentTerm  = ListCommonHelper.GetPaymentTerm("en")
                                   .Where(x => x.Key != 2 && x.Key < 6)
                                   .ToDictionary(x => x.Key, x => x.Value);
            ViewBag.CurrencyList = ListCommonHelper.GetCurrencyList();
            ViewBag.BankList     = ListCommonHelper.GetBankList();
            var cashReceiptObj = CashOutHelper.GetCashReceiptInfo(invId, agNoteId);

            return(View("~/Views/CashManagement/CashInReceipt.cshtml", cashReceiptObj));
        }
Ejemplo n.º 2
0
        public ActionResult CCCashDeposit(int operationId, decimal receiptAmount = 0)
        {
            ViewBag.PaymentTerm = ListCommonHelper.GetPaymentTerm("en")
                                  .Where(x => x.Key == 1)
                                  .ToDictionary(x => x.Key, x => x.Value);
            ViewBag.CurrencyList = ListCommonHelper.GetCurrencyList();
            ViewBag.BankList     = ListCommonHelper.GetBankList();
            var cashReceiptObj = CashOutHelper.GetCashReceiptInfo(0, 0, 0, operationId, receiptAmount);

            ViewBag.CashRecTitle = "Custom Clearance Cash Deposit For Operation " + cashReceiptObj.OperationCode;

            return(View("~/Views/CashManagement/CashInReceipt.cshtml", cashReceiptObj));
        }
Ejemplo n.º 3
0
        public ActionResult PrintCashInV(int id, bool isOut)
        {
            CashInVm invObj;

            if (isOut)
            {
                invObj = CashOutHelper.GetCashReceiptInfo(0, 0, id);
            }
            else
            {
                invObj = CashHelper.GetCashReceiptInfo(0, 0, id);
            }
            return(View(invObj));
        }
Ejemplo n.º 4
0
        public ActionResult GetCashReceiptsForNote(int agNoteId, bool isOut = false)
        {
            List <CashInInvoiceVm> cashReceiptList;

            if (isOut)
            {
                cashReceiptList = CashOutHelper.GetCashAgNoteList(agNoteId);
            }
            else
            {
                cashReceiptList = CashHelper.GetCashAgNoteList(agNoteId);
            }

            return(PartialView("~/Views/CashManagement/_CashReceiptsForInv.cshtml", cashReceiptList));
        }
Ejemplo n.º 5
0
        public ActionResult DeleteCashOutReceipt(int receiptId, string deleteReason)
        {
            #region Check Rights
            bool hasRights = false;
            hasRights = AdminHelper.CheckUserAction(ScreenEnum.CashManagment, ActionEnum.Delete);
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action", JsonRequestBehavior.AllowGet));
            }

            #endregion

            string isDeleted = CashOutHelper.DeleteCashOutReceipt(receiptId, deleteReason);
            return(Json(isDeleted, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AddEditCashReceipt(ViewModel.CashInVm cashObj)
        {
            string isSaved = "false";
            int    receiptId;

            if (cashObj.CashType == "cashin")
            {
                isSaved = CashHelper.AddEditCashReceipt(cashObj, out receiptId);
            }
            else
            {
                isSaved = CashOutHelper.AddEditCashReceipt(cashObj, out receiptId);
            }

            return(Json(isSaved + "_" + receiptId));
        }
Ejemplo n.º 7
0
        public ActionResult AddEditCashReceipt(CashInVm cashVmObj)
        {
            string isSaved = "false";
            int    receiptId;

            if (cashVmObj.CashType == "cashin")
            {
                isSaved = CashHelper.AddEditCashReceipt(cashVmObj, out receiptId);
            }
            else //Cash Out Receipt or CC cash deposit
            {
                isSaved = CashOutHelper.AddEditCashReceipt(cashVmObj, out receiptId);
            }


            return(Json(isSaved + "_" + receiptId));
        }
Ejemplo n.º 8
0
        public ActionResult ViewCashInPartial(int id, bool isOut = false)
        {
            System.Globalization.CultureInfo clut = new System.Globalization.CultureInfo("ar-EG");

            Session["receiptId"] = id;
            Session["CashType"]  = isOut;
            CashInVm invObj;

            if (isOut)
            {
                invObj = CashOutHelper.GetCashReceiptInfo(0, 0, id);
            }
            else
            {
                invObj = CashHelper.GetCashReceiptInfo(0, 0, id);
            }
            return(PartialView("~/Views/CashManagement/_ViewCashInReceipt.cshtml", invObj));
        }
Ejemplo n.º 9
0
        public PartialViewResult GetCCCashDepositList(int operId)
        {
            var ccCashDepList = CashOutHelper.GetCCCashDepositList(operId);

            if (ccCashDepList.Count > 0)
            {
                Dictionary <string, decimal> DepositTotals = new Dictionary <string, decimal>();

                var DepositTotalsObj = ccCashDepList.GroupBy(x => x.CurrencySign)
                                       .Select(x => new { curr = x.Key, total = x.Sum(y => y.ReceiptAmount.Value) }).ToList();

                //Get any collcted back deposits
                var     depositSattl = CashHelper.GetCashSettlementForOper(operId);
                decimal depositAmout = 0;
                if (depositSattl != null)
                {
                    foreach (var item in DepositTotalsObj)
                    {
                        if (depositSattl.Keys.Contains(item.curr))
                        {
                            depositAmout = item.total - depositSattl[item.curr];
                        }
                        else
                        {
                            depositAmout = item.total;
                        }

                        DepositTotals.Add(item.curr, depositAmout);
                    }
                }

                ViewBag.DepositTotal = DepositTotals;
                //ViewBag.Currency = ccCashDepList.FirstOrDefault().CurrencySign;
            }
            else
            {
                ViewBag.DepositTotal = 0;
                ViewBag.Currency     = "EGP";
            }
            //Get AP invoices
            var apInvList = APInvoiceHelper.GetInvoiceListForOper(operId);

            if (apInvList.Count > 0)
            {
                var currList    = ListCommonHelper.GetCurrencyList();
                var apInvTotals = apInvList.Where(x => x.InvoiceType == 3).GroupBy(x => x.InvCurrencyId)
                                  .Select(x => new { curr = x.Key, total = x.Sum(y => y.InvoiceDetails.Sum(c => c.InvoiceAmount)) });

                Dictionary <string, decimal> apInvTotalsDic = new Dictionary <string, decimal>();
                string currSign = "";

                foreach (var item in apInvTotals)
                {
                    currSign = currList.Where(x => x.Key == item.curr).FirstOrDefault().Value;
                    apInvTotalsDic.Add(currSign, item.total);
                }

                ViewBag.CCInvTotal = apInvTotalsDic;
            }
            else
            {
                ViewBag.CCInvTotal = 0;
            }

            ViewBag.OperId = operId;

            var cashSettlement = CashHelper.GetCashSettlementForOper(operId);

            // if(cashSettlement.Count > 0)
            ViewBag.CashSettlement = cashSettlement;


            return(PartialView("~/Views/CashDeposit/_CCCashDepositList.cshtml", ccCashDepList));
        }