Пример #1
0
        public void LedgerPostingAdd()
        {
            try
            {
                string strfinancialId;
                //decOpeningBalance = Convert.ToDecimal(tbxOpbal.Text.Trim());
                LedgerPostingBL    objBL             = new LedgerPostingBL();
                LedgerPostingModel infoLedgerPosting = new LedgerPostingModel();

                FinancialYeaBL objFinBL = new FinancialYeaBL();

                FinancialYearModel infoFinancialYear = new FinancialYearModel();

                infoFinancialYear = objFinBL.FinancialYearViewForAccountLedger(1);

                strfinancialId = infoFinancialYear.FromDate.ToString("dd-MMM-yyyy");

                infoLedgerPosting.VoucherTypeId = 1;
                infoLedgerPosting.Date          = Convert.ToDateTime(dtDate.Text.Trim());
                infoLedgerPosting.LedgerId      = Convert.ToDecimal(objAccBL.GetLedgerIdByAccountName(cbxPayMode.Text.Trim() == null?String.Empty:cbxPayMode.Text.Trim()));
                infoLedgerPosting.VoucherNo     = tbxVchNumber.Text.Trim();

                //if (cbxCrDr.Text == "D")
                //{
                //    infoLedgerPosting.Debit = decOpeningBalance;
                //}
                //else
                //{
                //    infoLedgerPosting.Credit = decOpeningBalance;
                //}
                infoLedgerPosting.DetailsId = 0;
                infoLedgerPosting.YearId    = SessionVariables._decCurrentFinancialYearId;
                //infoLedgerPosting.InvoiceNo = decLedgerId.ToString();
                infoLedgerPosting.ChequeNo   = string.Empty;
                infoLedgerPosting.ChequeDate = DateTime.Now;
                infoLedgerPosting.Extra1     = string.Empty;
                infoLedgerPosting.Extra2     = string.Empty;

                objBL.LedgerPostingAdd(infoLedgerPosting);
            }
            catch (Exception ex)
            {
            }
        }
Пример #2
0
        public void ledgerPostingAdd()
        {
            eSunSpeedDomain.LedgerPostingModel infoLedgerPosting = new eSunSpeedDomain.LedgerPostingModel();
            BillSundry_VoucherModel            objSaleBS;

            for (int i = 0; i < dvgBsDetails.DataRowCount; i++)
            {
                DataRow row = dvgBsDetails.GetDataRow(i);

                objSaleBS       = new BillSundry_VoucherModel();
                objSaleBS.BS_Id = objBSBL.GetBSIdByBSName(row["BillSundry"].ToString() == null ? string.Empty : row["BillSundry"].ToString());
                //objSaleBS.Percentage = Convert.ToDecimal(row["Percentage"].ToString() == string.Empty ? "0.00" : row["Percentage"].ToString());
                //objSaleBS.Extra = row["Extra"].ToString() == null ? string.Empty : row["Extra"].ToString();
                //objSaleBS.Amount = Convert.ToDecimal(row["Amount"].ToString() == string.Empty ? "0.00" : row["Amount"].ToString());
                BillSundryMasterModel objbs = objBSBL.GetAllBillSundryByName(row["BillSundry"].ToString() == null ? string.Empty : row["BillSundry"].ToString());
                if (objbs.SaleAdjustInSaleAmount == true && objbs.SaleAdjustInPartyAmount == true)
                {
                    //Party Debit Posting
                    infoLedgerPosting.VoucherTypeId = 1;
                    infoLedgerPosting.LedgerId      = Convert.ToDecimal(objAccBL.GetLedgerIdByAccountName(tbxParty.Text.Trim() == null ? string.Empty : tbxParty.Text.Trim()));
                    infoLedgerPosting.Debit         = Convert.ToDecimal((Convert.ToDecimal(colTaxAmont.SummaryItem.SummaryValue) + Convert.ToDecimal(Amount.SummaryItem.SummaryValue)) - (Convert.ToDecimal(BSAmount.SummaryItem.SummaryValue)));
                    infoLedgerPosting.Credit        = 0;
                    infoLedgerPosting.Date          = Convert.ToDateTime(dtDate.Text.ToString());
                    infoLedgerPosting.VoucherNo     = tbxVoucherNumber.Text.Trim();
                    infoLedgerPosting.InvoiceNo     = string.Empty;
                    infoLedgerPosting.YearId        = 1;
                    infoLedgerPosting.DetailsId     = 0;
                    infoLedgerPosting.ChequeNo      = string.Empty;
                    infoLedgerPosting.ChequeDate    = DateTime.Now;
                    infoLedgerPosting.Extra1        = string.Empty;
                    infoLedgerPosting.Extra2        = string.Empty;
                    objLPBL.LedgerPostingAdd(infoLedgerPosting);

                    //Sale Credit Posting
                    infoLedgerPosting.Debit         = 0;
                    infoLedgerPosting.Credit        = Convert.ToDecimal(Convert.ToDecimal(Amount.SummaryItem.SummaryValue) - Convert.ToDecimal(BSAmount.SummaryItem.SummaryValue));
                    infoLedgerPosting.Date          = Convert.ToDateTime(dtDate.Text.ToString());
                    infoLedgerPosting.VoucherTypeId = 1;
                    infoLedgerPosting.VoucherNo     = tbxVoucherNumber.Text.Trim();
                    infoLedgerPosting.InvoiceNo     = string.Empty;
                    infoLedgerPosting.LedgerId      = objStBL.GetSaleLedgerId(tbxSaleType.Text.Trim());
                    infoLedgerPosting.YearId        = 1;
                    infoLedgerPosting.DetailsId     = 0;
                    infoLedgerPosting.ChequeNo      = string.Empty;
                    infoLedgerPosting.ChequeDate    = DateTime.Now;
                    infoLedgerPosting.Extra1        = string.Empty;
                    infoLedgerPosting.Extra2        = string.Empty;
                    objLPBL.LedgerPostingAdd(infoLedgerPosting);
                    //Tax Credit Posting
                    infoLedgerPosting.Debit         = 0;
                    infoLedgerPosting.Credit        = Convert.ToDecimal(colTaxAmont.SummaryItem.SummaryValue);
                    infoLedgerPosting.Date          = Convert.ToDateTime(dtDate.Text.ToString());
                    infoLedgerPosting.VoucherTypeId = 1;
                    infoLedgerPosting.VoucherNo     = tbxVoucherNumber.Text.Trim();
                    infoLedgerPosting.InvoiceNo     = string.Empty;
                    infoLedgerPosting.LedgerId      = objStBL.GetTaxLedgerId(tbxSaleType.Text.Trim());
                    infoLedgerPosting.YearId        = 1;
                    infoLedgerPosting.DetailsId     = 0;
                    infoLedgerPosting.ChequeNo      = string.Empty;
                    infoLedgerPosting.ChequeDate    = DateTime.Now;
                    infoLedgerPosting.Extra1        = string.Empty;
                    infoLedgerPosting.Extra2        = string.Empty;
                    objLPBL.LedgerPostingAdd(infoLedgerPosting);

                    ////Discount Debit Posting
                    //infoLedgerPosting.Debit = Convert.ToDecimal(BSAmount.SummaryItem.SummaryValue);
                    //infoLedgerPosting.Credit = 0;
                    //infoLedgerPosting.Date = Convert.ToDateTime(dtDate.Text.ToString());
                    //infoLedgerPosting.VoucherTypeId = 1;
                    //infoLedgerPosting.VoucherNo = tbxVoucherNumber.Text.Trim();
                    //infoLedgerPosting.InvoiceNo = string.Empty;
                    //infoLedgerPosting.LedgerId = objBSBL.GetBSLedgerId(tbxSaleType.Text.Trim());
                    //infoLedgerPosting.YearId = 1;
                    //infoLedgerPosting.DetailsId = 0;
                    //infoLedgerPosting.ChequeNo = string.Empty;
                    //infoLedgerPosting.ChequeDate = DateTime.Now;
                    //infoLedgerPosting.Extra1 = string.Empty;
                    //infoLedgerPosting.Extra2 = string.Empty;
                    //objLPBL.LedgerPostingAdd(infoLedgerPosting);
                }
            }
        }