Пример #1
0
        /// <summary>
        /// Function to clear the fields
        /// </summary>
        public void Clear()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                StockJournalMasterSP spMaster = new StockJournalMasterSP();
                if (isAutomatic)
                {
                    if (strVoucherNo == string.Empty)
                    {

                        strVoucherNo = "0";
                    }
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, TableName);

                    if (Convert.ToDecimal(strVoucherNo) != spMaster.StockJournalMasterMaxPlusOne(decVoucherTypeId))
                    {
                        strVoucherNo = spMaster.StockJournalMasterMax(decVoucherTypeId).ToString();
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, TableName);
                        if (spMaster.StockJournalMasterMax(decVoucherTypeId).ToString() == "0")
                        {
                            strVoucherNo = "0";
                            strVoucherNo = obj.VoucherNumberAutomaicGeneration(decVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, TableName);
                        }
                    }
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decVoucherTypeId, dtpDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
                else
                {
                    txtVoucherNo.ReadOnly = false;
                    txtVoucherNo.Text = string.Empty;
                    strInvoiceNo = txtVoucherNo.Text.Trim();
                }
                if (PrintAfetrSave())
                {
                    cbxPrintAfterSave.Checked = true;

                }
                else
                {
                    cbxPrintAfterSave.Checked = false;
                }
                btnDelete.Enabled = false;
                btnSave.Text = "Save";
                gbxTransactionType.Enabled = true;
                cmbFinishedGoods.Enabled = true;
                txtQty.Enabled = true;
                btnAdd.Enabled = true;
                VoucherDate();
                dgvConsumption.Rows.Clear();
                dgvProduction.Rows.Clear();
                dgvAdditionalCost.Rows.Clear();
                cmbFinishedGoods.Text = string.Empty;
                txtQty.Text = String.Empty;
                txtNarration.Text = string.Empty;
                //AutoCompleteProducts();
                lblAdditionalCostAmount.Text = "0.00";
                lblConsumptionAmount.Text = "0.00";
                lblProductionAmount.Text = "0.00";

            }
            catch (Exception ex)
            {
                MessageBox.Show("SJ:29" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #2
0
        /// <summary>
        /// To reset the form here and Generate the voucher no generation
        /// </summary>
        public void Clear()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                if (btnSave.Text == "Update")
                {
                    if (frmPaymentRegisterObj != null)
                    {
                        frmPaymentRegisterObj.Close();
                    }
                }
                if (isAutomatic)
                {

                    SalaryVoucherMasterSP spMaster = new SalaryVoucherMasterSP();
                    PaymentMasterSP SpPaymentMaster = new PaymentMasterSP();
                    if (strVoucherNo == string.Empty)
                    {
                        strVoucherNo = "0";
                    }
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                    if (Convert.ToDecimal(strVoucherNo) != SpPaymentMaster.PaymentMasterMax(decPaymentVoucherTypeId) + 1)
                    {
                        strVoucherNo = SpPaymentMaster.PaymentMasterMax(decPaymentVoucherTypeId).ToString();
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                        if (SpPaymentMaster.PaymentMasterMax(decPaymentVoucherTypeId) == 0)
                        {
                            strVoucherNo = "0";
                            strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                        }
                    }
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
                else
                {
                    txtVoucherNo.Text = string.Empty;
                    txtVoucherNo.ReadOnly = false;
                }
                dtpDate.MinDate = PublicVariables._dtFromDate;
                dtpDate.MaxDate = PublicVariables._dtToDate;
                dtpDate.Value = PublicVariables._dtCurrentDate;
                cmbBankorCash.SelectedIndex = -1;
                txtNarration.Text = string.Empty;
                txtTotal.Text = string.Empty;
                dgvPaymentVoucher.ClearSelection();
                dgvPaymentVoucher.Rows.Clear();
                btnSave.Text = "Save";
                btnDelete.Enabled = false;
                cbxPrintafterSave.Checked = false;
                dtblPartyBalance.Clear();
                if (isAutomatic)
                {
                    txtDate.Select();
                }
                else
                {
                    txtVoucherNo.Select();
                }
                PrintCheck();

            }
            catch (Exception ex)
            {
                MessageBox.Show("PV9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// Function to generate the voucher number as per settings
        /// </summary>
        public void voucherNumberGeneration()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                SalaryVoucherMasterSP spMaster = new SalaryVoucherMasterSP();
                //-----------------------------------------Voucher number Automatic generation ------------------------------------------------//
                if (strVoucherNo == string.Empty)
                {

                   strVoucherNo = "0"; 
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decMonthlyVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                if (Convert.ToDecimal(strVoucherNo) != spMaster.SalaryVoucherMasterGetMaxPlusOne(decMonthlyVoucherTypeId))
                {
                    strVoucherNo = spMaster.SalaryVoucherMasterGetMax(decMonthlyVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decMonthlyVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    if (spMaster.SalaryVoucherMasterGetMax(decMonthlyVoucherTypeId) == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decMonthlyVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    }
                }
                if (isAutomatic)
                {
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();

                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decMonthlyVoucherTypeId, dtpVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("MSV14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
Пример #4
0
 /// <summary>
 /// Function to generate Voucher number as per settings
 /// </summary>
 public void VoucherNumberGeneration()
 {
     SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
     TransactionsGeneralFill TransactionGenerateFillObj = new TransactionsGeneralFill();
     DeliveryNoteMasterSP spDeliveryNoteMaster = new DeliveryNoteMasterSP();
     string tableName = "DeliveryNoteMaster";
     string strPrefix = string.Empty;
     string strSuffix = string.Empty;
     try
     {
         strVoucherNo = "0";
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = TransactionGenerateFillObj.VoucherNumberAutomaicGeneration(decDeliveryNoteVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
         if (Convert.ToDecimal(strVoucherNo) != spDeliveryNoteMaster.DeliveryNoteMasterGetMaxPlusOne(decDeliveryNoteVoucherTypeId))
         {
             strVoucherNo = spDeliveryNoteMaster.DeliveryNoteMasterMax1(decDeliveryNoteVoucherTypeId).ToString();
             strVoucherNo = TransactionGenerateFillObj.VoucherNumberAutomaicGeneration(decDeliveryNoteVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             if (spDeliveryNoteMaster.DeliveryNoteMasterMax1(decDeliveryNoteVoucherTypeId) == "0")
             {
                 strVoucherNo = "0";
                 strVoucherNo = TransactionGenerateFillObj.VoucherNumberAutomaicGeneration(decDeliveryNoteVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             }
         }
         if (isAutomatic)
         {
             infoSuffixPrefix = new SuffixPrefixSP().GetSuffixPrefixDetails(decDeliveryNoteVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decDeliveryNoteSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strDeliveryNoteNo = strPrefix + strVoucherNo + strSuffix;
             txtDeliveryNoteNo.Text = strDeliveryNoteNo;
             txtDeliveryNoteNo.ReadOnly = true;
         }
         else
         {
             txtDeliveryNoteNo.Text = string.Empty;
             strDeliveryNoteNo = txtDeliveryNoteNo.Text.Trim();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("DN09:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #5
0
        /// <summary>
        /// Function to clear the fields
        /// </summary>
        public void clear()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                JournalMasterSP spMaster = new JournalMasterSP();


                //-----------------------------------VoucherNo automatic generation-------------------------------------------//

                if (strVoucherNo == string.Empty)
                {

                    strVoucherNo = "0"; //strMax;
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decJournalVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);

                if (Convert.ToDecimal(strVoucherNo) != spMaster.JournalMasterGetMaxPlusOne(decJournalVoucherTypeId))
                {
                    strVoucherNo = spMaster.JournalMasterGetMax(decJournalVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decJournalVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    if (spMaster.JournalMasterGetMax(decJournalVoucherTypeId).ToString() == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decJournalVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    }
                }

                //===================================================================================================================//
                if (isAutomatic)
                {
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();

                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decJournalVoucherTypeId, dtpVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
                else
                {
                    txtVoucherNo.ReadOnly = false;
                    txtVoucherNo.Text = string.Empty;
                    strInvoiceNo = txtVoucherNo.Text.Trim();
                }


                dgvJournalVoucher.Rows.Clear();
                VoucherDate();
                dtpVoucherDate.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
                txtDebitTotal.Text = string.Empty;
                txtCreditTotal.Text = string.Empty;
                txtNarration.Text = string.Empty;
                btnSave.Text = "Save";
                btnDelete.Enabled = false;
                isEditMode = false;
                dtblPartyBalance.Clear();//to clear party balance entries to clear the dgvpatybalance
                PrintCheck();
                if (!txtVoucherNo.ReadOnly)
                {
                    txtVoucherNo.Focus();
                }
                else
                {
                    txtDate.Select();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("JV2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
Пример #6
0
 /// <summary>
 /// Function for Voucher Number Generation
 /// </summary>
 public void VoucherNumberGeneration()
 {
     string strPrefix = string.Empty;
     string strSuffix = string.Empty;
     string tableName = "PurchaseReturnMaster";
     string strReturnNo = string.Empty;
     TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill();
     PurchaseReturnMasterSP SPPurchaseReturnMaster = new PurchaseReturnMasterSP();
     try
     {
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseReturnVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
         if (Convert.ToDecimal(strVoucherNo) != SPPurchaseReturnMaster.PurchaseReturnMasterGetMaxPlusOne(decPurchaseReturnVoucherTypeId))
         {
             strVoucherNo = SPPurchaseReturnMaster.PurchaseReturnMasterGetMax(decPurchaseReturnVoucherTypeId).ToString();
             strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseReturnVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             if (SPPurchaseReturnMaster.PurchaseReturnMasterGetMax(decPurchaseReturnVoucherTypeId) == "0")
             {
                 strVoucherNo = "0";
                 strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseReturnVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             }
         }
         if (isAutomatic)
         {
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPurchaseReturnVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decPurchaseReturnSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strReturnNo = strPrefix + strVoucherNo + strSuffix;
             txtReturnNo.Text = strReturnNo;
             txtReturnNo.ReadOnly = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR:27" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #7
0
 /// <summary>
 /// Function to reset the form to create new sales quatation
 /// </summary>
 public void Clear()
 {
     TransactionsGeneralFill transactionGeneralFillObj = new TransactionsGeneralFill();
     SalesQuotationMasterSP SpSalesQuotationMaster = new SalesQuotationMasterSP();
     try
     {
         if (isAutomatic)
         {
             strSalesQuotationNo = SpSalesQuotationMaster.SalesQuotationMasterGetMax(decsalesQuotationTypeId).ToString();
             if (strSalesQuotationNo == string.Empty)
             {
                 strSalesQuotationNo = " 0";
             }
             strSalesQuotationNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decsalesQuotationTypeId, Convert.ToDecimal(strSalesQuotationNo), dtpSalesQuotationDate.Value, tableName);
             if (Convert.ToDecimal(strSalesQuotationNo) != SpSalesQuotationMaster.SalesQuotationMaxGetPlusOne(decsalesQuotationTypeId))
             {
                 strSalesQuotationNo = Convert.ToString(SpSalesQuotationMaster.SalesQuotationMaxGetPlusOne(decsalesQuotationTypeId));
                 strSalesQuotationNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decsalesQuotationTypeId, Convert.ToDecimal(strSalesQuotationNo), dtpSalesQuotationDate.Value, tableName);
                 if (SpSalesQuotationMaster.SalesQuotationMasterGetMax(decsalesQuotationTypeId) == "0")
                 {
                     strSalesQuotationNo = "0";
                     strSalesQuotationNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decsalesQuotationTypeId, Convert.ToDecimal(strSalesQuotationNo), dtpSalesQuotationDate.Value, tableName);
                 }
             }
             if (isAutomatic)
             {
                 SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                 SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                 infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decsalesQuotationTypeId, dtpSalesQuotationDate.Value);
                 strPrefix = infoSuffixPrefix.Prefix;
                 strSuffix = infoSuffixPrefix.Suffix;
                 decSalesQuotationPreffixSuffixId = infoSuffixPrefix.SuffixprefixId;
                 strInvoiceNo = strPrefix + strSalesQuotationNo + strSuffix;
                 txtQuotationNo.Text = strInvoiceNo;
                 txtQuotationNo.ReadOnly = true;
             }
         }
         else
         {
             txtQuotationNo.Text = string.Empty;
         }
         salesQuotationDatefill();
         if (!ShowProductCode())
         {
             this.dgvProduct.Columns["dgvtxtProductCode"].Visible = false;
         }
         if (!ShowBarcode())
         {
             this.dgvProduct.Columns["dgvtxtBarcode"].Visible = false;
         }
         if (PrintAfetrSave())
         {
             cbxPrintAfterSave.Checked = true;
         }
         else
         {
             cbxPrintAfterSave.Checked = false;
         }
         dgvProduct.Rows.Clear();
         txtNarration.Text = string.Empty;
         txtTotal.Text = string.Empty;
         btnSave.Text = "Save";
         btnDelete.Enabled = false;
         cbxApproved.Checked = false;
         ComboCurrencyFill();
         ComboPricingLevelFill();
         ComboSalesManFill();
         CashOrPartyCombofill();
         FillProducts(false, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SQ:31" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #8
0
 /// <summary>
 /// For VoucherNumberGeneration
 /// </summary>
 public void VoucherNumberGeneration()
 {
     try
     {
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         RejectionOutMasterSP spRejectionOut = new RejectionOutMasterSP();
         strVoucherNo = "0";
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = obj.VoucherNumberAutomaicGeneration(decRejectionOutVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
         if (Convert.ToDecimal(strVoucherNo) != spRejectionOut.RejectionOutMasterGetMaxPlusOne(decRejectionOutVoucherTypeId))
         {
             strVoucherNo = spRejectionOut.RejectionOutMasterGetMax(decRejectionOutVoucherTypeId).ToString();
             strVoucherNo = obj.VoucherNumberAutomaicGeneration(decRejectionOutVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             if (spRejectionOut.RejectionOutMasterGetMax(decRejectionOutVoucherTypeId) == "0")
             {
                 strVoucherNo = "0";
                 strVoucherNo = obj.VoucherNumberAutomaicGeneration(decRejectionOutVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             }
         }
         if (isAutomatic)
         {
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decRejectionOutVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decRejectionOutSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strRejectionOutNo = strPrefix + strVoucherNo + strSuffix;
             txtRejectionOutNo.Text = strRejectionOutNo;
             txtRejectionOutNo.ReadOnly = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RO02:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #9
0
 /// <summary>
 /// Function to reset the form to make new service voucher
 /// </summary>
 public void Clear()
 {
     try
     {
         /*Automatic invoice number generation*/
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         VoucherDate();
         if (isAutomatic)    //  Checking voucher number generation is automatic or not
         {
             ServiceMasterSP spServiceMaster = new ServiceMasterSP();
             ContraMasterSP spContraMaster = new ContraMasterSP();
             if (strVoucherNo == string.Empty)
             {
                 strVoucherNo = "0";
             }
             strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecServicetVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
             if (Convert.ToDecimal(strVoucherNo) != (spServiceMaster.ServiceMasterGetMax(DecServicetVoucherTypeId)) + 1)
             {
                 strVoucherNo = spServiceMaster.ServiceMasterGetMax(DecServicetVoucherTypeId).ToString();
                 strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecServicetVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                 if (spServiceMaster.ServiceMasterGetMax(DecServicetVoucherTypeId) == 0)
                 {
                     strVoucherNo = "0";
                     strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecServicetVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                 }
             }
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(DecServicetVoucherTypeId, dtpVoucherDate.Value);   //  Getting suffix-prefix settings
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decServiceSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strInvoiceNo = strPrefix + strVoucherNo + strSuffix;    // Generating invoice number with suffix and prefix
             txtInvoiceNumber.Text = strInvoiceNo;
             txtInvoiceNumber.ReadOnly = true;
             txtVoucherDate.Select();
         }
         else
         {
             txtInvoiceNumber.Text = string.Empty;
             txtInvoiceNumber.ReadOnly = false;
         }
         ServiceAcoountComboFill();
         GridParticularComboFill();
         SalesmanComboFill();
         CashOrPartyComboFill();
         isEditMode = false;
         txtDiscount.Text = "0";
         txtTotalAmount.Text = "0";
         txtGrandTotal.Text = "0";
         txtCreditPeriod.Text = "0";
         txtCustomer.Text = string.Empty;
         txtNarration.Text = string.Empty;
         PrintCheck();
         int inCount = dgvServiceVoucher.RowCount;
         for (int i = 0; i < inCount; i++)
         {
             dgvServiceVoucher.Rows[i].Cells["dgvcmbParticulars"].Value = null;
             dgvServiceVoucher.Rows[i].Cells["dgvtxtMeasure"].Value = null;
             dgvServiceVoucher.Rows[i].Cells["dgvtxtAmount"].Value = null;
         }
         dgvServiceVoucher.ClearSelection();
         btnDelete.Enabled = false;
         btnSave.Text = "Save";
         dgvServiceVoucher.Rows.Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show("SV 04 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #10
0
        /// <summary>
        /// Voucher no automatic generation, it considered the settings also
        /// </summary>
        public void VoucherNumberGeneration()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();

                PDCClearanceMasterSP spPdclearance = new PDCClearanceMasterSP();

                if (strVoucherNo == string.Empty)
                {
                    strVoucherNo = "0";
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPDCclearanceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, strtableName);
                if (Convert.ToDecimal(strVoucherNo) != spPdclearance.PDCClearanceMaxUnderVoucherTypePlusOne(decPDCclearanceVoucherTypeId))
                {
                    strVoucherNo = spPdclearance.PDCClearanceMaxUnderVoucherType(decPDCclearanceVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPDCclearanceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, strtableName);
                    if (spPdclearance.PDCClearanceMaxUnderVoucherType(decPDCclearanceVoucherTypeId).ToString() == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPDCclearanceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, strtableName);
                    }
                }
                if (isAutomatic)
                {
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPDCclearanceVoucherTypeId, dtpVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    decSufixprefixPdcpayableID = infoSuffixPrefix.SuffixprefixId;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtvoucherNo.Text = strInvoiceNo;
                    lblVoucherNoManualValidator.Visible = false;
                    txtvoucherNo.ReadOnly = true;
                    txtvoucherNo.Enabled = false;
                }
                else
                {
                    txtvoucherNo.ReadOnly = false;
                    txtvoucherNo.Text = string.Empty;
                    lblVoucherNoManualValidator.Visible = true;
                    strInvoiceNo = txtvoucherNo.Text.Trim();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PC8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #11
0
 /// <summary>
 /// Function to generate Voucher number as per settings
 /// </summary>
 public void VoucherNoGeneration()
 {
     TransactionsGeneralFill obj = new TransactionsGeneralFill();
     AdvancePaymentSP spAdvancePayment = new AdvancePaymentSP();
     if (strVoucherNo == string.Empty)
     {
         strVoucherNo = "0";
     }
     strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpSalaryMonth.Value, strAdvancePayment);
     if (Convert.ToDecimal(strVoucherNo) != spAdvancePayment.AdvancePaymentGetMaxPlusOne(decPaymentVoucherTypeId))
     {
         strVoucherNo = spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId).ToString();
         strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpSalaryMonth.Value, strAdvancePayment);
         if (spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId) == "0")
         {
             strVoucherNo = "0";
             strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpSalaryMonth.Value, strAdvancePayment);
         }
     }
     if (isAutomatic)
     {
         SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix = spSuffixPrefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate.Value);
         strPrefix = infoSuffixPrefix.Prefix;
         strSuffix = infoSuffixPrefix.Suffix;
         strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
         txtAdvanceVoucherNo.Text = strInvoiceNo;
         txtAdvanceVoucherNo.Enabled = false;
     }
 }
Пример #12
0
 /// <summary>
 /// Function to use the voucherno Automatic generation
 /// </summary>
 public void VoucherNumberGeneration()
 {
     string strTableName = "SalesOrderMaster";
     string strPrefix = string.Empty;
     string strSuffix = string.Empty;
     string strInvoiceNo = string.Empty;
     try
     {
         SalesOrderMasterSP spSalesOrderMaster = new SalesOrderMasterSP();
         TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill();
         if (isAutomatic)
         {
             strVoucherNo = "0";
             if (strVoucherNo == string.Empty)
             {
                 strVoucherNo = "0"; //strMax;
             }
             strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decSalesOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
             if (Convert.ToDecimal(strVoucherNo) != spSalesOrderMaster.SalesOrderVoucherMasterMaxPlusOne(decSalesOrderTypeId))
             {
                 strVoucherNo = spSalesOrderMaster.SalesOrderVoucherMasterMax(decSalesOrderTypeId).ToString();
                 strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decSalesOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
                 if (spSalesOrderMaster.SalesOrderVoucherMasterMax(decSalesOrderTypeId).ToString() == "0")
                 {
                     strVoucherNo = "0";
                     strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decSalesOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
                 }
             }
             if (isAutomatic)
             {
                 SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                 SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                 infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decSalesOrderTypeId, dtpDate.Value);
                 strPrefix = infoSuffixPrefix.Prefix;
                 strSuffix = infoSuffixPrefix.Suffix;
                 strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                 txtOrderNo.Text = strInvoiceNo;
                 txtOrderNo.ReadOnly = true;
             }
             else
             {
                 txtOrderNo.ReadOnly = false;
                 txtOrderNo.Text = string.Empty;
                 strInvoiceNo = txtOrderNo.Text.Trim();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SO40:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }