Exemplo n.º 1
0
        public RefundToCustomerForm GetDataIntoModel()
        {
            OptionsEntity             oData = new OptionsEntity();
            ISalesOrderListRepository purchaseRepository = new SalesOrderListRepository();

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

            PQForm.RefundToCustomerDetails = new List <RefundToCustomerDetailsEntity>();
            RefundToCustomerEntity model = new RefundToCustomerEntity();

            //  this.ID = pqf.RefundToCustomer.ID;
            model.CustomerID   = this.SelectedCustomerID;
            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.RefundToCustomer = model;

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

                pqEntity.SalesNo     = item.SalesNo;
                pqEntity.SalesDate   = item.SalesDate;
                pqEntity.SalesAmount = Convert.ToDecimal(item.SalesAmountStr);

                //pqEntity.PaymentDueDate = Convert.ToDateTime(item.PaymentDueDateStr);
                pqEntity.PaymentDueDate = Utility.SimpleDateTime(item.PaymentDueDateStr);//Sunil Sharma
                //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.RefundToCustomerDetails.Add(pqEntity);
            }
            return(PQForm);
        }
Exemplo n.º 2
0
        public RefundToCustomerForm GetDataIntoModel()
        {
            RefundToCustomerForm PQForm = new RefundToCustomerForm();

            PQForm.RefundToCustomerDetails = new List <RefundToCustomerDetailsEntity>();
            RefundToCustomerEntity model = new RefundToCustomerEntity();

            //  this.ID = pqf.RefundToCustomer.ID;
            model.CustomerID   = this.SelectedCustomerID;
            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;
            if (this.IsChequeTrue == true)
            {
                model.IsCheque = true;
            }
            else
            {
                model.IsCheque = false;
            }

            PQForm.RefundToCustomer = model;

            foreach (var item in PQDetailsEntity)
            {
                RefundToCustomerDetailsEntity pqEntity = new RefundToCustomerDetailsEntity();

                pqEntity.SalesNo     = item.SalesNo;
                pqEntity.SalesDate   = item.SalesDate;
                pqEntity.SalesAmount = Convert.ToDecimal(item.SalesAmountStr);
                //item.SalesAmount=pqEntity.SalesAmount;
                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.RefundToCustomerDetails.Add(pqEntity);
            }
            return(PQForm);
        }