예제 #1
0
 /// <summary>
 /// Enter the customer id and add the customer to the transaction
 /// </summary>
 /// <param name="retailTransaction">The retail tranaction</param>
 /// <returns>The retail tranaction</returns>
 public void EnterCustomerId(DE.IRetailTransaction retailTransaction)
 {
 }
예제 #2
0
 /// <summary>
 /// Sets the customer status of the customer
 /// </summary>
 /// <param name="retailTransaction">The retail tranaction</param>
 public void Status(DE.IRetailTransaction retailTransaction)
 {
 }
예제 #3
0
        public void AuthorizeCustomerAccountPayment(ref bool valid, ref string comment, ref string manualAuthenticationCode, string customerId, decimal amount, DE.IRetailTransaction retailTransaction)
        {
            try
            {
                LSRetailPosis.ApplicationLog.Log(this.ToString(), "Customer.AuthorizeCustomerAccountPayment()", LSRetailPosis.LogTraceLevel.Trace);
                //Get the customer information for the customer
                DM.CustomerDataManager customerDataManager = new DM.CustomerDataManager(
                    ApplicationSettings.Database.LocalConnection, ApplicationSettings.Database.DATAAREAID);
                DE.ICustomer tempCust = customerDataManager.GetTransactionalCustomer(customerId);

                if (!string.IsNullOrEmpty(tempCust.InvoiceAccount))
                {
                    DE.ICustomer tempInvCust = customerDataManager.GetTransactionalCustomer(tempCust.InvoiceAccount);
                    if (tempInvCust.Blocked == DE.BlockedEnum.All)
                    {
                        tempCust.Blocked = tempInvCust.Blocked;
                    }
                    else if (tempInvCust.Blocked == DE.BlockedEnum.Invoice && tempCust.Blocked != DE.BlockedEnum.All)
                    {
                        tempCust.Blocked = DE.BlockedEnum.Invoice;
                    }
                }

                valid = true;

                if (LSRetailPosis.Settings.ApplicationSettings.Terminal.Standalone == true)
                {
                    decimal balance = customerDataManager.GetBalance(tempCust.CustomerId);
                    if (((balance * -1) + Convert.ToDecimal(amount)) > tempCust.CreditLimit)
                    {
                        valid   = false;
                        comment = LSRetailPosis.ApplicationLocalizer.Language.Translate(51007);  // The amount charged is higher than existing creditlimit
                    }
                    return;
                }

                // Using the transaction services to validate the transaction
                this.Application.TransactionServices.ValidateCustomerStatus(ref valid, ref comment, customerId, amount, retailTransaction.StoreCurrencyCode);
                if (comment.Length > 0)
                {
                    if (comment.Substring(0, 1) == "\t")
                    {
                        comment = comment.Remove(0, 1);
                    }
                }
            }
            catch (LSRetailPosis.PosisException px)
            {
                LSRetailPosis.ApplicationExceptionHandler.HandleException(this.ToString(), px);
                throw;
            }
            catch (Exception x)
            {
                LSRetailPosis.ApplicationExceptionHandler.HandleException(this.ToString(), x);
                throw;
            }
        }
예제 #4
0
 /// <summary>
 /// Sets the customer balance of the customer
 /// </summary>
 /// <param name="retailTransaction">The retail tranaction</param>
 public void Balance(DE.IRetailTransaction retailTransaction)
 {
 }