Example #1
0
        //public static List<PostingJob> GetPendingPostingJobs(int companyId)
        //{
        //    List<PostingJob> pendingJobList = new List<PostingJob>();
        //    try
        //    {
        //        string strErr = "";
        //        CRSDAL dal = new CRSDAL();
        //        dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
        //        dal.AddParameter("p_StatusId", 1, ParameterDirection.Input);
        //        DataSet dstOutPut = dal.ExecuteSelect("spJainTallyGet_PostingStatus", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);
        //        if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0)
        //        {
        //            for (int j = 0; j < dstOutPut.Tables.Count; j++)
        //            {
        //                if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0)
        //                {
        //                    for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++)
        //                    {
        //                        PostingJob pJob = new PostingJob();
        //                        pJob.CompanyId = companyId;
        //                        pJob.JobId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["jobid"].ToString());
        //                        pJob.JourneyDate = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journeydate"].ToString());
        //                        pendingJobList.Add(pJob);
        //                    }
        //                }
        //            }

        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Logger.WriteLog("PostingStatusAPI", "GetPendingPostingJobs", ex.Message);
        //    }
        //    return pendingJobList;
        //}

        public static List <PostingJob> GetPendingPostingJobsList(int companyId)
        {
            List <PostingJob> pendingJobList = new List <PostingJob>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                dal.AddParameter("p_StatusId", 1, ParameterDirection.Input);
                DataSet dstOutPut = dal.ExecuteSelect("spTallyGet_PostingStatus_20180130", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);
                if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0)
                {
                    for (int j = 0; j < dstOutPut.Tables.Count; j++)
                    {
                        if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0)
                        {
                            for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++)
                            {
                                PostingJob pJob = new PostingJob();
                                pJob.CompanyId   = companyId;
                                pJob.JobId       = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["jobid"].ToString());
                                pJob.JourneyDate = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journeydate"].ToString());
                                pendingJobList.Add(pJob);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("PostingStatusAPI", "GetPendingPostingJobs", ex.Message);
            }
            return(pendingJobList);
        }
        public static List<Cancellation> GetCancellation(int companyid,int intervalofdays)
        {
            List<Cancellation> CancellationList = new List<Cancellation>();

            try
            {
                string strErr = "";
                CRSDAL dal = new CRSDAL();
                dal.AddParameter("p_companyId", companyid, ParameterDirection.Input);
                dal.AddParameter("p_interval", intervalofdays, ParameterDirection.Input);
                DataSet dsOutPut = dal.ExecuteSelect("spJainTallyGet_CancellationData", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0)
                {
                    DataTable dtOutput = dsOutPut.Tables[0];
                    if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0)
                    {
                        for (int i = 0; i < dtOutput.Rows.Count; i++)
                        {
                            DataRow dr = dtOutput.Rows[i];
                            if (Convert.ToInt32(dr["DebitLedgerId"].ToString()) > 0 && Convert.ToInt32(dr["CreditLedgerId"].ToString()) > 0)
                            {
                                Cancellation c = new Cancellation();

                                c.BookingId = Convert.ToInt32(dr["bookingid"].ToString());
                                c.DebitLedgerId = Convert.ToInt32(dr["DebitLedgerId"].ToString());
                                c.CreditLedgerId = Convert.ToInt32(dr["CreditLedgerId"].ToString());
                                c.BaseFare = Convert.ToDecimal(dr["ActualTotalFare"].ToString());
                                c.GST = Convert.ToDecimal(dr["GST"].ToString());
                                c.IGST = Convert.ToDecimal(dr["IGST"].ToString());
                                c.RefundAmount = Convert.ToDecimal(dr["RefundAmt"].ToString());
                                c.Comm = Convert.ToDecimal(dr["AgentComm"].ToString());
                                c.CancelDate = Convert.ToDateTime(dr["CDate"].ToString());
                                c.CustomerName = Convert.ToString(dr["CustomerName"].ToString());
                                c.GSTNumber = Convert.ToString(dr["GSTNumber"].ToString());
                                c.CustomerStateName = Convert.ToString(dr["passengerstatename"].ToString());
                                c.TicketNo = Convert.ToString(dr["TicketNo"].ToString());
                                c.Docnumber = Convert.ToString(dr["docnumber"].ToString());
                                c.DocType = Convert.ToString(dr["doctype"].ToString());
                                CancellationList.Add(c);
                            }
                           

                        }
                    }

                }

            }
            catch (Exception ex)
            {

                Logger.WriteLog("CancellationAPI", "GetCancellation", ex.Message);
               // Logger.WriteLogAlert("Cancellation " + " Error for Bookigid: " + CancellationList[i].BookingId + " " + ex.Message);
            }
            return CancellationList;


        }
Example #3
0
        public static List <Booking> GetBranchBookings(int companyid, DateTime journeyDate)
        {
            List <Booking> bookingsList = new List <Booking>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_companyId", companyid, ParameterDirection.Input);
                dal.AddParameter("p_journeyDate", journeyDate, ParameterDirection.Input);
                DataSet dstOutPut = dal.ExecuteSelect("spKabraTallyGet_BranchBooking", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0)
                {
                    for (int j = 0; j < dstOutPut.Tables.Count; j++)
                    {
                        // int table = dstOutPut.Tables.Count;
                        if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0)
                        {
                            for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++)
                            {
                                // int row = dstOutPut.Tables[table - 1].Rows.Count;
                                Booking b = new Booking();

                                b.BranchId       = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["branchid"].ToString());
                                b.BusID          = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["busid"].ToString());
                                b.BranchName     = Convert.ToString(dstOutPut.Tables[j].Rows[i]["branchname"].ToString());
                                b.JourneyDate    = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["chartdate"].ToString());
                                b.DebitLedgerId  = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["Debitledgerid"].ToString());
                                b.CreditLedgerId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["Creditledgerid"].ToString());
                                b.TotalAmount    = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["TotalFare"].ToString());
                                b.GST            = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["GST"].ToString());
                                b.NetAmount      = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["NetAmt"].ToString());
                                b.ClassId        = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["ClassID"].ToString());
                                b.ClassName      = Convert.ToString(dstOutPut.Tables[j].Rows[i]["classname"].ToString());
                                b.DocNumber      = Convert.ToString(dstOutPut.Tables[j].Rows[i]["docnumber"].ToString());
                                //b.NetAmount = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["NetAmt"].ToString());
                                bookingsList.Add(b);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("BookingsAPI", "GetBranchBookings", ex.Message);
            }
            return(bookingsList);
        }
Example #4
0
        public static List <GSTBooking> GetBranchGSTBookings(int companyid, int intervalofdays)
        {
            List <GSTBooking> gstbookingsList = new List <GSTBooking>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_companyId", companyid, ParameterDirection.Input);
                dal.AddParameter("p_interval", intervalofdays, ParameterDirection.Input);
                DataSet dstOutPut = dal.ExecuteSelect("spJainTallyGet_GSTBookingDetails", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0)
                {
                    for (int j = 0; j < dstOutPut.Tables.Count; j++)
                    {
                        if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0)
                        {
                            for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++)
                            {
                                GSTBooking gb = new GSTBooking();

                                gb.BaseFare          = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["TotalFare"].ToString());
                                gb.TotalFare         = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["ActualTotalFare"].ToString());
                                gb.NetFare           = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["NetTotalFare"].ToString());
                                gb.BookingId         = Convert.ToInt64(dstOutPut.Tables[j].Rows[i]["BookingID"].ToString());
                                gb.GSTNumber         = Convert.ToString(dstOutPut.Tables[0].Rows[0]["GSTNumber"].ToString());
                                gb.DebitLedgerId     = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["DebitLedgerid"].ToString());
                                gb.CreditLedgerId    = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["CreditLedgerId"].ToString());
                                gb.GST               = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["GST"].ToString());
                                gb.IGST              = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["IGST"].ToString());
                                gb.Comm              = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["AgentComm"].ToString());
                                gb.CustomerName      = Convert.ToString(dstOutPut.Tables[0].Rows[0]["CustomerName"].ToString());
                                gb.CustomerStateName = Convert.ToString(dstOutPut.Tables[0].Rows[0]["passengerstatename"].ToString());
                                gb.TicketNo          = Convert.ToString(dstOutPut.Tables[j].Rows[i]["TicketNo"].ToString());
                                gb.DocNumber         = Convert.ToString(dstOutPut.Tables[j].Rows[i]["docnumber"].ToString());
                                gb.DocType           = Convert.ToString(dstOutPut.Tables[j].Rows[i]["doctype"].ToString());
                                gstbookingsList.Add(gb);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("BookingsAPI", "GetBranchCardBookings", ex.Message);
            }
            return(gstbookingsList);
        }
Example #5
0
        public static List <OnlineAgentDetails> GetOnlineAgentCollection(int companyid, DateTime journeyDate)
        {
            List <OnlineAgentDetails> AgentList = new List <OnlineAgentDetails>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_companyId", companyid, ParameterDirection.Input);
                dal.AddParameter("p_journeyDate", journeyDate, ParameterDirection.Input);
                DataSet dsOutPut = dal.ExecuteSelect("spKabraTallyGet_OnlineAgentCollection", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0)
                {
                    DataTable dtOutput = dsOutPut.Tables[0];
                    if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0)
                    {
                        for (int i = 0; i < dtOutput.Rows.Count; i++)
                        {
                            DataRow            dr = dtOutput.Rows[i];
                            OnlineAgentDetails ac = new OnlineAgentDetails();

                            ac.AgentName      = dr["AgentName"].ToString();
                            ac.AgentId        = Convert.ToInt32(dr["agentid"].ToString());
                            ac.BusId          = Convert.ToInt32(dr["busid"].ToString());
                            ac.DebitLedgerId  = Convert.ToInt32(dr["DebitLedgerId"].ToString());
                            ac.CreditLedgerId = Convert.ToInt32(dr["CreditLedgerId"].ToString());
                            ac.NetAmount      = Convert.ToDecimal(dr["NetAmt"].ToString());
                            ac.GST            = Convert.ToDecimal(dr["GST"].ToString());
                            ac.Discount       = Convert.ToDecimal(dr["Discount"].ToString());
                            ac.TotalFare      = Convert.ToDecimal(dr["TotalFare"].ToString());
                            ac.AgentComm      = Convert.ToDecimal(dr["AgentComm"].ToString());
                            ac.JourneyDate    = Convert.ToDateTime(dr["journeydate"].ToString());
                            ac.Docnumber      = Convert.ToString(dr["docnumber"].ToString());
                            ac.ClassName      = dr["classname"].ToString();
                            ac.ClassID        = Convert.ToInt32(dr["ClassID"].ToString());
                            AgentList.Add(ac);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("OnlineAgentAPI", "GetOnlineAgentCollection", ex.Message);
            }
            return(AgentList);
        }
        public static List <Franchise> GetFranchiseCollection(int companyid, DateTime journeyDate)
        {
            List <Franchise> franchisecollectionList = new List <Franchise>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_companyId", companyid, ParameterDirection.Input);
                dal.AddParameter("p_journeyDate", journeyDate, ParameterDirection.Input);
                DataSet dsOutPut = dal.ExecuteSelect("spKabraTallyGet_FranchiseBooking_test", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0)
                {
                    DataTable dtOutput = dsOutPut.Tables[0];
                    if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0)
                    {
                        for (int i = 0; i < dtOutput.Rows.Count; i++)
                        {
                            DataRow   dr = dtOutput.Rows[i];
                            Franchise fc = new Franchise();
                            fc.FranchiseId    = Convert.ToInt32(dr["BranchID"].ToString());
                            fc.FranchiseName  = dr["BranchName"].ToString();
                            fc.JourneyDate    = Convert.ToDateTime(dr["Journeydate"].ToString());
                            fc.DebitLedgerId  = Convert.ToInt32(dr["DebitLedgerId"].ToString());
                            fc.CreditLedgerId = Convert.ToInt32(dr["CreditLedgerId"].ToString());
                            //fc.FranchiseName = dr["DebitLedgerName"].ToString();
                            fc.NetAmount  = Convert.ToDecimal(dr["NetAmt"].ToString());
                            fc.TotalAmt   = Convert.ToDecimal(dr["TotalFare"].ToString());
                            fc.ServiceTax = Convert.ToDecimal(dr["GST"].ToString());
                            fc.Discount   = Convert.ToDecimal(dr["Discount"].ToString());
                            fc.AggentComm = Convert.ToDecimal(dr["Commission"].ToString());
                            fc.DocNumber  = Convert.ToString(dr["docnumber"].ToString());
                            fc.ClassID    = Convert.ToInt32(dr["ClassID"].ToString());
                            fc.classname  = Convert.ToString(dr["classname"].ToString());
                            franchisecollectionList.Add(fc);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("FranchiseAPI", "GetFranchiseCollection", ex.Message);
            }
            return(franchisecollectionList);
        }
Example #7
0
        public static void CreateJournalForUserWiseCollection(int companyId, List <Booking> bookingsList)
        {
            try
            {
                CRSDAL dal    = new CRSDAL();
                string strErr = "";



                for (int i = 0; i < bookingsList.Count; i++)
                {
                    Booking b = bookingsList[i];
                    if (strErr == "")
                    {
                        try
                        {
                            dal = new CRSDAL();
                            dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                            dal.AddParameter("p_JourneyDate", bookingsList[i].JourneyDate, ParameterDirection.Input);
                            dal.AddParameter("p_DebitLedgerId", bookingsList[i].DebitLedgerId, ParameterDirection.Input);
                            dal.AddParameter("p_CreditLedgerId", bookingsList[i].CreditLedgerId, ParameterDirection.Input);
                            dal.AddParameter("p_ClassID", bookingsList[i].ClassId, ParameterDirection.Input);
                            dal.AddParameter("p_TotalAmount", bookingsList[i].TotalAmount, ParameterDirection.Input);
                            dal.AddParameter("p_NetAmount", bookingsList[i].NetAmount, ParameterDirection.Input);
                            dal.AddParameter("p_GST", bookingsList[i].GST, ParameterDirection.Input);
                            dal.AddParameter("p_docnumber", bookingsList[i].DocNumber, 300, ParameterDirection.Input);

                            int status = dal.ExecuteDML("spKabraTallySet_BranchCollection_Test", CommandType.StoredProcedure, 0, ref strErr);
                            EntryCounter.GetInstance().AddCount(1);
                            if (strErr != "")
                            {
                                throw new Exception();
                            }
                        }
                        catch (Exception ex)
                        {
                            Logger.WriteLog("BookingAPI", "CreateJournalForUserWiseCollection", " Error for Branch: " + bookingsList[i].BranchName + " " + ex.Message);
                            Logger.WriteLogAlert2("BookingAPI " + "Error:CreateJournalForUserWiseCollection For JournalID: " + bookingsList[i].BranchName + " " + ex.Message);
                            PostingAPI.UpdatePostingStatusForException(companyId, bookingsList[i].JourneyDate, 9);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("BookingAPI", "CreateJournalForUserWiseCollection", ex.Message);
                Logger.WriteLogAlert("BookingAPI" + "CreateJournalForUserWiseCollection" + ex.Message);
            }
        }
        public static List <BusWise> GetAttachedBusCollection(int companyid, int intervalofdays)
        {
            List <BusWise> BusWiseList = new List <BusWise>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_companyId", companyid, ParameterDirection.Input);
                dal.AddParameter("p_interval", intervalofdays, ParameterDirection.Input);
                DataSet dsOutPut = dal.ExecuteSelect("spJainTallyGet_QuickView", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dsOutPut != null && dsOutPut.Tables != null && dsOutPut.Tables.Count > 0)
                {
                    DataTable dtOutput = dsOutPut.Tables[0];
                    if (dtOutput != null && dtOutput.Rows != null && dtOutput.Rows.Count > 0)
                    {
                        for (int i = 0; i < dtOutput.Rows.Count; i++)
                        {
                            DataRow dr = dtOutput.Rows[i];
                            BusWise bc = new BusWise();
                            bc.BusiD            = Convert.ToInt32(dr["BusID"].ToString());
                            bc.BusNumber        = dr["BusNumber"].ToString();
                            bc.JourneyDate      = Convert.ToDateTime(dr["JourneyDate"].ToString());
                            bc.AccsysLedgerId   = Convert.ToInt32(dr["accsysledgerid"].ToString());
                            bc.CommLedgerId     = Convert.ToInt32(dr["CommLedgerid"].ToString());
                            bc.NetAmount        = Convert.ToDecimal(dr["totalactualfare"].ToString());
                            bc.OfflineAgentComm = Convert.ToDecimal(dr["TotalOfflineAgentComm"].ToString());
                            bc.OnlineAgentComm  = Convert.ToDecimal(dr["TotalOnlineAgentComm"].ToString());
                            bc.CGST             = Convert.ToDecimal(dr["CGST"].ToString());
                            bc.SGST             = Convert.ToDecimal(dr["CGST"].ToString());
                            bc.BusComm          = Convert.ToDecimal(dr["Comm"].ToString());
                            bc.DocNumber        = Convert.ToString(dr["docnumber"].ToString());
                            BusWiseList.Add(bc);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("AttachedBusAPI", "GetAttachedBusCollection", ex.Message);
            }
            return(BusWiseList);
        }
Example #9
0
        public static void InsertUpdateCostCentresInCRS(List <Ledger> CostcenterList, int companyId)
        {
            try
            {
                if (CostcenterList != null && CostcenterList.Count > 0)
                {
                    for (int i = 0; i < CostcenterList.Count; i++)
                    {
                        Logger.WriteLog("Ledger Name: " + CostcenterList[i].LedgerName);
                        CRSDAL dal    = new CRSDAL();
                        string strErr = "";

                        dal.AddParameter("p_classname", CostcenterList[i].LedgerName, 200, ParameterDirection.Input);
                        dal.AddParameter("p_issubclass", 0, ParameterDirection.Input);
                        dal.AddParameter("p_parentclassid", 0, ParameterDirection.Input);
                        dal.AddParameter("p_CompanyId", companyId, ParameterDirection.Input);
                        dal.AddParameter("p_accsysid", CostcenterList[i].LedgerMasterID, 50, ParameterDirection.Input);
                        dal.AddParameter("p_parentname", "", 200, ParameterDirection.Input);

                        int status = dal.ExecuteDML("spTallySet_CostCentre", CommandType.StoredProcedure, 0, ref strErr);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("MastersAPI", "InsertUpdateCostCentresInCRS", ex.Message);
            }
        }
        private static List <Journal> GetJournals(int companyId, string spName)
        {
            List <Journal> journalList = new List <Journal>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_companyId", companyId, ParameterDirection.Input);
                DataSet dstOutPut = dal.ExecuteSelect(spName, CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0)
                {
                    for (int j = 0; j < dstOutPut.Tables.Count; j++)
                    {
                        if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0)
                        {
                            for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++)
                            {
                                Journal jl = new Journal();
                                jl.Action               = dstOutPut.Tables[j].Rows[i]["action"].ToString();
                                jl.AccSysId             = dstOutPut.Tables[j].Rows[i]["accsysid"].ToString();
                                jl.AccSysPostDateTime   = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["accsyspostdatetime"].ToString());
                                jl.BookingId            = Convert.ToInt64(dstOutPut.Tables[j].Rows[i]["bookingid"].ToString());
                                jl.CompanyId            = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["companyid"].ToString());
                                jl.CurrencyId           = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["currencyid"].ToString());
                                jl.DocFormattedNumber   = dstOutPut.Tables[j].Rows[i]["docformattednumber"].ToString();
                                jl.DocNumber            = dstOutPut.Tables[j].Rows[i]["docnumber"].ToString();
                                jl.DocSubtype           = dstOutPut.Tables[j].Rows[i]["docsubtype"].ToString();
                                jl.DocType              = dstOutPut.Tables[j].Rows[i]["doctype"].ToString();
                                jl.Narration            = dstOutPut.Tables[j].Rows[i]["narration"].ToString();
                                jl.JournalDateTime      = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journaldatetime"].ToString());
                                jl.JournalEntryDateTime = Convert.ToDateTime(dstOutPut.Tables[j].Rows[i]["journalentrydatetime"].ToString());
                                jl.JournalId            = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["voucherjournalid"].ToString());
                                jl.Type   = dstOutPut.Tables[j].Rows[i]["type"].ToString();
                                jl.UserId = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["userid"].ToString());

                                journalList.Add(jl);
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(journalList);
        }
        public static void UpdateTallyJournalIdInCRS(int journalId, string tallyId)
        {
            string strResult = "";

            try
            {
                CRSDAL dal    = new CRSDAL();
                string strErr = "";
                dal.AddParameter("p_journalId", journalId, ParameterDirection.Input);
                dal.AddParameter("p_accsysid", tallyId, 100, ParameterDirection.Input);
                //dal.AddParameter("p_ErrMsg", strErr, strErr.Length, ParameterDirection.Output);
                DataSet dstoutput = dal.ExecuteSelect("spKabraTallySet_JournalId", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", true, "", false);

                if (Convert.ToInt32(dstoutput.Tables[0].Rows[0]["countrow"].ToString()) == 0 || Convert.ToInt32(dstoutput.Tables[0].Rows[0]["countrow"].ToString()) > 1 || strErr != "")
                {
                    Logger.WriteLogAlert("AccountingAPI " + "Error In UpdateTallyJournalIdInCRS" + "For JournalId :" + journalId + " " + strErr);
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLogAlert("AccountingAPI " + "Error In UpdateTallyJournalIdInCRS" + "For JournalId :" + journalId + " " + ex);
            }
        }
        public static void CreateSaleForFranchiseCollection(int companyId, List <Franchise> FranchiseCollectionList)
        {
            try
            {
                CRSDAL dal    = null;
                string strErr = "";

                for (int i = 0; i < FranchiseCollectionList.Count; i++)
                {
                    Franchise fv        = FranchiseCollectionList[i];
                    string    narration = AccountingUtil.GetNarration(fv);
                    try
                    {
                        dal = new CRSDAL();
                        dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                        dal.AddParameter("p_BookingDate", FranchiseCollectionList[i].Bookingdate, ParameterDirection.Input);
                        dal.AddParameter("p_DebitLedgerId", FranchiseCollectionList[i].DebitLedgerId, ParameterDirection.Input);
                        dal.AddParameter("p_CreditLedgerId", FranchiseCollectionList[i].CreditLedgerId, ParameterDirection.Input);
                        dal.AddParameter("p_NetAmount", FranchiseCollectionList[i].NetAmount, ParameterDirection.Input);
                        dal.AddParameter("p_TotalAmount", FranchiseCollectionList[i].TotalAmt, ParameterDirection.Input);
                        dal.AddParameter("p_ServiceTax", FranchiseCollectionList[i].ServiceTax, ParameterDirection.Input);
                        dal.AddParameter("p_narration", narration, 3000, ParameterDirection.Input);
                        dal.AddParameter("p_docnumber", FranchiseCollectionList[i].DocNumber, 300, ParameterDirection.Input);

                        int status = dal.ExecuteDML("spTallySet_FranchiseCollectionJain", CommandType.StoredProcedure, 0, ref strErr);


                        EntryCounter.GetInstance().AddCount(1);
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteLog("FranchiseCollection", "CreateSaleForFranchiseCollection", " Error for Branch: " + FranchiseCollectionList[i].FranchiseId + " " + ex.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("FranchiseCollection", "CreateSaleForFranchiseCollection", ex.Message);
            }
        }
        public static List <JournalDetail> GetJournalDetail(int JournalID, string type)
        {
            List <JournalDetail> jdList = new List <JournalDetail>();

            try
            {
                string strErr = "";
                CRSDAL dal    = new CRSDAL();
                dal.AddParameter("p_JournalId", JournalID, ParameterDirection.Input);

                DataSet dstOutPut = dal.ExecuteSelect("spTallyGet_JournalDetail_Kabra", CommandType.StoredProcedure, 0, ref strErr, "p_ErrMessage", false, "", false);

                if (dstOutPut != null && dstOutPut.Tables != null && dstOutPut.Tables.Count > 0)
                {
                    for (int j = 0; j < dstOutPut.Tables.Count; j++)
                    {
                        if (dstOutPut.Tables[j] != null && dstOutPut.Tables[j].Rows != null && dstOutPut.Tables[j].Rows.Count > 0)
                        {
                            for (int i = 0; i < dstOutPut.Tables[j].Rows.Count; i++)
                            {
                                JournalDetail jd = new JournalDetail();
                                jd.Amount      = Convert.ToDecimal(dstOutPut.Tables[j].Rows[i]["amount"].ToString());
                                jd.Description = dstOutPut.Tables[j].Rows[i]["description"].ToString();
                                jd.LedgerName  = dstOutPut.Tables[j].Rows[i]["ledgername"].ToString();
                                jd.ClassName   = dstOutPut.Tables[j].Rows[i]["classname"].ToString();
                                jd.IsDebit     = Convert.ToInt16(dstOutPut.Tables[j].Rows[i]["isdebit"].ToString());
                                jd.LedgerId    = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["accsysledgerid"].ToString());
                                jd.ClassId     = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["accsysclassid"].ToString());
                                jd.JournalId   = Convert.ToInt32(dstOutPut.Tables[j].Rows[i]["voucherjournalid"].ToString());

                                jdList.Add(jd);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("AccountingAPI", "GetJournalDetail", ex.Message);
            }
            return(jdList);
        }
Example #14
0
        public static void InsertPostingStatus(int companyId, List <PostingJob> postinglist)
        {
            try
            {
                CRSDAL dal    = new CRSDAL();
                string strErr = "";
                // DateTime BookingDate = Convert.ToDateTime(BookingDateTo);

                for (int i = 0; i < postinglist.Count; i++)
                {
                    PostingJob p = postinglist[i];

                    try
                    {
                        dal = new CRSDAL();
                        dal.AddParameter("p_CompanyId", companyId, ParameterDirection.Input);
                        dal.AddParameter("p_JourneyDate", postinglist[i].JourneyDate, ParameterDirection.Input);
                        dal.AddParameter("p_JobId", postinglist[i].JobId, ParameterDirection.Input);
                        dal.AddParameter("p_StatusId", postinglist[i].StatusId, ParameterDirection.Input);
                        dal.AddParameter("p_Remarks", postinglist[i].Remarks, 200, ParameterDirection.Input);
                        dal.AddParameter("p_UserId", 0, ParameterDirection.Input);
                        dal.AddParameter("p_ErrMsg", "", 100, ParameterDirection.Output);


                        int status = dal.ExecuteDML("spTallySet_PostingStatus", CommandType.StoredProcedure, 0, ref strErr);

                        if (strErr != "")
                        {
                            Logger.WriteLog("", "", "Error while upating posting status for CompanyId: " + companyId + "JourneyDate: " + postinglist[i].JourneyDate + " JobId: " + postinglist[i].JobId + " StatusId: " + postinglist[i].StatusId + " Error Is: " + strErr);
                        }
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteLog("BookingAPI", "InsertPostingStatus", " Error for JourneyDate: " + postinglist[i].JourneyDate + " " + ex.Message);
                        Logger.WriteLogAlert("BookingAPI " + "Error:InsertPostingStatus For JourneyDate: " + postinglist[i].JourneyDate + " " + ex.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("PostingStatusAPI", "InsertPostingStatus", ex.Message);
            }
        }
Example #15
0
        public static void InsertUpdateLedgersInCRS(List <Ledger> ledgerList, int companyId)
        {
            try
            {
                if (ledgerList != null && ledgerList.Count > 0)
                {
                    for (int i = 0; i < ledgerList.Count; i++)
                    {
                        Logger.WriteLog("Ledger Name: " + ledgerList[i].LedgerName);
                        CRSDAL dal    = new CRSDAL();
                        string strErr = "";
                        dal.AddParameter("p_ledgerid", 0, ParameterDirection.Input);
                        dal.AddParameter("p_ledgername", ledgerList[i].LedgerName, 200, ParameterDirection.Input);
                        dal.AddParameter("p_LedgerTypeId", 0, ParameterDirection.Input);
                        dal.AddParameter("p_LedgerSubTypeId", 0, ParameterDirection.Input);
                        dal.AddParameter("p_CompanyId", companyId, ParameterDirection.Input);
                        dal.AddParameter("p_accsysid", ledgerList[i].LedgerMasterID, 50, ParameterDirection.Input);
                        dal.AddParameter("p_parentname", ledgerList[i].LedgerParentName, 200, ParameterDirection.Input);

                        int status = dal.ExecuteDML("spTallySet_Ledger_20171003_utkarsh", CommandType.StoredProcedure, 0, ref strErr);
                        if (strErr != "")
                        {
                            Logger.WriteLog("MastersAPI", "NoInsertUpdateLedgersInCRS", ledgerList[i].LedgerName);
                        }
                        else
                        {
                            //Logger.WriteLog("MastersAPI", "InsertUpdateLedgersInCRS", ledgerList[i].LedgerName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("MastersAPI", "InsertUpdateLedgersInCRS", ex.Message);
            }
        }
Example #16
0
 public static void UpdatePostingStatus(PostingJob pJob)
 {
     try
     {
         CRSDAL dal    = new CRSDAL();
         string strErr = "";
         dal.AddParameter("p_CompanyId", pJob.CompanyId, ParameterDirection.Input);
         dal.AddParameter("p_JourneyDate", pJob.JourneyDate, ParameterDirection.Input);
         dal.AddParameter("p_JobId", pJob.JobId, ParameterDirection.Input);
         dal.AddParameter("p_StatusId", pJob.StatusId, ParameterDirection.Input);
         dal.AddParameter("p_Remarks", pJob.Remarks, 200, ParameterDirection.Input);
         dal.AddParameter("p_UserId", 0, ParameterDirection.Input);
         dal.AddParameter("p_ErrMsg", "", 100, ParameterDirection.Output);
         int status = dal.ExecuteDML("spTallySet_PostingStatus", CommandType.StoredProcedure, 0, ref strErr);
         if (strErr != "")
         {
             Logger.WriteLog("", "", "Error while upating posting status for CompanyId: " + pJob.CompanyId + "JourneyDate: " + pJob.JourneyDate.ToString("yyyy-MM-dd") + " JobId: " + pJob.JobId + " StatusId: " + pJob.StatusId + " Error Is: " + strErr);
         }
     }
     catch (Exception ex)
     {
         Logger.WriteLog("PostingStatusAPI", "UpdatePostingStatus", ex.Message);
     }
 }
Example #17
0
        public static void CreateSaleForGSTBoookingCollection(int companyId, List <GSTBooking> gstbookingsList)
        {
            try
            {
                CRSDAL dal    = null;
                string strErr = "";

                decimal roundoff = 0;


                for (int i = 0; i < gstbookingsList.Count; i++)
                {
                    dal = new CRSDAL();
                    GSTBooking gb          = gstbookingsList[i];
                    string     narration   = AccountingUtil.GetNarration(gb);
                    string     description = AccountingUtil.GetDescription(gb);
                    roundoff = gstbookingsList[i].TotalFare - gstbookingsList[i].NetFare;

                    dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                    dal.AddParameter("p_BookingDate", gstbookingsList[i].BookingDate, ParameterDirection.Input);
                    dal.AddParameter("p_debitledgerid", gstbookingsList[i].DebitLedgerId, ParameterDirection.Input);
                    dal.AddParameter("p_creditledgerid", gstbookingsList[i].CreditLedgerId, ParameterDirection.Input);
                    dal.AddParameter("p_basefare", gstbookingsList[i].BaseFare, ParameterDirection.Input);
                    dal.AddParameter("p_totalfare", gstbookingsList[i].NetFare, ParameterDirection.Input);
                    dal.AddParameter("p_GST", gstbookingsList[i].GST, ParameterDirection.Input);
                    dal.AddParameter("p_IGST", gstbookingsList[i].IGST, ParameterDirection.Input);
                    dal.AddParameter("p_comm", gstbookingsList[i].Comm, ParameterDirection.Input);
                    dal.AddParameter("p_narration", narration, 3000, ParameterDirection.Input);
                    dal.AddParameter("p_description", description, 3000, ParameterDirection.Input);
                    dal.AddParameter("p_docnumber", gstbookingsList[i].DocNumber, 3000, ParameterDirection.Input);
                    dal.AddParameter("p_doctype", gstbookingsList[i].DocType, 3000, ParameterDirection.Input);
                    dal.AddParameter("p_roundoff", roundoff, ParameterDirection.Input);

                    int status = dal.ExecuteDML("spTallySet_BranchGSTBooking", CommandType.StoredProcedure, 0, ref strErr);

                    EntryCounter.GetInstance().AddCount(1);
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("UserWise", "CreateSaleForUserWiseCollection", ex.Message);
            }
        }
        public static void CreateSaleForFranchiseCollection(int companyId, List <Franchise> FranchiseCollectionList)
        {
            try
            {
                CRSDAL dal    = null;
                string strErr = "";

                for (int i = 0; i < FranchiseCollectionList.Count; i++)
                {
                    if (strErr == "")
                    {
                        Franchise fv        = FranchiseCollectionList[i];
                        string    narration = AccountingUtil.GetNarration(fv);
                        try
                        {
                            dal = new CRSDAL();
                            dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                            dal.AddParameter("p_JourneyDate", FranchiseCollectionList[i].JourneyDate, ParameterDirection.Input);
                            dal.AddParameter("p_DebitLedgerId", FranchiseCollectionList[i].DebitLedgerId, ParameterDirection.Input);
                            dal.AddParameter("p_CreditLedgerId", FranchiseCollectionList[i].CreditLedgerId, ParameterDirection.Input);
                            dal.AddParameter("p_NetAmount", FranchiseCollectionList[i].NetAmount, ParameterDirection.Input);
                            dal.AddParameter("p_TotalAmount", FranchiseCollectionList[i].TotalAmt, ParameterDirection.Input);
                            dal.AddParameter("p_GST", FranchiseCollectionList[i].ServiceTax, ParameterDirection.Input);
                            dal.AddParameter("p_docnumber", FranchiseCollectionList[i].DocNumber, 300, ParameterDirection.Input);
                            dal.AddParameter("p_ClassID", FranchiseCollectionList[i].ClassID, ParameterDirection.Input);
                            dal.AddParameter("p_AgentComm", FranchiseCollectionList[i].AggentComm, ParameterDirection.Input);
                            dal.AddParameter("p_Discount", FranchiseCollectionList[i].Discount, ParameterDirection.Input);

                            int status = dal.ExecuteDML("spKabraTallySet_FranchiseBooking_Test", CommandType.StoredProcedure, 0, ref strErr);
                            if (strErr != "")
                            {
                                throw new Exception();
                            }

                            EntryCounter.GetInstance().AddCount(1);
                        }
                        catch (Exception ex)
                        {
                            Logger.WriteLog("FranchiseCollection", "CreateSaleForFranchiseCollection", " Error for Franchise: " + FranchiseCollectionList[i].FranchiseName + " " + ex.Message);
                            Logger.WriteLogAlert2("FranchiseCollection" + "CreateSaleForFranchiseCollection" + " Error for Franchise: " + FranchiseCollectionList[i].FranchiseName + " " + ex.Message);
                            PostingAPI.UpdatePostingStatusForException(companyId, FranchiseCollectionList[i].JourneyDate, 9);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("FranchiseCollection", "CreateSaleForFranchiseCollection", ex.Message);
                Logger.WriteLogAlert("FranchiseCollection" + "CreateSaleForFranchiseCollection" + ex.Message);
            }
        }
        public static void CreateSaleForBusWiseCollection(int companyId, List <BusWise> BusWiseCollectionList)
        {
            try
            {
                CRSDAL dal    = null;
                string strErr = "";

                for (int i = 0; i < BusWiseCollectionList.Count; i++)
                {
                    //BusWise bc = BusWiseCollectionList[i];
                    //string narration = AccountingUtil.GetNarration(bc);

                    decimal totalamount = 0;
                    decimal totalColl   = 0;


                    totalamount = BusWiseCollectionList[i].NetAmount - (BusWiseCollectionList[i].SGST + BusWiseCollectionList[i].CGST + BusWiseCollectionList[i].BusComm);
                    totalColl   = totalamount + BusWiseCollectionList[i].SGST + BusWiseCollectionList[i].CGST + BusWiseCollectionList[i].BusComm + BusWiseCollectionList[i].OfflineAgentComm + BusWiseCollectionList[i].OnlineAgentComm;


                    try
                    {
                        dal = new CRSDAL();
                        dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                        dal.AddParameter("p_JourneyDate", BusWiseCollectionList[i].JourneyDate, ParameterDirection.Input);
                        dal.AddParameter("p_AccsysledgerId", BusWiseCollectionList[i].AccsysLedgerId, ParameterDirection.Input);
                        dal.AddParameter("p_CommLedgerId", BusWiseCollectionList[i].CommLedgerId, ParameterDirection.Input);
                        dal.AddParameter("p_NetAmount", totalamount, ParameterDirection.Input);
                        dal.AddParameter("p_TotalAmount", totalColl, ParameterDirection.Input);
                        dal.AddParameter("p_Comm", BusWiseCollectionList[i].BusComm, ParameterDirection.Input);
                        dal.AddParameter("p_GST", BusWiseCollectionList[i].CGST, ParameterDirection.Input);
                        dal.AddParameter("p_TotalOfflineAgentComm", BusWiseCollectionList[i].OfflineAgentComm, ParameterDirection.Input);
                        dal.AddParameter("p_TotalOnlineAgentComm", BusWiseCollectionList[i].OnlineAgentComm, ParameterDirection.Input);
                        dal.AddParameter("p_docnumber", BusWiseCollectionList[i].DocNumber, 1000, ParameterDirection.Input);

                        // dal.AddParameter("p_narration", narration, 3000, ParameterDirection.Input);

                        int status = dal.ExecuteDML("spJainTallySet_BusCollection", CommandType.StoredProcedure, 0, ref strErr);


                        EntryCounter.GetInstance().AddCount(1);
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteLog("BusWiseCollection", "CreateSaleForBusWiseCollection", " Error for Bus: " + BusWiseCollectionList[i].BusiD + " " + ex.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("BusWiseCollection", "CreateSaleForBusWiseCollection", ex.Message);
            }
        }
        public static void CreateCreditForCancellationdata(int companyId, List<Cancellation> CancellationList)
        {
            CRSDAL dal = null;
            try
            {

                string strErr = "";
               

                for (int i = 0; i < CancellationList.Count; i++)
                {
                    if (CancellationList[i].DebitLedgerId > 0 && CancellationList[i].CreditLedgerId > 0)
                    {

                        Cancellation c = CancellationList[i];

                        string description = AccountingUtil.GetDescription(c);
                       
                        try
                        {
                            dal = new CRSDAL();
                            dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                            dal.AddParameter("p_CancelDate", CancellationList[i].CancelDate, ParameterDirection.Input);
                            dal.AddParameter("p_DebitLedgerId", CancellationList[i].DebitLedgerId, ParameterDirection.Input);
                            dal.AddParameter("p_CreditLedgerId", CancellationList[i].CreditLedgerId, ParameterDirection.Input);
                            dal.AddParameter("p_RefundAmt", CancellationList[i].RefundAmount, ParameterDirection.Input);
                            dal.AddParameter("p_TotalAmount", CancellationList[i].BaseFare, ParameterDirection.Input);
                            dal.AddParameter("p_GST", CancellationList[i].GST, ParameterDirection.Input);
                            dal.AddParameter("p_IGST", CancellationList[i].IGST, ParameterDirection.Input);
                            dal.AddParameter("p_Comm", CancellationList[i].Comm, ParameterDirection.Input);
                            dal.AddParameter("p_BookingId", CancellationList[i].BookingId, ParameterDirection.Input);
                            dal.AddParameter("p_TicketNo", CancellationList[i].TicketNo, 3000, ParameterDirection.Input);
                            dal.AddParameter("p_description", description, 3000, ParameterDirection.Input);
                            dal.AddParameter("p_docnumber", CancellationList[i].Docnumber, 3000, ParameterDirection.Input);
                            dal.AddParameter("p_doctype", CancellationList[i].DocType, 3000, ParameterDirection.Input);

                            int status = dal.ExecuteDML("spTallySet_CancellationJain", CommandType.StoredProcedure, 0, ref strErr);
                            EntryCounter.GetInstance().AddCount(1);
                            //if (strErr != "")
                            //{
                            //    Logger.WriteLogAlert("Cancellation " + " Error for Bookigid: " + CancellationList[i].BookingId );
                            //    break;
                            //}

                        }



                        catch (Exception ex)
                        {
                            Logger.WriteLog("Cancellation", "CreateCreditForCancellationdata", " Error for Bookigid: " + CancellationList[i].BookingId + " " + ex.Message);
                            Logger.WriteLogAlert("Cancellation " + " Error for Bookigid: " + CancellationList[i].BookingId + " " + ex.Message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("Cancellation", "CreateCreditForCancellationdata", ex.Message);
            }
        }
Example #21
0
        public static void CreateJournalForOnlineAgentCollection(int companyId, List <OnlineAgentDetails> agentlist)
        {
            try
            {
                CRSDAL dal    = null;
                string strErr = "";


                for (int i = 0; i < agentlist.Count; i++)
                {
                    OnlineAgentDetails al = agentlist[i];
                    // string narration = AccountingUtil.GetNarration(al);
                    try
                    {
                        dal = new CRSDAL();
                        dal.AddParameter("p_CompanyID", companyId, ParameterDirection.Input);
                        dal.AddParameter("p_JourneyDate", agentlist[i].JourneyDate, ParameterDirection.Input);
                        dal.AddParameter("p_DebitLedgerId", agentlist[i].DebitLedgerId, ParameterDirection.Input);
                        dal.AddParameter("p_CreditLedgerId", agentlist[i].CreditLedgerId, ParameterDirection.Input);
                        dal.AddParameter("p_ClassID", agentlist[i].ClassID, ParameterDirection.Input);
                        dal.AddParameter("p_TotalAmount", agentlist[i].TotalFare, ParameterDirection.Input);
                        dal.AddParameter("p_docnumber", agentlist[i].Docnumber, 300, ParameterDirection.Input);
                        dal.AddParameter("p_AgentComm", agentlist[i].AgentComm, ParameterDirection.Input);
                        dal.AddParameter("p_NetAmount", agentlist[i].NetAmount, ParameterDirection.Input);
                        dal.AddParameter("p_GST", agentlist[i].GST, ParameterDirection.Input);
                        dal.AddParameter("p_Discount", agentlist[i].Discount, ParameterDirection.Input);


                        int status = dal.ExecuteDML("spKabraTallySet_OnlineAgentCollection", CommandType.StoredProcedure, 0, ref strErr);


                        EntryCounter.GetInstance().AddCount(1);
                    }
                    catch (Exception ex)
                    {
                        Logger.WriteLog("OnlineAgentAPI", "CreateJournalForOnlineAgentCollection", " Error for Agent: " + agentlist[i].AgentName + " " + ex.Message);
                        Logger.WriteLogAlert("OnlineAgentAPI" + "CreateJournalForOnlineAgentCollection" + " Error for Agent: " + agentlist[i].AgentName + " " + ex.Message);
                        PostingAPI.UpdatePostingStatusForException(companyId, agentlist[i].JourneyDate, 7);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLog("OnlineAgentAPI", "CreateJournalForOnlineAgentCollection", ex.Message);
                Logger.WriteLogAlert("OnlineAgentAPI" + "CreateJournalForOnlineAgentCollection" + ex.Message);
            }
        }