fix bugs from excel 1
This commit is contained in:
parent
ff68ee6a1f
commit
315d37ca31
@ -11,7 +11,7 @@ android {
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.utsmm.kbz.uat" //mpu
|
||||
applicationId "com.utsmm.kbz"
|
||||
minSdk 24
|
||||
targetSdk 33
|
||||
versionCode 10
|
||||
|
||||
@ -7,6 +7,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.utsmyanmar.baselib.fragment.DataBindingFragment;
|
||||
import com.utsmyanmar.baselib.ui.NumberKeyboard;
|
||||
import com.utsmyanmar.baselib.util.CardDetectCallback;
|
||||
import com.utsmyanmar.baselib.util.DataBindingConfig;
|
||||
import com.utsmyanmar.baselib.util.TimeoutCallback;
|
||||
@ -98,6 +99,13 @@ public class InputAmountFragment extends DataBindingFragment implements DataBind
|
||||
|
||||
setToolBarTitleWithBackIcon(getResourceString(R.string.txt_subtitle_amount));
|
||||
|
||||
boolean decimalEnabled = SystemParamsOperation.getInstance().getDecimalEnable();
|
||||
View keyboardView = getView().findViewById(R.id.numberKeyboard);
|
||||
|
||||
if (keyboardView instanceof NumberKeyboard) {
|
||||
((NumberKeyboard) keyboardView).setDecimalEnable(decimalEnabled);
|
||||
}
|
||||
|
||||
if(sharedViewModel.isEcr.getValue() != null){
|
||||
if(sharedViewModel.isEcr.getValue()){
|
||||
|
||||
|
||||
@ -43,6 +43,10 @@ import javax.inject.Inject;
|
||||
@HiltViewModel
|
||||
public class SharedViewModel extends ViewModel {
|
||||
|
||||
public MutableLiveData<String> terminalId = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<Boolean> qrPartialRefundEnable = new MutableLiveData<>();
|
||||
|
||||
private static final String TAG = SharedViewModel.class.getSimpleName();
|
||||
|
||||
private final Repository repository;
|
||||
@ -173,9 +177,14 @@ public class SharedViewModel extends ViewModel {
|
||||
setPrintStatus(PrintStatus.FIRST_PRINT);
|
||||
isReprint.setValue(false);
|
||||
cardNo.setValue("");
|
||||
String tid = SystemParamsOperation.getInstance().getTerminalId();
|
||||
terminalId.setValue(tid);
|
||||
boolean isQrPartialRefundEnable = SystemParamsOperation.getInstance().isQrPartialRefundEnable();
|
||||
qrPartialRefundEnable.setValue(isQrPartialRefundEnable);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setEmvTrans(boolean status) {
|
||||
isEmv.setValue(status);
|
||||
}
|
||||
@ -268,6 +277,7 @@ public class SharedViewModel extends ViewModel {
|
||||
return repository.getParams(siriusRequest);
|
||||
}
|
||||
|
||||
|
||||
private void printReceipt(boolean isMerchantCopy) {
|
||||
PrintXReceipt.getInstance().printSmileReceipt(payDetail.getValue(), isMerchantCopy, new PrintXStatus() {
|
||||
@Override
|
||||
|
||||
@ -428,6 +428,8 @@ public class TMSSetupsImpl implements TMSSetups{
|
||||
} else if (TextUtils.equals(name,"qrpay_enable")) {
|
||||
|
||||
SystemParamsOperation.getInstance().setQRPayStatus(parseBoolean(data));
|
||||
} else if (TextUtils.equals(name, "qr_partial_refund_enable")){
|
||||
SystemParamsOperation.getInstance().setQrPartialRefundEnable(parseBoolean(data));
|
||||
} else if(TextUtils.equals(name, "mmqr_interval_waiting_time")){
|
||||
|
||||
SystemParamsOperation.getInstance().setWaveIntervalTime(data);
|
||||
|
||||
@ -23,6 +23,29 @@
|
||||
android:background="@color/colorPrimary"
|
||||
android:padding="16dp">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/tid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tidText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text='@{`TID : ` + shareViewModel.terminalId}'
|
||||
tools:text="TID : 123456789"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/bannerCard" />
|
||||
</FrameLayout>
|
||||
|
||||
<!-- ====================== BANNER ====================== -->
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
@ -30,21 +53,21 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="4dp"
|
||||
app:cardElevation="6dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:cardElevation="6dp"
|
||||
app:layout_constraintDimensionRatio="16:6"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintDimensionRatio="16:6">
|
||||
app:layout_constraintStart_toStartOf="@id/tid"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tid">
|
||||
|
||||
<com.denzcoskun.imageslider.ImageSlider
|
||||
android:id="@+id/image_slider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:iss_auto_cycle="true"
|
||||
app:iss_period="5000"
|
||||
app:iss_delay="5000"
|
||||
app:iss_no_dots="true"
|
||||
app:iss_period="5000"
|
||||
app:iss_title_background="@color/transparent" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@ -59,9 +82,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:paddingTop="12dp">
|
||||
|
||||
|
||||
>
|
||||
<!-- ===== FULL WIDTH SALE BUTTON ===== -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardMenuCard"
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="sharedViewModel"
|
||||
type="com.utsmm.kbz.ui.core_viewmodel.SharedViewModel" />
|
||||
@ -67,7 +68,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Partial Amount"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
android:visibility="@{sharedViewModel.qrPartialRefundEnable ? View.VISIBLE : View.GONE}"
|
||||
/>
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="app_name">KBZ UAT</string>
|
||||
<string name="app_name">KBZ</string>
|
||||
<string name="app_name_sit">SMILE-SIT</string>
|
||||
<string name="app_name_uat">SMILE-UAT</string>
|
||||
<string name="app_name_plus">SMILE-PLUS</string>
|
||||
|
||||
@ -285,8 +285,8 @@ public class NetworkModule {
|
||||
tmsAddress = getTMSUrlFromNative();
|
||||
}
|
||||
|
||||
// String baseUrl = tmsAddress.trim() + "/api/v1/";
|
||||
String baseUrl = tmsAddress.trim() + "/";
|
||||
String baseUrl = tmsAddress.trim() + "/api/v1/";
|
||||
// String baseUrl = tmsAddress.trim() + "/";
|
||||
|
||||
|
||||
final Gson gson =
|
||||
@ -398,8 +398,8 @@ public class NetworkModule {
|
||||
OkHttpClient client = new OkHttpClient.Builder()
|
||||
.addInterceptor(interceptor)
|
||||
.build();
|
||||
// String baseUrl = "http://receipt-nest.utsmyanmar.com/";
|
||||
String baseUrl = "https://api-tms-uat.kbzbank.com:8443/receipt/";
|
||||
String baseUrl = "http://receipt-nest.utsmyanmar.com/";
|
||||
// String baseUrl = "https://api-tms-uat.kbzbank.com:8443/receipt/";
|
||||
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(baseUrl)
|
||||
|
||||
@ -107,7 +107,6 @@ public class Repository {
|
||||
return siriusApiService.getParams(siriusRequest);
|
||||
}
|
||||
public Observable<EReceiptResponse> sendReceipt(Object body){
|
||||
// String apiSecret = "y812J21lhha11OS";
|
||||
String apiSecret = BuildConfig.ERECEIPT_SECRET;
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
String bodyString = new Gson().toJson(body);
|
||||
|
||||
@ -20,9 +20,20 @@ public class NumberKeyboard extends ViewGroup {
|
||||
private int mKeyWidth;
|
||||
private int hSpacing = 1;
|
||||
private int vSpacing = 1;
|
||||
boolean isDecimalEnable = false;
|
||||
|
||||
private KeyClickCallback mKeyClickCallback;
|
||||
|
||||
public void setDecimalEnable(boolean enable){
|
||||
this.isDecimalEnable = enable;
|
||||
View key = getChildAt(9); // index starts at 0
|
||||
if (key instanceof TextView) {
|
||||
key.setAlpha(enable ? 1f : 0.3f);
|
||||
}
|
||||
invalidate();
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public void setKeyClickCallback(KeyClickCallback callback) {
|
||||
this.mKeyClickCallback = callback;
|
||||
}
|
||||
@ -201,6 +212,9 @@ public class NumberKeyboard extends ViewGroup {
|
||||
if (child == null) {
|
||||
return true;
|
||||
}
|
||||
if (!isDecimalEnable && (position + 1) == 10) {
|
||||
return true;
|
||||
}
|
||||
child.setBackgroundColor(getResources().getColor(R.color.CDDDDDD,null));
|
||||
|
||||
|
||||
@ -217,6 +231,9 @@ public class NumberKeyboard extends ViewGroup {
|
||||
child.setBackgroundColor(getResources().getColor(R.color.white,null));
|
||||
if (mKeyClickCallback != null) {
|
||||
if ((position + 1) == 10) {
|
||||
if(!isDecimalEnable){
|
||||
return true;
|
||||
}
|
||||
mKeyClickCallback.onDelClick();
|
||||
} else if ((position + 1) == 11) {
|
||||
mKeyClickCallback.onNumClick(0);
|
||||
|
||||
@ -1562,5 +1562,15 @@ public class SystemParamsOperation {
|
||||
SharedPreferencesUtil.clearByKey(TRANSACTION_MANAGER_KEY);
|
||||
}
|
||||
|
||||
public void setQrPartialRefundEnable(boolean enable){
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
params.setQrPartialRefundEnable(enable);
|
||||
saveSystemParamsSettings(params);
|
||||
}
|
||||
|
||||
public boolean isQrPartialRefundEnable() {
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
return params.isQrPartialRefundEnable();
|
||||
}
|
||||
|
||||
}
|
||||
@ -42,8 +42,9 @@ public class SystemParamsSettings implements Serializable {
|
||||
|
||||
// private String tmsAddress = "https://tms.smile-mm.com";
|
||||
// private String tmsAddress = "http://128.199.170.203";
|
||||
// private String tmsAddress = "http://sirius-nest.utsmyanmar.com";
|
||||
private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius";
|
||||
private String tmsAddress = "http://sirius-nest.utsmyanmar.com";
|
||||
// private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius";
|
||||
private String ereceiptAddress = "http://receipt-nest.utsmyanmar.com";
|
||||
|
||||
private String terminalCapability = "E0E8C8";
|
||||
|
||||
@ -235,6 +236,15 @@ public class SystemParamsSettings implements Serializable {
|
||||
|
||||
private byte[] pik_kcv;
|
||||
|
||||
private boolean qrPartialRefundEnable = false;
|
||||
|
||||
public boolean isQrPartialRefundEnable(){
|
||||
return qrPartialRefundEnable;
|
||||
}
|
||||
|
||||
public void setQrPartialRefundEnable(boolean qrPartialRefundEnable){
|
||||
this.qrPartialRefundEnable = qrPartialRefundEnable;
|
||||
}
|
||||
|
||||
protected boolean isManualEntryPinEnable() {return manualEntryPinEnable;}
|
||||
|
||||
@ -266,6 +276,12 @@ public class SystemParamsSettings implements Serializable {
|
||||
|
||||
protected String getAuthToken() { return authToken;}
|
||||
|
||||
protected String getEreceiptAddress() { return ereceiptAddress; }
|
||||
|
||||
protected void setEreceiptAddress(String ereceiptAddress){
|
||||
this.ereceiptAddress = ereceiptAddress;
|
||||
}
|
||||
|
||||
public boolean isDecimal_enable() {
|
||||
return decimal_enable;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user