Пример #1
0
        public ActionResult CostCodeCreate()
        {
            MainApplication model = new MainApplication();
            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _UserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Пример #2
0
        public ActionResult JobWorkPayment()
        {
            MainApplication model = new MainApplication()
            {
                JobWorkPaymentDetails = new JobWorkPayment(),
            };

            //CREATE JOB WORK PAYMENT CODE
            string year = FinancialYear;

            string[] yr          = year.Split(' ', '-');
            string   FinYr       = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);
            string   paymentcode = string.Empty;

            var jobworkpaymentdata = _JobWorkPaymentService.GetLastPaymentByFinYr(FinYr);
            int PaymentVal         = 0;
            int length             = 0;

            if (jobworkpaymentdata != null)
            {
                paymentcode = jobworkpaymentdata.PaymentCode.Substring(3, 6);
                length      = (Convert.ToInt32(paymentcode) + 1).ToString().Length;
                PaymentVal  = Convert.ToInt32(paymentcode) + 1;
            }
            else
            {
                PaymentVal = 1;
                length     = 1;
            }

            paymentcode = _utilityService.getName("JWP", length, PaymentVal);
            paymentcode = paymentcode + FinYr;
            model.JobWorkPaymentDetails.PaymentCode = paymentcode;

            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            //IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode = string.Empty;

                int modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult Create()
        {
            MainApplication model = new MainApplication()
            {
                OutwardToTailorDetails = new OutwardToTailor(),
            };

            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);

            string OutwardCode = string.Empty;

            var details = _OutwardToTailorService.GetLastRowrByFinYr(FinYr);
            int val     = 0;
            int length  = 0;

            if (details != null)
            {
                OutwardCode = details.OutwardCode.Substring(4, 6);
                length      = (Convert.ToInt32(OutwardCode) + 1).ToString().Length;
                val         = Convert.ToInt32(OutwardCode) + 1;

                val    = details.Id;
                val    = val + 1;
                length = val.ToString().Length;
            }
            else
            {
                val    = 1;
                length = 1;
            }
            OutwardCode = _UtilityService.getName("OWTT", length, val);
            OutwardCode = OutwardCode + FinYr;
            model.OutwardToTailorDetails.OutwardCode = OutwardCode;
            TempData["PreviousOutToTailor"]          = OutwardCode;

            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            model.RetailBillList     = _RetailBillService.GetAll();
            model.JobWorkerList      = _JobWorkerService.GetAll();
            return(View(model));
        }
Пример #4
0
        public ActionResult CreateCarryForward()
        {
            MainApplication model = new MainApplication()
            {
                BalanceCarryForwardDetails = new BalanceCarryForward(),
            };

            var username = HttpContext.Session["UserName"].ToString();

            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _iIModuleService.GetLastRow().Id;
                for (int i = 95; i <= modulelastcount; i++)
                {
                    var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);

            var    carryforwarddata  = _BalanceCarryForwardService.GetLastRowByFinYr(FinYr);
            string CarryaforwardCode = string.Empty;

            int carryforwardvalue = 0;
            int len = 0;

            if (carryforwarddata != null)
            {
                CarryaforwardCode = carryforwarddata.CarryForwardCode.Substring(4, 6);
                len = (Convert.ToInt32(CarryaforwardCode) + 1).ToString().Length;
                carryforwardvalue = Convert.ToInt32(CarryaforwardCode) + 1;
            }
            else
            {
                carryforwardvalue = 1;
                len = 1;
            }
            CarryaforwardCode = _utilityservice.getName("BCFW", len, carryforwardvalue);
            CarryaforwardCode = CarryaforwardCode + FinYr;
            model.BalanceCarryForwardDetails.CarryForwardCode = CarryaforwardCode;

            var    TodayDate           = DateTime.Now;
            var    PreviousDate        = DateTime.Now.AddDays(-1);
            var    newPreviousDate     = PreviousDate;
            double TodayOpeningBalance = 0;
            double TodayClosingBalance = 0;

            var CarryForwdDetails = _BalanceCarryForwardService.GetDataByDate(Convert.ToDateTime(TodayDate).Date);

            if (CarryForwdDetails != null)
            {
                Session["TodayCarryForwdData"] = "Yes";
            }
            else
            {
                Session["TodayCarryForwdData"] = "No";
            }

            var CarryForwardData = _BalanceCarryForwardService.GetDataByDate(Convert.ToDateTime(PreviousDate).Date);

            if (CarryForwardData == null)
            {
                TodayOpeningBalance            = 0;
                Session["TodayOpeningBalance"] = 0;
            }
            else
            {
                TodayOpeningBalance            = Convert.ToDouble(CarryForwardData.ClosingBalance);
                Session["TodayOpeningBalance"] = TodayOpeningBalance;
            }

            double SOOpeningBal             = 0;
            double RBOpeningBal             = 0;
            double SBOpeningBal             = 0;
            double IIClosingBal             = 0;
            double IEClosingBal             = 0;
            double ROOpeningBal             = 0;
            double CardChequeHandOpeningBal = 0;
            double CashHandOpeningBal       = 0;
            double TotalOpeningBal          = 0;

            model.CashierSalesOrderList = _CashierSalesOrderService.GetOrderNoByDate(Convert.ToDateTime(TodayDate).Date);
            foreach (var cashsalesbilldata in model.CashierSalesOrderList)
            {
                SOOpeningBal = SOOpeningBal + Convert.ToDouble(cashsalesbilldata.AdvancePayment);
            }

            model.CashierRetailBillList = _CashierRetailBillService.GetBillsByDate(Convert.ToDateTime(TodayDate).Date);
            foreach (var cashretailbilldata in model.CashierRetailBillList)
            {
                RBOpeningBal = RBOpeningBal + Convert.ToDouble(cashretailbilldata.Payment);
            }

            model.CashierSalesBillList = _CashierSalesBillService.GetBillsByDate(Convert.ToDateTime(TodayDate).Date);
            foreach (var cashsalesbilldata in model.CashierSalesBillList)
            {
                SBOpeningBal = SBOpeningBal + Convert.ToDouble(cashsalesbilldata.Payment);
            }

            var IndirectIncomeDetails = _IncomeExchangeVoucherService.GetEntryByDateAndVoucherType(Convert.ToDateTime(TodayDate), "Receipt");

            foreach (var entry in IndirectIncomeDetails)
            {
                IIClosingBal = IIClosingBal + Convert.ToDouble(entry.Amount);
            }

            model.CashierRefundOrderList = _CashierRefundOrderService.GetBillsByDate(Convert.ToDateTime(TodayDate).Date);
            foreach (var cashdrefundorderdata in model.CashierRefundOrderList)
            {
                ROOpeningBal = ROOpeningBal + Convert.ToDouble(cashdrefundorderdata.RefundAmount);
            }

            model.CardChequeHandoverList = _CardChequeHandoverService.GetDataByDate(Convert.ToDateTime(TodayDate).Date);
            foreach (var cardchequedata in model.CardChequeHandoverList)
            {
                CardChequeHandOpeningBal = CardChequeHandOpeningBal + Convert.ToDouble(cardchequedata.CardChequeAmount);
            }

            model.CashHandoverList = _CashHandoverService.GetDataByDate(Convert.ToDateTime(TodayDate).Date);
            foreach (var cashdata in model.CashHandoverList)
            {
                CashHandOpeningBal = CashHandOpeningBal + Convert.ToDouble(cashdata.HandoverCash);
            }

            var IndirectIncData = _IncomeExchangeVoucherService.GetEntryByDateAndVoucherType(Convert.ToDateTime(TodayDate), "Expense");

            foreach (var entry in IndirectIncData)
            {
                IEClosingBal = IEClosingBal + Convert.ToDouble(entry.Amount);
            }


            TodayClosingBalance            = TodayOpeningBalance + SOOpeningBal + RBOpeningBal + SBOpeningBal + IIClosingBal - ROOpeningBal - CardChequeHandOpeningBal - CashHandOpeningBal - IEClosingBal;
            Session["TodayClosingBalance"] = TodayClosingBalance;

            return(View(model));
        }
        public ActionResult PurchaseReturn()
        {
            MainApplication model = new MainApplication();

            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            var username = HttpContext.Session["UserName"].ToString();

            if (username != "SuperAdmin")
            {
                int modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _UserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                        Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                        break;
                    }
                }
            }

            string shopcode = Session["LOGINSHOPGODOWNCODE"].ToString();

            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);
            var      LastPurchaseReturn   = _PurchaseReturnService.GetLastPurchaseByFinYr(FinYr, shopcode);
            string   PurchaseReturnCode   = string.Empty;
            int      PurchaseReturnLength = 0;
            int      PurchaseReturnNo     = 0;

            if (LastPurchaseReturn == null)
            {
                PurchaseReturnLength = 1;
                PurchaseReturnNo     = 1;
            }
            else
            {
                int PurchaseReturnIndex = LastPurchaseReturn.PurchaseReturnNo.LastIndexOf('P');
                PurchaseReturnCode   = LastPurchaseReturn.PurchaseReturnNo.Substring(PurchaseReturnIndex + 2, 6);
                PurchaseReturnLength = (Convert.ToInt32(PurchaseReturnCode) + 1).ToString().Length;
                PurchaseReturnNo     = Convert.ToInt32(PurchaseReturnCode) + 1;
            }

            string name        = Session["SHOPGODOWNNAME"] as string;
            string utilityname = string.Empty;

            if (shopcode.Contains("SH"))
            {
                var details = _ShopService.GetShopDetailsByName(name);
                utilityname = details.ShortCode + "/PR";
            }
            else
            {
                var details = _GodownService.GetGodownDetailsByName(name);
                utilityname = details.ShortCode + "/PR";
            }
            PurchaseReturnCode     = _UtilityService.getName(utilityname, PurchaseReturnLength, PurchaseReturnNo);
            PurchaseReturnCode     = PurchaseReturnCode + FinYr;
            model.PurchaseReturnNo = PurchaseReturnCode;
            TempData["PreviousPurchaseReturnNo"] = PurchaseReturnCode;

            return(View(model));
        }
Пример #6
0
        public ActionResult Dashboard()
        {
            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                int modulelastcount = _iIModuleService.GetLastRow().Id;
                var AssignRights    = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
                if (AssignRights.Count() == 0)
                {
                    TempData["NotEnoughRights"] = "Yes";
                    return(RedirectToAction("Login", "User"));
                }
                else
                {
                    int rightscount = 0;
                    for (int i = 96; i <= modulelastcount; i++)
                    {
                        var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                        if (assigndetails != null)
                        {
                            Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                            break;
                        }
                        else
                        {
                            rightscount++;
                        }
                    }
                    if (modulelastcount - 96 == rightscount)
                    {
                        Session["LOGINSHOPGODOWNCODE"] = null;
                        Session["SHOPGODOWNNAME"]      = null;
                    }
                }
            }

            MainApplication model = new MainApplication();

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            string loggedinshopname = Session["SHOPGODOWNNAME"] as string;

            TempData["PendingPoes"]             = _IPurchaseOrderDetailService.GetPendingPo("Pending");
            TempData["Inward"]                  = _IPurchaseOrderDetailService.GetInwardDetailsByDate();
            TempData["OutwardToShop"]           = _OutwardToShopService.GetDailyOutwardsToShop();
            TempData["OutwardShopToGodown"]     = _OutwardShopToGodownService.GetDailyOutwardsToGodown();
            TempData["OutwardInterGodown"]      = _OutwardInterGodownService.GetDailyOutwardInterGodown();
            TempData["OutwardInterShop"]        = _OutwardInterShopService.GetDailyOutwardInterShop();
            TempData["OutwardToClient"]         = _IOutwardToClientService.GetOutWardToClientByDate();
            TempData["InwardWithoutPO"]         = _InwardFromSupplierService.GetDailyInwardWithoutPo();
            TempData["InwardFromGodown"]        = _InwardFromGodownService.GetDailyInwardsFromGodown();
            TempData["InwardShopToGodown"]      = _InwardFromShopToGodownService.GetDailyInwardsShopToGodown();
            TempData["InwardInterGodown"]       = _InwardInterGodownService.GetDailyInwardInterGodown();
            TempData["InwardInterShop"]         = _InwardInterShopService.GetDailyInwardInterShop();
            TempData["EntryStock"]              = _EntryStockItemService.GetAllItems();
            TempData["ShopStock"]               = _IShopStockService.GetShopStockTillDate();
            TempData["GodownStock"]             = _GodownStockService.GetGodownStockTillDate();
            TempData["RetailBill"]              = _IRetailInvoiceMasterService.GetRetailBillByDate();
            TempData["SalesBill"]               = _ISalesBillService.GetSalesBillByDate();
            TempData["Quotations"]              = _QuotationService.GetDailyQuotations();
            TempData["SalesOrders"]             = _SalesOrderService.GetDailySalesOrders();
            TempData["DeliveryChallans"]        = _DeliveryChallanService.GetDailyChallans();
            TempData["SalesReturns"]            = _SalesReturnService.GetDailySalesReturns();
            TempData["PurchaseReturns"]         = _PurchaseReturnService.GetDailyPurchaseReturns();
            TempData["CashierSalesOrder"]       = _CashierSalesOrderService.GetDailyCashierSalesOrder();
            TempData["CashierRetailBill"]       = _CashierRetailBillService.GetDailyCashierRetailBill();
            TempData["CashierTempCashMemo"]     = _CashierTemporaryCashMemoService.GetDailyCashierTempCashMemo();
            TempData["CashierSalesBill"]        = _CashierSalesBillService.GetDailyCashierSalesBill();
            TempData["CashierRefundOrder"]      = _CashierRefundOrderService.GetDailyCashierRefundOrder();
            TempData["CashHandover"]            = _CashHandoverService.GetDailyCashHandover();
            TempData["CardChequeHandover"]      = _CardChequeHandoverService.GetDailyCardChequeHandover();
            TempData["IncomeExchangeVoucher"]   = _IncomeExchangeVoucherService.GetDailyIncomeExchangeVoucher();
            TempData["Requisitionsshops"]       = _RequisitionForShopService.GetDailyRequisitionsForShops(loggedinshopname);
            TempData["Requisitionsgodowns"]     = _RequisitionForShopService.GetDailyRequisitionsForGodowns(loggedinshopname);
            TempData["Requisitionssuperadmin"]  = _RequisitionForShopService.GetDailyRequisitionsForSuperAdmin(loggedinshopname);
            TempData["Requisitionsgodowns1"]    = _RequisitionForGodownService.GetDailyRequisitionsForGodowns(loggedinshopname);
            TempData["Requisitionssuperadmin1"] = _RequisitionForGodownService.GetDailyRequisitionsForSuperAdmin(loggedinshopname);

            //DASHBOARD FOR LOGIN PERSON FOR EXCEPT SUPERADMIN
            var loginuserdetails = _EmployeeMasterService.getEmpByEmail(UserEmail);

            TempData["EmployeeDesignation"] = loginuserdetails.Designation;
            TempData["EmployeeDepartment"]  = loginuserdetails.department;
            if (loginuserdetails.Designation == "PurchaseManager")
            {
                Session["LOGINSHOPGODOWNCODE"] = "PurchaseManager";
                Session["SHOPGODOWNNAME"]      = "PurchaseManager";
            }
            return(View(model));
        }
Пример #7
0
        public ActionResult CreateBillPayment()
        {
            MainApplication model = new MainApplication()
            {
                BillPaymentDetails = new BillPayment(),
            };

            var details = _BillPaymentService.GetLastRow();
            int val     = 0;
            int length  = 0;

            if (details != null)
            {
                val    = details.Id;
                val    = val + 1;
                length = val.ToString().Length;
            }
            else
            {
                val    = 1;
                length = 1;
            }
            String code = _utilityservice.getName("BP", length, val);

            model.BillPaymentDetails.BillPaymentCode = code;

            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _iIModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }