order history details
This commit is contained in:
@@ -10,14 +10,12 @@ import android.support.v4.widget.DrawerLayout;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Gravity;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -33,8 +31,8 @@ import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.adapter.recycler.NavigationMenuRecyclerAdapter;
|
||||
import ch.pizzalink.android.fragment.CartFragment;
|
||||
import ch.pizzalink.android.fragment.OrderHistoryFragment;
|
||||
import ch.pizzalink.android.fragment.StoreInfoFragment;
|
||||
import ch.pizzalink.android.fragment.HistoryFragment;
|
||||
import ch.pizzalink.android.fragment.MenuFragment;
|
||||
import ch.pizzalink.android.fragment.ProductFragment;
|
||||
import ch.pizzalink.android.fragment.ProfileFragment;
|
||||
@@ -45,8 +43,6 @@ import ch.pizzalink.android.view.PizzalinkToolbar;
|
||||
import io.github.luizgrp.sectionedrecyclerviewadapter.SectionParameters;
|
||||
import io.github.luizgrp.sectionedrecyclerviewadapter.SectionedRecyclerViewAdapter;
|
||||
import io.github.luizgrp.sectionedrecyclerviewadapter.StatelessSection;
|
||||
import q.rorbin.badgeview.Badge;
|
||||
import q.rorbin.badgeview.QBadgeView;
|
||||
|
||||
public class MainActivity extends BaseActivity {
|
||||
|
||||
@@ -204,10 +200,10 @@ public class MainActivity extends BaseActivity {
|
||||
return true;
|
||||
|
||||
case R.id.action_history:
|
||||
if (currentFragmentName.equals(HistoryFragment.FRAGMENT_NAME))
|
||||
if (currentFragmentName.equals(OrderHistoryFragment.FRAGMENT_NAME))
|
||||
return true;
|
||||
fragmentManager.beginTransaction().replace(R.id.fragmentContainer, HistoryFragment.newInstance()).commit();
|
||||
currentFragmentName = HistoryFragment.FRAGMENT_NAME;
|
||||
fragmentManager.beginTransaction().replace(R.id.fragmentContainer, OrderHistoryFragment.newInstance()).commit();
|
||||
currentFragmentName = OrderHistoryFragment.FRAGMENT_NAME;
|
||||
|
||||
currentCategoryId = -1;
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package ch.pizzalink.android.activity;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.helper.PriceHelper;
|
||||
import ch.pizzalink.android.model.OrderHistoryModel;
|
||||
import ch.pizzalink.android.view.PizzalinkInfoView;
|
||||
|
||||
public class OrderHistoryDetailsActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.orderDatePizzalinkInfoLayout) PizzalinkInfoView orderDatePizzalinkInfoLayout;
|
||||
@BindView(R.id.orderStatusPizzalinkInfoLayout) PizzalinkInfoView orderStatusPizzalinkInfoLayout;
|
||||
@BindView(R.id.orderShippingTimePizzalinkInfoLayout) PizzalinkInfoView orderShippingTimePizzalinkInfoLayout;
|
||||
@BindView(R.id.orderTotalPizzalinkInfoLayout) PizzalinkInfoView orderTotalPizzalinkInfoLayout;
|
||||
@BindView(R.id.orderPaymentMethodPizzalinkInfoLayout) PizzalinkInfoView orderPaymentMethodPizzalinkInfoLayout;
|
||||
@BindView(R.id.orderFullnamePizzalinkInfoLayout) PizzalinkInfoView orderFullnamePizzalinkInfoLayout;
|
||||
@BindView(R.id.orderShippingMethodPizzalinkInfoLayout) PizzalinkInfoView orderShippingMethodPizzalinkInfoLayout;
|
||||
@BindView(R.id.orderShippingAddressPizzalinkInfoLayout) PizzalinkInfoView orderShippingAddressPizzalinkInfoLayout;
|
||||
@BindView(R.id.orderNotePizzalinkInfoLayout) PizzalinkInfoView orderNotePizzalinkInfoLayout;
|
||||
|
||||
private OrderHistoryModel orderHistoryModel;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_order_history_details);
|
||||
ButterKnife.bind(this);
|
||||
getDataFromIntent();
|
||||
initViews();
|
||||
}
|
||||
|
||||
private void getDataFromIntent(){
|
||||
orderHistoryModel = (OrderHistoryModel) getIntent().getSerializableExtra("orderHistoryModel");
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
orderDatePizzalinkInfoLayout.setText(orderHistoryModel.getFormattedCreateDate());
|
||||
orderStatusPizzalinkInfoLayout.setText(orderHistoryModel.getStatus());
|
||||
if(orderHistoryModel.getShippingTime().isEmpty()){
|
||||
orderShippingTimePizzalinkInfoLayout.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
orderShippingTimePizzalinkInfoLayout.setText(orderHistoryModel.getShippingTime());
|
||||
}
|
||||
orderTotalPizzalinkInfoLayout.setText(PriceHelper.roundFractions(orderHistoryModel.getTotalString()));
|
||||
orderPaymentMethodPizzalinkInfoLayout.setText(orderHistoryModel.getPaymentMethod());
|
||||
orderFullnamePizzalinkInfoLayout.setText(orderHistoryModel.getFirstname() + " " + orderHistoryModel.getLastname());
|
||||
orderShippingMethodPizzalinkInfoLayout.setText(orderHistoryModel.getShippingMethod());
|
||||
orderShippingAddressPizzalinkInfoLayout.setText(createAddress());
|
||||
if(orderHistoryModel.getComment().isEmpty()){
|
||||
orderNotePizzalinkInfoLayout.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
orderNotePizzalinkInfoLayout.setText(orderHistoryModel.getComment());
|
||||
}
|
||||
}
|
||||
|
||||
private String createAddress(){
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder
|
||||
.append(orderHistoryModel.getFirstname())
|
||||
.append(" ")
|
||||
.append(orderHistoryModel.getLastname())
|
||||
.append("\n");
|
||||
|
||||
if(!orderHistoryModel.getPaymentAddress1().isEmpty()){
|
||||
stringBuilder
|
||||
.append(orderHistoryModel.getShippingAddress1())
|
||||
.append("\n");
|
||||
}
|
||||
|
||||
if(!orderHistoryModel.getShippingAddress2().isEmpty()){
|
||||
stringBuilder
|
||||
.append(orderHistoryModel.getShippingAddress2())
|
||||
.append("\n");
|
||||
}
|
||||
stringBuilder
|
||||
.append(orderHistoryModel.getShippingPostcode())
|
||||
.append(" ")
|
||||
.append(orderHistoryModel.getShippingCity())
|
||||
.append("\n")
|
||||
.append(orderHistoryModel.getShippingCountry());
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -14,7 +13,7 @@ import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.helper.PriceHelper;
|
||||
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
||||
import ch.pizzalink.android.model.OrderModel;
|
||||
import ch.pizzalink.android.model.OrderHistoryModel;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 04/10/2017.
|
||||
@@ -25,7 +24,7 @@ public class OrderHistoryRecyclerAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
private final int HOLDER_ORDER = 0;
|
||||
private final int HOLDER_SPACE = 1;
|
||||
|
||||
private ArrayList<OrderModel> orderHistoryList = new ArrayList<>();
|
||||
private ArrayList<OrderHistoryModel> orderHistoryList = new ArrayList<>();
|
||||
private RecyclerItemClickListener recyclerItemClickListener;
|
||||
|
||||
public static class OrderViewHolder extends RecyclerView.ViewHolder {
|
||||
@@ -37,6 +36,14 @@ public class OrderHistoryRecyclerAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
public OrderViewHolder(final View view, final RecyclerItemClickListener recyclerItemClickListener) {
|
||||
super(view);
|
||||
ButterKnife.bind(this, view);
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(recyclerItemClickListener != null){
|
||||
recyclerItemClickListener.onItemClick(view, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +62,7 @@ public class OrderHistoryRecyclerAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
return HOLDER_ORDER;
|
||||
}
|
||||
|
||||
public OrderHistoryRecyclerAdapter(ArrayList<OrderModel> orderHistoryList,
|
||||
public OrderHistoryRecyclerAdapter(ArrayList<OrderHistoryModel> orderHistoryList,
|
||||
RecyclerItemClickListener recyclerItemClickListener){
|
||||
this.orderHistoryList = orderHistoryList;
|
||||
this.recyclerItemClickListener = recyclerItemClickListener;
|
||||
@@ -113,11 +120,11 @@ public class OrderHistoryRecyclerAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
return orderHistoryList.size() + 1 ;
|
||||
}
|
||||
|
||||
private String createOrderInfoText(OrderModel orderModel){
|
||||
private String createOrderInfoText(OrderHistoryModel orderHistoryModel){
|
||||
return new StringBuilder()
|
||||
.append(orderModel.getFormattedCreateDate())
|
||||
.append(orderHistoryModel.getFormattedCreateDate())
|
||||
.append("\n\n")
|
||||
.append(orderModel.getStatus())
|
||||
.append(orderHistoryModel.getStatus())
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import ch.pizzalink.android.model.CityModel;
|
||||
import ch.pizzalink.android.model.ZoneModel;
|
||||
import ch.pizzalink.android.model.cart.CartInfoModel;
|
||||
import ch.pizzalink.android.model.CategoryModel;
|
||||
import ch.pizzalink.android.model.OrderModel;
|
||||
import ch.pizzalink.android.model.OrderHistoryModel;
|
||||
import ch.pizzalink.android.model.UserModel;
|
||||
import ch.pizzalink.android.model.menu.MenuProductModel;
|
||||
import retrofit2.Call;
|
||||
@@ -53,7 +53,7 @@ public interface ApiInterface {
|
||||
Call<ResponseObject> logout(@Field("token") String customerToken);
|
||||
|
||||
@GET(ApiEndPoints.API_GET_ORDER_HISTORY)
|
||||
Call<ResponseArray<OrderModel>> getOrderHistory(@Query("token") String token);
|
||||
Call<ResponseArray<OrderHistoryModel>> getOrderHistory(@Query("token") String token);
|
||||
|
||||
@GET(ApiEndPoints.API_GET_CART_PRODUCTS)
|
||||
Call<ResponseObject<CartInfoModel>> getCartProducts(@Query("token") String token);
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
package ch.pizzalink.android.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
import butterknife.BindString;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import ch.pizzalink.android.R;
|
||||
import ch.pizzalink.android.activity.BaseActivity;
|
||||
import ch.pizzalink.android.activity.OrderHistoryDetailsActivity;
|
||||
import ch.pizzalink.android.adapter.recycler.OrderHistoryRecyclerAdapter;
|
||||
import ch.pizzalink.android.api.ApiErrorUtils;
|
||||
import ch.pizzalink.android.api.ApiService;
|
||||
@@ -24,7 +23,7 @@ import ch.pizzalink.android.api.ResponseArray;
|
||||
import ch.pizzalink.android.helper.DialogHelper;
|
||||
import ch.pizzalink.android.helper.SessionHelper;
|
||||
import ch.pizzalink.android.interfaces.RecyclerItemClickListener;
|
||||
import ch.pizzalink.android.model.OrderModel;
|
||||
import ch.pizzalink.android.model.OrderHistoryModel;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -33,7 +32,7 @@ import retrofit2.Response;
|
||||
* Created by cimenmus on 20/09/2017.
|
||||
*/
|
||||
|
||||
public class HistoryFragment extends BaseFragment {
|
||||
public class OrderHistoryFragment extends BaseFragment {
|
||||
|
||||
@BindView(R.id.orderHistoryRecyclerView) RecyclerView orderHistoryRecyclerView;
|
||||
|
||||
@@ -41,13 +40,13 @@ public class HistoryFragment extends BaseFragment {
|
||||
|
||||
public static final java.lang.String FRAGMENT_NAME = "historyFragment";
|
||||
|
||||
private ArrayList<OrderModel> orderHistoryList = new ArrayList<>();
|
||||
private ArrayList<OrderHistoryModel> orderHistoryList = new ArrayList<>();
|
||||
private OrderHistoryRecyclerAdapter orderHistoryRecyclerAdapter;
|
||||
|
||||
public HistoryFragment() {}
|
||||
public OrderHistoryFragment() {}
|
||||
|
||||
public static HistoryFragment newInstance() {
|
||||
return new HistoryFragment();
|
||||
public static OrderHistoryFragment newInstance() {
|
||||
return new OrderHistoryFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +56,7 @@ public class HistoryFragment extends BaseFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_history, container, false);
|
||||
View view = inflater.inflate(R.layout.fragment_order_history, container, false);
|
||||
ButterKnife.bind(this, view);
|
||||
initViews();
|
||||
getOrderHistory();
|
||||
@@ -73,7 +72,9 @@ public class HistoryFragment extends BaseFragment {
|
||||
orderHistoryRecyclerAdapter = new OrderHistoryRecyclerAdapter(orderHistoryList, new RecyclerItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
|
||||
Intent orderHistoryDetailsIntent = new Intent(BaseActivity.currentActivity, OrderHistoryDetailsActivity.class);
|
||||
orderHistoryDetailsIntent.putExtra("orderHistoryModel", orderHistoryList.get(position));
|
||||
startActivity(orderHistoryDetailsIntent);
|
||||
}
|
||||
});
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(BaseActivity.currentActivity);
|
||||
@@ -112,11 +113,11 @@ public class HistoryFragment extends BaseFragment {
|
||||
|
||||
private void getOrderHistory(){
|
||||
DialogHelper.showLoadingDialog();
|
||||
Call<ResponseArray<OrderModel>> call = ApiService.apiInterface.
|
||||
Call<ResponseArray<OrderHistoryModel>> call = ApiService.apiInterface.
|
||||
getOrderHistory(SessionHelper.getCustomerToken().getToken());
|
||||
call.enqueue(new Callback<ResponseArray<OrderModel>>() {
|
||||
call.enqueue(new Callback<ResponseArray<OrderHistoryModel>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseArray<OrderModel>> call, Response<ResponseArray<OrderModel>> response) {
|
||||
public void onResponse(Call<ResponseArray<OrderHistoryModel>> call, Response<ResponseArray<OrderHistoryModel>> response) {
|
||||
DialogHelper.hideLoadingDialog();
|
||||
if(response.isSuccessful() &&
|
||||
response.body().getData() != null &&
|
||||
@@ -127,15 +128,15 @@ public class HistoryFragment extends BaseFragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ResponseArray<OrderModel>> call, Throwable t) {
|
||||
public void onFailure(Call<ResponseArray<OrderHistoryModel>> call, Throwable t) {
|
||||
DialogHelper.hideLoadingDialog();
|
||||
DialogHelper.showFailedDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void fillAndNotifyOrderHistoryList(ArrayList<OrderModel> orderList){
|
||||
OrderModel.checkNull(orderList);
|
||||
private void fillAndNotifyOrderHistoryList(ArrayList<OrderHistoryModel> orderList){
|
||||
OrderHistoryModel.checkNull(orderList);
|
||||
orderHistoryList.clear();
|
||||
orderHistoryList.addAll(orderList);
|
||||
orderHistoryRecyclerAdapter.notifyDataSetChanged();
|
||||
@@ -0,0 +1,759 @@
|
||||
package ch.pizzalink.android.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import ch.pizzalink.android.helper.DateTimeHelper;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 04/10/2017.
|
||||
*/public class OrderHistoryModel implements Serializable {
|
||||
|
||||
@SerializedName("order_id")
|
||||
@Expose
|
||||
private String id;
|
||||
@SerializedName("invoice_no")
|
||||
@Expose
|
||||
private String invoiceNo;
|
||||
@SerializedName("invoice_prefix")
|
||||
@Expose
|
||||
private String invoicePrefix;
|
||||
@SerializedName("store_id")
|
||||
@Expose
|
||||
private String storeId;
|
||||
@SerializedName("store_name")
|
||||
@Expose
|
||||
private String storeName;
|
||||
@SerializedName("store_url")
|
||||
@Expose
|
||||
private String storeUrl;
|
||||
@SerializedName("customer_id")
|
||||
@Expose
|
||||
private String customerId;
|
||||
@SerializedName("customer_group_id")
|
||||
@Expose
|
||||
private String customerGroupId;
|
||||
@SerializedName("firstname")
|
||||
@Expose
|
||||
private String firstname;
|
||||
@SerializedName("lastname")
|
||||
@Expose
|
||||
private String lastname;
|
||||
@SerializedName("email")
|
||||
@Expose
|
||||
private String email;
|
||||
@SerializedName("telephone")
|
||||
@Expose
|
||||
private String telephone;
|
||||
@SerializedName("fax")
|
||||
@Expose
|
||||
private String fax;
|
||||
@SerializedName("custom_field")
|
||||
@Expose
|
||||
private String customField;
|
||||
@SerializedName("payment_firstname")
|
||||
@Expose
|
||||
private String paymentFirstname;
|
||||
@SerializedName("payment_lastname")
|
||||
@Expose
|
||||
private String paymentLastname;
|
||||
@SerializedName("payment_company")
|
||||
@Expose
|
||||
private String paymentCompany;
|
||||
@SerializedName("payment_address_1")
|
||||
@Expose
|
||||
private String paymentAddress1;
|
||||
@SerializedName("payment_address_2")
|
||||
@Expose
|
||||
private String paymentAddress2;
|
||||
@SerializedName("payment_city")
|
||||
@Expose
|
||||
private String paymentCity;
|
||||
@SerializedName("payment_postcode")
|
||||
@Expose
|
||||
private String paymentPostcode;
|
||||
@SerializedName("payment_country")
|
||||
@Expose
|
||||
private String paymentCountry;
|
||||
@SerializedName("payment_country_id")
|
||||
@Expose
|
||||
private String paymentCountryId;
|
||||
@SerializedName("payment_zone")
|
||||
@Expose
|
||||
private String paymentZone;
|
||||
@SerializedName("payment_zone_id")
|
||||
@Expose
|
||||
private String paymentZoneId;
|
||||
@SerializedName("payment_address_format")
|
||||
@Expose
|
||||
private String paymentAddressFormat;
|
||||
@SerializedName("payment_custom_field")
|
||||
@Expose
|
||||
private String paymentCustomField;
|
||||
@SerializedName("payment_method")
|
||||
@Expose
|
||||
private String paymentMethod;
|
||||
@SerializedName("payment_code")
|
||||
@Expose
|
||||
private String paymentCode;
|
||||
@SerializedName("shipping_firstname")
|
||||
@Expose
|
||||
private String shippingFirstname;
|
||||
@SerializedName("shipping_lastname")
|
||||
@Expose
|
||||
private String shippingLastname;
|
||||
@SerializedName("shipping_company")
|
||||
@Expose
|
||||
private String shippingCompany;
|
||||
@SerializedName("shipping_address_1")
|
||||
@Expose
|
||||
private String shippingAddress1;
|
||||
@SerializedName("shipping_address_2")
|
||||
@Expose
|
||||
private String shippingAddress2;
|
||||
@SerializedName("shipping_city")
|
||||
@Expose
|
||||
private String shippingCity;
|
||||
@SerializedName("shipping_postcode")
|
||||
@Expose
|
||||
private String shippingPostcode;
|
||||
@SerializedName("shipping_country")
|
||||
@Expose
|
||||
private String shippingCountry;
|
||||
@SerializedName("shipping_country_id")
|
||||
@Expose
|
||||
private String shippingCountryId;
|
||||
@SerializedName("shipping_zone")
|
||||
@Expose
|
||||
private String shippingZone;
|
||||
@SerializedName("shipping_zone_id")
|
||||
@Expose
|
||||
private String shippingZoneId;
|
||||
@SerializedName("shipping_address_format")
|
||||
@Expose
|
||||
private String shippingAddressFormat;
|
||||
@SerializedName("shipping_custom_field")
|
||||
@Expose
|
||||
private String shippingCustomField;
|
||||
@SerializedName("shipping_method")
|
||||
@Expose
|
||||
private String shippingMethod;
|
||||
@SerializedName("shipping_code")
|
||||
@Expose
|
||||
private String shippingCode;
|
||||
@SerializedName("comment")
|
||||
@Expose
|
||||
private String comment;
|
||||
@SerializedName("total")
|
||||
@Expose
|
||||
private String total;
|
||||
@SerializedName("order_status_id")
|
||||
@Expose
|
||||
private String orderStatusId;
|
||||
@SerializedName("affiliate_id")
|
||||
@Expose
|
||||
private String affiliateId;
|
||||
@SerializedName("commission")
|
||||
@Expose
|
||||
private String commission;
|
||||
@SerializedName("marketing_id")
|
||||
@Expose
|
||||
private String marketingId;
|
||||
@SerializedName("tracking")
|
||||
@Expose
|
||||
private String tracking;
|
||||
@SerializedName("language_id")
|
||||
@Expose
|
||||
private String languageId;
|
||||
@SerializedName("currency_id")
|
||||
@Expose
|
||||
private String currencyId;
|
||||
@SerializedName("currency_code")
|
||||
@Expose
|
||||
private String currencyCode;
|
||||
@SerializedName("currency_value")
|
||||
@Expose
|
||||
private String currencyValue;
|
||||
@SerializedName("ip")
|
||||
@Expose
|
||||
private String ip;
|
||||
@SerializedName("forwarded_ip")
|
||||
@Expose
|
||||
private String forwardedIp;
|
||||
@SerializedName("user_agent")
|
||||
@Expose
|
||||
private String userAgent;
|
||||
@SerializedName("accept_language")
|
||||
@Expose
|
||||
private String acceptLanguage;
|
||||
@SerializedName("date_added")
|
||||
@Expose
|
||||
private String createDate;
|
||||
@SerializedName("date_modified")
|
||||
@Expose
|
||||
private String dateModified;
|
||||
@SerializedName("shipping_time")
|
||||
@Expose
|
||||
private String shippingTime;
|
||||
@SerializedName("status")
|
||||
@Expose
|
||||
private String status;
|
||||
|
||||
public int getTotalInt(){
|
||||
try {
|
||||
return Integer.valueOf(total);
|
||||
}catch (Exception e){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTotalString(){
|
||||
return currencyCode + " " + total;
|
||||
}
|
||||
|
||||
public String getFormattedCreateDate(){
|
||||
return DateTimeHelper.getFormattedDateFromDateString(createDate);
|
||||
}
|
||||
|
||||
private void checkNull(){
|
||||
|
||||
if(id == null)
|
||||
id = "";
|
||||
|
||||
if(createDate == null)
|
||||
createDate = "";
|
||||
|
||||
if(currencyCode == null)
|
||||
currencyCode = "";
|
||||
|
||||
if(currencyValue == null)
|
||||
currencyValue = "";
|
||||
|
||||
if(firstname == null)
|
||||
firstname = "";
|
||||
|
||||
if(lastname == null)
|
||||
lastname = "";
|
||||
|
||||
if(status == null)
|
||||
status = "";
|
||||
|
||||
if(total == null)
|
||||
total = "";
|
||||
}
|
||||
|
||||
public static void checkNull(ArrayList<OrderHistoryModel> orderHistoryList){
|
||||
for(OrderHistoryModel orderHistoryModel : orderHistoryList){
|
||||
orderHistoryModel.checkNull();
|
||||
}
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInvoiceNo() {
|
||||
return invoiceNo;
|
||||
}
|
||||
|
||||
public void setInvoiceNo(String invoiceNo) {
|
||||
this.invoiceNo = invoiceNo;
|
||||
}
|
||||
|
||||
public String getInvoicePrefix() {
|
||||
return invoicePrefix;
|
||||
}
|
||||
|
||||
public void setInvoicePrefix(String invoicePrefix) {
|
||||
this.invoicePrefix = invoicePrefix;
|
||||
}
|
||||
|
||||
public String getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(String storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public String getStoreName() {
|
||||
return storeName;
|
||||
}
|
||||
|
||||
public void setStoreName(String storeName) {
|
||||
this.storeName = storeName;
|
||||
}
|
||||
|
||||
public String getStoreUrl() {
|
||||
return storeUrl;
|
||||
}
|
||||
|
||||
public void setStoreUrl(String storeUrl) {
|
||||
this.storeUrl = storeUrl;
|
||||
}
|
||||
|
||||
public String getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setCustomerId(String customerId) {
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public String getCustomerGroupId() {
|
||||
return customerGroupId;
|
||||
}
|
||||
|
||||
public void setCustomerGroupId(String customerGroupId) {
|
||||
this.customerGroupId = customerGroupId;
|
||||
}
|
||||
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
|
||||
public void setFirstname(String firstname) {
|
||||
this.firstname = firstname;
|
||||
}
|
||||
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
|
||||
public void setLastname(String lastname) {
|
||||
this.lastname = lastname;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getTelephone() {
|
||||
return telephone;
|
||||
}
|
||||
|
||||
public void setTelephone(String telephone) {
|
||||
this.telephone = telephone;
|
||||
}
|
||||
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public void setFax(String fax) {
|
||||
this.fax = fax;
|
||||
}
|
||||
|
||||
public String getCustomField() {
|
||||
return customField;
|
||||
}
|
||||
|
||||
public void setCustomField(String customField) {
|
||||
this.customField = customField;
|
||||
}
|
||||
|
||||
public String getPaymentFirstname() {
|
||||
return paymentFirstname;
|
||||
}
|
||||
|
||||
public void setPaymentFirstname(String paymentFirstname) {
|
||||
this.paymentFirstname = paymentFirstname;
|
||||
}
|
||||
|
||||
public String getPaymentLastname() {
|
||||
return paymentLastname;
|
||||
}
|
||||
|
||||
public void setPaymentLastname(String paymentLastname) {
|
||||
this.paymentLastname = paymentLastname;
|
||||
}
|
||||
|
||||
public String getPaymentCompany() {
|
||||
return paymentCompany;
|
||||
}
|
||||
|
||||
public void setPaymentCompany(String paymentCompany) {
|
||||
this.paymentCompany = paymentCompany;
|
||||
}
|
||||
|
||||
public String getPaymentAddress1() {
|
||||
return paymentAddress1;
|
||||
}
|
||||
|
||||
public void setPaymentAddress1(String paymentAddress1) {
|
||||
this.paymentAddress1 = paymentAddress1;
|
||||
}
|
||||
|
||||
public String getPaymentAddress2() {
|
||||
return paymentAddress2;
|
||||
}
|
||||
|
||||
public void setPaymentAddress2(String paymentAddress2) {
|
||||
this.paymentAddress2 = paymentAddress2;
|
||||
}
|
||||
|
||||
public String getPaymentCity() {
|
||||
return paymentCity;
|
||||
}
|
||||
|
||||
public void setPaymentCity(String paymentCity) {
|
||||
this.paymentCity = paymentCity;
|
||||
}
|
||||
|
||||
public String getPaymentPostcode() {
|
||||
return paymentPostcode;
|
||||
}
|
||||
|
||||
public void setPaymentPostcode(String paymentPostcode) {
|
||||
this.paymentPostcode = paymentPostcode;
|
||||
}
|
||||
|
||||
public String getPaymentCountry() {
|
||||
return paymentCountry;
|
||||
}
|
||||
|
||||
public void setPaymentCountry(String paymentCountry) {
|
||||
this.paymentCountry = paymentCountry;
|
||||
}
|
||||
|
||||
public String getPaymentCountryId() {
|
||||
return paymentCountryId;
|
||||
}
|
||||
|
||||
public void setPaymentCountryId(String paymentCountryId) {
|
||||
this.paymentCountryId = paymentCountryId;
|
||||
}
|
||||
|
||||
public String getPaymentZone() {
|
||||
return paymentZone;
|
||||
}
|
||||
|
||||
public void setPaymentZone(String paymentZone) {
|
||||
this.paymentZone = paymentZone;
|
||||
}
|
||||
|
||||
public String getPaymentZoneId() {
|
||||
return paymentZoneId;
|
||||
}
|
||||
|
||||
public void setPaymentZoneId(String paymentZoneId) {
|
||||
this.paymentZoneId = paymentZoneId;
|
||||
}
|
||||
|
||||
public String getPaymentAddressFormat() {
|
||||
return paymentAddressFormat;
|
||||
}
|
||||
|
||||
public void setPaymentAddressFormat(String paymentAddressFormat) {
|
||||
this.paymentAddressFormat = paymentAddressFormat;
|
||||
}
|
||||
|
||||
public String getPaymentCustomField() {
|
||||
return paymentCustomField;
|
||||
}
|
||||
|
||||
public void setPaymentCustomField(String paymentCustomField) {
|
||||
this.paymentCustomField = paymentCustomField;
|
||||
}
|
||||
|
||||
public String getPaymentMethod() {
|
||||
return paymentMethod;
|
||||
}
|
||||
|
||||
public void setPaymentMethod(String paymentMethod) {
|
||||
this.paymentMethod = paymentMethod;
|
||||
}
|
||||
|
||||
public String getPaymentCode() {
|
||||
return paymentCode;
|
||||
}
|
||||
|
||||
public void setPaymentCode(String paymentCode) {
|
||||
this.paymentCode = paymentCode;
|
||||
}
|
||||
|
||||
public String getShippingFirstname() {
|
||||
return shippingFirstname;
|
||||
}
|
||||
|
||||
public void setShippingFirstname(String shippingFirstname) {
|
||||
this.shippingFirstname = shippingFirstname;
|
||||
}
|
||||
|
||||
public String getShippingLastname() {
|
||||
return shippingLastname;
|
||||
}
|
||||
|
||||
public void setShippingLastname(String shippingLastname) {
|
||||
this.shippingLastname = shippingLastname;
|
||||
}
|
||||
|
||||
public String getShippingCompany() {
|
||||
return shippingCompany;
|
||||
}
|
||||
|
||||
public void setShippingCompany(String shippingCompany) {
|
||||
this.shippingCompany = shippingCompany;
|
||||
}
|
||||
|
||||
public String getShippingAddress1() {
|
||||
return shippingAddress1;
|
||||
}
|
||||
|
||||
public void setShippingAddress1(String shippingAddress1) {
|
||||
this.shippingAddress1 = shippingAddress1;
|
||||
}
|
||||
|
||||
public String getShippingAddress2() {
|
||||
return shippingAddress2;
|
||||
}
|
||||
|
||||
public void setShippingAddress2(String shippingAddress2) {
|
||||
this.shippingAddress2 = shippingAddress2;
|
||||
}
|
||||
|
||||
public String getShippingCity() {
|
||||
return shippingCity;
|
||||
}
|
||||
|
||||
public void setShippingCity(String shippingCity) {
|
||||
this.shippingCity = shippingCity;
|
||||
}
|
||||
|
||||
public String getShippingPostcode() {
|
||||
return shippingPostcode;
|
||||
}
|
||||
|
||||
public void setShippingPostcode(String shippingPostcode) {
|
||||
this.shippingPostcode = shippingPostcode;
|
||||
}
|
||||
|
||||
public String getShippingCountry() {
|
||||
return shippingCountry;
|
||||
}
|
||||
|
||||
public void setShippingCountry(String shippingCountry) {
|
||||
this.shippingCountry = shippingCountry;
|
||||
}
|
||||
|
||||
public String getShippingCountryId() {
|
||||
return shippingCountryId;
|
||||
}
|
||||
|
||||
public void setShippingCountryId(String shippingCountryId) {
|
||||
this.shippingCountryId = shippingCountryId;
|
||||
}
|
||||
|
||||
public String getShippingZone() {
|
||||
return shippingZone;
|
||||
}
|
||||
|
||||
public void setShippingZone(String shippingZone) {
|
||||
this.shippingZone = shippingZone;
|
||||
}
|
||||
|
||||
public String getShippingZoneId() {
|
||||
return shippingZoneId;
|
||||
}
|
||||
|
||||
public void setShippingZoneId(String shippingZoneId) {
|
||||
this.shippingZoneId = shippingZoneId;
|
||||
}
|
||||
|
||||
public String getShippingAddressFormat() {
|
||||
return shippingAddressFormat;
|
||||
}
|
||||
|
||||
public void setShippingAddressFormat(String shippingAddressFormat) {
|
||||
this.shippingAddressFormat = shippingAddressFormat;
|
||||
}
|
||||
|
||||
public String getShippingCustomField() {
|
||||
return shippingCustomField;
|
||||
}
|
||||
|
||||
public void setShippingCustomField(String shippingCustomField) {
|
||||
this.shippingCustomField = shippingCustomField;
|
||||
}
|
||||
|
||||
public String getShippingMethod() {
|
||||
return shippingMethod;
|
||||
}
|
||||
|
||||
public void setShippingMethod(String shippingMethod) {
|
||||
this.shippingMethod = shippingMethod;
|
||||
}
|
||||
|
||||
public String getShippingCode() {
|
||||
return shippingCode;
|
||||
}
|
||||
|
||||
public void setShippingCode(String shippingCode) {
|
||||
this.shippingCode = shippingCode;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public String getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(String total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public String getOrderStatusId() {
|
||||
return orderStatusId;
|
||||
}
|
||||
|
||||
public void setOrderStatusId(String orderStatusId) {
|
||||
this.orderStatusId = orderStatusId;
|
||||
}
|
||||
|
||||
public String getAffiliateId() {
|
||||
return affiliateId;
|
||||
}
|
||||
|
||||
public void setAffiliateId(String affiliateId) {
|
||||
this.affiliateId = affiliateId;
|
||||
}
|
||||
|
||||
public String getCommission() {
|
||||
return commission;
|
||||
}
|
||||
|
||||
public void setCommission(String commission) {
|
||||
this.commission = commission;
|
||||
}
|
||||
|
||||
public String getMarketingId() {
|
||||
return marketingId;
|
||||
}
|
||||
|
||||
public void setMarketingId(String marketingId) {
|
||||
this.marketingId = marketingId;
|
||||
}
|
||||
|
||||
public String getTracking() {
|
||||
return tracking;
|
||||
}
|
||||
|
||||
public void setTracking(String tracking) {
|
||||
this.tracking = tracking;
|
||||
}
|
||||
|
||||
public String getLanguageId() {
|
||||
return languageId;
|
||||
}
|
||||
|
||||
public void setLanguageId(String languageId) {
|
||||
this.languageId = languageId;
|
||||
}
|
||||
|
||||
public String getCurrencyId() {
|
||||
return currencyId;
|
||||
}
|
||||
|
||||
public void setCurrencyId(String currencyId) {
|
||||
this.currencyId = currencyId;
|
||||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
return currencyCode;
|
||||
}
|
||||
|
||||
public void setCurrencyCode(String currencyCode) {
|
||||
this.currencyCode = currencyCode;
|
||||
}
|
||||
|
||||
public String getCurrencyValue() {
|
||||
return currencyValue;
|
||||
}
|
||||
|
||||
public void setCurrencyValue(String currencyValue) {
|
||||
this.currencyValue = currencyValue;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public String getForwardedIp() {
|
||||
return forwardedIp;
|
||||
}
|
||||
|
||||
public void setForwardedIp(String forwardedIp) {
|
||||
this.forwardedIp = forwardedIp;
|
||||
}
|
||||
|
||||
public String getUserAgent() {
|
||||
return userAgent;
|
||||
}
|
||||
|
||||
public void setUserAgent(String userAgent) {
|
||||
this.userAgent = userAgent;
|
||||
}
|
||||
|
||||
public String getAcceptLanguage() {
|
||||
return acceptLanguage;
|
||||
}
|
||||
|
||||
public void setAcceptLanguage(String acceptLanguage) {
|
||||
this.acceptLanguage = acceptLanguage;
|
||||
}
|
||||
|
||||
public String getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
||||
public void setCreateDate(String createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
public String getDateModified() {
|
||||
return dateModified;
|
||||
}
|
||||
|
||||
public void setDateModified(String dateModified) {
|
||||
this.dateModified = dateModified;
|
||||
}
|
||||
|
||||
public String getShippingTime() {
|
||||
return shippingTime;
|
||||
}
|
||||
|
||||
public void setShippingTime(String shippingTime) {
|
||||
this.shippingTime = shippingTime;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
package ch.pizzalink.android.model;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import ch.pizzalink.android.helper.DateTimeHelper;
|
||||
|
||||
/**
|
||||
* Created by cimenmus on 04/10/2017.
|
||||
*/
|
||||
|
||||
public class OrderModel {
|
||||
|
||||
@Expose @SerializedName("order_id") private String id;
|
||||
@Expose @SerializedName("date_added") private String createDate;
|
||||
@Expose @SerializedName("currency_code") private String currencyCode;
|
||||
@Expose @SerializedName("currency_value") private String currencyValue;
|
||||
private String firstname;
|
||||
private String lastname;
|
||||
private String status;
|
||||
private String total;
|
||||
|
||||
public int getTotalInt(){
|
||||
try {
|
||||
return Integer.valueOf(total);
|
||||
}catch (Exception e){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTotalString(){
|
||||
return currencyCode + " " + total;
|
||||
}
|
||||
|
||||
public String getFormattedCreateDate(){
|
||||
return DateTimeHelper.getFormattedDateFromDateString(createDate);
|
||||
}
|
||||
|
||||
private void checkNull(){
|
||||
|
||||
if(id == null)
|
||||
id = "";
|
||||
|
||||
if(createDate == null)
|
||||
createDate = "";
|
||||
|
||||
if(currencyCode == null)
|
||||
currencyCode = "";
|
||||
|
||||
if(currencyValue == null)
|
||||
currencyValue = "";
|
||||
|
||||
if(firstname == null)
|
||||
firstname = "";
|
||||
|
||||
if(lastname == null)
|
||||
lastname = "";
|
||||
|
||||
if(status == null)
|
||||
status = "";
|
||||
|
||||
if(total == null)
|
||||
total = "";
|
||||
}
|
||||
|
||||
public static void checkNull(ArrayList<OrderModel> orderHistoryList){
|
||||
for(OrderModel orderModel : orderHistoryList){
|
||||
orderModel.checkNull();
|
||||
}
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
|
||||
public void setFirstname(String firstname) {
|
||||
this.firstname = firstname;
|
||||
}
|
||||
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
|
||||
public void setLastname(String lastname) {
|
||||
this.lastname = lastname;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCurrencyCode() {
|
||||
return currencyCode;
|
||||
}
|
||||
|
||||
public void setCurrency_code(String currencyCode) {
|
||||
this.currencyCode = currencyCode;
|
||||
}
|
||||
|
||||
public String getCurrencyValue() {
|
||||
return currencyValue;
|
||||
}
|
||||
|
||||
public void setCurrencyValue(String currencyValue) {
|
||||
this.currencyValue = currencyValue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user