Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.OrderAddress


    order.setPostUsername(postUsername);
    order.setPostPassword(postPassword);   
    order.setInputCurrency(orderHeader.getSiteCurrency().getSiteCurrencyClass().getSiteCurrencyClassName());
//    order.setTxnId(orderHeader.getOrderNum());
    order.setTxnId(orderHeader.getOrderHeaderId().toString());   
    OrderAddress orderAddress = orderHeader.getCustAddress();
    if (orderHeader.getBillingAddress().getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      orderAddress = orderHeader.getBillingAddress();
    }
    order.setCardHolderName(orderAddress.getCustFirstName() + " " + orderAddress.getCustLastName());
//    order.setAmount(Format.getSimpleFloat(orderEngine.getOrderPriceTotal()));
    order.setAmount(Format.getSimpleFloat(orderHeader.getOrderTotal()));
    order.setCardNumber(creditCardInfo.getCreditCardNum());
    String expiryMonth = (creditCardInfo.getCreditCardExpiryMonth());
    String expiryYear = (creditCardInfo.getCreditCardExpiryYear());
View Full Code Here


    ContentBean contentBean = getContentBean(request);

    MessageResources resources = this.getResources(request);
    form.setOrderNum(header.getOrderNum());
   
    OrderAddress address = header.getCustAddress();
    String name = Format.formatCustomerName("", address.getCustFirstName(), address.getCustMiddleName(), address.getCustLastName(), "");
    form.setCustName(name);
    form.setCustEmail(header.getCustEmail());
    form.setCustPrefix(address.getCustPrefix());
    form.setCustFirstName(address.getCustFirstName());
    form.setCustMiddleName(address.getCustMiddleName());
    form.setCustLastName(address.getCustLastName());
    form.setCustSuffix(address.getCustSuffix());
    form.setCustAddressLine1(address.getCustAddressLine1());
    form.setCustAddressLine2(address.getCustAddressLine2());
    form.setCustCityName(address.getCustCityName());
    form.setCustStateName(address.getCustStateName());
    form.setCustStateCode(address.getCustStateCode());
    form.setCustCountryName(address.getCustCountryName());
    form.setCustCountryCode(address.getCustCountryCode());
    form.setCustZipCode(address.getCustZipCode());
    form.setCustPhoneNum(address.getCustPhoneNum());
    form.setCustFaxNum(address.getCustFaxNum());

    address = header.getBillingAddress();
    form.setBillingCustUseAddress(address.getCustUseAddress());
    if (address.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      name = Format.formatCustomerName("", address.getCustFirstName(), address.getCustMiddleName(), address.getCustLastName(), "");
      form.setBillingCustName(name);
      form.setBillingCustPrefix(address.getCustPrefix());
      form.setBillingCustFirstName(address.getCustFirstName());
      form.setBillingCustMiddleName(address.getCustMiddleName());
      form.setBillingCustLastName(address.getCustLastName());
      form.setBillingCustSuffix(address.getCustSuffix());
      form.setBillingCustAddressLine1(address.getCustAddressLine1());
      form.setBillingCustAddressLine2(address.getCustAddressLine2());
      form.setBillingCustCityName(address.getCustCityName());
      form.setBillingCustStateName(address.getCustStateName());
      form.setBillingCustStateCode(address.getCustStateCode());
      form.setBillingCustCountryName(address.getCustCountryName());
      form.setBillingCustCountryCode(address.getCustCountryCode());
      form.setBillingCustZipCode(address.getCustZipCode());
      form.setBillingCustPhoneNum(address.getCustPhoneNum());
      form.setBillingCustFaxNum(address.getCustFaxNum());
    }
   
    address = header.getShippingAddress();
    form.setShippingCustUseAddress(address.getCustUseAddress());
    if (address.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      name = Format.formatCustomerName("", address.getCustFirstName(), address.getCustMiddleName(), address.getCustLastName(), "");
      form.setShippingCustName(name);
      form.setShippingCustPrefix(address.getCustPrefix());
      form.setShippingCustFirstName(address.getCustFirstName());
      form.setShippingCustMiddleName(address.getCustMiddleName());
      form.setShippingCustLastName(address.getCustLastName());
      form.setShippingCustSuffix(address.getCustSuffix());
      form.setShippingCustAddressLine1(address.getCustAddressLine1());
      form.setShippingCustAddressLine2(address.getCustAddressLine2());
      form.setShippingCustCityName(address.getCustCityName());
      form.setShippingCustStateName(address.getCustStateName());
      form.setShippingCustStateCode(address.getCustStateCode());
      form.setShippingCustCountryName(address.getCustCountryName());
      form.setShippingCustCountryCode(address.getCustCountryCode());
      form.setShippingCustZipCode(address.getCustZipCode());
      form.setShippingCustPhoneNum(address.getCustPhoneNum());
      form.setShippingCustFaxNum(address.getCustFaxNum());
    }
   
    form.setPriceTotal(numberFormatter.formatCurrency(orderEngine.getOrderSubTotal()));
    form.setShippingTotal(numberFormatter.formatCurrency(orderEngine.getOrderShippingTotal()));
    form.setTaxTotal(numberFormatter.formatCurrency(orderEngine.getOrderTaxTotal()));
View Full Code Here

    nvp += "&ACCT=" + creditCardInfo.getCreditCardNum();
    nvp += "&EXPDATE=" + creditCardInfo.getCreditCardExpiryMonth() + creditCardInfo.getCreditCardExpiryYear();
    nvp += "&CVV2=" + creditCardInfo.getCreditCardVerNum();
    nvp += "&AMT=" + URLEncoder.encode(Format.getSimpleFloat(orderHeader.getOrderTotal()), Constants.SYSTEM_ENCODING);

    OrderAddress billingAddress = orderHeader.getBillingAddress();
    nvp += "&FIRSTNAME=" + URLEncoder.encode(billingAddress.getCustFirstName(), Constants.SYSTEM_ENCODING);
    nvp += "&LASTNAME=" + URLEncoder.encode(billingAddress.getCustLastName(), Constants.SYSTEM_ENCODING);
    String street = URLEncoder.encode(billingAddress.getCustAddressLine1(), Constants.SYSTEM_ENCODING);
    if (!Format.isNullOrEmpty(billingAddress.getCustAddressLine2())) {
      street += " " + billingAddress.getCustAddressLine2();
    }
    nvp += "&STREET=" + street;
    nvp += "&CITY=" + URLEncoder.encode(billingAddress.getCustCityName(), Constants.SYSTEM_ENCODING);
    nvp += "&STATE=" + URLEncoder.encode(billingAddress.getCustStateCode(), Constants.SYSTEM_ENCODING);
    nvp += "&ZIP=" + URLEncoder.encode(billingAddress.getCustZipCode(), Constants.SYSTEM_ENCODING);
    nvp += "&COUNTRYCODE=" + billingAddress.getCustCountryCode();
    nvp += "&VERBOSITY=MEDIUM";

    if (ApplicationGlobal.isLocalTesting()) {
      logger.error(nvp);
    }
View Full Code Here

   
    Order order = new Order();
    order.setStoreID(storeId);
    order.setPassphrase(passphrase);
   
    OrderAddress orderAddress = orderHeader.getCustAddress();
    if (orderHeader.getBillingAddress().getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      orderAddress = orderHeader.getBillingAddress();
    }
    order.setBname(orderAddress.getCustFirstName() + " " + orderAddress.getCustLastName());
    order.setBcompany("");
    order.setBaddress1(orderAddress.getCustAddressLine1());
    order.setBaddress2(orderAddress.getCustAddressLine2());
    order.setBcity(orderAddress.getCustCityName());
    order.setBprovince(orderAddress.getCustStateName());
    order.setBcountry(orderAddress.getCustCountryName());
    order.setBpostalcode(orderAddress.getCustZipCode());
   
    OrderAddress shipAddress = orderHeader.getCustAddress();
    if (orderHeader.getShippingAddress().getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      shipAddress = orderHeader.getShippingAddress();
    }
    else if (orderHeader.getShippingAddress().getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_BILL)) {
      if (orderHeader.getBillingAddress().getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
        shipAddress = orderHeader.getBillingAddress();
      }
      else {
        shipAddress = orderHeader.getCustAddress();
      }
    }
    order.setSname(shipAddress.getCustFirstName() + " " + shipAddress.getCustLastName());
    order.setScompany("");
    order.setSaddress1(shipAddress.getCustAddressLine1());
    order.setSaddress2(shipAddress.getCustAddressLine2());
    order.setScity(shipAddress.getCustCityName());
    order.setSprovince(shipAddress.getCustStateName());
    order.setScountry(shipAddress.getCustCountryName());
    order.setSpostalcode(shipAddress.getCustZipCode());
   
    order.setPhone(orderAddress.getCustPhoneNum());
    order.setFax(orderAddress.getCustFaxNum());
    order.setEmail(orderHeader.getCustEmail());
    order.setTax1(Format.getSimpleFloat(orderEngine.getOrderTaxTotal()));
View Full Code Here

    nvp += "&CREDITCARDTYPE=" + getCreditCardType(orderHeader.getCreditCardDesc());
    nvp += "&ACCT=" + creditCardInfo.getCreditCardNum();
    nvp += "&EXPDATE=" + creditCardInfo.getCreditCardExpiryMonth() + creditCardInfo.getCreditCardExpiryYear();
    nvp += "&CVV2=" + creditCardInfo.getCreditCardVerNum();

    OrderAddress billingAddress = orderHeader.getBillingAddress();
    nvp += "&FIRSTNAME=" + URLEncoder.encode(billingAddress.getCustFirstName(), Constants.SYSTEM_ENCODING);
    nvp += "&LASTNAME=" + URLEncoder.encode(billingAddress.getCustLastName(), Constants.SYSTEM_ENCODING);
    String street = URLEncoder.encode(billingAddress.getCustAddressLine1(), Constants.SYSTEM_ENCODING);
    if (!Format.isNullOrEmpty(billingAddress.getCustAddressLine2())) {
      street += " " + billingAddress.getCustAddressLine2();
    }
    nvp += "&STREET=" + street;
    nvp += "&CITY=" + URLEncoder.encode(billingAddress.getCustCityName(), Constants.SYSTEM_ENCODING);
    nvp += "&STATE=" + URLEncoder.encode(billingAddress.getCustStateCode(), Constants.SYSTEM_ENCODING);
    nvp += "&ZIP=" + URLEncoder.encode(billingAddress.getCustZipCode(), Constants.SYSTEM_ENCODING);
    nvp += "&COUNTRYCODE=" + billingAddress.getCustCountryCode();

    if (ApplicationGlobal.isLocalTesting()) {
      logger.error(nvp);
    }
    String response = sendTransmission(nvp);
View Full Code Here

      paymentForm.setPaymentReference4(paymentTran.getPaymentReference4());
      paymentForm.setPaymentReference5(paymentTran.getPaymentReference5());
      orderHeaderDisplayForm.setVoidPaymentTran(paymentForm);
    }
   
    OrderAddress custAddress = orderHeader.getCustAddress();
    CustomerAddressDisplayForm addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(custAddress.getCustUseAddress());
    addressForm.setOrderAddressId(custAddress.getOrderAddressId().toString());
    addressForm.setCustPrefix(custAddress.getCustPrefix());
    addressForm.setCustFirstName(custAddress.getCustFirstName());
    addressForm.setCustMiddleName(custAddress.getCustMiddleName());
    addressForm.setCustLastName(custAddress.getCustLastName());
    addressForm.setCustSuffix(custAddress.getCustSuffix());
    addressForm.setCustAddressLine1(custAddress.getCustAddressLine1());
    addressForm.setCustAddressLine2(custAddress.getCustAddressLine2());
    addressForm.setCustCityName(custAddress.getCustCityName());
    Country country = custAddress.getCountry();
    State state = custAddress.getState();
    if (state != null) {
      addressForm.setCustStateName(state.getStateName());
      addressForm.setCustStateCode(state.getStateCode());
    }
    addressForm.setCustCountryName(country.getCountryName());
    addressForm.setCustCountryCode(country.getCountryCode());
    addressForm.setCustZipCode(custAddress.getCustZipCode());
    addressForm.setCustPhoneNum(custAddress.getCustPhoneNum());
    addressForm.setCustFaxNum(custAddress.getCustFaxNum());
    form.setCustAddress(addressForm);
   
    OrderAddress billingAddress = orderHeader.getBillingAddress();
    addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(billingAddress.getCustUseAddress());
    if (billingAddress.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      addressForm.setOrderAddressId(billingAddress.getOrderAddressId().toString());
      addressForm.setCustPrefix(billingAddress.getCustPrefix());
      addressForm.setCustFirstName(billingAddress.getCustFirstName());
      addressForm.setCustMiddleName(billingAddress.getCustMiddleName());
      addressForm.setCustLastName(billingAddress.getCustLastName());
      addressForm.setCustSuffix(billingAddress.getCustSuffix());
      addressForm.setCustAddressLine1(billingAddress.getCustAddressLine1());
      addressForm.setCustAddressLine2(billingAddress.getCustAddressLine2());
      country = billingAddress.getCountry();
      state = billingAddress.getState();
      addressForm.setCustCityName(billingAddress.getCustCityName());
      if (state != null) {
        addressForm.setCustStateName(state.getStateName());
        addressForm.setCustStateCode(state.getStateCode());
      }
      addressForm.setCustCountryName(country.getCountryName());
      addressForm.setCustCountryCode(country.getCountryCode());
      addressForm.setCustZipCode(billingAddress.getCustZipCode());
      addressForm.setCustPhoneNum(billingAddress.getCustPhoneNum());
      addressForm.setCustFaxNum(billingAddress.getCustFaxNum());
    }
    form.setBillingAddress(addressForm);
   
    OrderAddress shippingAddress = orderHeader.getShippingAddress();
    addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(shippingAddress.getCustUseAddress());
    if (shippingAddress.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      addressForm.setOrderAddressId(shippingAddress.getOrderAddressId().toString());
      addressForm.setCustPrefix(shippingAddress.getCustPrefix());
      addressForm.setCustFirstName(shippingAddress.getCustFirstName());
      addressForm.setCustMiddleName(shippingAddress.getCustMiddleName());
      addressForm.setCustLastName(shippingAddress.getCustLastName());
      addressForm.setCustSuffix(shippingAddress.getCustSuffix());
      addressForm.setCustAddressLine1(shippingAddress.getCustAddressLine1());
      addressForm.setCustAddressLine2(shippingAddress.getCustAddressLine2());
      addressForm.setCustCityName(shippingAddress.getCustCityName());
      country = shippingAddress.getCountry();
      state = shippingAddress.getState();
      if (state != null) {
        addressForm.setCustStateName(state.getStateName());
        addressForm.setCustStateCode(state.getStateCode());
      }
      addressForm.setCustCountryName(country.getCountryName());
      addressForm.setCustCountryCode(country.getCountryCode());
      addressForm.setCustZipCode(shippingAddress.getCustZipCode());
      addressForm.setCustPhoneNum(shippingAddress.getCustPhoneNum());
      addressForm.setCustFaxNum(shippingAddress.getCustFaxNum());
    }
    form.setShippingAddress(addressForm);
   
    Vector<OrderItemDetailDisplayForm> orderItemDetails = new Vector<OrderItemDetailDisplayForm>();
    Iterator<?> iterator = null;
View Full Code Here

        Vector<OrderListingDisplayForm> vector = new Vector<OrderListingDisplayForm>();
        int startRecord = (pageNo - 1) * adminBean.getListingPageSize();
        int endRecord = startRecord + adminBean.getListingPageSize();
        for (int i = startRecord; i < list.size() && i < endRecord; i++) {
          OrderHeader orderHeader = (OrderHeader) list.get(i);
          OrderAddress orderAddress = orderHeader.getCustAddress();
          OrderListingDisplayForm orderDisplay = new OrderListingDisplayForm();
          orderDisplay.setOrderHeaderId(Format.getLong(orderHeader.getOrderHeaderId()));
          orderDisplay.setOrderNum(orderHeader.getOrderNum());
          orderDisplay.setCustFirstName(orderAddress.getCustFirstName());
          orderDisplay.setCustLastName(orderAddress.getCustLastName());
          orderDisplay.setCustEmail(orderHeader.getCustEmail());
          orderDisplay.setCustCityName(orderAddress.getCustCityName());
          orderDisplay.setCustStateCode(orderAddress.getCustStateCode());
          orderDisplay.setCustCountryCode(orderAddress.getCustCountryCode());
          orderDisplay.setOrderTotal(Format.getFloatObj(orderHeader.getOrderTotal()));
          orderDisplay.setOrderStatus(orderHeader.getOrderStatus());
          orderDisplay.setOrderDate(Format.getFullDatetime(orderHeader.getOrderDate()));
            vector.add(orderDisplay);
        }
View Full Code Here

    header.setOrderNum(orderHeader.getOrderNum());
    header.setOrderDatetime(formatter.formatFullDate(orderHeader.getOrderDate()));
    header.setCustEmail(orderHeader.getCustEmail());
    header.setCurrencyCode(orderHeader.getSiteCurrency().getSiteCurrencyClass().getCurrency().getCurrencyCode());
   
    OrderAddress custAddress = orderHeader.getCustAddress();
    header.setCustUseAddress(custAddress.getCustUseAddress());
    header.setCustPrefix(custAddress.getCustPrefix());
    header.setCustFirstName(custAddress.getCustFirstName());
    header.setCustMiddleName(custAddress.getCustMiddleName());
    header.setCustLastName(custAddress.getCustLastName());
    header.setCustSuffix(custAddress.getCustSuffix());
    header.setCustAddressLine1(custAddress.getCustAddressLine1());
    header.setCustAddressLine2(custAddress.getCustAddressLine2());
    header.setCustCityName(custAddress.getCustCityName());
    header.setCustStateName(custAddress.getCustStateName());
    header.setCustCountryName(custAddress.getCustCountryName());
    header.setCustZipCode(custAddress.getCustZipCode());
    header.setCustPhoneNum(custAddress.getCustPhoneNum());
    header.setCustFaxNum(custAddress.getCustFaxNum());

    OrderAddress billingAddress = orderHeader.getBillingAddress();
    header.setBillingCustUseAddress(billingAddress.getCustUseAddress());
    header.setBillingCustPrefix(billingAddress.getCustPrefix());
    header.setBillingCustFirstName(billingAddress.getCustFirstName());
    header.setBillingCustMiddleName(billingAddress.getCustMiddleName());
    header.setBillingCustLastName(billingAddress.getCustLastName());
    header.setBillingCustSuffix(billingAddress.getCustSuffix());
    header.setBillingCustAddressLine1(billingAddress.getCustAddressLine1());
    header.setBillingCustAddressLine2(billingAddress.getCustAddressLine2());
    header.setBillingCustCityName(billingAddress.getCustCityName());
    header.setBillingCustStateName(billingAddress.getCustStateName());
    header.setBillingCustCountryName(billingAddress.getCustCountryName());
    header.setBillingCustZipCode(billingAddress.getCustZipCode());
    header.setBillingCustPhoneNum(billingAddress.getCustPhoneNum());
    header.setBillingCustFaxNum(billingAddress.getCustFaxNum());

    OrderAddress shippingAddress = orderHeader.getShippingAddress();
    header.setShippingCustUseAddress(shippingAddress.getCustUseAddress());
    header.setShippingCustPrefix(shippingAddress.getCustPrefix());
    header.setShippingCustFirstName(shippingAddress.getCustFirstName());
    header.setShippingCustMiddleName(shippingAddress.getCustMiddleName());
    header.setShippingCustLastName(shippingAddress.getCustLastName());
    header.setShippingCustSuffix(shippingAddress.getCustSuffix());
    header.setShippingCustAddressLine1(shippingAddress.getCustAddressLine1());
    header.setShippingCustAddressLine2(shippingAddress.getCustAddressLine2());
    header.setShippingCustCityName(shippingAddress.getCustCityName());
    header.setShippingCustStateName(shippingAddress.getCustStateName());
    header.setShippingCustCountryName(shippingAddress.getCustCountryName());
    header.setShippingCustZipCode(shippingAddress.getCustZipCode());
    header.setShippingCustPhoneNum(shippingAddress.getCustPhoneNum());
    header.setShippingCustFaxNum(shippingAddress.getCustFaxNum());

    header.setSubTotal(formatter.formatCurrency(orderEngine.getOrderSubTotal()));
    header.setShippingTotal(formatter.formatCurrency(orderHeader.getShippingTotal().floatValue() - orderHeader.getShippingDiscountTotal().floatValue()));
    header.setTaxTotal(formatter.formatCurrency(orderEngine.getOrderTaxTotal()));
    header.setOrderTotal(formatter.formatCurrency(orderHeader.getOrderTotal().floatValue()));
View Full Code Here

      form.setShippingTotal(formatter.formatCurrency(orderHeader.getShippingTotal()));
      form.setShippingDiscountTotal(formatter.formatCurrency(orderHeader.getShippingDiscountTotal()));
      form.setShippingOrderTotal(formatter.formatCurrency(orderHeader.getShippingTotal() - orderHeader.getShippingDiscountTotal()));
      form.setOrderTotal(formatter.formatCurrency(orderHeader.getOrderTotal()));
     
      OrderAddress custAddress = orderHeader.getCustAddress();
      if (custAddress != null) {
        ShoppingCartAddressActionForm custAddressForm = new ShoppingCartAddressActionForm();
        custAddressForm.setCustUseAddress(custAddress.getCustUseAddress());
        custAddressForm.setCustPrefix(custAddress.getCustPrefix());
        custAddressForm.setCustFirstName(custAddress.getCustFirstName());
        custAddressForm.setCustMiddleName(custAddress.getCustMiddleName());
        custAddressForm.setCustLastName(custAddress.getCustLastName());
        custAddressForm.setCustSuffix(custAddress.getCustSuffix());
        custAddressForm.setCustAddressLine1(custAddress.getCustAddressLine1());
        custAddressForm.setCustAddressLine2(custAddress.getCustAddressLine2());
        custAddressForm.setCustCityName(custAddress.getCustCityName());
        custAddressForm.setCustStateName(custAddress.getCustStateName());
        custAddressForm.setCustStateCode(custAddress.getCustStateCode());
        custAddressForm.setCustZipCode(custAddress.getCustZipCode());
        custAddressForm.setCustCountryName(custAddress.getCustCountryName());
        custAddressForm.setCustCountryCode(custAddress.getCustCountryCode());
        custAddressForm.setCustPhoneNum(custAddress.getCustPhoneNum());
        custAddressForm.setCustFaxNum(custAddress.getCustFaxNum());
        form.setCustAddress(custAddressForm);
      }
     
      OrderAddress billingAddress = orderHeader.getBillingAddress();
      OrderAddress shippingAddress = orderHeader.getShippingAddress();
    if (billingAddress != null) {
        ShoppingCartAddressActionForm billingAddressForm = new ShoppingCartAddressActionForm();
        billingAddressForm.setCustUseAddress(billingAddress.getCustUseAddress());
        billingAddressForm.setCustPrefix(billingAddress.getCustPrefix());
        billingAddressForm.setCustFirstName(billingAddress.getCustFirstName());
        billingAddressForm.setCustMiddleName(billingAddress.getCustMiddleName());
        billingAddressForm.setCustLastName(billingAddress.getCustLastName());
        billingAddressForm.setCustSuffix(billingAddress.getCustSuffix());
        billingAddressForm.setCustAddressLine1(billingAddress.getCustAddressLine1());
        billingAddressForm.setCustAddressLine2(billingAddress.getCustAddressLine2());
        billingAddressForm.setCustCityName(billingAddress.getCustCityName());
        billingAddressForm.setCustStateName(billingAddress.getCustStateName());
        billingAddressForm.setCustStateCode(billingAddress.getCustStateCode());
        billingAddressForm.setCustZipCode(billingAddress.getCustZipCode());
        billingAddressForm.setCustCountryName(billingAddress.getCustCountryName());
        billingAddressForm.setCustCountryCode(billingAddress.getCustCountryCode());
        billingAddressForm.setCustPhoneNum(billingAddress.getCustPhoneNum());
        billingAddressForm.setCustFaxNum(billingAddress.getCustFaxNum());
        form.setBillingAddress(billingAddressForm);
    }
    if (shippingAddress != null) {
        ShoppingCartAddressActionForm shippingAddressForm = new ShoppingCartAddressActionForm();
        shippingAddressForm.setCustUseAddress(shippingAddress.getCustUseAddress());
        shippingAddressForm.setCustPrefix(shippingAddress.getCustPrefix());
        shippingAddressForm.setCustFirstName(shippingAddress.getCustFirstName());
        shippingAddressForm.setCustMiddleName(shippingAddress.getCustMiddleName());
        shippingAddressForm.setCustLastName(shippingAddress.getCustLastName());
        shippingAddressForm.setCustSuffix(shippingAddress.getCustSuffix());
        shippingAddressForm.setCustAddressLine1(shippingAddress.getCustAddressLine1());
        shippingAddressForm.setCustAddressLine2(shippingAddress.getCustAddressLine2());
        shippingAddressForm.setCustCityName(shippingAddress.getCustCityName());
        shippingAddressForm.setCustStateName(shippingAddress.getCustStateName());
        shippingAddressForm.setCustStateCode(shippingAddress.getCustStateCode());
        shippingAddressForm.setCustZipCode(shippingAddress.getCustZipCode());
        shippingAddressForm.setCustCountryName(shippingAddress.getCustCountryName());
        shippingAddressForm.setCustCountryCode(shippingAddress.getCustCountryCode());
        shippingAddressForm.setCustPhoneNum(shippingAddress.getCustPhoneNum());
        shippingAddressForm.setCustFaxNum(shippingAddress.getCustFaxNum());
        form.setShippingAddress(shippingAddressForm);
    }
      form.setCustEmail(orderHeader.getCustEmail());
      form.setShippingMethodName(orderHeader.getShippingMethodName());
      PaymentTran payment = orderHeader.getPaymentTran();
View Full Code Here

      orderHeader = new OrderHeader();
    }
   
    Customer customer = shoppingCart.getCustomer();
    if (customer != null) {
      OrderAddress custAddress = null;
      if (orderHeader.getCustAddress() != null) {
        custAddress = orderHeader.getCustAddress();
      }
      else {
        custAddress = new OrderAddress();
        custAddress.setRecCreateBy(Constants.USERNAME_SYSTEM);
        custAddress.setRecCreateDatetime(new Date());
      }
      CustomerAddress adddress = customer.getCustAddress();
      custAddress.setCustUseAddress(Constants.CUST_ADDRESS_USE_OWN);
      custAddress.setCustPrefix(adddress.getCustPrefix());
      custAddress.setCustFirstName(adddress.getCustFirstName());
      custAddress.setCustMiddleName(adddress.getCustMiddleName());
      custAddress.setCustLastName(adddress.getCustLastName());
      custAddress.setCustSuffix(adddress.getCustSuffix());
      custAddress.setCustAddressLine1(adddress.getCustAddressLine1());
      custAddress.setCustAddressLine2(adddress.getCustAddressLine2());
      custAddress.setCustCityName(adddress.getCustCityName());
      custAddress.setCustStateName(adddress.getCustStateName());
      custAddress.setCustStateCode(adddress.getCustStateCode());
      custAddress.setCustCountryName(adddress.getCustCountryName());
      custAddress.setCustCountryCode(adddress.getCustCountryCode());
      custAddress.setCustStateName(adddress.getCustStateName());
      custAddress.setCustZipCode(adddress.getCustZipCode());
      custAddress.setCustPhoneNum(adddress.getCustPhoneNum());
      custAddress.setCustFaxNum(adddress.getCustFaxNum());
      custAddress.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      custAddress.setRecUpdateDatetime(new Date());
      Country country = CountryDAO.loadByCountryCode(siteId, adddress.getCustCountryCode());
      custAddress.setCountry(country);
      if (adddress.getCustStateCode() != null) {
        State state = StateDAO.loadByStateCode(siteId, adddress.getCustStateCode());
        custAddress.setState(state);
      }
      em.persist(custAddress);
      orderHeader.setCustAddress(custAddress);
    }
   
    CustomerAddress billingAddress = shoppingCart.getBillingAddress();
    if (billingAddress != null) {
      OrderAddress address = null;
      if (orderHeader.getBillingAddress() != null) {
        address = orderHeader.getBillingAddress();
      }
      else {
        address = new OrderAddress();
        address.setRecCreateBy(Constants.USERNAME_SYSTEM);
        address.setRecCreateDatetime(new Date());
      }
      address.setCustUseAddress(billingAddress.getCustUseAddress());
      address.setCustPrefix(billingAddress.getCustPrefix());
      address.setCustFirstName(billingAddress.getCustFirstName());
      address.setCustMiddleName(billingAddress.getCustMiddleName());
      address.setCustLastName(billingAddress.getCustLastName());
      address.setCustSuffix(billingAddress.getCustSuffix());
      address.setCustAddressLine1(billingAddress.getCustAddressLine1());
      address.setCustAddressLine2(billingAddress.getCustAddressLine2());
      address.setCustCityName(billingAddress.getCustCityName());
      address.setCustStateName(billingAddress.getCustStateName());
      address.setCustStateCode(billingAddress.getCustStateCode());
      address.setCustCountryName(billingAddress.getCustCountryName());
      address.setCustCountryCode(billingAddress.getCustCountryCode());
      address.setCustStateName(billingAddress.getCustStateName());
      address.setCustZipCode(billingAddress.getCustZipCode());
      address.setCustPhoneNum(billingAddress.getCustPhoneNum());
      address.setCustFaxNum(billingAddress.getCustFaxNum());
      address.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      address.setRecUpdateDatetime(new Date());
      Country country = CountryDAO.loadByCountryCode(siteId, billingAddress.getCustCountryCode());
      address.setCountry(country);
      if (billingAddress.getCustStateCode() != null) {
        State state = StateDAO.loadByStateCode(siteId, billingAddress.getCustStateCode());
        address.setState(state);
      }
      em.persist(address);
      orderHeader.setBillingAddress(address);
    }
    CustomerAddress shippingAddress = shoppingCart.getShippingAddress();
    if (shippingAddress != null) {
      OrderAddress address = null;
      if (orderHeader.getShippingAddress() != null) {
        address = orderHeader.getShippingAddress();
      }
      else {
        address = new OrderAddress();
        address.setRecCreateBy(Constants.USERNAME_SYSTEM);
        address.setRecCreateDatetime(new Date());
      }
      address.setCustUseAddress(shippingAddress.getCustUseAddress());
      address.setCustPrefix(shippingAddress.getCustPrefix());
      address.setCustFirstName(shippingAddress.getCustFirstName());
      address.setCustMiddleName(shippingAddress.getCustMiddleName());
      address.setCustLastName(shippingAddress.getCustLastName());
      address.setCustSuffix(shippingAddress.getCustSuffix());
      address.setCustAddressLine1(shippingAddress.getCustAddressLine1());
      address.setCustAddressLine2(shippingAddress.getCustAddressLine2());
      address.setCustCityName(shippingAddress.getCustCityName());
      address.setCustStateName(shippingAddress.getCustStateName());
      address.setCustStateCode(shippingAddress.getCustStateCode());
      address.setCustCountryName(shippingAddress.getCustCountryName());
      address.setCustCountryCode(shippingAddress.getCustCountryCode());
      address.setCustStateName(shippingAddress.getCustStateName());
      address.setCustZipCode(shippingAddress.getCustZipCode());
      address.setCustPhoneNum(shippingAddress.getCustPhoneNum());
      address.setCustFaxNum(shippingAddress.getCustFaxNum());
      address.setRecUpdateBy(Constants.USERNAME_SYSTEM);
      address.setRecUpdateDatetime(new Date());
      Country country = CountryDAO.loadByCountryCode(siteId, shippingAddress.getCustCountryCode());
      address.setCountry(country);
      if (shippingAddress.getCustStateCode() != null) {
        State state = StateDAO.loadByStateCode(siteId, shippingAddress.getCustStateCode());
        address.setState(state);
      }
      em.persist(address);
      orderHeader.setShippingAddress(address);
    }
    if (customer != null) {
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.OrderAddress

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.