Ejemplo n.º 1
0
 public ResultStatus Freeze(
     CustomerMaint customerMaint,
     CustomerMaint_Request request,
     out CustomerMaint_Result result)
 {
     return(this.Freeze(customerMaint, (CustomerMaint_Parameters)null, request, out result));
 }
Ejemplo n.º 2
0
 public ResultStatus LoadESigDetails(
     CustomerMaint customerMaint,
     CustomerMaint_Request request,
     out CustomerMaint_Result result)
 {
     return(this.LoadESigDetails(customerMaint, (CustomerMaint_LoadESigDetails_Parameters)null, request, out result));
 }
Ejemplo n.º 3
0
 public ResultStatus GetWIPMsgs(
     CustomerMaint customerMaint,
     CustomerMaint_Request request,
     out CustomerMaint_Result result)
 {
     return(this.GetWIPMsgs(customerMaint, (CustomerMaint_Parameters)null, request, out result));
 }
Ejemplo n.º 4
0
 public CustomerMaintMethod(
     CustomerMaint Cdo,
     CustomerMaintMethods Method,
     CustomerMaint_Parameters Parameters)
 {
     this.Cdo           = Cdo;
     this.ServiceMethod = Method;
     this.Parameters    = Parameters;
 }
Ejemplo n.º 5
0
        public virtual IEnumerable ViewCustomer(PXAdapter adapter)
        {
            CustomerMaint graph = PXGraph.CreateInstance <CustomerMaint>();

            graph.BAccount.Current = graph.BAccount.Search <Customer.acctCD>(ARCustomerList.Current.AcctCD);
            throw new PXRedirectRequiredException(graph, true, "View Customer")
                  {
                      Mode = PXBaseRedirectException.WindowMode.NewWindow
                  };
        }
        public virtual IEnumerable ViewCustomer(PXAdapter adapter)
        {
            if (this.Cards.Current != null)
            {
                Customer customer = PXSelect <Customer,
                                              Where <Customer.bAccountID, Equal <Required <Customer.bAccountID> > > >
                                    .Select(this, this.Cards.Current.BAccountID);

                CustomerMaint graph = PXGraph.CreateInstance <CustomerMaint>();
                graph.BAccount.Current = customer;
                throw new PXRedirectRequiredException(graph, Messages.ViewCustomer);
            }
            return(adapter.Get());
        }
Ejemplo n.º 7
0
        protected virtual void viewCustomer()
        {
            CCSynchronizeCard       syncCard      = CustomerCardPaymentData.Current;
            CustomerMaint           customer      = CreateInstance <CustomerMaint>();
            PXSelectBase <Customer> customerQuery = new PXSelect <Customer,
                                                                  Where <Customer.bAccountID, Equal <Required <Customer.bAccountID> > > >(this);

            customer.CurrentCustomer.Current = customerQuery.SelectSingle(syncCard.BAccountID);

            if (customer.CurrentCustomer.Current != null)
            {
                throw new PXRedirectRequiredException(customer, true, string.Empty);
            }
        }
Ejemplo n.º 8
0
 public ResultStatus GetEnvironment(
     CustomerMaint cdo,
     CustomerMaint_Request request,
     out CustomerMaint_Result result)
 {
     result = (CustomerMaint_Result)null;
     try
     {
         return(((ICustomerMaintService)this._Channel).GetEnvironment(this._UserProfile, cdo, request, out result));
     }
     catch (Exception ex)
     {
         return(this.OnThrowException(ex));
     }
 }
        /// <summary>
        /// Generates a list of documents that meet the filter criteria.
        /// This list is used for display in the processing screen
        /// </summary>
        /// <returns>List of Customers with Dunning Letters</returns>
        protected virtual IEnumerable details()
        {
            CreditHoldParameters header = Filter.Current;
            List <DetailsResult> result = new List <DetailsResult>();

            if (header == null)
            {
                yield break;
            }

            foreach (PXResult <Customer, ARDunningLetter> record in GetCustomersToProcess(header))
            {
                ARDunningLetter dunningLetter = record;
                Customer        customer      = record;
                if (header.ShowAll == false && customer.Status != header.IncludedCustomerStatus)
                {
                    continue;
                }

                DetailsResult res = new DetailsResult();
                res.Copy(this, dunningLetter, customer);

                IEnumerable <Override.ExtendedCustomer> customerFamily =
                    CustomerMaint.GetChildAccountsAndSelfStripped <Override.Customer.sharedCreditCustomerID>(this, customer.BAccountID);

                int?[] customerFamilyIDs = customerFamily
                                           .Select(row => row.BusinessAccount.BAccountID)
                                           .Where(id => id != null)
                                           .ToArray();

                var balances = CustomerMaint.GetCustomerBalances(this, customerFamilyIDs);
                if (balances != null)
                {
                    res.InvBal = balances.CurrentBal ?? 0.0m;
                }
                result.Add(res);
            }

            foreach (var item in result)
            {
                Details.Cache.SetStatus(item, PXEntryStatus.Held);
                yield return(item);
            }
            Details.Cache.IsDirty = false;
        }
Ejemplo n.º 10
0
        public ResultStatus AddDataTransaction(CustomerMaint cdo)
        {
            this.OnBeforeCall(nameof(AddDataTransaction), (DCObject)cdo, (Parameters)null, (Request)null);
            ResultStatus res;

            try
            {
                res = !this._IsTransactionOpened ? this.GetAddDataTransactionException() : this.AddMethod((Method) new CustomerMaintMethod(cdo, CustomerMaintMethods.AddDataTransaction, (CustomerMaint_Parameters)null));
            }
            catch (Exception ex)
            {
                res = this.OnThrowException(ex);
            }
            if (res.IsSuccess)
            {
                Result result;
                this.OnAfterCall(nameof(AddDataTransaction), res, (DCObject)cdo, (Parameters)null, (Request)null, result);
            }
            return(res);
        }
        protected virtual void GetCustomerBalance(PXCache cache, Customer customer, out decimal?CustomerBal,
                                                  out DateTime?OldInvoiceDate)
        {
            ARBalances summarybal;

            using (new PXConnectionScope())
            {
                summarybal =
                    CustomerMaint.GetCustomerBalances <PX.Objects.AR.Override.Customer.sharedCreditCustomerID>(
                        cache.Graph, customer.SharedCreditCustomerID);
            }

            CustomerBal = 0m;
            var curaccumbal = cache.Current as ARBalances;

            if (curaccumbal != null && cache.GetStatus(curaccumbal) == PXEntryStatus.Inserted)
            {
                //get balance only from PXAccumulator
                foreach (ARBalances accumbal in cache.Inserted)
                {
                    if (accumbal.CustomerID != curaccumbal.CustomerID)
                    {
                        continue;
                    }
                    CustomerBal += accumbal.CurrentBal + accumbal.UnreleasedBal + accumbal.TotalOpenOrders;
                }
            }

            OldInvoiceDate = null;
            if (summarybal != null)
            {
                CustomerBal += (summarybal.CurrentBal ?? 0m);
                CustomerBal += (summarybal.UnreleasedBal ?? 0m);
                CustomerBal += (summarybal.TotalOpenOrders ?? 0m);
                CustomerBal += (summarybal.TotalShipped ?? 0m);
                CustomerBal -= (summarybal.TotalPrepayments ?? 0m);

                OldInvoiceDate = summarybal.OldInvoiceDate;
            }
        }
Ejemplo n.º 12
0
        public virtual IEnumerable viewCustomer(PXAdapter adapter)
        {
            if (this.CCTrans.Current != null)
            {
                CCProcTran            row        = this.CCTrans.Current;
                CustomerPaymentMethod pmInstance = PXSelect <CustomerPaymentMethod, Where <CustomerPaymentMethod.pMInstanceID, Equal <Required <CustomerPaymentMethod.pMInstanceID> > > > .Select(this, row.PMInstanceID);

                if (pmInstance != null)
                {
                    CustomerMaint graph = PXGraph.CreateInstance <CustomerMaint>();
                    graph.BAccount.Current = graph.BAccount.Search <Customer.bAccountID>(pmInstance.BAccountID);
                    if (graph.BAccount.Current != null)
                    {
                        throw new PXRedirectRequiredException(graph, true, Messages.ViewCustomer)
                              {
                                  Mode = PXBaseRedirectException.WindowMode.NewWindow
                              };
                    }
                }
            }
            return(adapter.Get());
        }
Ejemplo n.º 13
0
        public virtual IEnumerable ViewCustomer(PXAdapter adapter)
        {
            BAccount account = PXSelect <BAccount, Where <BAccount.bAccountID, Equal <Current <PMTran.bAccountID> > > > .Select(this);

            if (account != null)
            {
                if (account.Type == BAccountType.CustomerType || account.Type == BAccountType.CombinedType)
                {
                    CustomerMaint graph = CreateInstance <CustomerMaint>();
                    graph.BAccount.Current = PXSelect <Customer, Where <Customer.bAccountID, Equal <Current <PMTran.bAccountID> > > > .Select(this);

                    throw new PXRedirectRequiredException(graph, true, "")
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
                else if (account.Type == BAccountType.VendorType)
                {
                    VendorMaint graph = CreateInstance <VendorMaint>();
                    graph.BAccount.Current = PXSelect <VendorR, Where <VendorR.bAccountID, Equal <Current <PMTran.bAccountID> > > > .Select(this);

                    throw new PXRedirectRequiredException(graph, true, "")
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
                else if (account.Type == BAccountType.EmployeeType || account.Type == BAccountType.EmpCombinedType)
                {
                    EmployeeMaint graph = CreateInstance <EmployeeMaint>();
                    graph.Employee.Current = PXSelect <EPEmployee, Where <EPEmployee.bAccountID, Equal <Current <PMTran.bAccountID> > > > .Select(this);

                    throw new PXRedirectRequiredException(graph, true, "")
                          {
                              Mode = PXBaseRedirectException.WindowMode.NewWindow
                          };
                }
            }
            return(adapter.Get());
        }
Ejemplo n.º 14
0
        public ResultStatus ExecuteTransaction(
            CustomerMaint cdo,
            CustomerMaint_Request request,
            out CustomerMaint_Result result)
        {
            result = (CustomerMaint_Result)null;
            this.OnBeforeCall(nameof(ExecuteTransaction), (DCObject)cdo, (Parameters)null, (Request)request);
            ResultStatus res;

            try
            {
                res = !this._IsTransactionOpened ? ((ICustomerMaintService)this._Channel).ExecuteTransaction(this._UserProfile, cdo, request, out result) : this.AddMethod((Method) new CustomerMaintMethod(cdo, CustomerMaintMethods.ExecuteTransaction, (CustomerMaint_Parameters)null));
            }
            catch (Exception ex)
            {
                res = this.OnThrowException(ex);
            }
            if (res.IsSuccess)
            {
                this.OnAfterCall(nameof(ExecuteTransaction), res, (DCObject)cdo, (Parameters)null, (Request)request, (Result)result);
            }
            return(res);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Generates a list of documents that meet the filter criteria.
        /// This list is used for display in the processing screen
        /// </summary>
        /// <returns>List of Customers with Dunning Letters</returns>
        protected virtual IEnumerable details()
        {
            CreditHoldParameters header = Filter.Current;
            List <DetailsResult> result = new List <DetailsResult>();

            if (header == null)
            {
                yield break;
            }

            foreach (PXResult <Customer, ARDunningLetter> record in GetCustomersToProcess(header))
            {
                ARDunningLetter dunningLetter = record;
                Customer        customer      = record;
                if (header.ShowAll == false && customer.Status != header.IncludedCustomerStatus)
                {
                    continue;
                }

                DetailsResult res = new DetailsResult();
                res.Copy(this, dunningLetter, customer);

                ARBalances balances = CustomerMaint.GetCustomerBalances <Override.Customer.sharedCreditCustomerID>(this, customer.BAccountID);
                if (balances != null)
                {
                    res.InvBal = balances.CurrentBal ?? 0.0m;
                }
                result.Add(res);
            }

            foreach (var item in result)
            {
                Details.Cache.SetStatus(item, PXEntryStatus.Held);
                yield return(item);
            }
            Details.Cache.IsDirty = false;
        }
Ejemplo n.º 16
0
        public ResultStatus LoadESigDetails(
            CustomerMaint customerMaint,
            CustomerMaint_LoadESigDetails_Parameters parameters,
            CustomerMaint_Request request,
            out CustomerMaint_Result result)
        {
            result = (CustomerMaint_Result)null;
            this.OnBeforeCall(nameof(LoadESigDetails), (DCObject)customerMaint, (Parameters)parameters, (Request)request);
            ResultStatus res;

            try
            {
                res = !this._IsTransactionOpened ? ((ICustomerMaintService)this._Channel).LoadESigDetails(this._UserProfile, customerMaint, parameters, request, out result) : this.AddMethod((Method) new CustomerMaintMethod(customerMaint, CustomerMaintMethods.LoadESigDetails, (CustomerMaint_Parameters)parameters));
            }
            catch (Exception ex)
            {
                res = this.OnThrowException(ex);
            }
            if (res.IsSuccess)
            {
                this.OnAfterCall(nameof(LoadESigDetails), res, (DCObject)customerMaint, (Parameters)parameters, (Request)request, (Result)result);
            }
            return(res);
        }
Ejemplo n.º 17
0
 public ResultStatus NewCopy(CustomerMaint customerMaint)
 {
     return(this.NewCopy(customerMaint, (CustomerMaint_Parameters)null, (CustomerMaint_Request)null, out CustomerMaint_Result _));
 }
Ejemplo n.º 18
0
 public ResultStatus ExecuteTransaction(CustomerMaint cdo)
 {
     return(this.ExecuteTransaction(cdo, (CustomerMaint_Request)null, out CustomerMaint_Result _));
 }
Ejemplo n.º 19
0
 public ResultStatus Delete(CustomerMaint customerMaint)
 {
     return(this.Delete(customerMaint, (CustomerMaint_Parameters)null, (CustomerMaint_Request)null, out CustomerMaint_Result _));
 }