Commit bef3835b authored by iman Fauzi's avatar iman Fauzi

💣 fix conflict

parents 11ad115d f808c3ba
...@@ -25,9 +25,12 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment; ...@@ -25,9 +25,12 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.yono.messeripos.api.client.Client; import com.yono.messeripos.api.client.Client;
import com.yono.messeripos.api.service.PaymentService; import com.yono.messeripos.api.service.PaymentService;
import com.yono.messeripos.models.PaymentsModels; import com.yono.messeripos.models.PaymentsModels;
import com.yono.messeripos.models.VaNumberModels;
import com.yono.messeripos.response.DataResponse; import com.yono.messeripos.response.DataResponse;
import com.yono.messeripos.utils.Utils; import com.yono.messeripos.utils.Utils;
import java.util.List;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
...@@ -67,8 +70,7 @@ public class BottomSheets extends BottomSheetDialogFragment { ...@@ -67,8 +70,7 @@ public class BottomSheets extends BottomSheetDialogFragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable public View onCreateView(LayoutInflater inflater, @Nullable
ViewGroup container, @Nullable Bundle savedInstanceState) ViewGroup container, @Nullable Bundle savedInstanceState) {
{
View v = inflater.inflate(R.layout.activity_bottom_sheets, View v = inflater.inflate(R.layout.activity_bottom_sheets,
container, false); container, false);
...@@ -79,12 +81,12 @@ public class BottomSheets extends BottomSheetDialogFragment { ...@@ -79,12 +81,12 @@ public class BottomSheets extends BottomSheetDialogFragment {
btnCash = v.findViewById(R.id.btnCash); btnCash = v.findViewById(R.id.btnCash);
totalHarga = v.findViewById(R.id.totalHarga); totalHarga = v.findViewById(R.id.totalHarga);
utils = new Utils(); utils = new Utils();
btnCash.setEnabled(false); btnCash.setEnabled(false);
// bottomSheetBehavior = BottomSheetBehavior.from(layoutFormCash); // bottomSheetBehavior = BottomSheetBehavior.from(layoutFormCash);
sharedPreferences = getActivity().getSharedPreferences(MainActivity.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE); sharedPreferences = getActivity().getSharedPreferences(MainActivity.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE);
// bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); // bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
long ga = paymentsModels.getGrossAmount(); long ga = paymentsModels.getGrossAmount();
String setCurrency = utils.convertPrice("Rp.", ga); String setCurrency = utils.convertPrice("Rp.", ga);
...@@ -130,11 +132,11 @@ public class BottomSheets extends BottomSheetDialogFragment { ...@@ -130,11 +132,11 @@ public class BottomSheets extends BottomSheetDialogFragment {
grossAmount = paymentsModels.getGrossAmount(); grossAmount = paymentsModels.getGrossAmount();
input = Long.parseLong(inputAmount.getText().toString()); input = Long.parseLong(inputAmount.getText().toString());
result = input-grossAmount; result = input - grossAmount;
if (result > 0) { if (result > 0) {
btnCash.setEnabled(true); btnCash.setEnabled(true);
}else { } else {
btnCash.setEnabled(false); btnCash.setEnabled(false);
} }
...@@ -163,26 +165,25 @@ public class BottomSheets extends BottomSheetDialogFragment { ...@@ -163,26 +165,25 @@ public class BottomSheets extends BottomSheetDialogFragment {
); );
PaymentService paymentService = client.Client(PaymentService.class); PaymentService paymentService = client.Client(PaymentService.class);
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels>>() {
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels>>() { @Override
@Override public void onResponse(Call<DataResponse<PaymentsModels>> call, Response<DataResponse<PaymentsModels>> response) {
public void onResponse(Call<DataResponse<PaymentsModels>> call, Response<DataResponse<PaymentsModels>> response) { Log.i("CASH", "onResponse: " + utils.convertGson(response.body()));
Log.i("CASH", "onResponse: " + utils.convertGson(response.body())); if (response.body() != null) {
if (response.body() != null) { SharedPreferences.Editor editor = PaymentActivity.sharedPreferences.edit();
SharedPreferences.Editor editor = PaymentActivity.sharedPreferences.edit(); editor.putBoolean(CHECKOUT, false);
editor.putBoolean(CHECKOUT, false); editor.putString(ORDER_ID, "");
editor.putString(ORDER_ID, ""); if (editor.commit()) {
if (editor.commit()) { Intent i = new Intent(getActivity(), MainActivity.class);
Intent i = new Intent(getActivity(), MainActivity.class); view.getContext().startActivity(i);
view.getContext().startActivity(i);
}
} }
} }
@Override }
public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) {
} @Override
}); public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) {
} }
} });
}
}
\ No newline at end of file
...@@ -34,6 +34,7 @@ import com.yono.messeripos.models.MainViewModelsCart; ...@@ -34,6 +34,7 @@ import com.yono.messeripos.models.MainViewModelsCart;
import com.yono.messeripos.models.PaymentsModels; import com.yono.messeripos.models.PaymentsModels;
import com.yono.messeripos.models.ProductCartModels; import com.yono.messeripos.models.ProductCartModels;
import com.yono.messeripos.models.ProductModels; import com.yono.messeripos.models.ProductModels;
import com.yono.messeripos.models.VaNumberModels;
import com.yono.messeripos.response.DataResponse; import com.yono.messeripos.response.DataResponse;
import com.yono.messeripos.response.OrdersResponse; import com.yono.messeripos.response.OrdersResponse;
import com.yono.messeripos.utils.Utils; import com.yono.messeripos.utils.Utils;
...@@ -238,9 +239,9 @@ public class CartActivity extends AppCompatActivity { ...@@ -238,9 +239,9 @@ public class CartActivity extends AppCompatActivity {
paymentsModels.setTransactionStatus("pending"); paymentsModels.setTransactionStatus("pending");
Log.i("Convert Input", "onChanged: "+utils.convertGson(paymentsModels)); Log.i("Convert Input", "onChanged: "+utils.convertGson(paymentsModels));
PaymentService paymentService = client.Client(PaymentService.class); PaymentService paymentService = client.Client(PaymentService.class);
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels>>() { paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
@Override @Override
public void onResponse(Call<DataResponse<PaymentsModels>> call, Response<DataResponse<PaymentsModels>> response) { public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) {
Log.i("Response simpan_cart", "onResponse: "+utils.convertGson(response.body())); Log.i("Response simpan_cart", "onResponse: "+utils.convertGson(response.body()));
if (response.body() != null){ if (response.body() != null){
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
...@@ -258,7 +259,7 @@ public class CartActivity extends AppCompatActivity { ...@@ -258,7 +259,7 @@ public class CartActivity extends AppCompatActivity {
} }
@Override @Override
public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) { public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) {
new AlertDialog.Builder(CartActivity.this) new AlertDialog.Builder(CartActivity.this)
.setCancelable(false) .setCancelable(false)
.setTitle("Save new Order") .setTitle("Save new Order")
......
...@@ -4,31 +4,85 @@ import android.os.Bundle; ...@@ -4,31 +4,85 @@ import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.EditText;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment; import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.button.MaterialButton;
import com.yono.messeripos.adapter.CategoryAdapter;
import com.yono.messeripos.api.client.Client;
import com.yono.messeripos.api.service.CategoryServise;
import com.yono.messeripos.models.CategoryModels;
import com.yono.messeripos.models.MainViewModels; import com.yono.messeripos.models.MainViewModels;
import com.yono.messeripos.models.MainViewModelsCart; import com.yono.messeripos.models.MainViewModelsCart;
import com.yono.messeripos.response.DataResponse;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class FormCategory extends BottomSheetDialogFragment { public class FormCategory extends BottomSheetDialogFragment {
MainViewModels mainViewModels; MainViewModels mainViewModels;
public EditText etCategoryName;
public MaterialButton btnAddCategory;
CategoryModels categoryModelsEdit;
Boolean updateCategory = false;
public FormCategory() { public FormCategory() {
} }
public interface FormCategoryListener {
void onAddCategory(CategoryModels categoryModels);
void onUpdateCategory(CategoryModels categoryModels);
}
private FormCategoryListener listener;
public void setListener(FormCategoryListener listener) {
this.listener = listener;
}
public void EditFormCategory(CategoryModels categoryModels){
this.updateCategory = true;
this.categoryModelsEdit = categoryModels;
}
@Nullable @Nullable
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.form_category, View v = inflater.inflate(R.layout.form_category,
container, false); container, false);
etCategoryName = v.findViewById(R.id.etCategoryName);
btnAddCategory = v.findViewById(R.id.btnAddCategory);
mainViewModels = new ViewModelProvider(getActivity()).get(MainViewModels.class); mainViewModels = new ViewModelProvider(getActivity()).get(MainViewModels.class);
if (!updateCategory){
etCategoryName.setText("");
}else{
etCategoryName.setText(categoryModelsEdit.getNameCategory());
btnAddCategory.setText("Update Category");
}
btnAddCategory.setOnClickListener(view -> addCategory());
return v; return v;
} }
private void addCategory() {
if (!updateCategory){
CategoryModels categoryModels = new CategoryModels();
categoryModels.setNameCategory(etCategoryName.getText().toString());
listener.onAddCategory(categoryModels);
}else{
CategoryModels categoryModels = new CategoryModels();
categoryModels.setNameCategory(etCategoryName.getText().toString());
categoryModels.setIdCategory(categoryModelsEdit.getIdCategory());
listener.onUpdateCategory(categoryModels);
}
}
} }
...@@ -31,6 +31,7 @@ import com.google.android.material.appbar.MaterialToolbar; ...@@ -31,6 +31,7 @@ import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.bottomsheet.BottomSheetDialogFragment; import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.jaredrummler.materialspinner.MaterialSpinner; import com.jaredrummler.materialspinner.MaterialSpinner;
import com.yono.messeripos.api.client.Client; import com.yono.messeripos.api.client.Client;
import com.yono.messeripos.api.service.CategoryServise;
import com.yono.messeripos.api.service.ProductService; import com.yono.messeripos.api.service.ProductService;
import com.yono.messeripos.databinding.FormProductBinding; import com.yono.messeripos.databinding.FormProductBinding;
import com.yono.messeripos.models.CategoryModels; import com.yono.messeripos.models.CategoryModels;
...@@ -70,6 +71,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -70,6 +71,7 @@ public class FormProductActivity extends AppCompatActivity {
Client client = new Client(); Client client = new Client();
ProductModels productModelsIntent; ProductModels productModelsIntent;
List<String> categorySelect = new ArrayList<>(); List<String> categorySelect = new ArrayList<>();
FormCategory formCategory;
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
...@@ -89,7 +91,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -89,7 +91,7 @@ public class FormProductActivity extends AppCompatActivity {
} }
productModelsIntent = getIntent().getParcelableExtra(MainActivity.DATA_PRODUCT); productModelsIntent = getIntent().getParcelableExtra(MainActivity.DATA_PRODUCT);
formCategory = new FormCategory();
MaterialToolbar toolbars = findViewById(R.id.topAppBarForm); MaterialToolbar toolbars = findViewById(R.id.topAppBarForm);
setSupportActionBar(toolbars); setSupportActionBar(toolbars);
...@@ -122,14 +124,45 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -122,14 +124,45 @@ public class FormProductActivity extends AppCompatActivity {
binding.btnAddCategory.setOnClickListener(view -> addCategory()); binding.btnAddCategory.setOnClickListener(view -> addCategory());
//spinner //spinner
categoryModels = new ArrayList<>(); setSpinner("");
categoryModels.add("SELECT CATEGORY");
setSpinner();
setSelectedSpinner(); setSelectedSpinner();
setAddListenerCategory();
}
private void setAddListenerCategory() {
formCategory.setListener(new FormCategory.FormCategoryListener() {
@Override
public void onAddCategory(CategoryModels categoryModels) {
progressDialog.show();
CategoryServise categoryServise = client.Client(CategoryServise.class);
categoryServise.addCategory(categoryModels).enqueue(new Callback<DataResponse<CategoryModels>>() {
@Override
public void onResponse(Call<DataResponse<CategoryModels>> call, Response<DataResponse<CategoryModels>> response) {
if (response.body().getStatusData()){
progressDialog.dismiss();
setSpinner("post");
formCategory.dismiss();
formCategory.etCategoryName.setText("");
}
}
@Override
public void onFailure(Call<DataResponse<CategoryModels>> call, Throwable t) {
new AlertDialog.Builder(FormProductActivity.this)
.setTitle("Add Category failed!")
.setMessage("Add category failed, try again!").show();
}
});
}
@Override
public void onUpdateCategory(CategoryModels categoryModels) {
}
});
} }
private void addCategory() { private void addCategory() {
FormCategory formCategory = new FormCategory();
formCategory.show(getSupportFragmentManager(), formCategory.show(getSupportFragmentManager(),
"ModalFormCategory"); "ModalFormCategory");
} }
...@@ -143,10 +176,13 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -143,10 +176,13 @@ public class FormProductActivity extends AppCompatActivity {
}); });
} }
private void setSpinner() { private void setSpinner(String s) {
categoryModels = new ArrayList<>();
categoryModels.add("SELECT CATEGORY");
mainViewModels.getCategory().observe(this, listDataResponse -> { mainViewModels.getCategory().observe(this, listDataResponse -> {
List<CategoryModels> cate = listDataResponse.getData(); List<CategoryModels> cate = listDataResponse.getData();
for (CategoryModels cd: cate){ for (CategoryModels cd: cate){
categoryModels.add(cd.getNameCategory()); categoryModels.add(cd.getNameCategory());
} }
...@@ -163,7 +199,7 @@ public class FormProductActivity extends AppCompatActivity { ...@@ -163,7 +199,7 @@ public class FormProductActivity extends AppCompatActivity {
productModels.setProductName(binding.etName.getText().toString()); productModels.setProductName(binding.etName.getText().toString());
productModels.setPriceProduct(Integer.parseInt(binding.etPrice.getText().toString())); productModels.setPriceProduct(Integer.parseInt(binding.etPrice.getText().toString()));
productModels.setStockProduct(Integer.parseInt(binding.etStock.getText().toString())); productModels.setStockProduct(Integer.parseInt(binding.etStock.getText().toString()));
productModels.setCategoryProduct(getCategory(categoryModels.get(0))); productModels.setCategoryProduct(getCategory(categorySelect.get(0)));
if (isUpdate){ if (isUpdate){
......
...@@ -67,9 +67,9 @@ public class HistoryActivity extends AppCompatActivity { ...@@ -67,9 +67,9 @@ public class HistoryActivity extends AppCompatActivity {
mainViewModels.getAllTransactions().observe(HistoryActivity.this, mainViewModels.getAllTransactions().observe(HistoryActivity.this,
new Observer<DataResponse<List<PaymentsModels>>>() { new Observer<DataResponse<List<PaymentsModels<String>>>>() {
@Override @Override
public void onChanged(DataResponse<List<PaymentsModels>> listDataResponse) { public void onChanged(DataResponse<List<PaymentsModels<String>>> listDataResponse) {
Log.i("Hasil_transaksi", "onChanged: "+utils.convertGson(listDataResponse.getData())); Log.i("Hasil_transaksi", "onChanged: "+utils.convertGson(listDataResponse.getData()));
ArrayList<PaymentsModels> newData = new ArrayList<>(); ArrayList<PaymentsModels> newData = new ArrayList<>();
newData.addAll(listDataResponse.getData()); newData.addAll(listDataResponse.getData());
......
...@@ -75,7 +75,7 @@ public class LoginActivity extends AppCompatActivity { ...@@ -75,7 +75,7 @@ public class LoginActivity extends AppCompatActivity {
public void onChanged(DataResponse<UsersModels> usersModelsDataResponse) { public void onChanged(DataResponse<UsersModels> usersModelsDataResponse) {
Log.d("Status", usersModelsDataResponse.getMessageData()); Log.d("Status", usersModelsDataResponse.getMessageData());
if (!usersModelsDataResponse.getMessageData().equals("Login Failed")){ if (usersModelsDataResponse.getStatusData()){
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(SplashScreen.SESSION, true); editor.putBoolean(SplashScreen.SESSION, true);
editor.commit(); editor.commit();
......
package com.yono.messeripos; package com.yono.messeripos;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
...@@ -41,6 +42,7 @@ import com.google.gson.Gson; ...@@ -41,6 +42,7 @@ import com.google.gson.Gson;
import com.yono.messeripos.adapter.CategoryAdapter; import com.yono.messeripos.adapter.CategoryAdapter;
import com.yono.messeripos.adapter.ProductAdapter; import com.yono.messeripos.adapter.ProductAdapter;
import com.yono.messeripos.api.client.Client; import com.yono.messeripos.api.client.Client;
import com.yono.messeripos.api.service.CategoryServise;
import com.yono.messeripos.api.service.ProductService; import com.yono.messeripos.api.service.ProductService;
import com.yono.messeripos.databinding.ActivityMainBinding; import com.yono.messeripos.databinding.ActivityMainBinding;
import com.yono.messeripos.models.CategoryModels; import com.yono.messeripos.models.CategoryModels;
...@@ -76,11 +78,13 @@ public class MainActivity extends AppCompatActivity { ...@@ -76,11 +78,13 @@ public class MainActivity extends AppCompatActivity {
public static final String ORDER_ID = "orderId"; public static final String ORDER_ID = "orderId";
Client client = new Client(); Client client = new Client();
public static ArrayList<ProductModels> productModelsArrayList = new ArrayList<>(); public static ArrayList<ProductModels> productModelsArrayList = new ArrayList<>();
public static ArrayList<CategoryModels> categoryModelsArrayList = new ArrayList<>();
public static final String DATA_PRODUCT = "DATA_PRODUCT"; public static final String DATA_PRODUCT = "DATA_PRODUCT";
public static final String MY_SHARED_PREFERENCES = "main_sahred"; public static final String MY_SHARED_PREFERENCES = "main_sahred";
ProgressDialog progressDialog; ProgressDialog progressDialog;
MaterialButton btnAddCart; MaterialButton btnAddCart;
SkeletonScreen skeletonCategory; SkeletonScreen skeletonCategory;
FormCategory formCategory;
...@@ -99,6 +103,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -99,6 +103,7 @@ public class MainActivity extends AppCompatActivity {
binding.tvCategory.setVisibility(View.GONE); binding.tvCategory.setVisibility(View.GONE);
binding.tvProduct.setVisibility(View.GONE); binding.tvProduct.setVisibility(View.GONE);
formCategory = new FormCategory();
categoryAdapter = new CategoryAdapter(); categoryAdapter = new CategoryAdapter();
productAdapter = new ProductAdapter(); productAdapter = new ProductAdapter();
mainViewModelsCart = new ViewModelProvider(MainActivity.this).get(MainViewModelsCart.class); mainViewModelsCart = new ViewModelProvider(MainActivity.this).get(MainViewModelsCart.class);
...@@ -111,7 +116,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -111,7 +116,7 @@ public class MainActivity extends AppCompatActivity {
toolbar = findViewById(R.id.topAppBar); toolbar = findViewById(R.id.topAppBar);
mainViewModels = ViewModelProviders.of(this).get(MainViewModels.class); mainViewModels = ViewModelProviders.of(this).get(MainViewModels.class);
if (orderId.isEmpty()) if (sharedPreferences.getString(ORDER_ID,"").isEmpty())
{ {
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(ORDER_ID,"MES-ORDER"+utils.timeStamp()); editor.putString(ORDER_ID,"MES-ORDER"+utils.timeStamp());
...@@ -134,6 +139,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -134,6 +139,7 @@ public class MainActivity extends AppCompatActivity {
mainViewModelsGetProduct(); mainViewModelsGetProduct();
productAdapterListener(); productAdapterListener();
categoryAdapterListener(); categoryAdapterListener();
formCategoryListener();
} }
private void toolbarSetOnItemClicked() { private void toolbarSetOnItemClicked() {
...@@ -184,7 +190,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -184,7 +190,7 @@ public class MainActivity extends AppCompatActivity {
caModels.setIdCategory(0); caModels.setIdCategory(0);
List<CategoryModels> categoryModels = listDataResponse.getData(); List<CategoryModels> categoryModels = listDataResponse.getData();
ArrayList<CategoryModels> categoryModelsArrayList = new ArrayList<>(); categoryModelsArrayList = new ArrayList<>();
categoryModels.add(0,caModels); categoryModels.add(0,caModels);
categoryModelsArrayList.addAll(categoryModels); categoryModelsArrayList.addAll(categoryModels);
...@@ -301,13 +307,13 @@ public class MainActivity extends AppCompatActivity { ...@@ -301,13 +307,13 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onAddCart(ProductModels product) { public void onAddCart(ProductModels product) {
mainViewModelsCart.checkOrderProduct(product.getIdProduct(), orderId).observe(MainActivity.this, new Observer<List<ProductCartModels>>() { mainViewModelsCart.checkOrderProduct(product.getIdProduct(), sharedPreferences.getString(ORDER_ID,"")).observe(MainActivity.this, new Observer<List<ProductCartModels>>() {
@RequiresApi(api = Build.VERSION_CODES.N) @RequiresApi(api = Build.VERSION_CODES.N)
@Override @Override
public void onChanged(List<ProductCartModels> productCartModels) { public void onChanged(List<ProductCartModels> productCartModels) {
if (productCartModels.isEmpty() && cartIsEmpty){ if (productCartModels.isEmpty() && cartIsEmpty){
mainViewModelsCart.insertCart(new ProductCartModels( mainViewModelsCart.insertCart(new ProductCartModels(
orderId, sharedPreferences.getString(ORDER_ID,""),
1, 1,
product.getIdProduct(), product.getIdProduct(),
product.getProductName(), product.getProductName(),
...@@ -337,14 +343,50 @@ public class MainActivity extends AppCompatActivity { ...@@ -337,14 +343,50 @@ public class MainActivity extends AppCompatActivity {
}); });
} }
private void formCategoryListener() {
formCategory.setListener(new FormCategory.FormCategoryListener() {
@Override
public void onAddCategory(CategoryModels categoryModels) {
}
@Override
public void onUpdateCategory(CategoryModels categoryModels) {
progressDialog.show();
CategoryServise categoryServise = client.Client(CategoryServise.class);
categoryServise.updateCategory(categoryModels.getIdCategory(), categoryModels).enqueue(new Callback<DataResponse<CategoryModels>>() {
@Override
public void onResponse(Call<DataResponse<CategoryModels>> call, Response<DataResponse<CategoryModels>> response) {
progressDialog.dismiss();
Log.i("Update", "onResponse: "+utils.convertGson(response.body()));
if (response.body() != null && response.body().getMessageData() != "Parameter not found!"){
categoryAdapter.notifyDataSetChanged();
formCategory.dismiss();
}else{
new AlertDialog.Builder(MainActivity.this)
.setTitle("Update Category failed!")
.setMessage(response.body().getMessageData()).show();
}
}
@Override
public void onFailure(Call<DataResponse<CategoryModels>> call, Throwable t) {
new AlertDialog.Builder(MainActivity.this)
.setTitle("Update Category failed!")
.setMessage("Update category failed, try again!").show();
}
});
}
});
}
private void categoryAdapterListener() { private void categoryAdapterListener() {
categoryAdapter.setListener(new CategoryAdapter.CategoryListener() { categoryAdapter.setListener(new CategoryAdapter.CategoryListener() {
@Override @Override
public void onGetProduct(CategoryModels categoryModels) { public void onGetProduct(CategoryModels categoryModels) {
showLoading(true); progressDialog.show();
Log.i("diluar if", "onGetProduct: "+selectCategory); Log.i("diluar if", "onGetProduct: "+selectCategory);
if (!selectCategory){ if (!selectCategory){
progressDialog.show();
binding.rvProduct.setVisibility(View.GONE); binding.rvProduct.setVisibility(View.GONE);
Log.i("if", "onGetProduct: "+selectCategory); Log.i("if", "onGetProduct: "+selectCategory);
} }
...@@ -403,12 +445,31 @@ public class MainActivity extends AppCompatActivity { ...@@ -403,12 +445,31 @@ public class MainActivity extends AppCompatActivity {
@Override @Override
public void onUpdateCategory(CategoryModels categoryModels) { public void onUpdateCategory(CategoryModels categoryModels) {
formCategory.EditFormCategory(categoryModels);
formCategory.show(getSupportFragmentManager(),
"ModalFormCategory");
} }
@Override @Override
public void onDeleteCategory(CategoryModels categoryModels) { public void onDeleteCategory(CategoryModels categoryModels, int position) {
progressDialog.show();
CategoryServise categoryServise = client.Client(CategoryServise.class);
categoryServise.deleteCategory(categoryModels.getIdCategory()).enqueue(new Callback<DataResponse<CategoryModels>>() {
@Override
public void onResponse(Call<DataResponse<CategoryModels>> call, Response<DataResponse<CategoryModels>> response) {
progressDialog.dismiss();
categoryModelsArrayList.remove(position);
Log.i("KAAAA", "onResponse: "+utils.convertGson(categoryModelsArrayList));
// binding.rvCategory.removeViewAt(position);
categoryAdapter.notifyItemRemoved(position);
categoryAdapter.notifyItemRangeChanged(position, categoryModelsArrayList.size());
}
@Override
public void onFailure(Call<DataResponse<CategoryModels>> call, Throwable t) {
}
});
} }
}); });
} }
......
...@@ -34,6 +34,7 @@ import com.yono.messeripos.api.service.PaymentService; ...@@ -34,6 +34,7 @@ import com.yono.messeripos.api.service.PaymentService;
import com.yono.messeripos.models.MainViewModelsCart; import com.yono.messeripos.models.MainViewModelsCart;
import com.yono.messeripos.models.PaymentsModels; import com.yono.messeripos.models.PaymentsModels;
import com.yono.messeripos.models.ProductCartModels; import com.yono.messeripos.models.ProductCartModels;
import com.yono.messeripos.models.VaNumberModels;
import com.yono.messeripos.response.DataResponse; import com.yono.messeripos.response.DataResponse;
import com.yono.messeripos.response.PaymentResponse; import com.yono.messeripos.response.PaymentResponse;
import com.yono.messeripos.utils.Utils; import com.yono.messeripos.utils.Utils;
...@@ -194,44 +195,86 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -194,44 +195,86 @@ public class PaymentActivity extends AppCompatActivity {
Client client = new Client(); Client client = new Client();
paymentsModels.setPaymentType("bank_transfer"); paymentsModels.setPaymentType("bank_transfer");
paymentsModels.setBank(methodPay); paymentsModels.setBank(methodPay);
paymentsModels.setOrderId(orderId); paymentsModels.setOrderIdUpdate(sharedPreferences.getString(ORDER_ID,""));
paymentsModels.setOrderId(sharedPreferences.getString(ORDER_ID, ""));
paymentsModels.setTransactionStatus("success");
paymentsModels.setTransaction_id(utils.timeStamp()+"-MES");
paymentsModels.setTransaction_time(utils.timeStamp());
Log.i("BANK", "onClick: "+utils.convertGson(paymentsModels)); Log.i("BANK", "onClick: "+utils.convertGson(paymentsModels));
PaymentService paymentService = client.Client(PaymentService.class); PaymentService paymentService = client.Client(PaymentService.class);
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels>>() {
@Override
public void onResponse(Call<DataResponse<PaymentsModels>> call, Response<DataResponse<PaymentsModels>> response) {
Log.i("Paymen_bank", "onResponse: "+utils.convertGson(response.body()));
if (response.body() != null){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(ORDER_ID, "");
editor.putBoolean(CHECKOUT, false);
progressDialog.dismiss();
if (editor.commit()){
qrCode = new QRCode(response.body());
qrCode.show(
getSupportFragmentManager(),
qrCode.getTag()
);
if (paymentsModelsIntent == null){
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
@Override
public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) {
Log.i("Paymen_bank", "onResponse: "+utils.convertGson(response.body()));
if (response.body() != null){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(ORDER_ID, "");
editor.putBoolean(CHECKOUT, false);
progressDialog.dismiss();
if (editor.commit()){
qrCode = new QRCode(response.body());
qrCode.show(
getSupportFragmentManager(),
"QRCode"
);
}
}else{
progressDialog.dismiss();
new AlertDialog.Builder(PaymentActivity.this)
.setTitle("Payment Order")
.setMessage("Erorr save!").show();
} }
}else{ }
@Override
public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) {
progressDialog.dismiss(); progressDialog.dismiss();
new AlertDialog.Builder(PaymentActivity.this) new AlertDialog.Builder(PaymentActivity.this)
.setCancelable(false)
.setTitle("Payment Order") .setTitle("Payment Order")
.setMessage("Erorr save!").show(); .setMessage("Add new payment failed, try again!").show();
}
});
}else{
paymentService.postFromCartPending(paymentsModels).enqueue(new Callback<DataResponse>() {
@Override
public void onResponse(Call<DataResponse> call,
Response<DataResponse> response) {
Log.i("Paymen_bank_sa", "onResponse: "+utils.convertGson(response.body()));
if (response.body() != null){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(ORDER_ID, "");
editor.putBoolean(CHECKOUT, false);
progressDialog.dismiss();
if (editor.commit()){
qrCode = new QRCode(response.body());
qrCode.show(
getSupportFragmentManager(),
"QRCode"
);
}
}else{
progressDialog.dismiss();
new AlertDialog.Builder(PaymentActivity.this)
.setTitle("Payment Order")
.setMessage("Erorr save!").show();
}
} }
}
@Override @Override
public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) { public void onFailure(Call<DataResponse> call, Throwable t) {
progressDialog.dismiss(); progressDialog.dismiss();
new AlertDialog.Builder(PaymentActivity.this) new AlertDialog.Builder(PaymentActivity.this)
.setCancelable(false) .setCancelable(false)
.setTitle("Payment Order") .setTitle("Payment Order")
.setMessage("Add new payment failed, try again!").show(); .setMessage("Add new payment failed, try again!").show();
} }
}); });
}
} }
} }
}); });
...@@ -249,9 +292,10 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -249,9 +292,10 @@ public class PaymentActivity extends AppCompatActivity {
); );
PaymentService paymentService = client.Client(PaymentService.class); PaymentService paymentService = client.Client(PaymentService.class);
paymentService.postFromCart(paymentsModels1).enqueue(new Callback<DataResponse<PaymentsModels>>() { paymentService.postFromCart(paymentsModels1).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
@Override @Override
public void onResponse(Call<DataResponse<PaymentsModels>> call, Response<DataResponse<PaymentsModels>> response) { public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call,
Response<DataResponse<PaymentsModels<List<VaNumberModels>>>> response) {
if (response.body() != null){ if (response.body() != null){
progressDialog.dismiss(); progressDialog.dismiss();
SharedPreferences.Editor editor = sharedPreferences.edit(); SharedPreferences.Editor editor = sharedPreferences.edit();
...@@ -264,7 +308,7 @@ public class PaymentActivity extends AppCompatActivity { ...@@ -264,7 +308,7 @@ public class PaymentActivity extends AppCompatActivity {
} }
@Override @Override
public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) { public void onFailure(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Throwable t) {
} }
}); });
......
...@@ -21,8 +21,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment; ...@@ -21,8 +21,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
import com.google.zxing.WriterException; import com.google.zxing.WriterException;
import com.yono.messeripos.models.PaymentsModels; import com.yono.messeripos.models.PaymentsModels;
import com.yono.messeripos.models.VaNumberModels;
import com.yono.messeripos.response.DataResponse; import com.yono.messeripos.response.DataResponse;
import java.util.List;
import androidmads.library.qrgenearator.QRGContents; import androidmads.library.qrgenearator.QRGContents;
import androidmads.library.qrgenearator.QRGEncoder; import androidmads.library.qrgenearator.QRGEncoder;
...@@ -33,9 +36,9 @@ public class QRCode extends BottomSheetDialogFragment { ...@@ -33,9 +36,9 @@ public class QRCode extends BottomSheetDialogFragment {
QRGEncoder qrgEncoder; QRGEncoder qrgEncoder;
String inputValue; String inputValue;
Bitmap bitmap; Bitmap bitmap;
DataResponse<PaymentsModels> paymentsModels; DataResponse<PaymentsModels<List<VaNumberModels>>> paymentsModels;
public QRCode(DataResponse<PaymentsModels> paymentsModels) { public QRCode(DataResponse<PaymentsModels<List<VaNumberModels>>> paymentsModels) {
this.paymentsModels = paymentsModels; this.paymentsModels = paymentsModels;
Log.d("TAG", "QRCode: "+paymentsModels); Log.d("TAG", "QRCode: "+paymentsModels);
......
...@@ -28,7 +28,7 @@ public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyView ...@@ -28,7 +28,7 @@ public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyView
void onUpdateCategory(CategoryModels categoryModels); void onUpdateCategory(CategoryModels categoryModels);
void onDeleteCategory(CategoryModels categoryModels); void onDeleteCategory(CategoryModels categoryModels, int position);
} }
private CategoryListener listener; private CategoryListener listener;
...@@ -78,7 +78,7 @@ public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyView ...@@ -78,7 +78,7 @@ public class CategoryAdapter extends RecyclerView.Adapter<CategoryAdapter.MyView
binding.setCategory(categoryModels); binding.setCategory(categoryModels);
binding.cvCategory.setOnClickListener(view -> listener.onGetProduct(categoryModels)); binding.cvCategory.setOnClickListener(view -> listener.onGetProduct(categoryModels));
binding.categoryDelete.setOnClickListener(view -> listener.onDeleteCategory(categoryModels)); binding.categoryDelete.setOnClickListener(view -> listener.onDeleteCategory(categoryModels, getAdapterPosition()));
binding.categoryUpdate.setOnClickListener(view -> listener.onUpdateCategory(categoryModels)); binding.categoryUpdate.setOnClickListener(view -> listener.onUpdateCategory(categoryModels));
if (!MainActivity.status_update) { if (!MainActivity.status_update) {
......
...@@ -9,8 +9,10 @@ import java.util.List; ...@@ -9,8 +9,10 @@ import java.util.List;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.POST; import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path; import retrofit2.http.Path;
import retrofit2.http.Query; import retrofit2.http.Query;
...@@ -23,4 +25,10 @@ public interface CategoryServise { ...@@ -23,4 +25,10 @@ public interface CategoryServise {
@POST(ApiHelper.VERSI_API_1+"category") @POST(ApiHelper.VERSI_API_1+"category")
Call<DataResponse<CategoryModels>> addCategory(@Body CategoryModels categoryModels); Call<DataResponse<CategoryModels>> addCategory(@Body CategoryModels categoryModels);
@DELETE(ApiHelper.VERSI_API_1+"category/{id}")
Call<DataResponse<CategoryModels>> deleteCategory(@Path("id") int id);
@PUT(ApiHelper.VERSI_API_1+"category/{id}")
Call<DataResponse<CategoryModels>> updateCategory(@Path("id") int id, @Body CategoryModels categoryModels);
} }
...@@ -2,8 +2,11 @@ package com.yono.messeripos.api.service; ...@@ -2,8 +2,11 @@ package com.yono.messeripos.api.service;
import com.yono.messeripos.api.ApiHelper; import com.yono.messeripos.api.ApiHelper;
import com.yono.messeripos.models.PaymentsModels; import com.yono.messeripos.models.PaymentsModels;
import com.yono.messeripos.models.VaNumberModels;
import com.yono.messeripos.response.DataResponse; import com.yono.messeripos.response.DataResponse;
import java.util.List;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body; import retrofit2.http.Body;
import retrofit2.http.GET; import retrofit2.http.GET;
...@@ -14,6 +17,9 @@ public interface PaymentService { ...@@ -14,6 +17,9 @@ public interface PaymentService {
@POST(ApiHelper.VERSI_API_1+"payment") @POST(ApiHelper.VERSI_API_1+"payment")
Call<DataResponse<PaymentsModels>> postFromCart(@Body PaymentsModels paymentsModels); Call<DataResponse<PaymentsModels>> postFromCart(@Body PaymentsModels paymentsModels);
@POST(ApiHelper.VERSI_API_1+"payment/midtrans/push")
Call<DataResponse> postFromCartPending(@Body PaymentsModels paymentsModels);
@GET(ApiHelper.VERSI_API_1+"payment/{id}") @GET(ApiHelper.VERSI_API_1+"payment/{id}")
Call<DataResponse<PaymentsModels>> getTransactionById(@Body PaymentsModels paymentsModels, @Path("id") int id); Call<DataResponse<PaymentsModels>> getTransactionById(@Body PaymentsModels paymentsModels, @Path("id") int id);
} }
...@@ -11,6 +11,6 @@ import retrofit2.http.GET; ...@@ -11,6 +11,6 @@ import retrofit2.http.GET;
public interface TransactionService { public interface TransactionService {
@GET(ApiHelper.VERSI_API_1+"payments") @GET(ApiHelper.VERSI_API_1+"payments")
Call<DataResponse<List<PaymentsModels>>> getAllTransaction(); Call<DataResponse<List<PaymentsModels<String>>>> getAllTransaction();
} }
...@@ -29,7 +29,7 @@ public class MainViewModels extends ViewModel { ...@@ -29,7 +29,7 @@ public class MainViewModels extends ViewModel {
MutableLiveData<DataResponse<List<ProductModels>>> productByCategory; MutableLiveData<DataResponse<List<ProductModels>>> productByCategory;
MutableLiveData<DataResponse<List<CategoryModels>>> categoryList; MutableLiveData<DataResponse<List<CategoryModels>>> categoryList;
MutableLiveData<DataResponse<UsersModels>> usersLogin; MutableLiveData<DataResponse<UsersModels>> usersLogin;
MutableLiveData<DataResponse<List<PaymentsModels>>> transactions; MutableLiveData<DataResponse<List<PaymentsModels<String>>>> transactions;
private MainViewModels mainViewModels; private MainViewModels mainViewModels;
...@@ -63,7 +63,7 @@ public class MainViewModels extends ViewModel { ...@@ -63,7 +63,7 @@ public class MainViewModels extends ViewModel {
return productByCategory; return productByCategory;
} }
public LiveData<DataResponse<List<PaymentsModels>>> getAllTransactions(){ public LiveData<DataResponse<List<PaymentsModels<String>>>> getAllTransactions(){
getDataTransaction(); getDataTransaction();
return transactions; return transactions;
} }
...@@ -102,10 +102,10 @@ public class MainViewModels extends ViewModel { ...@@ -102,10 +102,10 @@ public class MainViewModels extends ViewModel {
private void getDataTransaction() { private void getDataTransaction() {
TransactionService transactionService = client.Client(TransactionService.class); TransactionService transactionService = client.Client(TransactionService.class);
transactionService.getAllTransaction().enqueue(new Callback<DataResponse<List<PaymentsModels>>>() { transactionService.getAllTransaction().enqueue(new Callback<DataResponse<List<PaymentsModels<String>>>>() {
@Override @Override
public void onResponse(Call<DataResponse<List<PaymentsModels>>> call, public void onResponse(Call<DataResponse<List<PaymentsModels<String>>>> call,
Response<DataResponse<List<PaymentsModels>>> response) { Response<DataResponse<List<PaymentsModels<String>>>> response) {
Log.i("Get all transaction", "onResponse: "+utils.convertGson(response.body())); Log.i("Get all transaction", "onResponse: "+utils.convertGson(response.body()));
if (response.body() != null){ if (response.body() != null){
transactions.setValue(response.body()); transactions.setValue(response.body());
...@@ -115,7 +115,7 @@ public class MainViewModels extends ViewModel { ...@@ -115,7 +115,7 @@ public class MainViewModels extends ViewModel {
} }
@Override @Override
public void onFailure(Call<DataResponse<List<PaymentsModels>>> call, Throwable t) { public void onFailure(Call<DataResponse<List<PaymentsModels<String>>>> call, Throwable t) {
Log.e("Error get transaction", "onFailure: ",t ); Log.e("Error get transaction", "onFailure: ",t );
transactions = null; transactions = null;
} }
......
...@@ -65,20 +65,20 @@ public class MainViewModelsCart extends AndroidViewModel { ...@@ -65,20 +65,20 @@ public class MainViewModelsCart extends AndroidViewModel {
} }
public void insertPayments(PaymentsModels paymentsModels){ // public void insertPayments(PaymentsModels paymentsModels){
PaymentService paymentService = client.Client(PaymentService.class); // PaymentService paymentService = client.Client(PaymentService.class);
paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels>>() { // paymentService.postFromCart(paymentsModels).enqueue(new Callback<DataResponse<PaymentsModels<List<VaNumberModels>>>>() {
@Override // @Override
public void onResponse(Call<DataResponse<PaymentsModels>> call, Response<DataResponse<PaymentsModels>> response) { // public void onResponse(Call<DataResponse<PaymentsModels<List<VaNumberModels>>>> call, Response<DataResponse<PaymentsModels>> response) {
//
} // }
//
@Override // @Override
public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) { // public void onFailure(Call<DataResponse<PaymentsModels>> call, Throwable t) {
//
} // }
}); // });
} // }
public void insertOrders(OrdersResponse ordersResponse){ public void insertOrders(OrdersResponse ordersResponse){
Client client = new Client(); Client client = new Client();
......
...@@ -10,7 +10,7 @@ import androidx.databinding.BindingAdapter; ...@@ -10,7 +10,7 @@ import androidx.databinding.BindingAdapter;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.yono.messeripos.R; import com.yono.messeripos.R;
public class PaymentsModels implements Parcelable { public class PaymentsModels<T> implements Parcelable {
@SerializedName("order_code") @SerializedName("order_code")
private String orderId; private String orderId;
...@@ -26,14 +26,26 @@ public class PaymentsModels implements Parcelable { ...@@ -26,14 +26,26 @@ public class PaymentsModels implements Parcelable {
@SerializedName("transaction_status") @SerializedName("transaction_status")
private String transactionStatus; private String transactionStatus;
@SerializedName("transaction_time")
private String transaction_time;
@SerializedName("transaction_id")
private String transaction_id;
@SerializedName("created_at") @SerializedName("created_at")
private String createdAt; private String createdAt;
@SerializedName("updated_at") @SerializedName("updated_at")
private String updatedAt; private String updatedAt;
@SerializedName("va_numbers")
private T nomorPembayaran;
@SerializedName("va_number") @SerializedName("va_number")
private String nomorPembayaran; private String nomorPembayaranGet;
@SerializedName("order_id")
private String orderIdUpdate;
public PaymentsModels() { public PaymentsModels() {
...@@ -54,7 +66,6 @@ public class PaymentsModels implements Parcelable { ...@@ -54,7 +66,6 @@ public class PaymentsModels implements Parcelable {
transactionStatus = in.readString(); transactionStatus = in.readString();
createdAt = in.readString(); createdAt = in.readString();
updatedAt = in.readString(); updatedAt = in.readString();
nomorPembayaran = in.readString();
} }
public static final Creator<PaymentsModels> CREATOR = new Creator<PaymentsModels>() { public static final Creator<PaymentsModels> CREATOR = new Creator<PaymentsModels>() {
...@@ -125,15 +136,46 @@ public class PaymentsModels implements Parcelable { ...@@ -125,15 +136,46 @@ public class PaymentsModels implements Parcelable {
this.updatedAt = updatedAt; this.updatedAt = updatedAt;
} }
public T getNomorPembayaran() {
public String getNomorPembayaran() {
return nomorPembayaran; return nomorPembayaran;
} }
public void setNomorPembayaran(String nomorPembayaran) { public void setNomorPembayaran(T nomorPembayaran) {
this.nomorPembayaran = nomorPembayaran; this.nomorPembayaran = nomorPembayaran;
} }
public String getTransaction_time() {
return transaction_time;
}
public void setTransaction_time(String transaction_time) {
this.transaction_time = transaction_time;
}
public String getNomorPembayaranGet() {
return nomorPembayaranGet;
}
public void setNomorPembayaranGet(String nomorPembayaranGet) {
this.nomorPembayaranGet = nomorPembayaranGet;
}
public String getOrderIdUpdate() {
return orderIdUpdate;
}
public void setOrderIdUpdate(String orderIdUpdate) {
this.orderIdUpdate = orderIdUpdate;
}
public String getTransaction_id() {
return transaction_id;
}
public void setTransaction_id(String transaction_id) {
this.transaction_id = transaction_id;
}
@Override @Override
public int describeContents() { public int describeContents() {
return 0; return 0;
...@@ -148,6 +190,5 @@ public class PaymentsModels implements Parcelable { ...@@ -148,6 +190,5 @@ public class PaymentsModels implements Parcelable {
parcel.writeString(transactionStatus); parcel.writeString(transactionStatus);
parcel.writeString(createdAt); parcel.writeString(createdAt);
parcel.writeString(updatedAt); parcel.writeString(updatedAt);
parcel.writeString(nomorPembayaran);
} }
} }
package com.yono.messeripos.models;
import com.google.gson.annotations.SerializedName;
public class VaNumberModels {
@SerializedName("bank")
private String bank;
@SerializedName("va_number")
private String va_number;
}
...@@ -121,15 +121,6 @@ ...@@ -121,15 +121,6 @@
app:layout_constraintTop_toBottomOf="@id/tfPassword" app:layout_constraintTop_toBottomOf="@id/tfPassword"
app:layout_constraintVertical_bias="0.01999998" /> app:layout_constraintVertical_bias="0.01999998" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="forgot your password ?"
android:textColor="@color/colorWhite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnLogin" />
<ProgressBar <ProgressBar
android:id="@+id/progressBar" android:id="@+id/progressBar"
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
android:layout_alignParentStart="true" /> android:layout_alignParentStart="true" />
<EditText <EditText
android:id="@+id/etBayar" android:id="@+id/etCategoryName"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/tvAddCategory" android:layout_below="@id/tvAddCategory"
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
android:imeOptions="actionDone"/> android:imeOptions="actionDone"/>
<Button <Button
android:id="@+id/btnCash" android:id="@+id/btnAddCategory"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/text_new_category" android:text="@string/text_new_category"
android:hint="Insert Money" android:hint="Insert Money"
android:layout_below="@id/etBayar" /> android:layout_below="@id/etCategoryName" />
</RelativeLayout> </RelativeLayout>
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
android:id="@+id/tvVA" android:id="@+id/tvVA"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{transaction.nomorPembayaran}" android:text="@{transaction.nomorPembayaranGet}"
android:textAllCaps="true" android:textAllCaps="true"
android:textColor="#000" android:textColor="#000"
android:textStyle="bold" android:textStyle="bold"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment