public static AdvancePayment ToAdvancePayment(this BaseAdvancePaymentModel advancePayment)
        {
            AdvancePayment _result = new AdvancePayment();

            if (advancePayment.Id.HasValue)
            {
                _result.Id = advancePayment.Id.GetValueOrDefault();
            }
            _result.EmployeeId      = advancePayment.EmployeeId;
            _result.LedgerId        = advancePayment.LedgerId;
            _result.SuffixPrefixId  = advancePayment.SuffixPrefixId;
            _result.VoucherTypeId   = advancePayment.VoucherTypeId;
            _result.FinancialYearId = advancePayment.FinancialYearId;
            _result.VoucherNumber   = advancePayment.VoucherNumber;
            _result.InvoiceNumber   = advancePayment.InvoiceNumber;
            _result.Date            = advancePayment.Date;
            _result.Amount          = advancePayment.Amount;
            _result.SalaryMonth     = advancePayment.SalaryMonth;
            _result.ChequeNumber    = advancePayment.ChequeNumber;
            _result.ChequeDate      = advancePayment.ChequeDate;
            _result.Narration       = advancePayment.Narration;
            _result.CreatedDate     = advancePayment.CreatedDate;
            _result.ModifiedDate    = advancePayment.ModifiedDate;
            return(_result);
        }
        public static BaseAdvancePaymentModel ToBaseAdvancePayment(this AdvancePayment advancePayment)
        {
            BaseAdvancePaymentModel _result = new BaseAdvancePaymentModel();

            _result.Id              = advancePayment.Id;
            _result.EmployeeId      = advancePayment.EmployeeId;
            _result.LedgerId        = advancePayment.LedgerId;
            _result.SuffixPrefixId  = advancePayment.SuffixPrefixId;
            _result.VoucherTypeId   = advancePayment.VoucherTypeId;
            _result.FinancialYearId = advancePayment.FinancialYearId;
            _result.VoucherNumber   = advancePayment.VoucherNumber;
            _result.InvoiceNumber   = advancePayment.InvoiceNumber;
            _result.Date            = advancePayment.Date;
            _result.Amount          = advancePayment.Amount;
            _result.SalaryMonth     = advancePayment.SalaryMonth;
            _result.ChequeNumber    = advancePayment.ChequeNumber;
            _result.ChequeDate      = advancePayment.ChequeDate;
            _result.Narration       = advancePayment.Narration;
            _result.CreatedDate     = advancePayment.CreatedDate;
            _result.ModifiedDate    = advancePayment.ModifiedDate;
            return(_result);
        }