auto print disabled
currently auto print disabled for QR
This commit is contained in:
parent
53a9d8ba1b
commit
c697d6c3f9
@ -14,8 +14,8 @@ android {
|
|||||||
applicationId "com.utsmm.kbz"
|
applicationId "com.utsmm.kbz"
|
||||||
minSdk 24
|
minSdk 24
|
||||||
targetSdk 33
|
targetSdk 33
|
||||||
versionCode 2
|
versionCode 1
|
||||||
versionName "1.01"
|
versionName "1.00"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -122,7 +122,8 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
sharedViewModel.setPrintStatus(PrintStatus.FIRST_PRINT);
|
sharedViewModel.setPrintStatus(PrintStatus.NOT_PRINT);
|
||||||
|
sharedViewModel.postPrintReceiptMsg("Print Receipt for Merchant?");
|
||||||
|
|
||||||
observePrintProcess();
|
observePrintProcess();
|
||||||
|
|
||||||
@ -139,17 +140,20 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
|
|||||||
case FIRST_PRINT:
|
case FIRST_PRINT:
|
||||||
sharedViewModel.postPrintReceiptMsg("Printing Receipt for Merchant");
|
sharedViewModel.postPrintReceiptMsg("Printing Receipt for Merchant");
|
||||||
startPrintProcess(true);
|
startPrintProcess(true);
|
||||||
|
sharedViewModel.postPrintReceiptMsg("Print Receipt for Customer?");
|
||||||
|
sharedViewModel.setVisibilityPrintReceiptButtons(0);
|
||||||
break;
|
break;
|
||||||
case FIRST_PRINT_DONE:
|
case FIRST_PRINT_DONE:
|
||||||
sharedViewModel.postPrintReceiptMsg("Confirm Print Receipt for Customer");
|
sharedViewModel.postPrintReceiptMsg("Print Receipt for Customer?");
|
||||||
if(sharedViewModel.isEcr.getValue() != null &&
|
// sharedViewModel.postPrintReceiptMsg("Confirm Print Receipt for Customer");
|
||||||
sharedViewModel.isEcr.getValue() &&
|
// if(sharedViewModel.isEcr.getValue() != null &&
|
||||||
SystemParamsOperation.getInstance().isAutoPrintCustomerCopy()) {
|
// sharedViewModel.isEcr.getValue() &&
|
||||||
sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
// SystemParamsOperation.getInstance().isAutoPrintCustomerCopy()) {
|
||||||
sharedViewModel.setPrintStatus(PrintStatus.SECOND_PRINT);
|
// sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
||||||
} else {
|
// sharedViewModel.setPrintStatus(PrintStatus.SECOND_PRINT);
|
||||||
sharedViewModel.setVisibilityPrintReceiptButtons(0);
|
// } else {
|
||||||
}
|
// sharedViewModel.setVisibilityPrintReceiptButtons(0);
|
||||||
|
// }
|
||||||
break;
|
break;
|
||||||
case SECOND_PRINT:
|
case SECOND_PRINT:
|
||||||
sharedViewModel.postPrintReceiptMsg("Printing Receipt for Customer");
|
sharedViewModel.postPrintReceiptMsg("Printing Receipt for Customer");
|
||||||
@ -248,16 +252,32 @@ public class PrintReceiptFragment extends DataBindingFragment implements DataBin
|
|||||||
public class ClickEvent {
|
public class ClickEvent {
|
||||||
|
|
||||||
public void onConfirm() {
|
public void onConfirm() {
|
||||||
|
PrintStatus printStatus = sharedViewModel.getPrintStatus().getValue();
|
||||||
|
|
||||||
sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
if(printStatus == PrintStatus.NOT_PRINT){
|
||||||
|
sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
||||||
|
sharedViewModel.setPrintStatus(PrintStatus.FIRST_PRINT);
|
||||||
|
}else if(printStatus == PrintStatus.FIRST_PRINT || printStatus == PrintStatus.FIRST_PRINT_DONE){
|
||||||
|
sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
||||||
|
sharedViewModel.setPrintStatus(PrintStatus.SECOND_PRINT);
|
||||||
|
}
|
||||||
|
|
||||||
sharedViewModel.setPrintStatus(PrintStatus.SECOND_PRINT);
|
// sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
||||||
|
//
|
||||||
|
// sharedViewModel.setPrintStatus(PrintStatus.SECOND_PRINT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCancel() {
|
public void onCancel() {
|
||||||
sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
PrintStatus printStatus = sharedViewModel.getPrintStatus().getValue();
|
||||||
isCardInside();
|
|
||||||
|
if(printStatus == PrintStatus.NOT_PRINT){
|
||||||
|
sharedViewModel.setPrintStatus(PrintStatus.FIRST_PRINT_DONE);
|
||||||
|
}else{
|
||||||
|
sharedViewModel.setVisibilityPrintReceiptButtons(8);
|
||||||
|
isCardInside();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,8 @@ public class EReceiptUtil {
|
|||||||
|
|
||||||
public EReceiptRequest generateQRReceipt(PayDetail payDetail, TransResultStatus status) {
|
public EReceiptRequest generateQRReceipt(PayDetail payDetail, TransResultStatus status) {
|
||||||
|
|
||||||
|
String terminalIdForEreceipt = SystemParamsOperation.getInstance().getTerminalIdForEreceipt();
|
||||||
|
|
||||||
double realAmount = payDetail.getAmount() / 100.0;
|
double realAmount = payDetail.getAmount() / 100.0;
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
String amount = df.format(realAmount);
|
String amount = df.format(realAmount);
|
||||||
@ -67,6 +69,9 @@ public class EReceiptUtil {
|
|||||||
request.setAppId(packageName);
|
request.setAppId(packageName);
|
||||||
request.setDE41(qrTerminalId);
|
request.setDE41(qrTerminalId);
|
||||||
request.setDE42(qrMerchantId);
|
request.setDE42(qrMerchantId);
|
||||||
|
request.setTerminalId(terminalIdForEreceipt);
|
||||||
|
request.setShortCode(qrMerchantId);
|
||||||
|
|
||||||
request.setInvoiceNumber(payDetail.getInvoiceNo());
|
request.setInvoiceNumber(payDetail.getInvoiceNo());
|
||||||
request.setDE11(payDetail.getVoucherNo());
|
request.setDE11(payDetail.getVoucherNo());
|
||||||
|
|
||||||
|
|||||||
@ -651,6 +651,8 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
}
|
}
|
||||||
else if (TextUtils.equals(name, "certificate_password")) {
|
else if (TextUtils.equals(name, "certificate_password")) {
|
||||||
SystemParamsOperation.getInstance().setCertificatePassword(data);
|
SystemParamsOperation.getInstance().setCertificatePassword(data);
|
||||||
|
}else if(TextUtils.equals(name, "terminalId")){
|
||||||
|
SystemParamsOperation.getInstance().setTerminalIdForEreceipt(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
app/uat/release/baselineProfiles/0/app-uat-release.dm
Normal file
BIN
app/uat/release/baselineProfiles/0/app-uat-release.dm
Normal file
Binary file not shown.
BIN
app/uat/release/baselineProfiles/1/app-uat-release.dm
Normal file
BIN
app/uat/release/baselineProfiles/1/app-uat-release.dm
Normal file
Binary file not shown.
37
app/uat/release/output-metadata.json
Normal file
37
app/uat/release/output-metadata.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.utsmm.kbz.uat",
|
||||||
|
"variantName": "uatRelease",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 1,
|
||||||
|
"versionName": "1.00-uat",
|
||||||
|
"outputFile": "app-uat-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File",
|
||||||
|
"baselineProfiles": [
|
||||||
|
{
|
||||||
|
"minApi": 28,
|
||||||
|
"maxApi": 30,
|
||||||
|
"baselineProfiles": [
|
||||||
|
"baselineProfiles/1/app-uat-release.dm"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"minApi": 31,
|
||||||
|
"maxApi": 2147483647,
|
||||||
|
"baselineProfiles": [
|
||||||
|
"baselineProfiles/0/app-uat-release.dm"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"minSdkVersionForDexing": 24
|
||||||
|
}
|
||||||
@ -35,10 +35,14 @@ public class EReceiptRequest {
|
|||||||
private String cardLabel;
|
private String cardLabel;
|
||||||
|
|
||||||
private String batchNumber;
|
private String batchNumber;
|
||||||
|
private String shortCode;
|
||||||
|
private String terminalId;
|
||||||
|
|
||||||
public EReceiptRequest() {}
|
public EReceiptRequest() {}
|
||||||
|
|
||||||
// GETTERS
|
// GETTERS
|
||||||
|
public String getTerminalId(){ return terminalId; }
|
||||||
|
public String getShortCode(){ return shortCode; }
|
||||||
|
|
||||||
public String getDE2() {
|
public String getDE2() {
|
||||||
return DE2;
|
return DE2;
|
||||||
@ -154,6 +158,8 @@ public class EReceiptRequest {
|
|||||||
this.batchNumber = batchNumber;
|
this.batchNumber = batchNumber;
|
||||||
}
|
}
|
||||||
// SETTERS
|
// SETTERS
|
||||||
|
public void setShortCode(String shortCode){ this.shortCode = shortCode; }
|
||||||
|
public void setTerminalId(String terminalId){ this.terminalId = terminalId; }
|
||||||
public void setDE3(String DE3) {
|
public void setDE3(String DE3) {
|
||||||
this.DE3 = DE3;
|
this.DE3 = DE3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1654,4 +1654,15 @@ public class SystemParamsOperation {
|
|||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getEreceiptAddress();
|
return params.getEreceiptAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTerminalIdForEreceipt(String data) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setTerminalIdForEreceipt(data);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTerminalIdForEreceipt(){
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getTerminalIdForEreceipt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -44,8 +44,8 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
// private String tmsAddress = "http://128.199.170.203";
|
// private String tmsAddress = "http://128.199.170.203";
|
||||||
private String tmsAddress = "http://sirius-nest.utsmyanmar.com";
|
private String tmsAddress = "http://sirius-nest.utsmyanmar.com";
|
||||||
// private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius"; //for uat
|
// private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius"; //for uat
|
||||||
private String ereceiptAddress = "http://receipt-nest.utsmyanmar.com";
|
private String ereceiptAddress = "http://receipt-nest.utsmyanmar.com"; //for on prime
|
||||||
// String baseUrl = "http://receipt-nest.utsmyanmar.com/"; //for uat
|
// private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt"; //for uat
|
||||||
|
|
||||||
|
|
||||||
private String terminalCapability = "E0E8C8";
|
private String terminalCapability = "E0E8C8";
|
||||||
@ -249,6 +249,7 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
private String certFilePath = "";
|
private String certFilePath = "";
|
||||||
private String certClientFilePath = "";
|
private String certClientFilePath = "";
|
||||||
private String certificatePassword = "";
|
private String certificatePassword = "";
|
||||||
|
private String terminalIdForEreceipt = "";
|
||||||
|
|
||||||
public boolean isQrPartialRefundEnable(){
|
public boolean isQrPartialRefundEnable(){
|
||||||
return qrPartialRefundEnable;
|
return qrPartialRefundEnable;
|
||||||
@ -1000,6 +1001,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
return certificatePassword;
|
return certificatePassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTerminalIdForEreceipt() {
|
||||||
|
return terminalIdForEreceipt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerminalIdForEreceipt(String data) {
|
||||||
|
this.terminalIdForEreceipt = data;
|
||||||
|
}
|
||||||
|
|
||||||
/* // 流水号起始
|
/* // 流水号起始
|
||||||
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
||||||
// 批次号起始
|
// 批次号起始
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user