public static bool AddUnpostedVoucher(AccountingTransactionTempDto voucherEntryDto)
        {
            try
            {
                var newVoucherNo = AccountingDataProvider.GetLastVoucherNo();

                var entity = new tAccountingTransactionTemp
                {
                    CompanyId        = voucherEntryDto.CompanyId,
                    CreditAccount    = voucherEntryDto.CreditAccount,
                    DebitAccount     = voucherEntryDto.DebitAccount,
                    AccountingYearId = voucherEntryDto.AccountingYearId,
                    VoucherNo        = newVoucherNo,
                    Currency         = voucherEntryDto.CurrencyCode,
                    LineId           = voucherEntryDto.LineId,
                    Total            = voucherEntryDto.Total,
                    UserId           = voucherEntryDto.UserId,
                    ValueTotal       = voucherEntryDto.ValueTotal,
                    VoucherDate      = voucherEntryDto.VoucherDate,
                };
                var result = AccountingDataProvider.AddUnpostedVoucher(entity);

                if (result == 1)
                {
                    AccountingDataProvider.DeleteLastVoucherInformation(new tLastVoucherInformation
                    {
                        LastVoucherNo = newVoucherNo
                    });
                    AccountingDataProvider.AddLastVoucherInformation(new tLastVoucherInformation
                    {
                        LastVoucherNo = newVoucherNo + 1
                    });
                    return(true);
                }
                return(false);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
        }