コード例 #1
0
        public ActionResult CashBookPdf(RptSearchVModel vmodel)
        {
            vmodel.fDate  = Convert.ToDateTime(Session["fDate"]);
            vmodel.toDate = Convert.ToDateTime(Session["tDate"]);
            string finyear = Session["FinYear"].ToString();

            vmodel.BranchCode = Session["Branch"].ToString();
            string          sql      = string.Format("EXEC rptCashBook '" + finyear + "','" + Session["ProjCode"].ToString() + "','" + vmodel.BranchCode + "','" + vmodel.fDate.ToString("MM/dd/yyyy") + "','" + vmodel.toDate.ToString("MM/dd/yyyy") + "'");
            List <CashBook> cashBook = _CashBookService.SqlQueary(sql).ToList();

            ViewBag.Datef     = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.Datet     = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            ViewBag.HasBranch = _sysSetService.All().FirstOrDefault().HasBranch;
            if (vmodel.BranchCode != "" && vmodel.BranchCode != "0")
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            return(new Rotativa.ViewAsPdf("CashBookPdf", cashBook)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\"        --footer-font-size \"9\" --footer-spacing 5  --footer-font-name \"calibri light\""
            });
        }
コード例 #2
0
        public ActionResult ItemWiseSalesStatementRptPdf(DateTime fDate, DateTime tDate, string BranchCode, string LocCode, string FinYear, string ItemCode)
        {
            string sql = string.Format("Exec rpt_ItemWiseSalesStat '" + BranchCode + "','" + LocCode + "','" + ItemCode + "', '" + fDate.ToString("yyyy/MM/dd") + "', '" + tDate.ToString("yyyy/MM/dd") + "'");
            IEnumerable <ItemWiseSaleVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <ItemWiseSaleVM>(sql).ToList();
            }
            ViewBag.LocName = _locationService.All().Where(s => s.LocCode == LocCode).Select(x => x.LocName).FirstOrDefault();

            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            return(new Rotativa.ViewAsPdf("rpt_ItemWiseSalesStatementPdf", "", VchrLst)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #3
0
        public ActionResult MontlyQuantityRptPdf(DateTime fDate, DateTime tDate, string ProjCode, string BranchCode, string FinYear)
        {
            string customerGroup = "";
            //rpt_SP_ProdSales_Qty @fdate smalldatetime, @tdate smalldatetime, @ProjCode varchar(3), @BranchCode
            string sql = string.Format("EXEC rpt_SP_ProdSales_Qty '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "'");
            IEnumerable <MontlyQuantity> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <MontlyQuantity>(sql).ToList();
            }
            var FY = FinYear;

            ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            //ViewBag.fDate = fDate.ToString("dd-MMM-yyyy");
            //ViewBag.tDate = tDate.ToString("dd-MMM-yyyy");
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("rptSalesCollectionStatePdf", "", VchrLst)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #4
0
        public ActionResult JobWiseRecPayPdf(string ProjCode, string BranchCode, string JobNo, string fDate, string tDate)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptJobWiseRecPay_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("JobWiseRecPay", "JobWiseRecPay", new { errMsg }));
            }
            if (BranchCode == null)
            {
                BranchCode = Session["BranchCode"].ToString();
            }
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(Convert.ToDateTime(fDate));
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(Convert.ToDateTime(tDate));
            string sql = string.Format("Exec rpt_JobRecPay '" + Session["FinYear"].ToString() + "','" + ProjCode + "','" + BranchCode + "','" + JobNo + "','" + Convert.ToDateTime(fDate).ToString("yyyy/MM/dd") + "','" + Convert.ToDateTime(tDate).ToString("yyyy/MM/dd") + "',''");

            List <rptJobWiseVM> JobWiseRecPay = _JobWiseReportService.SqlQueary(sql).ToList();

            Response.AppendHeader("Content-Disposition", "inline; filename= JobWiseIncExp" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("JobWiseRecPayPdf", "", JobWiseRecPay)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                //FileName = RptName + "-" + DateTime.Now.ToShortDateString() + ".pdf" , contStatementReportPdf
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #5
0
        public ActionResult StoreRptPdf(DateTime fDate, DateTime tDate, string BranchCode, string ItemCode, string FinYear)
        {
            //string sql = string.Format("EXEC rpt_SP_CollectionStat_1'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "', '" + BranchCode + "', '" + FinYear + "',''");
            //IEnumerable<MovementItemVM> VchrLst;
            //using (AcclineERPContext dbContext = new AcclineERPContext())
            //{
            //    VchrLst = dbContext.Database.SqlQuery<MovementItemVM>(sql).ToList();
            //}
            ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            ViewBag.ItemCode   = _ItemInfoService.All().Where(s => s.ItemCode == ItemCode).Select(x => x.ItemCode).FirstOrDefault();
            ViewBag.fDate      = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate      = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            //Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("StoreRptPdf", "", "")
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #6
0
        public ActionResult TransWiseVatRptPdf(DateTime fDate, DateTime tDate, string TransNo, string command)
        {
            string FinYear = Session["FinYear"].ToString();
            string sql     = string.Format("EXEC VM_rpt6P1  '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + TransNo + "', '" + FinYear + "','" + Session["ProjCode"].ToString() + "','" + Session["BranchCode"].ToString() + "'");
            IEnumerable <VatStatementVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <VatStatementVM>(sql).ToList();
            }
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;


            if (command == "Preview")
            {
                return(View("rptVatPdf", VchrLst));
            }
            else
            {
                return(View("~/Views/VATRpt/rptVatPdf - Copy.cshtml", VchrLst));
            }
        }
コード例 #7
0
        public ActionResult SalesCollectionStatementRptPdf(DateTime fDate, DateTime tDate, string ProjCode, string BranchCode, string FinYear)
        {
            ViewBag.BranchName = "All";
            if (BranchCode != "")
            {
                String BranchName = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
                ViewBag.BranchName = BranchName;
            }

            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(fDate), Convert.ToString(tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("SalesCollectionStatRpt_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }



            string customerGroup = "";
            //rpt_SP_SalesCollectionStat_1  @fdate smalldatetime, @tdate smalldatetime, @ProjCode varchar(3), @BranchCode varchar(3),@FinYear varchar(7), @customerGroup varchar(7)

            string sql = string.Format("EXEC rpt_SP_SalesCollectionStat_1 '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "', '" + FinYear + "','" + customerGroup + "' "); //,'" + Session["UserName"] + "'


            //string sql = string.Format("EXEC rpt_SP_SalesCollectionStat_1 '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "', '" + FinYear + "','"+ customerGroup +"'");
            IEnumerable <SalesCollectionStat> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <SalesCollectionStat>(sql).ToList();
            }
            ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            //ViewBag.fDate = fDate.ToString("dd-MMM-yyyy");
            //ViewBag.tDate = tDate.ToString("dd-MMM-yyyy");
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            //Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("rptSalesCollectionStatePdf", "", VchrLst)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #8
0
        public ActionResult StockLedgerPdf(RptSearchVModel vmodel, string finyear)
        {
            vmodel.BranchCode  = Session["Branch"].ToString();
            vmodel.AccountCode = Session["AccountCode"].ToString();
            var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == "rptStoreLedger");

            ViewBag.LedgerCap   = ledger.LedgerCap;
            ViewBag.RptCap      = ledger.RptCap;
            ViewBag.OpeningCap  = ledger.OpeningCap;
            ViewBag.ClosingCap  = ledger.ClosingCap;
            ViewBag.Col1Cap     = ledger.Col1Cap;
            ViewBag.Col2Cap     = ledger.Col2Cap;
            ViewBag.Col3Cap     = ledger.Col3Cap;
            ViewBag.Col4Cap     = ledger.Col4Cap;
            ViewBag.Col5Cap     = ledger.Col5Cap;
            ViewBag.Col6Cap     = ledger.Col6Cap;
            ViewBag.Col7Cap     = ledger.Col7Cap;
            ViewBag.Col8Cap     = ledger.Col8Cap;
            ViewBag.fDate       = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate       = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            ViewBag.AccountCode = vmodel.AccountCode;
            ViewBag.BranchCode  = vmodel.BranchCode;
            if (vmodel.BranchCode != "")
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }
            if (vmodel.AccountCode != "")
            {
                ViewBag.Account = _ItemService.All().FirstOrDefault(x => x.ItemCode == vmodel.AccountCode.Trim()).ItemName.ToString();
            }
            else
            {
                ViewBag.Account = "All";
            }

            ViewBag.PrintDate = DateTime.Now.ToShortDateString();

            finyear = Session["FinYear"].ToString();

            string sql = string.Format(" EXEC " + ledger.SP_Name + " '" + finyear + "','" + Session["ProjCode"].ToString() + "','" + vmodel.BranchCode + "','" + vmodel.AccountCode + "','" + vmodel.fDate.ToString("MM/dd/yyyy") + "','" + vmodel.toDate.ToString("MM/dd/yyyy") + "'");
            List <ReportLedger> rptLedger = _ReportLedgerService.SqlQueary(sql).ToList();
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            return(new Rotativa.ViewAsPdf("StockLedgerPdf", rptLedger)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\"        --footer-font-size \"9\" --footer-spacing 5  --footer-font-name \"calibri light\""
            });
        }
コード例 #9
0
        public ActionResult GetCashBook(RptSearchVModel vmodel)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.toDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("Search", "CashBook", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptCashBook_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("Search", "CashBook", new { errMsg }));
            }
            Session["fDate"] = vmodel.fDate;
            Session["tDate"] = vmodel.toDate;
            string finyear = Session["FinYear"].ToString();

            vmodel.BranchCode = (vmodel.BranchCode == "0") ? "" : vmodel.BranchCode;
            Session["Branch"] = vmodel.BranchCode;

            ViewBag.HasBranch = _sysSetService.All().FirstOrDefault().HasBranch;
            if (vmodel.BranchCode != "" && vmodel.BranchCode != "0")
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }
            string sql = string.Format("EXEC rptCashBook '" + finyear + "','" + Session["ProjCode"].ToString() + "','" + vmodel.BranchCode + "','" + vmodel.fDate.ToString("yyyy/MM/dd") + "','" + vmodel.toDate.ToString("yyyy/MM/dd") + "'");

            List <CashBook> cashBook = _CashBookService.SqlQueary(sql).ToList();
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (cashBook.Count == 0)
            {
                string errMsg = "There is no data on this date. Please try another !!!";
                return(RedirectToAction("Search", "CashBook", new { errMsg }));
            }
            else
            {
                ViewBag.Datef = InWord.GetAbbrMonthNameDate(vmodel.fDate);
                ViewBag.Datet = InWord.GetAbbrMonthNameDate(vmodel.toDate);
                return(View(cashBook));
            }
        }
コード例 #10
0
        public ActionResult GetCustomerLedger(RptSearchVModel vmodel, string finyear)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("CustomerLedgerGDS_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            finyear       = Session["FinYear"].ToString();
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(vmodel.tDate);


            ViewBag.CustCode = vmodel.SubCode;
            ViewBag.Customer = _ISubsidiaryInfoAppService.All().FirstOrDefault(x => x.SubCode == vmodel.SubCode.Trim()).SubName.ToString();
            ViewBag.SubCode  = vmodel.SubCode;



            string sql = string.Format("exec rpt_CustLedger_GDS '" + vmodel.fDate.ToString("yyyy/MM/dd") + "','" + vmodel.tDate.ToString("yyyy/MM/dd") + "','" + vmodel.SubCode + "','" + Session["FinYear"].ToString() + "','" + Session["UserName"] + "'  ");


            IEnumerable <CustomerLedgerVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <CustomerLedgerVM>(sql).ToList();
            }

            return(new Rotativa.ViewAsPdf("CustomerLedgerPdf", "", VchrLst)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #11
0
        public ActionResult GetVoucherPreview(string VchrNo, string FinYear)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptVoucherPreview_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg }));
            }
            if (VchrNo != null)
            {
                var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == "rptVoucher");
                ViewBag.RptCap  = ledger.RptCap;
                ViewBag.Col1Cap = ledger.Col1Cap;
                ViewBag.Col2Cap = ledger.Col2Cap;
                ViewBag.Col3Cap = ledger.Col3Cap;
                ViewBag.Col4Cap = ledger.Col4Cap;
                ViewBag.Col5Cap = ledger.Col5Cap;
                ViewBag.Col6Cap = ledger.Col6Cap;
                ViewBag.Col7Cap = ledger.Col7Cap;
                string BranchCode = Session["BranchCode"].ToString();
                ViewBag.Branch = _BranchService.All().Where(x => x.BranchCode == BranchCode.Trim()).Select(s => s.BranchName).ToString();

                FinYear = Session["FinYear"].ToString();
                string sql = string.Format("EXEC rptVoucher '" + FinYear + "','" + VchrNo + "'");
                List <VchrPreviewVM> rptVchr = _VchrPreviewVMService.SqlQueary(sql).ToList();
                //if (rptVchr.Count == 0)
                //{
                //    string errMsg = "There is no data in this combination. Please try again !!!";
                //    return RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg });
                //}
                //else
                //{
                double amt = 0;
                foreach (var item in rptVchr)
                {
                    if (item.cramount != 0)
                    {
                        amt += item.cramount;
                    }
                }
                string InWordsamt = InWord.ConvertToWords(amt.ToString());
                ViewBag.InWordsAmt = InWordsamt;
                return(View(rptVchr));
                //}
            }
            else
            {
                string errMsg = "Voucher no is required!";
                return(RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg }));
            }
        }
コード例 #12
0
        public ActionResult TransWiseVat6P10RptPdf(DateTime fDate, DateTime tDate, string TransNo, string command)
        {
            List <Vat6P10> VchrLst_Ka  = new List <Vat6P10>();
            List <Vat6P10> VchrLst_Kha = new List <Vat6P10>();

            string sql = string.Format("EXEC VM_rpt6P10 '" + TransNo + "','','','','" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','Ka' ");

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst_Ka = dbContext.Database.SqlQuery <Vat6P10>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt6P10 '" + TransNo + "','','','','" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','Kha' ");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst_Kha = dbContext.Database.SqlQuery <Vat6P10>(sql).ToList();
            }
            Ka_KhaModel finalItem = new Ka_KhaModel();

            finalItem.VchrLst_Ka1  = VchrLst_Ka;
            finalItem.VchrLst_Kha1 = VchrLst_Kha;
            ViewBag.fDate          = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate          = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View(finalItem));
            }
            else
            {
                return(View("TransWiseVat6P10RptPdf - Copy", finalItem));
            }

            //return new Rotativa.ViewAsPdf("TransWiseVat6P10RptPdf", "", finalItem)
            //{
            //    //PageMargins= new Rotativa.Options.Margins(2,2,0,1),
            //    PageSize = Rotativa.Options.Size.A4, // (14f, 8.5f),
            //    // PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,
            //    PageOrientation = Rotativa.Options.Orientation.Portrait,

            //    CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            //};
        }
コード例 #13
0
        public ActionResult GetMoneyReceiptPdf(string ReceiptNo)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("MoneyReceiptCash_Print"))
            {
                string errMsg = "P";
                return(RedirectToAction("CashMoneyReceipt", "CashMoneyReceipt", new { errMsg }));
            }
            MoneyReceiptVM MRVM     = new MoneyReceiptVM();
            var            cashRPfd = _moneyReceiptService.All().FirstOrDefault(x => x.MRNo == ReceiptNo && x.PayMode == "Ca");

            if (cashRPfd != null)
            {
                MRVM.MRNo     = cashRPfd.MRNo;
                MRVM.CustCode = cashRPfd.CustCode.Trim();
                MRVM.CustName = (from s in _subsidiaryInfoService.All().ToList() where s.SubCode == cashRPfd.CustCode.Trim() select s.SubName).FirstOrDefault();
                MRVM.Address  = (from se in _SubsidiaryExtService.All().ToList() where se.SubCode.Trim() == cashRPfd.CustCode.Trim() select se.SubAddress).FirstOrDefault();
                MRVM.InWord   = InWord.ConvertToWords(Convert.ToString(cashRPfd.MRAmount));
                MRVM.AcType   = _newChartService.All().FirstOrDefault(s => s.Accode == cashRPfd.Accode).AcName;
                MRVM.MRDate   = cashRPfd.MRDate;

                #region //For us Culture Ex: 0.00
                const string culture = "en-US";
                CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);
                Thread.CurrentThread.CurrentCulture   = ci;
                Thread.CurrentThread.CurrentUICulture = ci;
                #endregion

                MRVM.Amount  = Convert.ToDecimal(cashRPfd.MRAmount);
                MRVM.PayMode = "Ca";
                return(new Rotativa.ViewAsPdf("~/Views/CashReceipt/MoneyReceiptPdf.cshtml", MRVM)
                {
                    PageSize = Rotativa.Options.Size.A4
                });
            }
            else
            {
                //string errMsg = "E";
                //return RedirectToAction("CashOperation", "CashOperation", new { errMsg });
                MRVM.PayMode = "Ca";
                return(new Rotativa.ViewAsPdf("~/Views/CashReceipt/MoneyReceiptPdf.cshtml", MRVM)
                {
                    PageSize = Rotativa.Options.Size.A4
                });
            }
        }
コード例 #14
0
        public ActionResult GetVoucherPreview(string VchrNo, string FinYear)
        {
            var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == "rptVoucher");

            ViewBag.RptCap  = ledger.RptCap;
            ViewBag.Col1Cap = ledger.Col1Cap;
            ViewBag.Col2Cap = ledger.Col2Cap;
            ViewBag.Col3Cap = ledger.Col3Cap;
            ViewBag.Col4Cap = ledger.Col4Cap;
            ViewBag.Col5Cap = ledger.Col5Cap;
            ViewBag.Col6Cap = ledger.Col6Cap;
            ViewBag.Col7Cap = ledger.Col7Cap;
            string BranchCode = Session["BranchCode"].ToString();

            ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == BranchCode.Trim()).BranchName.ToString();

            FinYear = Session["FinYear"].ToString();
            string sql = string.Format("EXEC rptVoucher '" + FinYear + "','" + VchrNo + "'");
            List <VchrPreviewVM> rptVchr = _VchrPreviewVMService.SqlQueary(sql).ToList();
            //if (rptVchr.Count == 0)
            //{
            //    string errMsg = "There is no data in this combination. Please try again !!!";
            //    return RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg });
            //}
            //else
            //{
            double amt = 0;

            foreach (var item in rptVchr)
            {
                if (item.cramount != 0)
                {
                    amt += item.cramount;
                }
            }
            string InWordsamt = InWord.ConvertToWords(amt.ToString());

            ViewBag.InWordsAmt = InWordsamt;
            return(View("~/Views/VchrPreview/GetVoucherPreview.cshtml", rptVchr));
            //}
        }
コード例 #15
0
        public ActionResult TransWiseVat6P2P1RptPdf(DateTime fDate, DateTime tDate, string TransNo, string FinYear, string command)
        {
            string sql = string.Format("EXEC VM_rpt6P2P1 '" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + TransNo + "', '" + FinYear + "'");
            IEnumerable <VatStatementVM> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <VatStatementVM>(sql).ToList();
            }

            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View("rptVat6P2P1Pdf", VchrLst));
            }
            else
            {
                return(View("rptVat6P2P1Pdf", VchrLst));
            }

            //return new Rotativa.ViewAsPdf("rptVat6P2P1Pdf", "", VchrLst)
            //{
            //    //PageMargins= new Rotativa.Options.Margins(2,2,0,1),
            //    PageSize = Rotativa.Options.Size.A4, // (14f, 8.5f),
            //    // PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,
            //    PageOrientation = Rotativa.Options.Orientation.Landscape,

            //    CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            //};
        }
コード例 #16
0
        public ActionResult GetMoneyReceiptPdf(string ReceiptNo)
        {
            MoneyReceiptVM MRVM  = new MoneyReceiptVM();
            var            crPfd = _chequeReceiptService.All().FirstOrDefault(x => x.ChqReceiptNo == ReceiptNo);

            if (crPfd != null)
            {
                var todayDate = DateTime.Now;
                var TingCount = _chequeReceiptService.All().FirstOrDefault(x => x.ChqReceiptNo == ReceiptNo);
                TingCount.MRTing     = TingCount.MRTing + 1;
                TingCount.MRTingTime = todayDate.AddHours(todayDate.Hour).AddMinutes(todayDate.Minute).AddSeconds(todayDate.Second).AddMilliseconds(todayDate.Millisecond);

                MRVM.MRNo       = crPfd.ChqReceiptNo;
                MRVM.CustCode   = crPfd.SubCode.Trim();
                MRVM.ChequeDate = (DateTime)crPfd.ChqDate;
                MRVM.CustName   = (from s in _subsidiaryService.All().ToList() where s.SubCode == crPfd.SubCode.Trim() select s.SubName).FirstOrDefault();
                MRVM.Address    = (from se in _SubsidiaryExtService.All().ToList() where se.SubCode.Trim() == crPfd.SubCode.Trim() select se.SubAddress).FirstOrDefault();
                MRVM.InWord     = InWord.ConvertToWords(crPfd.Amount.ToString());
                MRVM.AcType     = LoadDropDown.GetMrAgainst(crPfd.MRAgainst);
                MRVM.MRDate     = crPfd.ChqReceiptDate;
                MRVM.Amount     = crPfd.Amount;
                MRVM.PayMode    = "ChequeReceipt";
                MRVM.ChequeNo   = crPfd.ChqNo;
                MRVM.BankName   = _bankInfoService.All().FirstOrDefault(s => s.BankCode == crPfd.BankCode).BankName;;
                MRVM.Branch     = crPfd.BranchName;
                _chequeReceiptService.Update(TingCount);
                _chequeReceiptService.Save();
                return(new Rotativa.ViewAsPdf("~/Views/CashReceipt/MoneyReceiptPdf.cshtml", MRVM)
                {
                    PageSize = Rotativa.Options.Size.A4
                });
            }
            else
            {
                string errMsg = "NF";
                return(RedirectToAction("ChequeReceipts", "ChequeReceipts", new { errMsg }));
            }
        }
コード例 #17
0
        public ActionResult IncomeExpenditurePdf(string ProjName, string fDate, string tDate)
        {
            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptBalanceSheet_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("IncExpAcRpt", "IncExpAcRpt", new { errMsg }));
            }
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(Convert.ToDateTime(fDate));
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(Convert.ToDateTime(tDate));
            string sql = string.Format("Exec rptIncExpAC1 '" + ProjName + "','" + Session["BranchCode"].ToString() + "','" + Convert.ToDateTime(fDate).ToString("MM/dd/yyyy") + "','" + Convert.ToDateTime(tDate).ToString("MM/dd/yyyy") + "','" + Session["FinYear"].ToString() + "'");

            List <BalSheetRptVM> balSheet = _BalSheetRptService.SqlQueary(sql).ToList();

            Response.AppendHeader("Content-Disposition", "inline; filename= IncomeExpenditure_" + DateTime.Now.ToShortDateString() + ".pdf");
            return(new Rotativa.ViewAsPdf("IncomeExpenditurePdf", "", balSheet)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                //FileName = RptName + "-" + DateTime.Now.ToShortDateString() + ".pdf" , contStatementReportPdf
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #18
0
        public ActionResult SummaryReportPdf(RptSearchVModel vmodel, string finyear)
        {
            vmodel.BranchCode     = Session["Branch"].ToString();
            vmodel.LedgerTypeCode = Session["LedgerType"].ToString();
            if (Session["LevelNo"] == null)
            {
                vmodel.LevelNo = "0";
            }
            else
            {
                vmodel.LevelNo = Session["LevelNo"].ToString();
            }
            // vmodel.LevelNo =Session["LevelNo"].ToString();
            var rptCap = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == vmodel.LedgerTypeCode);


            ViewBag.LedgerCap  = rptCap.LedgerCap;
            ViewBag.RptCap     = rptCap.RptCap;
            ViewBag.Col1Cap    = rptCap.Col1Cap;
            ViewBag.Col2Cap    = rptCap.Col2Cap;
            ViewBag.Col3Cap    = rptCap.Col3Cap;
            ViewBag.Col4Cap    = rptCap.Col4Cap;
            ViewBag.Col5Cap    = rptCap.Col5Cap;
            ViewBag.Col6Cap    = rptCap.Col6Cap;
            ViewBag.Col7Cap    = rptCap.Col7Cap;
            ViewBag.Col8Cap    = rptCap.Col8Cap;
            ViewBag.fDate      = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate      = InWord.GetAbbrMonthNameDate(vmodel.tDate);
            ViewBag.BranchCode = vmodel.BranchCode;
            if (vmodel.BranchCode != "" && vmodel.BranchCode != "0")
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }
            ViewBag.HasBranch = _sysSetService.All().FirstOrDefault().HasBranch;
            ViewBag.PrintDate = DateTime.Now.ToShortDateString();

            finyear = Session["FinYear"].ToString();
            if (Session["LevelNo"] == null)
            {
                vmodel.LevelNo = "0";
            }
            else
            {
                vmodel.LevelNo = Session["LevelNo"].ToString();
            }
            string sql = string.Format(" EXEC " + rptCap.SP_Name + " '" + finyear + "','','" + vmodel.BranchCode + "','" + vmodel.fDate.ToString("MM/dd/yyyy") + "','" + vmodel.tDate.ToString("MM/dd/yyyy") + "','" + Session["Discardcntl"] + "','" + vmodel.LevelNo + "'");
            List <SummaryReport> summaryReport = _SumRptService.SqlQueary(sql).ToList();

            Session["Discardcntl"] = "";
            Session["LevelNo"]     = "";
            //if (summaryReport.Count == 0)
            //{
            //    string errMsg = "There is no data in this combination. Please try again !!!";
            //    return RedirectToAction("GetSummaryReport2", "SummaryReport", new { errMsg });
            //}
            //else
            //{
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            if (rptCap.RptCap == "Stock Summary")
            {
                return(new Rotativa.ViewAsPdf("SummaryStockReportPdf", summaryReport)
                {
                    CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\"        --footer-font-size \"9\" --footer-spacing 5  --footer-font-name \"calibri light\""
                });
            }
            return(new Rotativa.ViewAsPdf("SummaryReportPdf", summaryReport)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\"        --footer-font-size \"9\" --footer-spacing 5  --footer-font-name \"calibri light\""
            });
            //}
        }
コード例 #19
0
        //public SelectList GardenSelection()
        //{

        //    var UserName = User.Identity.Name;
        //    var brans = _employeeService.All().Where(x => x.Email == UserName).ToList().FirstOrDefault();
        //    var UserId = brans.Id;
        //    var items = _userbranchService.All().ToList().Where(x => x.Userid == UserId.ToString()).ToList();
        //    List<Branch> branchList = new List<Branch>();
        //    foreach (var item in items)
        //    {
        //        var branch = _BranchService.All().ToList().FirstOrDefault(x => x.BranchCode == item.BranchCode);
        //        branchList.Add(branch);
        //    }
        //    branchList.Insert(0, new Branch() { BranchCode = "0", BranchName = "---- Select ----" });
        //    //List<Branch> BranchCode = new SelectList(branchList, "BranchCode", "BranchName");
        //    return new SelectList(branchList.OrderBy(x => x.BranchCode), "BranchCode", "BranchName");

        //}
        public ActionResult GetSummaryReport(RptSearchVModel vmodel, string finyear)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.toDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("Search", "SummaryReport", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptTrialBalance_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("Search", "SummaryReport", new { errMsg }));
            }

            Session["Branch"]     = (vmodel.BranchCode == null) ? "" : vmodel.BranchCode;
            Session["LedgerType"] = vmodel.LedgerTypeCode;
            Session["fDate"]      = vmodel.fDate;
            Session["tDate"]      = vmodel.toDate;
            if (vmodel.LevelNo == null)
            {
                vmodel.LevelNo = "0";
            }

            Session["LevelNo"] = vmodel.LevelNo;
            //  Session["LevelNo"] = vmodel.LevelNo;



            var rptCap = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == vmodel.LedgerTypeCode);


            ViewBag.LedgerCap  = rptCap.LedgerCap;
            ViewBag.RptCap     = rptCap.RptCap;
            ViewBag.Col1Cap    = rptCap.Col1Cap;
            ViewBag.Col2Cap    = rptCap.Col2Cap;
            ViewBag.Col3Cap    = rptCap.Col3Cap;
            ViewBag.Col4Cap    = rptCap.Col4Cap;
            ViewBag.Col5Cap    = rptCap.Col5Cap;
            ViewBag.Col6Cap    = rptCap.Col6Cap;
            ViewBag.Col7Cap    = rptCap.Col7Cap;
            ViewBag.Col8Cap    = rptCap.Col8Cap;
            ViewBag.fDate      = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate      = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            ViewBag.foDate     = vmodel.fDate.ToString("MM/dd/yyyy");
            ViewBag.toDate     = vmodel.toDate.ToString("MM/dd/yyyy");
            ViewBag.LocCode    = vmodel.LocCode;//----location---//
            ViewBag.BranchCode = vmodel.BranchCode;
            if (vmodel.BranchCode != null && vmodel.BranchCode != "0")
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }
            //---------------Location---------------------------//

            if (vmodel.LocCode != null && vmodel.LocCode != "0")
            {
                ViewBag.Location = _locationService.All().FirstOrDefault(x => x.LocCode == vmodel.LocCode.Trim()).LocName.ToString();
            }
            else
            {
                ViewBag.Location = "All";
            }

            finyear = Session["FinYear"].ToString();
            if (vmodel.LevelNo == null)
            {
                vmodel.LevelNo = "0";
            }

            string sql = string.Format(" EXEC " + rptCap.SP_Name + " '" + finyear + "','01','" + vmodel.LocCode + "','" + vmodel.fDate.ToString("MM/dd/yyyy") + "','" + vmodel.toDate.ToString("MM/dd/yyyy") + "','" + vmodel.DisControl + "','" + vmodel.LevelNo + "'");
            List <SummaryReport> summaryReport = _SumRptService.SqlQueary(sql).ToList();

            Session["Discardcntl"] = vmodel.DisControl;
            //if (summaryReport.Count == 0)
            //{
            //    string errMsg = "There is no data in this combination. Please try again !!!";
            //    return RedirectToAction("Search", "SummaryReport", new { errMsg });
            //}
            //else
            //{
            if (rptCap.RptCap == "Stock Summary")
            {
                return(View("~/Views/SummaryReport/GetSummaryStockReport.cshtml", summaryReport));
            }
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            return(View(summaryReport));
            //}
        }
コード例 #20
0
        public ActionResult GetGLEntries(RptSearchVModel vmodel)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.toDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("Search", "ListOfTransaction", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptJournalVoucher_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("Search", "ListOfTransaction", new { errMsg }));
            }

            string finyear = Session["FinYear"].ToString();

            Session["Branch"]     = vmodel.BranchCode;
            Session["LedgerType"] = vmodel.LedgerTypeCode;
            Session["fDate"]      = vmodel.fDate;
            Session["tDate"]      = vmodel.toDate;
            Session["Data"]       = vmodel.JTrGrpId;
            ViewBag.fDate         = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate         = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            if (vmodel.JTrGrpId == null)
            {
                vmodel.JTrGrpId = "";
            }
            // Session["NullData"] = vmodel.JTrGrpId = "";

            string sql = string.Format("EXEC rptListTran '" + finyear + "','01','" + vmodel.BranchCode + "','" + vmodel.JTrGrpId.Trim() + "','" + vmodel.fDate.ToString("MM-dd-yyyy") + "','" + vmodel.toDate.ToString("MM-dd-yyyy") + "'");
            List <JarnalVoucher> glReport = _jarnalVoucherService.SqlQueary(sql).ToList();
            // Session["Data"] = glReport;
            //if (glReport.Count == 0)
            //{
            //    string errMsg = "Data not found !!!";
            //    return RedirectToAction("Search", "ListOfTransaction", new { errMsg });
            //}
            //else
            //{
            double amt = 0;
            List <JarnalVoucher> sList = new List <JarnalVoucher>();  //InWord.ConvertToWords(amt.ToString()).ToList();

            foreach (var item in glReport)
            {
                //if (item.CrAmount != 0)
                // {
                if (item.DrAmount > 0)
                {
                    amt = item.DrAmount;
                }
                else if (item.CrAmount > 0)
                {
                    amt = item.CrAmount;
                }

                JarnalVoucher sAmt = new JarnalVoucher();
                sAmt.ACCode     = item.ACCode;
                sAmt.VDate      = item.VDate;
                sAmt.AcName     = item.AcName;
                sAmt.InWords    = InWord.ConvertToWords(amt.ToString());
                sAmt.AcName     = item.AcName;
                sAmt.Narration  = item.Narration;
                sAmt.SubSidiary = item.SubSidiary;
                sAmt.CrAmount   = item.CrAmount;
                sAmt.DrAmount   = item.DrAmount;
                sAmt.VchrNo     = item.VchrNo;
                sAmt.Posted     = item.Posted;
                sAmt.Sub_Ac     = item.Sub_Ac;
                sList.Add(sAmt);
                // }
            }
            return(View("~/Views/ListOfTransaction/TransactionList.cshtml", sList));
            //}
        }
コード例 #21
0
        public ActionResult rptSalesCollectionComparisonPdf(RptSearchVModel vmodel, string finyear)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("SalesCollectionComparison_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }

            finyear            = Session["FinYear"].ToString();
            ViewBag.SubCode    = vmodel.SubCode;
            ViewBag.ProjCode   = vmodel.projCode;
            ViewBag.BranchCode = vmodel.BranchCode;
            ViewBag.fDate      = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate      = InWord.GetAbbrMonthNameDate(vmodel.tDate);
            String BranchCode = vmodel.BranchCode;

            ViewBag.BranchName = "All";
            if (BranchCode != "")
            {
                ViewBag.BranchName = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            }



            //For us Culture Ex: 0.00
            const string culture = "en-US";

            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.GetCultureInfo(culture);
            System.Threading.Thread.CurrentThread.CurrentCulture   = ci;
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;


            string sql_1 = string.Format("exec rpt_salescolcomparison_det  '" + vmodel.fDate.ToString("yyyy-MM-dd") + "','" + vmodel.tDate.ToString("yyyy-MM-dd") + "','" + vmodel.projCode + "','" + vmodel.BranchCode + "' ,'" + Session["UserName"] + "'  ");
            string sql_2 = string.Format("exec rpt_salescolcomparison_foot   '" + vmodel.fDate.ToString("yyyy-MM-dd") + "','" + vmodel.tDate.ToString("yyyy-MM-dd") + "','" + vmodel.projCode + "','" + vmodel.BranchCode + "','" + Session["UserName"] + "'  ");

            // string sql_1 = string.Format("exec rpt_salescolcomparison_det  '" + vmodel.fDate.ToString("yyyy-MM-dd") + "','" + vmodel.tDate.ToString("yyyy-MM-dd") + "','" + vmodel.projCode + "','" + vmodel.BranchCode + "' ");
            //string sql_2 = string.Format("exec rpt_salescolcomparison_foot   '" + vmodel.fDate.ToString("yyyy-MM-dd") + "','" + vmodel.tDate.ToString("yyyy-MM-dd") + "','" + vmodel.projCode + "','" + vmodel.BranchCode + "' ");
            IEnumerable <SalesCollectionComparisionVM> VchrLst;
            SalesCollectionComparisionVM yearlyData = new SalesCollectionComparisionVM();

            //IEnumerable<SalesCollectionComparisionVM > yearlyData;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <SalesCollectionComparisionVM>(sql_1).ToList();
                //yearlyData = dbContext.Database.SqlQuery<SalesCollectionComparisionVM>(sql_2).FirstOrDefault();
                yearlyData = dbContext.Database.SqlQuery <SalesCollectionComparisionVM>(sql_2).FirstOrDefault();
            }
            ViewBag.yearlyDataV = yearlyData;
            return(new Rotativa.ViewAsPdf("rptSalesCollectionComparisonPdf", "", VchrLst)
            {
                PageOrientation = Rotativa.Options.Orientation.Portrait,
                PageSize = Rotativa.Options.Size.A4,
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });
        }
コード例 #22
0
        public JsonResult UpdateData(string finYear, DateTime fDate, DateTime tDate, string command)
        {
            List <Vat6P9P1_1> Part1  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part2  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part3  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part4  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part5  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part6  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part7  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part8  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part9  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part10 = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part11 = new List <Vat6P9P1_1>();
            string            today  = DateTime.Today.ToString("yyyy/MM/dd");
            int month = fDate.Day;
            int year  = fDate.Year;
            //@ProjCode, @BranchCode, @FinYear,@Year, @Month, @fdate,@tdate
            //VM_rpt9P1_P1 '','','2019-20',2019,7,'2019-7-1','2019-7-31'
            string sql = string.Format("EXEC VM_rpt9P1_P1 '','',''," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part1 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P2 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + today + "','64',1");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part2 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }

            sql = string.Format("EXEC VM_rpt9P1_P3 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part3 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P4 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part4 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P5  '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part5 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P6 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part6 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P7 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part7 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P8 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part8 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P9 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part9 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P10 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part10 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P11 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part11 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            Part1Part2Model finalItem = new Part1Part2Model();

            finalItem.P1_1PArt1  = Part1;
            finalItem.P1_1PArt2  = Part2;
            finalItem.P1_1PArt3  = Part3;
            finalItem.P1_1PArt4  = Part4;
            finalItem.P1_1PArt5  = Part5;
            finalItem.P1_1PArt6  = Part6;
            finalItem.P1_1PArt7  = Part7;
            finalItem.P1_1PArt8  = Part8;
            finalItem.P1_1PArt9  = Part9;
            finalItem.P1_1PArt10 = Part10;
            finalItem.P1_1PArt11 = Part11;
            ViewBag.fDate        = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate        = InWord.GetAbbrMonthNameDate(tDate);
            return(Json(new
            {
                redirectUrl = Url.Action("TransWiseVat6P9P1_1RptPdf", "VATRpt"),
                finalItem,
                isRedirect = true
            }));
        }
コード例 #23
0
        public ActionResult PendingRptPdf(DateTime fDate, DateTime tDate)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(fDate), Convert.ToString(tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("PendingSearch_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }

            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            List <PendingNotEncashRptVM> finalList = new List <PendingNotEncashRptVM>();
            List <MoneyReceipt>          MRList    = new List <MoneyReceipt>();
            List <ChequeReceipt>         CRList    = new List <ChequeReceipt>();



            //ChequeReceipt itemob2 = new ChequeReceipt();

            //MoneyReceipt MoneyReceipt = new MoneyReceipt();
            //List<String> MRIdList = new List<String>();


            MRList = _IMoneyReceiptAppService.All().Where(x => x.EncashDate == null).ToList();
            CRList = _IChequeReceiptAppService.All().Where(x => x.ChqStatus == null).ToList();


            foreach (var item in MRList)
            {
                PendingNotEncashRptVM itemob = new PendingNotEncashRptVM();

                itemob.MRSL     = item.MRSL;
                itemob.MRNo     = item.MRNo;
                itemob.MRDate   = item.MRDate;
                itemob.CustCode = item.CustCode;
                //itemob.ChkAmount = "";
                itemob.MRAmount = item.MRAmount;
                itemob.Remarks  = item.Remarks;

                finalList.Add(itemob);
            }


            foreach (var item in CRList)
            {
                PendingNotEncashRptVM itemob = new PendingNotEncashRptVM();
                itemob.MRSL      = item.MRSL;
                itemob.MRNo      = item.ChqReceiptNo;
                itemob.MRDate    = item.ChqReceiptDate;
                itemob.CustCode  = item.SubCode;
                itemob.ChkAmount = item.Amount;
                // itemob.MRAmount = item.MRAmount;
                itemob.Remarks = item.Remarks;

                finalList.Add(itemob);
            }



            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            return(new Rotativa.ViewAsPdf("~/Views/Pending/PendingRptPdf.cshtml", finalList)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });

            //return View(finalList);
        }
コード例 #24
0
        public ActionResult GetVoucherPreviewPdf(string FinYear, string vchrNo, string pType)
        {
            var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == "rptVoucher");

            ViewBag.RptCap    = ledger.RptCap;
            ViewBag.Col1Cap   = ledger.Col1Cap;
            ViewBag.Col2Cap   = ledger.Col2Cap;
            ViewBag.Col3Cap   = ledger.Col3Cap;
            ViewBag.Col4Cap   = ledger.Col4Cap;
            ViewBag.Col5Cap   = ledger.Col5Cap;
            ViewBag.Col6Cap   = ledger.Col6Cap;
            ViewBag.Col7Cap   = ledger.Col7Cap;
            ViewBag.HasBranch = _sysSetService.All().FirstOrDefault().HasBranch;
            if (ViewBag.HasBranch == true)
            {
                var BranchCode = Session["BranchCode"].ToString();
                if (BranchCode != null)
                {
                    ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == BranchCode).BranchName.ToString();
                }
                else
                {
                    ViewBag.Branch = "All";
                }
            }

            string sql = string.Format("EXEC rptVoucher '" + FinYear + "','" + vchrNo + "'");
            List <VchrPreviewVM> rptVchr = _VchrPreviewVMService.SqlQueary(sql).ToList();
            //if (rptVchr.Count == 0)
            //{
            //    string errMsg = "There is no data in this combination. Please try again !!!";
            //    return RedirectToAction("SearchVoucher", "VchrPreview", new { errMsg });
            //}
            //else
            //{
            double amt = 0;

            foreach (var item in rptVchr)
            {
                if (item.cramount != 0)
                {
                    amt += item.cramount;
                }
            }
            string InWordsamt = InWord.ConvertToWords(amt.ToString());

            ViewBag.InWordsAmt = InWordsamt;
            if (pType == "A4")
            {
                return(new Rotativa.ViewAsPdf("~/Views/VchrPreview/VchrPreviewPdf.cshtml", rptVchr)
                {
                    PageSize = Rotativa.Options.Size.A4
                });
            }
            else if (pType == "A3")
            {
                return(new Rotativa.ViewAsPdf("~/Views/VchrPreview/VchrPreviewPdf.cshtml", rptVchr)
                {
                    PageSize = Rotativa.Options.Size.A3
                });
            }
            else
            {
                return(new Rotativa.ViewAsPdf("~/Views/VchrPreview/VchrPreviewPdf.cshtml", rptVchr)
                {
                    PageSize = Rotativa.Options.Size.A5
                });
            }
            //}
        }
コード例 #25
0
        public ActionResult TransWiseVat6P9P1_1RptPdf(string finYear, DateTime fDate, DateTime tDate, string command)
        {
            List <Vat6P9P1_1> Part1  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part2  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part3  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part4  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part5  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part6  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part7  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part8  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part9  = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part10 = new List <Vat6P9P1_1>();
            List <Vat6P9P1_1> Part11 = new List <Vat6P9P1_1>();
            string            today  = DateTime.Today.ToString("yyyy/MM/dd");
            int month = fDate.Day;
            int year  = fDate.Year;
            //@ProjCode, @BranchCode, @FinYear,@Year, @Month, @fdate,@tdate
            //VM_rpt9P1_P1 '','','2019-20',2019,7,'2019-7-1','2019-7-31'
            string sql = string.Format("EXEC VM_rpt9P1_P1 '','',''," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part1 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P2 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + today + "','64',1");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part2 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }

            sql = string.Format("EXEC VM_rpt9P1_P3 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part3 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P4 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part4 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P5  '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part5 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P6 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part6 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P7 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part7 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P8 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part8 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P9 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part9 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P10 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part10 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            sql = string.Format("EXEC VM_rpt9P1_P11 '','','" + finYear + "'," + year + "," + month + ",'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "'");
            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                Part11 = dbContext.Database.SqlQuery <Vat6P9P1_1>(sql).ToList();
            }
            Part1Part2Model finalItem = new Part1Part2Model();

            finalItem.P1_1PArt1  = Part1;
            finalItem.P1_1PArt2  = Part2;
            finalItem.P1_1PArt3  = Part3;
            finalItem.P1_1PArt4  = Part4;
            finalItem.P1_1PArt5  = Part5;
            finalItem.P1_1PArt6  = Part6;
            finalItem.P1_1PArt7  = Part7;
            finalItem.P1_1PArt8  = Part8;
            finalItem.P1_1PArt9  = Part9;
            finalItem.P1_1PArt10 = Part10;
            finalItem.P1_1PArt11 = Part11;
            ViewBag.fDate        = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate        = InWord.GetAbbrMonthNameDate(tDate);
            //bool process = false;

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            if (command == "Preview")
            {
                return(View(finalItem));
            }

            //return Json(process, JsonRequestBehavior.AllowGet);
            else
            {
                sql = string.Format("exec Count_MRPrint " + year + "," + month + "");
            }
            IEnumerable <MonthlyReturn> MontlyReturnLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                MontlyReturnLst = dbContext.Database.SqlQuery <MonthlyReturn>(sql).ToList();
            }

            return(View("TransWiseVat6P9P1_1RptPdf - Copy", finalItem));
            //return new Rotativa.ViewAsPdf("TransWiseVat6P9P1_1RptPdf", "", finalItem)
            //{
            //    //PageMargins= new Rotativa.Options.Margins(2,2,0,1),
            //    PageSize = Rotativa.Options.Size.A4, // (14f, 8.5f),
            //    // PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,
            //    PageOrientation = Rotativa.Options.Orientation.Portrait,
            //    CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            //};
        }
コード例 #26
0
        public ActionResult MontlyQuantityRptPdf2(string Location, string CustomerName, DateTime fDate, DateTime tDate, string ProjCode, string BranchCode, string FinYear, string QtyAmt)
        {
            //#### AMOUNT

            string ItemGroup = "";

            string sp            = "";
            string customerGroup = "";

            //string Location = "";

            if (QtyAmt != "Amount")
            {
                sp = "rpt_SP_ProdSales_Qty";
            }
            else
            {
                sp = "rpt_SP_ProdSales_Amt";
            }

            customerGroup = CustomerName;
            //rpt_SP_ProdSales_Qty @fdate smalldatetime, @tdate smalldatetime, @ProjCode varchar(3), @BranchCode varchar(3),@FinYear varchar(7), @customerGroup varchar(7),@ItemGroup varchar(6)

            string sql = string.Format("EXEC " + sp + "'" + fDate.ToString("yyyy/MM/dd") + "','" + tDate.ToString("yyyy/MM/dd") + "','" + ProjCode + "', '" + BranchCode + "','" + FinYear + "','" + customerGroup + "','" + ItemGroup + "','" + Session["UserName"] + "'  ");
            IEnumerable <MontlyQuantity> VchrLst;

            using (AcclineERPContext dbContext = new AcclineERPContext())
            {
                VchrLst = dbContext.Database.SqlQuery <MontlyQuantity>(sql).ToList();
            }
            ViewBag.BranchCode = _BranchService.All().Where(s => s.BranchCode == BranchCode).Select(x => x.BranchName).FirstOrDefault();
            //ViewBag.fDate = fDate.ToString("dd-MMM-yyyy");
            //ViewBag.tDate = tDate.ToString("dd-MMM-yyyy");
            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);

            //Response.AppendHeader("Content-Disposition", "inline; filename=" + RptName + "_" + DateTime.Now.ToShortDateString() + ".pdf");



            //#### AMOUNT  #######


            ViewBag.CustomerName = "All";
            ViewBag.Location     = "All";

            if (CustomerName != "")
            {
                CustomerName         = _ISubsidiaryInfoService.All().Where(s => s.SubCode == CustomerName).Select(x => x.SubName).FirstOrDefault();
                ViewBag.CustomerName = CustomerName;
            }
            if (Location != "")
            {
                Location         = _ILocationAppService.All().ToList().Where(s => s.LocCode == Location).Select(x => x.LocName).FirstOrDefault();
                ViewBag.Location = Location;
            }



            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;



            if (QtyAmt != "Amount")
            {
                return(new Rotativa.ViewAsPdf("~/Views/MontlyQuantity/QuantityPdf.cshtml", VchrLst)
                {
                    PageOrientation = Rotativa.Options.Orientation.Landscape,
                    PageSize = Rotativa.Options.Size.A4,
                    CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
                });
            }

            else
            {
                return(new Rotativa.ViewAsPdf("~/Views/MontlyQuantity/AmountPdf.cshtml", VchrLst)
                {
                    PageOrientation = Rotativa.Options.Orientation.Landscape,
                    PageSize = Rotativa.Options.Size.A4,
                    CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
                });
            }
        }
コード例 #27
0
        //public ActionResult ListOfTransectionPreview(RptSearchVModel vmodel, string pType)
        //{
        //    string finyear = Session["FinYear"].ToString();
        //    Session["Branch"] = vmodel.BranchCode;
        //    Session["LedgerType"] = vmodel.LedgerTypeCode;
        //    Session["fDate"] = vmodel.fDate;
        //    Session["tDate"] = vmodel.tDate;

        //    var BranchCode = Session["BranchCode"].ToString();
        //    if (BranchCode != null)
        //    {
        //        ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == BranchCode).BranchName.ToString();
        //    }
        //    else
        //    {
        //        ViewBag.Branch = "All";
        //    }
        //    string sql = string.Format("EXEC rptListTran '" + finyear + "','01','" + vmodel.BranchCode + "','" + vmodel.JTrGrpId + "','" + Convert.ToDateTime(vmodel.fDate) + "','" + Convert.ToDateTime(vmodel.tDate) + "'");
        //    List<JarnalVoucher> glReport = _jarnalVoucherService.SqlQueary(sql).ToList();
        //    if (glReport.Count == 0)
        //    {
        //        string errMsg = "Data not found !!!";
        //        //ViewBag.msg = errMsg;
        //        return RedirectToAction("CashOperation", "CashOperation", new { errMsg });
        //    }
        //    else
        //    {
        //        if (pType == "A4") { return new Rotativa.ViewAsPdf("~/Views/CashOperation/ListOfTransectionPreview.cshtml", glReport) { PageSize = Rotativa.Options.Size.A4 }; }
        //        else if (pType == "A3") { return new Rotativa.ViewAsPdf("~/Views/CashOperation/ListOfTransectionPreview.cshtml", glReport) { PageSize = Rotativa.Options.Size.A3 }; }
        //        else { return new Rotativa.ViewAsPdf("~/Views/CashOperation/ListOfTransectionPreview.cshtml", glReport) { PageSize = Rotativa.Options.Size.A5 }; }
        //    }
        //}


        public ActionResult ListOfTransactionPreview(RptSearchVModel vmodel)
        {
            vmodel.fDate      = Convert.ToDateTime(Session["fDate"]);
            vmodel.toDate     = Convert.ToDateTime(Session["tDate"]);
            vmodel.BranchCode = Session["Branch"].ToString();
            string finyear = Session["FinYear"].ToString();

            if (Session["Data"] == null)
            {
                vmodel.JTrGrpId = "";
            }
            else
            {
                vmodel.JTrGrpId = Session["Data"].ToString();
            }
            //vmodel.JTrGrpId = Session["Data"].ToString();
            //if (vmodel.JTrGrpId == null)
            //{
            //    vmodel.JTrGrpId = "";
            //}

            // string x = "" = Session["NullData"].ToString();
            string sql = string.Format("EXEC rptListTran '" + finyear + "','01','" + vmodel.BranchCode + "','" + vmodel.JTrGrpId + "','" + vmodel.fDate.ToString("MM/dd/yyyy") + "','" + vmodel.toDate.ToString("MM/dd/yyyy") + "'");
            List <JarnalVoucher> glReport = _jarnalVoucherService.SqlQueary(sql).ToList();

            ViewBag.BranchCode = vmodel.BranchCode;
            ViewBag.fDate      = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate      = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            ViewBag.HasBranch  = _sysSetService.All().FirstOrDefault().HasBranch;
            if (ViewBag.HasBranch == true)
            {
                if (vmodel.BranchCode != null && vmodel.BranchCode != "0")
                {
                    ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
                }
                else
                {
                    ViewBag.Branch = "All";
                }
            }
            //  var glReport = Session["Data"].ToString();
            //if (glReport == null)
            //{
            //    string errMsg = "Data not found !!!";
            //    return RedirectToAction("ListOfTransaction", "Search", new { errMsg });
            //}
            //else
            //{
            double amt = 0;
            //foreach (var item in glReport)
            //{
            //    double amt = 0;
            List <JarnalVoucher> sList = new List <JarnalVoucher>();  //InWord.ConvertToWords(amt.ToString()).ToList();

            foreach (var item in glReport)
            {
                if (item.DrAmount > 0)
                {
                    amt = item.DrAmount;
                }
                else if (item.CrAmount > 0)
                {
                    amt = item.CrAmount;
                }

                JarnalVoucher sAmt = new JarnalVoucher();
                sAmt.ACCode     = item.ACCode;
                sAmt.VDate      = item.VDate;
                sAmt.AcName     = item.AcName;
                sAmt.InWords    = InWord.ConvertToWords(amt.ToString());
                sAmt.AcName     = item.AcName;
                sAmt.Narration  = item.Narration;
                sAmt.SubSidiary = item.SubSidiary;
                sAmt.CrAmount   = item.CrAmount;
                sAmt.DrAmount   = item.DrAmount;
                sAmt.VchrNo     = item.VchrNo;
                sAmt.Posted     = item.Posted;
                sAmt.Sub_Ac     = item.Sub_Ac;
                sList.Add(sAmt);
                // }
            }
            //string InWordsamt = InWord.ConvertToWords(amt.ToString());
            //ViewBag.InWordsAmt = InWordsamt;

            // ViewBag.glDate = date;
            //  return View("~/Views/ListOfTransection/TransectionList.cshtml", glReport);
            return(new Rotativa.ViewAsPdf("ListOfTransactionPreview", sList)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\"        --footer-font-size \"9\" --footer-spacing 5  --footer-font-name \"calibri light\""
            });
            //}
        }
コード例 #28
0
        public ActionResult ReportLedgerPdf(RptSearchVModel vmodel, string finyear)
        {
            vmodel.BranchCode     = Session["Branch"].ToString();
            vmodel.LedgerTypeCode = Session["LedgerType"].ToString();
            vmodel.AccountCode    = Session["AccountCode"].ToString();
            //vmodel.fDate = Session["fDate"].;
            //vmodel.tDate = Session["tDate"].ToString();
            var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.LedgerTypeCode == vmodel.LedgerTypeCode);

            ViewBag.LedgerCap   = ledger.LedgerCap;
            ViewBag.RptCap      = ledger.RptCap;
            ViewBag.OpeningCap  = ledger.OpeningCap;
            ViewBag.ClosingCap  = ledger.ClosingCap;
            ViewBag.Col1Cap     = ledger.Col1Cap;
            ViewBag.Col2Cap     = ledger.Col2Cap;
            ViewBag.Col3Cap     = ledger.Col3Cap;
            ViewBag.Col4Cap     = ledger.Col4Cap;
            ViewBag.Col5Cap     = ledger.Col5Cap;
            ViewBag.Col6Cap     = ledger.Col6Cap;
            ViewBag.Col7Cap     = ledger.Col7Cap;
            ViewBag.Col8Cap     = ledger.Col8Cap;
            ViewBag.fDate       = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate       = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            ViewBag.AccountCode = vmodel.AccountCode;
            ViewBag.BranchCode  = vmodel.BranchCode;
            if (vmodel.BranchCode != null)
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }

            if (vmodel.LedgerTypeCode == "01")
            {
                ViewBag.Account = _NewChartService.All().FirstOrDefault(x => x.Accode == vmodel.AccountCode.Trim()).AcName.ToString();
            }
            else if (vmodel.LedgerTypeCode == "02")
            {
                ViewBag.Account = _SubsidiaryService.All().FirstOrDefault(x => x.SubCode == vmodel.AccountCode.Trim()).SubName.ToString();
            }
            else
            {
                ViewBag.Account = _ItemService.All().FirstOrDefault(x => x.ItemCode == vmodel.AccountCode.Trim()).ItemName.ToString();
            }

            ViewBag.PrintDate = DateTime.Now.ToShortDateString();

            finyear = Session["FinYear"].ToString();

            string sql = string.Format(" EXEC " + ledger.SP_Name + " '" + finyear + "','" + Session["ProjCode"].ToString() + "','" + vmodel.BranchCode + "','" + vmodel.AccountCode + "','" + vmodel.fDate.ToString("MM/dd/yyyy") + "','" + vmodel.toDate.ToString("MM/dd/yyyy") + "'");
            List <ReportLedger> rptLedger = _ReportLedgerService.SqlQueary(sql).ToList();
            //if (rptLedger.Count == 0)
            //{
            //    string errMsg = "There is no data in this combination. Please try again !!!";
            //    return RedirectToAction("Search", "Report", new { errMsg });
            //}
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            return(new Rotativa.ViewAsPdf("ReportLedgerPdf", rptLedger)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\"        --footer-font-size \"9\" --footer-spacing 5  --footer-font-name \"calibri light\""
            });
        }
コード例 #29
0
        public ActionResult Sample_GiftRptPdf(string LocCode, DateTime fDate, DateTime tDate)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(fDate), Convert.ToString(tDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("Sample_Gift_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("SecUserLogin", "SecUserLogin", new { errMsg }));
            }



            ViewBag.fDate = InWord.GetAbbrMonthNameDate(fDate);
            ViewBag.tDate = InWord.GetAbbrMonthNameDate(tDate);


            ViewBag.Location = "All";


            if (LocCode != "")
            {
                LocCode          = _ILocationAppService.All().ToList().Where(s => s.LocCode == LocCode).Select(x => x.LocName).FirstOrDefault();
                ViewBag.Location = LocCode;
            }


            List <Sample_giftRptVM> finalList = new List <Sample_giftRptVM>(); List <String> IssueIdList = new List <String>();

            if (LocCode == "")
            {
                IssueIdList = _IIssueMainService.All().Where(x => x.IssueDate > fDate && x.IssueDate < tDate).Select(s => s.IssueNo).ToList();
            }
            else
            {
                IssueIdList = _IIssueMainService.All().Where(x => x.IssueDate > fDate && x.IssueDate < tDate && x.FromLocCode == LocCode).Select(s => s.IssueNo).ToList();
            }
            foreach (var IssueId in IssueIdList)
            {
                Sample_giftRptVM item = new Sample_giftRptVM();
                var DetailList        = _IssueDetailsAppService.All().FirstOrDefault(x => x.IssueNo == IssueId);
                var Mainlist          = _IIssueMainService.All().FirstOrDefault(x => x.IssueNo == IssueId);
                item.No       = IssueId;
                item.date     = Mainlist.IssueDate.ToShortDateString();
                item.Type     = _INewChartAppService.All().Where(x => x.Accode == Mainlist.DesLocCode).Select(x => x.AcName).FirstOrDefault();
                item.Lot      = DetailList.LotNo;
                item.Quantity = DetailList.Qty;
                item.U_Price  = DetailList.Price;
                item.Amount   = Mainlist.Amount;
                item.Given_To = _ISubsidiaryInfoService.All().Where(x => x.SubCode == Mainlist.ToLocCode).Select(x => x.SubName).FirstOrDefault();
                finalList.Add(item);
            }

            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            return(new Rotativa.ViewAsPdf("~/Views/Sample_Gift/Sample_GiftRptPdf.cshtml", finalList)
            {
                CustomSwitches = "--footer-left \"Reporting Date: " + DateTime.Now.ToString("dd-MM-yyyy") + "\" " + "--footer-right \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\""
            });

            //return View(finalList);
        }
コード例 #30
0
        public ActionResult GetReportLedger(RptSearchVModel vmodel, string finyear)
        {
            var ChkFYR = GetCompanyInfo.ValidateFinYearDateRange(Convert.ToString(vmodel.fDate), Convert.ToString(vmodel.toDate), Session["FinYear"].ToString());

            if (ChkFYR != "")
            {
                return(RedirectToAction("StockLedgerRpt", "StockLedgerRpt", new { errMsg = ChkFYR }));
            }

            RBACUser rUser = new RBACUser(Session["UserName"].ToString());

            if (!rUser.HasPermission("RptGeneralLedger_Preview"))
            {
                string errMsg = "No Preview Permission for this User !!";
                return(RedirectToAction("StockLedgerRpt", "StockLedgerRpt", new { errMsg }));
            }
            vmodel.BranchCode      = (vmodel.BranchCode == null) ? "" : vmodel.BranchCode;
            Session["Branch"]      = vmodel.BranchCode;
            vmodel.AccountCode     = (vmodel.AccountCode == null) ? "" : vmodel.AccountCode;
            Session["AccountCode"] = vmodel.AccountCode;
            Session["fDate"]       = vmodel.fDate;
            Session["tDate"]       = vmodel.toDate;


            var ledger = _LedgerCapService.All().ToList().FirstOrDefault(x => x.SP_Name == "rptStoreLedger");


            ViewBag.LedgerCap   = ledger.LedgerCap;
            ViewBag.RptCap      = ledger.RptCap;
            ViewBag.OpeningCap  = ledger.OpeningCap;
            ViewBag.ClosingCap  = ledger.ClosingCap;
            ViewBag.Col1Cap     = ledger.Col1Cap;
            ViewBag.Col2Cap     = ledger.Col2Cap;
            ViewBag.Col3Cap     = ledger.Col3Cap;
            ViewBag.Col4Cap     = ledger.Col4Cap;
            ViewBag.Col5Cap     = ledger.Col5Cap;
            ViewBag.Col6Cap     = ledger.Col6Cap;
            ViewBag.Col7Cap     = ledger.Col7Cap;
            ViewBag.Col8Cap     = ledger.Col8Cap;
            ViewBag.fDate       = InWord.GetAbbrMonthNameDate(vmodel.fDate);
            ViewBag.tDate       = InWord.GetAbbrMonthNameDate(vmodel.toDate);
            ViewBag.AccountCode = vmodel.AccountCode;
            ViewBag.BranchCode  = vmodel.BranchCode;
            ViewBag.HasBranch   = _sysSetService.All().FirstOrDefault().HasBranch;

            if (vmodel.BranchCode != "" && vmodel.BranchCode != "0")
            {
                ViewBag.Branch = _BranchService.All().FirstOrDefault(x => x.BranchCode == vmodel.BranchCode.Trim()).BranchName.ToString();
            }
            else
            {
                ViewBag.Branch = "All";
            }
            if (vmodel.AccountCode != "")
            {
                ViewBag.Account = _ItemService.All().FirstOrDefault(x => x.ItemCode == vmodel.AccountCode.Trim()).ItemName.ToString();
            }
            else
            {
                ViewBag.Account = "All";
            }

            finyear = Session["FinYear"].ToString();

            string sql = string.Format(" EXEC " + ledger.SP_Name + " '" + finyear + "','" + Session["ProjCode"].ToString() + "','" + vmodel.BranchCode + "','" + vmodel.AccountCode + "','" + vmodel.fDate.ToString("MM-dd-yyyy") + "','" + vmodel.toDate.ToString("MM-dd-yyyy") + "'");
            List <ReportLedger> rptLedger = _ReportLedgerService.SqlQueary(sql).ToList();
            //For us Culture Ex: 0.00
            const string culture = "en-US";
            CultureInfo  ci      = CultureInfo.GetCultureInfo(culture);

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;
            return(View(rptLedger));
        }