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);
            }
        }
示例#2
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++)
                {
                    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 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);
            }
        }