Beispiel #1
0
        public AdvancePaymentInfo AdvancePaymentView(decimal decAdvancePaymentId)
        {
            AdvancePaymentInfo infoiAdvancePayment = new AdvancePaymentInfo();

            try
            {
                infoiAdvancePayment = spAdvancePayment.AdvancePaymentView(decAdvancePaymentId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AP5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(infoiAdvancePayment);
        }
Beispiel #2
0
        public ActionResult GetAdvancePaymentEditDetails(string advancePaymentEditId)
        {
            try
            {
                decAdvancePaymentEditId = Convert.ToDecimal(advancePaymentEditId);
                AdvancePaymentSP   spadvance     = new AdvancePaymentSP();
                AdvancePaymentInfo infoadvance   = new AdvancePaymentInfo();
                VoucherTypeSP      spvouchertype = new VoucherTypeSP();
                infoadvance  = spadvance.AdvancePaymentView(decAdvancePaymentEditId);
                strVoucherNo = infoadvance.VoucherNo;
                string txtAdvanceVoucherNo = infoadvance.InvoiceNo;
                strInvoiceNo = infoadvance.InvoiceNo;
                string employeeId    = infoadvance.EmployeeId.ToString();
                string salaryMonth   = infoadvance.SalaryMonth.ToString("yyyy-MM");
                string txtDate       = infoadvance.Date.ToString("yyyy-MM-dd");
                string txtChequeDate = infoadvance.Date.ToString("yyyy-MM-dd");
                string ledgerId      = infoadvance.LedgerId.ToString();
                string txtCheckNo    = infoadvance.Chequenumber;
                string txtAmount     = infoadvance.Amount.ToString();
                string txtNarration  = infoadvance.Narration;
                bool   isBankAccount = false;
                decAdvancePaymentsId = decAdvancePaymentId;

                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                DataTable cashOrBank        = obj.CashOrBankComboFill(false);
                DataTable employee          = EmployeeComboFill();
                string    jsonCashOrBank    = Utils.ConvertDataTabletoString(cashOrBank);
                string    jsonEmployee      = Utils.ConvertDataTabletoString(employee);

                if (cashOrBank.Rows.Count > 0)
                {
                    decimal cashOrBankId   = (decimal)cashOrBank.Rows[0][1];
                    string  cashOrBankName = (string)cashOrBank.Rows[0][0];
                    isBankAccount = CheckWhetherBankOrCash(cashOrBankId, cashOrBankName);
                }

                decPaymentVoucherTypeId  = infoadvance.VoucherTypeId;
                decPaymentSuffixPrefixId = infoadvance.SuffixPrefixId;
                isAutomatic = spvouchertype.CheckMethodOfVoucherNumbering(decPaymentVoucherTypeId);

                return(Json(new
                {
                    success = "true",
                    ex = "no",
                    data = new
                    {
                        voucherNo = strVoucherNo,
                        employee = jsonEmployee,
                        employeeId,
                        salaryMonth,
                        chequeNo = txtCheckNo,
                        date = txtDate,
                        amount = txtAmount,
                        cashOrBank = jsonCashOrBank,
                        ledgerId,
                        chequeDate = txtChequeDate,
                        narration = txtNarration,
                        isAutomatic,
                        isBankAccount
                    }
                }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = "true", ex = "AP3:" + ex.Message }));
            }
        }