public JournalForm GetDataIntoModel()
        {
            OptionsEntity oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();
            oData = purchaseRepository.GetOptionSettings();
            JournalForm JForm = new JournalForm();
            JForm.JournalaDataDetails= new List<JournalFormEntity>();
            JournalFormEntity model = new JournalFormEntity();
            model.JournalNo = this.JournalNo;
            model.JournalDate = DateTime.ParseExact(this.JournalDateStr, oData.DateFormat, null);

            JForm.JournalData = model;

            foreach (var item in JournalDetailsEntity)
            {
                if (item.ID != null)
                {
                    JournalFormEntity jEntity = new JournalFormEntity();
                    jEntity.ID = item.ID;
                    jEntity.JournalDateStr = item.JournalDateStr;
                    jEntity.Credit = item.Credit;
                    jEntity.Debit = item.Debit;
                    if (item.ID != 0 && Convert.ToInt32(item.ID) > 0)
                    {
                        JForm.JournalaDataDetails.Add(jEntity);
                    }
                }
            }

            return JForm;
        }
        public void  GetJournalDetails(string JNo)
        {
            OptionsEntity oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();
            oData = purchaseRepository.GetOptionSettings();
            string obj = JNo.ToString();
            JournalForm JObj = journalRepository.GetJournalDetails(obj);
            this.JournalNo = JObj.JournalData.JournalNo;
            DateTime Dateinstr = (DateTime)JObj.JournalData.JournalDate;
            this.JournalDateStr = Dateinstr.ToString(oData.DateFormat);
            this.JournalDetailsEntity = new ObservableCollection<JGridViewModel>();
            this.sumCredit =Convert.ToString(JObj.JournalaDataDetails.Sum(x => x.Credit));
            this.sumDebit = Convert.ToString(JObj.JournalaDataDetails.Sum(x => x.Debit));

            foreach (var item in JObj.JournalaDataDetails)
            {
                JGridViewModel pqEntity = new JGridViewModel(JournalList);
                pqEntity.ID = item.ID;
                pqEntity.JournalDateStr = item.JournalDateStr;
                pqEntity.Credit = item.Credit;
                pqEntity.Debit = item.Debit;
                
                JournalDetailsEntity.Add(pqEntity);
            }
        }
Ejemplo n.º 3
0
        public TransferMoneyEntity GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            TransferMoneyEntity model = new TransferMoneyEntity();

            model.SelectedtransferFromCashAndBankAcntID = this.SelectedtransferFromCashAndBankAcntID;
            model.SelectedtransferToCashBankAcntID      = this.SelectedtransferToCashBankAcntID;
            model.CashChequeDate = DateTime.ParseExact(this.CashChequeDateStr, oData.DateFormat, null);
            model.CashChequeNo   = this.CashChequeNo;
            model.AmountStr      = AmountStr;
            model.Amount         = Convert.ToDecimal(AmountStr);
            model.TransferFromBeforeBalanceStr = this.TransferFromBeforeBalanceStr;
            model.TransferFromBeforeBalance    = Convert.ToDecimal(TransferFromBeforeBalance);
            model.TransferFromAfterBalanceStr  = this.TransferFromAfterBalanceStr;
            model.TransferFromAfterBalance     = Convert.ToDecimal(TransferFromAfterBalance);
            model.TransferToBeforeBalanceStr   = this.TransferToBeforeBalanceStr;
            model.TransferToBeforeBalance      = Convert.ToDecimal(TransferToBeforeBalance);
            model.TransferToAfterBalanceStr    = this.TransferToAfterBalanceStr;
            model.TransferToAfterBalance       = Convert.ToDecimal(TransferToAfterBalance);
            model.TaxRate  = this.TaxRate;
            model.Remarks  = this.Remarks;
            model.IsCheque = this.IsCheque;

            return(model);
        }
        public PaymentFromCustomerForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            PaymentFromCustomerForm PQForm = new PaymentFromCustomerForm();

            PQForm.PaymentFromCustomerDetails = new List <PaymentFromCustomerDetailsEntity>();
            PaymentFromCustomerEntity model = new PaymentFromCustomerEntity();

            //  this.ID = pqf.PaymentFromCustomer.ID;
            model.CustomerID = this.SelectedCustomerID;
            model.AccountId  = this.SelectedAccountID;
            //model.DateStr = this.DateStr;
            model.Date         = DateTime.ParseExact(this.DateStr, oData.DateFormat, null);
            model.AmountStr    = this.AmountStr;
            model.Amount       = Convert.ToDecimal(this.AmountStr);
            model.IsCheque     = this.IsCheque;
            model.CashChequeNo = this.CashChequeNo;
            model.Remarks      = this.Remarks;
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.PaymentFromCustomer = model;

            foreach (var item in PQDetailsEntity.Where(e => Convert.ToDecimal(e.AmountAdjustedStr) != 0))
            {
                PaymentFromCustomerDetailsEntity pqEntity = new PaymentFromCustomerDetailsEntity();

                pqEntity.SalesNo     = item.SalesNo;
                pqEntity.SalesDate   = item.SalesDate;
                pqEntity.SalesAmount = Convert.ToDecimal(item.SalesAmountStr);
                //item.SalesAmount=pqEntity.SalesAmount;
                if (item.PaymentDueDateStr != string.Empty)
                {
                    // pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                    pqEntity.PaymentDueDate = Utility.SimpleDateTime(item.PaymentDueDateStr);   //Sunil Sharma
                }
                else
                {
                    pqEntity.PaymentDueDate = null;
                }
                //pqEntity.AmountDueStr = Convert.ToString(item.AmountDue);
                pqEntity.AmountDue = Convert.ToDecimal(item.AmountDueStr);
                // pqEntity.AmountAdjustedStr = Convert.ToString(item.AmountAdjusted);
                pqEntity.AmountAdjusted = Convert.ToDecimal(item.AmountAdjustedStr);

                pqEntity.Discount = Convert.ToDecimal(item.DiscountStr);

                PQForm.PaymentFromCustomerDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Ejemplo n.º 5
0
        public PayMoneyEntity GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            PayMoneyEntity model = new PayMoneyEntity();

            model.SelectedLinkedAcntID   = this.SelectedLinkedAcntID;
            model.SelectedCashBankAcntID = this.SelectedCashBankAcntID;
            model.CashChequeDate         = DateTime.ParseExact(this.CashChequeDateStr, oData.DateFormat, null);
            model.CashChequeNo           = this.CashChequeNo;
            model.TotalBeforeTaxStr      = TotalBeforeTaxStr;
            model.TotalBeforeTax         = Convert.ToDecimal(TotalBeforeTaxStr);
            model.TotalTaxStr            = this.TotalTaxStr;
            model.TotalTax         = Convert.ToDecimal(TotalTaxStr);
            model.TotalAfterTaxStr = this.TotalAfterTaxStr;
            model.TotalAfterTax    = Convert.ToDecimal(TotalAfterTaxStr);
            model.SelectedTaxID    = this.SelectedTaxID;
            model.TaxRate          = this.TaxRate;
            model.Remarks          = this.Remarks;
            model.IsCheque         = this.IsCheque;

            return(model);
        }
Ejemplo n.º 6
0
        private void AdjustCreditNotes(string AdjustedNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();

            IsNew = false;
            AdjustCreditNoteForm pqf = psRepository.AdjustCreditNoteDetails(AdjustedNo);

            pqf.AdjustCreditNote.Amount      = Math.Abs(decimal.Parse(pqf.AdjustCreditNote.Amount.ToString()));
            pqf.AdjustCreditNote.AmountStr   = Math.Abs(decimal.Parse(pqf.AdjustCreditNote.AmountStr)).ToString();
            pqf.AdjustCreditNote.MustCompare = true;
            if (pqf.AdjustCreditNote.AdjustCreditNoteDate == null)
            {
                this.AdjustCreditNoteDateStr = "";
            }
            else
            {
                DateTime Dateinstr = (DateTime)pqf.AdjustCreditNote.AdjustCreditNoteDate;
                this.AdjustCreditNoteDateStr = Dateinstr.ToString(oData.DateFormat);
            }

            GetModelData(pqf);
        }
        public AdjustDebitNoteForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            AdjustDebitNoteForm PQForm = new AdjustDebitNoteForm();

            PQForm.AdjustDebitNoteDetails = new List <AdjustDebitNoteDetailsEntity>();
            AdjustDebitNoteEntity model = new AdjustDebitNoteEntity();

            //  this.ID = pqf.AdjustDebitNote.ID;
            model.SupplierID = this.SelectedSupplierID;
            model.AccountId  = this.SelectedAccountID;
            model.Date       = this.Date;
            model.AmountStr  = this.AmountStr;
            model.Amount     = Convert.ToDecimal(this.AmountStr);
            model.IsCheque   = this.IsCheque;
            //model.CashChequeNo = this.CashChequeNo;
            model.Remarks               = this.Remarks;
            model.DebitNoteNo           = this.DebitNoteNo;
            model.AdjustDebitNoteNumber = this.AdjustDebitNoteNumber;
            model.AdjustDebitNoteDate   = DateTime.ParseExact(this.AdjustDebitNoteDateStr, oData.DateFormat, null);
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.AdjustDebitNote = model;

            foreach (var item in PQDetailsEntity.Where(e => !(string.IsNullOrEmpty(e.AmountAdjustedStr))))
            {
                AdjustDebitNoteDetailsEntity pqEntity = new AdjustDebitNoteDetailsEntity();

                pqEntity.PurchaseNo     = item.PurchaseNo;
                pqEntity.PurchaseDate   = item.PurchaseDate;
                pqEntity.PurchaseAmount = Convert.ToDecimal(item.PurchaseAmountStr);
                //item.PurchaseAmount=pqEntity.PurchaseAmount;
                //pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                pqEntity.PaymentDueDate = DateTime.ParseExact(item.PaymentDueDateStr, "dd'/'MM'/'yy", CultureInfo.InvariantCulture);
                //pqEntity.AmountDueStr = Convert.ToString(item.AmountDue);
                pqEntity.AmountDue = Convert.ToDecimal(item.AmountDueStr);
                // pqEntity.AmountAdjustedStr = Convert.ToString(item.AmountAdjusted);
                pqEntity.AmountAdjusted = Convert.ToDecimal(item.AmountAdjustedStr);

                pqEntity.Discount            = Convert.ToDecimal(item.DiscountStr);
                pqEntity.CheckAmountAdjusted = item.CheckAmountAdjusted;

                PQForm.AdjustDebitNoteDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Ejemplo n.º 8
0
        public void GetCountAndAdjustStock(string scNo)
        {
            // Mouse.OverrideCursor = Cursors.Wait;
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            CountAndAdjustStockForm pqf = casRepository.GetCountAndAdjustStock(scNo);

            this.StockCountNo = pqf.CountAndAdjustStock.StockCountNo;
            DateTime Dateinstr = (DateTime)pqf.CountAndAdjustStock.StockDate;

            this.StockDateStr = Dateinstr.ToString(oData.DateFormat);

            if (pqf.CountAndAdjustStock.Type == Convert.ToInt16(Stock_Type.IncreaseDecreaseStock))
            {
                IsIncreaseDecreaseStock = true;
                IsStockDamaged          = false;
                IsStockTake             = false;
                SharedValues.StockType  = Convert.ToInt16(Stock_Type.IncreaseDecreaseStock);
            }
            else if (pqf.CountAndAdjustStock.Type == Convert.ToInt16(Stock_Type.StockDamaged))
            {
                IsIncreaseDecreaseStock = false;
                IsStockDamaged          = true;
                IsStockTake             = false;
                SharedValues.StockType  = Convert.ToInt16(Stock_Type.StockDamaged);
            }
            else if (pqf.CountAndAdjustStock.Type == Convert.ToInt16(Stock_Type.StockTake))
            {
                IsIncreaseDecreaseStock = false;
                IsStockDamaged          = false;
                IsStockTake             = true;
                SharedValues.StockType  = Convert.ToInt16(Stock_Type.StockTake);
            }

            this.PSDetailsEntity = new ObservableCollection <DataGridViewModel>();
            foreach (var item in pqf.CountAndAdjustStockDetails)
            {
                DataGridViewModel pqEntity = new DataGridViewModel(ProductList);
                pqEntity.SelectedPSID = item.PSID;
                pqEntity.PandSCode    = item.PandSCode;
                pqEntity.PandSName    = item.PandSName;
                pqEntity.SystemQty    = item.SystemQty;
                pqEntity.CountQty     = item.CountQty;
                pqEntity.Difference   = item.Difference;

                pqEntity.AvgCost   = Convert.ToString(item.AverageCost);
                pqEntity.Amount    = item.Amount;
                pqEntity.AmountStr = item.AmountStr;

                PSDetailsEntity.Add(pqEntity);
            }
        }
Ejemplo n.º 9
0
        public CountAndAdjustStockForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            CountAndAdjustStockForm CSForm = new CountAndAdjustStockForm();

            CSForm.CountAndAdjustStockDetails = new List <CountAndAdjustStockDetailsEntity>();
            CountAndAdjustStockEntity model = new CountAndAdjustStockEntity();

            model.StockCountNo = this.StockCountNo;
            model.StockDate    = DateTime.ParseExact(this.StockDateStr, oData.DateFormat, null);

            if (IsIncreaseDecreaseStock == true)
            {
                model.StockType = Convert.ToByte(Stock_Type.IncreaseDecreaseStock);
            }
            if (IsStockDamaged == true)
            {
                model.StockType = Convert.ToByte(Stock_Type.StockDamaged);
            }
            if (IsStockTake == true)
            {
                model.StockType = Convert.ToByte(Stock_Type.StockTake);
            }

            CSForm.CountAndAdjustStock = model;

            foreach (var item in PSDetailsEntity.Where(e => e.CountQty != 0))
            {
                if (item.SelectedPSID != 0)
                {
                    CountAndAdjustStockDetailsEntity pqEntity = new CountAndAdjustStockDetailsEntity();
                    pqEntity.PSID              = item.SelectedPSID;
                    pqEntity.PandSCode         = item.PandSCode;
                    pqEntity.PandSName         = item.PandSName;
                    pqEntity.SystemQty         = item.SystemQty;
                    pqEntity.CountQty          = item.CountQty;
                    pqEntity.Difference        = item.Difference;
                    pqEntity.AvgCost           = item.AvgCost;
                    pqEntity.Amount            = item.Amount;
                    pqEntity.AdjustedAmount    = Convert.ToDecimal(AdjustedAmountStr);
                    pqEntity.AdjustedAmountStr = AdjustedAmountStr;
                    if (item.SelectedPSID != 0 && Convert.ToInt32(item.SelectedPSID) > 0)
                    {
                        CSForm.CountAndAdjustStockDetails.Add(pqEntity);
                    }
                }
            }
            return(CSForm);
        }
Ejemplo n.º 10
0
        private void GetRefundToCustomerDetails(string cashChequeNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            IsNew = false;
            RefundToCustomerForm pqf       = psRepository.GetRefundToCustomerDetails(cashChequeNo);
            DateTime             Dateinstr = (DateTime)pqf.RefundToCustomer.Date;

            this.DateStr = Dateinstr.ToString(oData.DateFormat);
            GetModelData(pqf);
        }
        public RefundFromSupplierForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            RefundFromSupplierForm PQForm = new RefundFromSupplierForm();

            PQForm.RefundFromSupplierDetails = new List <RefundFromSupplierDetailsEntity>();
            RefundFromSupplierEntity model = new RefundFromSupplierEntity();

            //  this.ID = pqf.RefundFromSupplier.ID;
            model.SupplierID   = this.SelectedSupplierID;
            model.AccountId    = this.SelectedAccountID;
            model.Date         = DateTime.ParseExact(this.DateStr, oData.DateFormat, null);
            model.AmountStr    = this.AmountStr;
            model.Amount       = Convert.ToDecimal(this.AmountStr);
            model.IsCheque     = this.IsCheque;
            model.CashChequeNo = this.CashChequeNo;
            model.Remarks      = this.Remarks;
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.RefundFromSupplier = model;

            foreach (var item in PQDetailsEntity.Where(e => Convert.ToDecimal(e.AmountAdjustedStr) != 0))
            {
                RefundFromSupplierDetailsEntity pqEntity = new RefundFromSupplierDetailsEntity();

                pqEntity.PurchaseNo     = item.PurchaseNo;
                pqEntity.PurchaseDate   = item.PurchaseDate;
                pqEntity.PurchaseAmount = Convert.ToDecimal(item.PurchaseAmountStr);
                //item.PurchaseAmount=pqEntity.PurchaseAmount;
                pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                //pqEntity.AmountDueStr = Convert.ToString(item.AmountDue);
                pqEntity.AmountDue = Convert.ToDecimal(item.AmountDueStr);
                // pqEntity.AmountAdjustedStr = Convert.ToString(item.AmountAdjusted);
                pqEntity.AmountAdjusted = Convert.ToDecimal(item.AmountAdjustedStr);

                pqEntity.Discount = Convert.ToDecimal(item.DiscountStr);

                PQForm.RefundFromSupplierDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Ejemplo n.º 12
0
        private void GetPaymentToSupplierDetails(string cashChequeNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            this.ListSuppliers = supplierRepository.GetAllSupplier().ToList();
            IsNew = false;
            PaymentToSupplierForm pqf = psRepository.GetPaymentToSupplierDetails(cashChequeNo);
            DateTime Dateinstr        = (DateTime)pqf.PaymentToSupplier.Date;

            this.DateStr = Dateinstr.ToString(oData.DateFormat);
            GetModelData(pqf);
        }
Ejemplo n.º 13
0
        private void GetPayMoneyDetails(string cashChequeNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData               = purchaseRepository.GetOptionSettings();
            IsNew               = false;
            IsTextBoxReadOnly   = true;
            IsCashChequeEnabled = false;
            PayMoneyEntity pqf       = rmRepository.GetPayMoneyDetails(cashChequeNo);
            DateTime       Dateinstr = (DateTime)pqf.CashChequeDate;

            this.CashChequeDateStr = Dateinstr.ToString(oData.DateFormat);
            GetModelData(pqf);
        }
Ejemplo n.º 14
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            if (oData != null)
            {
                CurrencyName = oData.CurrencyCode;
                DateFormat   = oData.DateFormat;
            }
            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = purchaseRepository.GetDefaultTaxes();
        }
        public DebitNoteForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            DebitNoteForm PQForm = new DebitNoteForm();

            PQForm.InvoiceDetails = new List <PurchaseInvoiceDetailEntity>();
            DebitNoteEntity model = new DebitNoteEntity();

            model.DebitNo                  = this.DebitNo;
            model.DebitDate                = this.DebitDate;
            model.TotalBeforeTax           = this.TotalBeforeTax;
            model.TotalTax                 = this.TotalTax;
            model.TotalAfterTax            = this.TotalAfterTax;
            model.SupplierCreditNoteNo     = this.SupplierCreditNoteNo;
            model.SupplierCreditNoteDate   = DateTime.ParseExact(this.SupplierCreditNoteDateStr, oData.DateFormat, null);
            model.SupplierCreditNoteAmount = this.SupplierCreditNoteAmount;
            model.SupplierID               = this.SelectedSupplierID;

            model.TermsAndConditions = this.TermsAndConditions;

            PQForm.DebitNote = model;

            foreach (var item in PQDetailsEntity)
            {
                PurchaseInvoiceDetailEntity pqEntity = new PurchaseInvoiceDetailEntity();
                pqEntity.PINo       = Convert.ToString(item.SelectedPSID);
                pqEntity.PandSCode  = item.PandSCode;
                pqEntity.PandSName  = item.PandSName;
                pqEntity.PIQty      = item.PQQty;
                pqEntity.PIPrice    = item.PQPrice;
                pqEntity.PIDiscount = item.PQDiscount;
                pqEntity.GSTRate    = item.GSTRate;
                pqEntity.GSTRateStr = Convert.ToString(item.GSTRate) + "%";
                pqEntity.PIAmount   = item.PQAmount;
                if (item.SelectedPSID != null && Convert.ToInt32(item.SelectedPSID) > 0)
                {
                    PQForm.InvoiceDetails.Add(pqEntity);
                }
            }
            return(PQForm);
        }
Ejemplo n.º 16
0
        void GetOptionsandTaxValues()
        {
            OptionsEntity             oData           = new OptionsEntity();
            ISalesOrderListRepository SalesRepository = new SalesOrderListRepository();

            oData = SalesRepository.GetOptionSettings();
            if (oData != null)
            {
                CurrencyName = oData.CurrencyCode;
                DateFormat   = oData.DateFormat;
                if (!string.IsNullOrWhiteSpace(oData.DefCashBankAcc))
                {
                    this.SelectedAccountID = Convert.ToInt32(oData.DefCashBankAcc);
                }
            }
            TaxModel objDefaultTax = new TaxModel();

            objDefaultTax = SalesRepository.GetDefaultTaxes();
        }
        private void GetPaymentFromCustomerDetails(string cashChequeNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            this.ListCustomers = CustomerRepository.GetCustomerList().ToList();
            IsNew = false;
            PaymentFromCustomerForm pqf = psRepository.GetPaymentFromCustomerDetails(cashChequeNo);

            if (pqf.PaymentFromCustomer != null)
            {
                DateTime Dateinstr = (DateTime)pqf.PaymentFromCustomer.Date;
                this.DateStr = Dateinstr.ToString(oData.DateFormat);
                GetModelData(pqf);
            }

            else
            {
            }
        }
        //void NavigateToSupplier(object param)
        //{
        //    string obj = param.ToString();
        //    SharedValues.getValue = obj;
        //    var mainview = ServiceLocator.Current.GetInstance<SupplierDetailView>();
        //    var mainregion = this.regionManager.Regions[RegionNames.MainRegion];
        //    mainregion.Add(mainview);
        //    if (mainregion != null)
        //    {
        //        mainregion.Activate(mainview);
        //    }


        //    var tabview = ServiceLocator.Current.GetInstance<SupplierTabView>();
        //    var tabregion = this.regionManager.Regions[RegionNames.MenuBarRegion];
        //    tabregion.Add(tabview);
        //    if (tabregion != null)
        //    {
        //        tabregion.Activate(tabview);
        //    }

        //    eventAggregator.GetEvent<TabVisibilityEvent>().Publish(true);
        //    eventAggregator.GetEvent<SubTabVisibilityEvent>().Publish(false);
        //    eventAggregator.GetEvent<TitleChangedEvent>().Publish("Suppliers Details Form");
        //}
        void ShowSales(object param)
        {
            this.ShowDetailTrue  = true;
            this.ShowSummaryTrue = false;
            ITodoUnpaidDetailRepository paymentRepository = new TodoUnpaidDetailRepository();

            //GetOptionsandTaxValues();
            this.ListDueDays        = paymentRepository.GetAllData(1);
            this.UnpaidPurchaseTrue = false;
            this.UnpaidPurSalesTrue = false;
            this.UnpaidSalesTrue    = true;
            this.UnpaidSummaryTrue  = false;
            DefaultList             = this.ListDueDays;
            this.ListDueDayscmbSup  = this.ListDueDays.GroupBy(x => x.Name).Select(y => y.First()).OrderBy(x => x.Name).ToList();
            this.ListDueDayscmbInv  = this.ListDueDays.GroupBy(x => x.InvoiceNo).Select(y => y.First()).OrderBy(x => x.InvoiceNo).ToList();
            this.ShowSelectedCount  = this.ListDueDays.Count();
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            this.DateformatStr = oData.DateFormat.ToString();
        }
        private void GetAdjustDebitNoteDetails(string DebitNoteNo)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            IsNew = false;
            AdjustDebitNoteForm pqf = psRepository.GetAdjustDebitNoteDetails(DebitNoteNo);

            pqf.AdjustDebitNote.Amount                = Math.Abs(decimal.Parse(pqf.AdjustDebitNote.Amount.ToString()));
            pqf.AdjustDebitNote.AmountStr             = Math.Abs(decimal.Parse(pqf.AdjustDebitNote.AmountStr)).ToString();
            pqf.AdjustDebitNote.AdjustDebitNoteNumber = "AD-" + psRepository.GetLatestInvoiceNo();
            if (pqf.AdjustDebitNote.AdjustDebitNoteDate == null)
            {
                this.AdjustDebitNoteDateStr = "";
            }
            else
            {
                DateTime Dateinstr = (DateTime)pqf.AdjustDebitNote.AdjustDebitNoteDate;
                this.AdjustDebitNoteDateStr = Dateinstr.ToString(oData.DateFormat);
            }
            GetModelData(pqf);
        }
        private void GetModelData(AdjustDebitNoteForm pqf)
        {
            if (IsNew == false)
            {
                this.ID = pqf.AdjustDebitNote.ID;
                this.SelectedSupplierID = pqf.AdjustDebitNote.SupplierID;
                this.DebitNoteNo        = pqf.AdjustDebitNote.DebitNoteNo;
                this.SelectedAccountID  = pqf.AdjustDebitNote.AccountId;
                this.Date                  = pqf.AdjustDebitNote.Date;
                this.AmountStr             = pqf.AdjustDebitNote.AmountStr;
                this.IsCheque              = pqf.AdjustDebitNote.IsCheque;
                this.AdjustDebitNoteNumber = pqf.AdjustDebitNote.AdjustDebitNoteNumber;


                if (IsCheque == true)
                {
                    IsChequeTrue = true;
                }
                else
                {
                    IsChequeFalse = true;
                }
                //this.CashChequeNo = pqf.AdjustDebitNote.CashChequeNo;
                this.Remarks = pqf.AdjustDebitNote.Remarks;
                if (this.ListSuppliers != null)
                {
                    foreach (var item in this.ListSuppliers)
                    {
                        if (item.ID == this.SelectedSupplierID)
                        {
                            this.SelectedSupplierName = item.SupplierName;
                        }
                    }
                }
            }

            var                       result             = pqf.AdjustDebitNoteDetails.OrderByDescending(e => e.UpdatedDate).GroupBy(e => e.PurchaseNo).Select(e => e.First()).ToList();
            OptionsEntity             oData              = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            this.PQDetailsEntity = new ObservableCollection <CollectAmountDataGridViewModel>();
            if (result != null)
            {
                foreach (var item in result)
                {
                    CollectAmountDataGridViewModel pqEntity = new CollectAmountDataGridViewModel();
                    pqEntity.PurchaseNo = item.PurchaseNo;
                    if (item.PurchaseDate != null)
                    {
                        pqEntity.PurchaseDate = item.PurchaseDate;
                        DateTime Dateinstr = (DateTime)item.PurchaseDate;
                        pqEntity.PurchaseDateStr = Dateinstr.ToString(oData.DateFormat);
                    }
                    else
                    {
                    }
                    pqEntity.PurchaseAmountStr = Convert.ToString(item.PurchaseAmount);
                    pqEntity.PurchaseAmount    = item.PurchaseAmount;
                    if (item.PaymentDueDate != null)
                    {
                        pqEntity.PaymentDueDate = item.PaymentDueDate;
                        DateTime Dateinstr1 = (DateTime)item.PaymentDueDate;
                        pqEntity.PaymentDueDateStr = changedateformat(item.PaymentDueDate);
                    }
                    else
                    {
                    }
                    pqEntity.AmountDueStr = Convert.ToString(item.AmountDue);
                    //pqEntity.AmountDue = item.AmountDue;
                    pqEntity.AmountAdjusted    = item.AmountAdjusted;
                    pqEntity.AmountAdjustedStr = Convert.ToString(item.AmountAdjusted);
                    //pqEntity.Discount = item.Discount;

                    PQDetailsEntity.Add(pqEntity);
                    TotalPurchaseAmount = Convert.ToString(PQDetailsEntity.Sum(e => e.PurchaseAmount));
                    TotalAdjutedAmount  = Convert.ToString(PQDetailsEntity.Sum(e => e.AmountAdjusted));
                    OnPropertyChanged("PQDetailsEntity");
                }
            }
            PQDetailsEntityLst = PQDetailsEntity;
        }
Ejemplo n.º 21
0
        public void GetCreditNote(object param)
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

            oData = purchaseRepository.GetOptionSettings();
            if (param != null)
            {
                CreditNoteForm pqf = dnRepository.GetCreditNoteDetails(Convert.ToString(param));

                this.ID                  = pqf.CreditNote.ID;
                this.CreditNo            = pqf.CreditNote.CreditNo;
                this.CreditDate          = pqf.CreditNote.CreditDate;
                this.CustomerDebitNoteNo = pqf.CreditNote.CustomerDebitNoteNo;

                if (CustomerDebitNoteDate == null)
                {
                    this.CustomerDebitNoteDate = pqf.CreditNote.CustomerDebitNoteDate;
                }
                else
                {
                    DateTime DateinStr = (DateTime)pqf.CreditNote.CustomerDebitNoteDate;
                    this.CustomerDebitNoteDateStr = DateinStr.ToString(oData.DateFormat);
                }

                this.CustomerDebitNoteAmount = pqf.CreditNote.CustomerDebitNoteAmount;
                this.SelectedCustomerID      = pqf.CreditNote.CustomerID;
                this.SalesInvoiceID          = pqf.CreditNote.SalesInvoiceID;
                this.SalesInvoiceNo          = pqf.CreditNote.SalesInvoiceNo;
                this.TermsAndConditions      = pqf.CreditNote.TermsAndConditions;

                this.TotalBeforeTax    = Convert.ToDecimal(pqf.CreditNote.TotalBeforeTax);
                this.TotalTax          = Convert.ToDecimal(pqf.CreditNote.TotalTax);
                this.TotalAfterTax     = Convert.ToDecimal(pqf.CreditNote.TotalAfterTax);
                this.TotalBeforeTaxStr = Convert.ToString(this.TotalBeforeTax);
                this.TotalTaxStr       = Convert.ToString(TotalTax);
                this.TotalAfterTaxStr  = Convert.ToString(TotalAfterTax);

                this.Status = pqf.CreditNote.Status;
                if (this.Status == 1)
                {
                    RubberAdjusted = true;
                }

                this.PQDetailsEntity = new ObservableCollection <DataGridViewModel>();
                foreach (var item in pqf.InvoiceDetails)
                {
                    DataGridViewModel pqEntity = new DataGridViewModel(ProductList);
                    pqEntity.SelectedPSID = Convert.ToString(item.SINo);
                    pqEntity.PandSCode    = item.PandSCode;
                    pqEntity.PandSName    = item.PandSName;
                    pqEntity.GSTRate      = item.GSTRate;
                    pqEntity.SQQty        = item.SIQty;
                    pqEntity.SQPrice      = Convert.ToString(item.Price);
                    pqEntity.SQDiscount   = item.SIDiscount;

                    //  PQDEntity.GSTRate = item.GSTRate;
                    pqEntity.SQAmount = item.SIAmount;

                    PQDetailsEntity.Add(pqEntity);
                }
            }
        }