示例#1
0
        public void VoucherNoGeneration(DateTime salaryMonth)
        {
            TransactionsGeneralFill obj = new TransactionsGeneralFill();
            AdvancePaymentSP        spAdvancePayment = new AdvancePaymentSP();

            if (strVoucherNo == string.Empty)
            {
                strVoucherNo = "0";
            }
            strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), salaryMonth, strAdvancePayment);
            if (Convert.ToDecimal(strVoucherNo) != spAdvancePayment.AdvancePaymentGetMaxPlusOne(decPaymentVoucherTypeId))
            {
                strVoucherNo = spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId).ToString();
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), salaryMonth, strAdvancePayment);
                if (spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId) == "0")
                {
                    strVoucherNo = "0";
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), salaryMonth, strAdvancePayment);
                }
            }
            if (isAutomatic)
            {
                SuffixPrefixSP   spSuffixPrefix   = new SuffixPrefixSP();
                SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                infoSuffixPrefix = spSuffixPrefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate);
                string strPrefix = infoSuffixPrefix.Prefix;
                string strSuffix = infoSuffixPrefix.Suffix;
                strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
            }
        }
示例#2
0
        public ActionResult GetDailySalaryVoucherForModal(string salaryDate)
        {
            bool   isSuccess    = true;
            string message      = string.Empty;
            string jsonResult   = string.Empty;
            string jsonCombo    = string.Empty;
            string strVoucherNo = string.Empty;
            string strTableName = "DailySalaryVoucherMaster";

            try
            {
                VoucherTypeSP spVoucherType   = new VoucherTypeSP();
                DataTable     dtblVouchetType = new DataTable();
                dtblVouchetType = spVoucherType.VoucherTypeSelectionComboFill("Daily Salary Voucher");
                int    inCount     = dtblVouchetType.Rows.Count;
                string voucherType = string.Empty;
                if (inCount == 1)
                {
                    voucherType = dtblVouchetType.Rows[0].ItemArray[0].ToString();
                    decimal decDailyVoucherTypeId = decimal.Parse(voucherType);

                    TransactionsGeneralFill    TransactionsGeneralFillobj = new TransactionsGeneralFill();
                    DailySalaryVoucherMasterSP spmaster = new DailySalaryVoucherMasterSP();
                    strVoucherNo = spmaster.SalaryVoucherMasterGetMaxPlusOne(decDailyVoucherTypeId).ToString();
                    strVoucherNo = TransactionsGeneralFillobj.VoucherNumberAutomaicGeneration(decDailyVoucherTypeId, Convert.ToDecimal(strVoucherNo), Convert.ToDateTime(salaryDate), strTableName);
                }

                DataTable dtbl = DailySalaryVoucherDetailsGridfill(false, "0", salaryDate);
                jsonResult = Utils.ConvertDataTabletoString(dtbl);

                DailySalaryVoucherMasterSP spMaster = new DailySalaryVoucherMasterSP();
                DataTable newDtbl = new DataTable();
                newDtbl   = spMaster.DailySalaryVoucherCashOrBankLedgersComboFill();
                jsonCombo = Utils.ConvertDataTabletoString(newDtbl);
            }
            catch (Exception ex)
            {
                isSuccess = false;
                message   = ex.Message;
            }
            return(Json(new { isSuccess, message, voucherNo = strVoucherNo, data = jsonResult, jsonCombo }));
        }