Merge remote-tracking branch 'origin/merge_latest_SIT' into merge_latest_SIT
# Conflicts: # paylibs/src/main/java/com/utsmyanmar/paylibs/print/printx/BaseXPrint.java
This commit is contained in:
commit
83d7f44561
@ -112,7 +112,7 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
Log.e("Print Config", "Printer Error: " + printerStatus);
|
Log.e("Print Config", "Printer Error: " + printerStatus);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printer.setGray(GrayLevelEnum.LEVEL_2);
|
printer.setGray(GrayLevelEnum.LEVEL_1);
|
||||||
Typeface typeface = ResourcesCompat.getFont(requireContext(), R.font.consolas_bold);
|
Typeface typeface = ResourcesCompat.getFont(requireContext(), R.font.consolas_bold);
|
||||||
printer.setTypeface(typeface);
|
printer.setTypeface(typeface);
|
||||||
SystemParamsOperation sp = SystemParamsOperation.getInstance();
|
SystemParamsOperation sp = SystemParamsOperation.getInstance();
|
||||||
@ -147,8 +147,9 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
if (!TextUtils.isEmpty(sp.getSecHostName())) {
|
if (!TextUtils.isEmpty(sp.getSecHostName())) {
|
||||||
printer.appendPrnStr("SECONDARY HOST", FONT_NORMAL, AlignEnum.LEFT, true);
|
printer.appendPrnStr("SECONDARY HOST", FONT_NORMAL, AlignEnum.LEFT, true);
|
||||||
printer.appendPrnStr("Name : " + sp.getSecHostName(), FONT_NORMAL, AlignEnum.LEFT, false);
|
printer.appendPrnStr("Name : " + sp.getSecHostName(), FONT_NORMAL, AlignEnum.LEFT, false);
|
||||||
printer.appendPrnStr("TID : " + sp.getSecHostTerminalId(), FONT_NORMAL, AlignEnum.LEFT, false);
|
// printer.appendPrnStr("TID : " + sp.getSecHostTerminalId(), FONT_NORMAL, AlignEnum.LEFT, false);
|
||||||
printer.appendPrnStr("MID : " + sp.getSecHostMerchantId(), FONT_NORMAL, AlignEnum.LEFT, false);
|
// printer.appendPrnStr("MID : " + sp.getSecHostMerchantId(), FONT_NORMAL, AlignEnum.LEFT, false);
|
||||||
|
printer.appendPrnStr("SHORT CODE : " + sp.getShortCode(), FONT_NORMAL, AlignEnum.LEFT, false);
|
||||||
String secHostIpAddress = sp.getSecHostIpAddress();
|
String secHostIpAddress = sp.getSecHostIpAddress();
|
||||||
String[] secHostIpAndPort = splitIpAndPort(secHostIpAddress);
|
String[] secHostIpAndPort = splitIpAndPort(secHostIpAddress);
|
||||||
String secHostIp = secHostIpAndPort[0];
|
String secHostIp = secHostIpAndPort[0];
|
||||||
|
|||||||
@ -23,13 +23,16 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
|
|
||||||
// Secondary Host
|
// Secondary Host
|
||||||
public MutableLiveData<String> secHostName = new MutableLiveData<>();
|
public MutableLiveData<String> secHostName = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostTid = new MutableLiveData<>();
|
// public MutableLiveData<String> secHostTid = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostMid = new MutableLiveData<>();
|
// public MutableLiveData<String> secHostMid = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> shortCode = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostPrimaryIp = new MutableLiveData<>();
|
public MutableLiveData<String> secHostPrimaryIp = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostPrimaryPort = new MutableLiveData<>();
|
public MutableLiveData<String> secHostPrimaryPort = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostSecondaryIp = new MutableLiveData<>();
|
public MutableLiveData<String> secHostSecondaryIp = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostSecondaryPort = new MutableLiveData<>();
|
public MutableLiveData<String> secHostSecondaryPort = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public MutableLiveData<String> terminalName = new MutableLiveData<>();
|
||||||
|
|
||||||
|
|
||||||
public void loadConfig() {
|
public void loadConfig() {
|
||||||
|
|
||||||
@ -40,6 +43,7 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
merchantPhone.setValue(sp.getMerchantPhoneNo());
|
merchantPhone.setValue(sp.getMerchantPhoneNo());
|
||||||
merchantAddress1.setValue(sp.getMerchantAddress());
|
merchantAddress1.setValue(sp.getMerchantAddress());
|
||||||
merchantAddress2.setValue(sp.getMerchantAddress2());
|
merchantAddress2.setValue(sp.getMerchantAddress2());
|
||||||
|
terminalName.setValue(sp.getTerminalName());
|
||||||
|
|
||||||
// PRIMARY HOST
|
// PRIMARY HOST
|
||||||
hostName.setValue(sp.getHostName());
|
hostName.setValue(sp.getHostName());
|
||||||
@ -60,8 +64,9 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
if (sp.getSecHostName() != null && !sp.getSecHostName().isEmpty()) {
|
if (sp.getSecHostName() != null && !sp.getSecHostName().isEmpty()) {
|
||||||
|
|
||||||
secHostName.setValue(sp.getSecHostName());
|
secHostName.setValue(sp.getSecHostName());
|
||||||
secHostTid.setValue(sp.getSecHostTerminalId());
|
// secHostTid.setValue(sp.getSecHostTerminalId());
|
||||||
secHostMid.setValue(sp.getSecHostMerchantId());
|
// secHostMid.setValue(sp.getSecHostMerchantId());
|
||||||
|
shortCode.setValue(sp.getShortCode());
|
||||||
|
|
||||||
String[] shp = split(sp.getSecHostIpAddress());
|
String[] shp = split(sp.getSecHostIpAddress());
|
||||||
secHostPrimaryIp.setValue(shp[0]);
|
secHostPrimaryIp.setValue(shp[0]);
|
||||||
|
|||||||
@ -108,6 +108,7 @@ public class EReceiptUtil {
|
|||||||
double realAmount = amt / 100.0;
|
double realAmount = amt / 100.0;
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
String amount = df.format(realAmount);
|
String amount = df.format(realAmount);
|
||||||
|
String terminalIdForEreceipt = SystemParamsOperation.getInstance().getTerminalIdForEreceipt();
|
||||||
|
|
||||||
String currentTimeStamp = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.getDefault())
|
String currentTimeStamp = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.getDefault())
|
||||||
.format(new java.util.Date());
|
.format(new java.util.Date());
|
||||||
@ -122,6 +123,8 @@ 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(invoiceNo != null ? invoiceNo : "");
|
request.setInvoiceNumber(invoiceNo != null ? invoiceNo : "");
|
||||||
request.setDE11(voucherNo != null ? voucherNo : "");
|
request.setDE11(voucherNo != null ? voucherNo : "");
|
||||||
|
|
||||||
|
|||||||
@ -157,6 +157,7 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
SystemParamsOperation.getInstance().setMerchantAddress(siriusMerchant.getAddress());
|
SystemParamsOperation.getInstance().setMerchantAddress(siriusMerchant.getAddress());
|
||||||
SystemParamsOperation.getInstance().setMerchantAddress2(siriusMerchant.getAddress2());
|
SystemParamsOperation.getInstance().setMerchantAddress2(siriusMerchant.getAddress2());
|
||||||
SystemParamsOperation.getInstance().setMerchantPhoneNo(siriusMerchant.getMobile());
|
SystemParamsOperation.getInstance().setMerchantPhoneNo(siriusMerchant.getMobile());
|
||||||
|
SystemParamsOperation.getInstance().setTerminalName(siriusMerchant.getDescription());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="android.view.View"/>
|
<import type="android.view.View"/>
|
||||||
<import type="android.text.TextUtils" />
|
<import type="android.text.TextUtils"/>
|
||||||
<variable
|
<variable
|
||||||
name="viewModel"
|
name="viewModel"
|
||||||
type="com.utsmm.kbz.ui.settings.HostConfigViewModel" />
|
type="com.utsmm.kbz.ui.settings.HostConfigViewModel" />
|
||||||
@ -46,129 +46,270 @@
|
|||||||
android:scrollbars="none">
|
android:scrollbars="none">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- HEADER -->
|
<!-- HEADER -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="TERMINAL CONFIGURATION"
|
android:text="TERMINAL CONFIGURATION"
|
||||||
android:gravity="center"
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textSize="18sp"
|
android:textAlignment="center"
|
||||||
android:paddingBottom="12dp"/>
|
android:paddingBottom="12dp"
|
||||||
|
tools:text="TERMINAL CONFIGURATION"/>
|
||||||
|
|
||||||
<!-- Merchant Info -->
|
<!-- Merchant Info -->
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
<TextView
|
||||||
android:text="@{viewModel.merchantName}" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
android:text="@{viewModel.merchantName}"
|
||||||
android:text="@{viewModel.merchantPhone}" />
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="16sp"
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
android:textStyle="bold"
|
||||||
android:text="@{viewModel.merchantAddress1}" />
|
android:textAlignment="center"
|
||||||
|
tools:text="Someone Mart"/>
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.merchantAddress2}" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="--------------------------------"
|
android:text="@{viewModel.merchantAddress1}"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textAlignment="center"
|
||||||
|
tools:text="Corner of Bogyoke and Botahtaung Pagoda Street"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.merchantAddress2}"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textAlignment="center"
|
||||||
|
tools:text="Yangon"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{viewModel.terminalName}"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Yangon"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="--------------------------------------------------------------------------"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"/>
|
android:paddingBottom="8dp"
|
||||||
|
tools:text="--------------------------------------------------------------------------"/>
|
||||||
|
|
||||||
<!-- PRIMARY HOST -->
|
<!-- PRIMARY HOST -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="PRIMARY HOST"
|
android:text="PRIMARY HOST"
|
||||||
android:textStyle="bold" />
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
android:textStyle="bold"
|
||||||
android:text='@{"Name : " + viewModel.hostName}' />
|
tools:text="PRIMARY HOST"/>
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"TID : " + viewModel.tid}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"MID : " + viewModel.mid}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Primary Ip : " + viewModel.primaryIp}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Primary Port : " + viewModel.primaryPort}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Secondary Ip : " + viewModel.secondaryIp}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Secondary Port : " + viewModel.secondaryPort}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Currency Code : " + viewModel.currencyCode}' />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="--------------------------------"
|
android:text='@{"Name : " + viewModel.hostName}'
|
||||||
android:paddingTop="8dp"
|
android:fontFamily="@font/rubik_regular"
|
||||||
android:paddingBottom="8dp"/>
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Name : Card Host"/>
|
||||||
|
|
||||||
<!-- SECONDARY HOST (only if exists) -->
|
<TextView
|
||||||
<LinearLayout
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility='@{!viewModel.secHostName.isEmpty() ? View.VISIBLE : View.GONE}'>
|
android:text='@{"TID : " + viewModel.tid}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="TID : 12345678"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"MID : " + viewModel.mid}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="MID : 123456789876543"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"PRIMARY IP : " + viewModel.primaryIp}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="PRIMARY IP : primaryidport.com"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"PRIMARY PORT : " + viewModel.primaryPort}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="PRIMARY PORT : 8080"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"SECONDARY IP : " + viewModel.secondaryIp}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="SECONDARY IP : secondaryidport.com"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"SECONDARY PORT : " + viewModel.secondaryPort}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="SECONDARY PORT : 8080"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"CURRENCY CODE : " + viewModel.currencyCode}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="CURRENCY CODE : MMK"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="--------------------------------------------------------------------------"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
tools:text="--------------------------------------------------------------------------"/>
|
||||||
|
|
||||||
|
<!-- SECONDARY HOST -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility='@{!viewModel.secHostName.isEmpty() ? View.VISIBLE : View.GONE}'
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="SECONDARY HOST"
|
android:text="SECONDARY HOST"
|
||||||
android:textStyle="bold" />
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
android:textStyle="bold"
|
||||||
android:text='@{"Name : " + viewModel.secHostName}' />
|
tools:text="SECONDARY HOST"/>
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"TID : " + viewModel.secHostTid}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"MID : " + viewModel.secHostMid}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Primary Ip : " + viewModel.secHostPrimaryIp}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Primary Port : " + viewModel.secHostPrimaryPort}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Secondary Ip : " + viewModel.secHostSecondaryIp}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Secondary Port : " + viewModel.secHostSecondaryPort}' />
|
|
||||||
|
|
||||||
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
|
|
||||||
android:text='@{"Currency Code : " + viewModel.currencyCode}' />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="--------------------------------"
|
android:text='@{"Name : " + viewModel.secHostName}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Name : QR Host"/>
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:text='@{"TID : " + viewModel.secHostTid}'-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
|
<!-- android:textSize="14sp"-->
|
||||||
|
<!-- android:textStyle="bold"-->
|
||||||
|
<!-- tools:text="TID : 87654321"/>-->
|
||||||
|
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:text='@{"MID : " + viewModel.secHostMid}'-->
|
||||||
|
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||||
|
<!-- android:textSize="14sp"-->
|
||||||
|
<!-- android:textStyle="bold"-->
|
||||||
|
<!-- tools:text="MID : 987654321012345"/>-->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"SHORT CODE : " + viewModel.shortCode}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="SHORT CODE : 12345678987"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"Primary Ip : " + viewModel.secHostPrimaryIp}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Primary Ip : 10.10.10.10"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"Primary Port : " + viewModel.secHostPrimaryPort}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Primary Port : 5000"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"Secondary Ip : " + viewModel.secHostSecondaryIp}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Secondary Ip : 10.10.10.11"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"Secondary Port : " + viewModel.secHostSecondaryPort}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Secondary Port : 5001"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text='@{"Currency Code : " + viewModel.currencyCode}'
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Currency Code : MMK"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="--------------------------------------------------------------------------"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingBottom="8dp"/>
|
android:paddingBottom="8dp"
|
||||||
|
tools:text="--------------------------------------------------------------------------"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
<!-- ACTION BUTTONS -->
|
<!-- ACTION BUTTONS -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/actionButtons"
|
android:id="@+id/actionButtons"
|
||||||
@ -187,7 +328,8 @@
|
|||||||
android:onClick="@{()-> click.onCancel()}"
|
android:onClick="@{()-> click.onCancel()}"
|
||||||
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
android:background="@drawable/bg_rounded_btn_cancel_cv"
|
||||||
android:textColor="@color/colorPrimary"
|
android:textColor="@color/colorPrimary"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"
|
||||||
|
tools:text="Cancel"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@ -198,9 +340,9 @@
|
|||||||
android:onClick="@{()-> click.onPrint()}"
|
android:onClick="@{()-> click.onPrint()}"
|
||||||
android:background="@drawable/bg_rounded_btn_cv"
|
android:background="@drawable/bg_rounded_btn_cv"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textStyle="bold"/>
|
android:textStyle="bold"
|
||||||
|
tools:text="Print"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@ -82,8 +82,9 @@ public abstract class BaseXPrint {
|
|||||||
protected final int FONT_SIZE_BIG = 24;
|
protected final int FONT_SIZE_BIG = 24;
|
||||||
|
|
||||||
protected int fontSmall = 16;
|
protected int fontSmall = 16;
|
||||||
|
// protected FontEntity fontSmall = new FontEntity(DotMatrixFontEnum.CH_SONG_20X20, DotMatrixFontEnum.ASC_SONG_8X16);
|
||||||
|
|
||||||
protected int fontNormal = 20;
|
protected int fontNormal = 21;
|
||||||
|
|
||||||
// protected FontEntity fontNormal = new FontEntity(DotMatrixFontEnum.CH_SONG_24X24, DotMatrixFontEnum.ASC_SONG_12X24);
|
// protected FontEntity fontNormal = new FontEntity(DotMatrixFontEnum.CH_SONG_24X24, DotMatrixFontEnum.ASC_SONG_12X24);
|
||||||
protected FontEntity fontBold = new FontEntity(DotMatrixFontEnum.CH_SONG_24X24, DotMatrixFontEnum.ASC_SONG_BOLD_16X24);
|
protected FontEntity fontBold = new FontEntity(DotMatrixFontEnum.CH_SONG_24X24, DotMatrixFontEnum.ASC_SONG_BOLD_16X24);
|
||||||
@ -116,7 +117,7 @@ public abstract class BaseXPrint {
|
|||||||
Resources resources = PayLibsUtils.getInstance().context.getResources();
|
Resources resources = PayLibsUtils.getInstance().context.getResources();
|
||||||
// Typeface typeface = ResourcesCompat.getFont(PayLibsUtils.getInstance().context, R.font.consolas);
|
// Typeface typeface = ResourcesCompat.getFont(PayLibsUtils.getInstance().context, R.font.consolas);
|
||||||
// printer.setTypeface(typeface);
|
// printer.setTypeface(typeface);
|
||||||
printer.setTypeface(Typeface.createFromAsset(PayLibsUtils.getInstance().context.getAssets(), "fonts/victor_mono.ttf"));
|
printer.setTypeface(Typeface.createFromAsset(PayLibsUtils.getInstance().context.getAssets(), "fonts/consolab.ttf"));
|
||||||
printer.setGray(getGrayLevel());
|
printer.setGray(getGrayLevel());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -858,18 +859,16 @@ public abstract class BaseXPrint {
|
|||||||
if (TextUtils.equals(merchantAddress2, "") || merchantAddress2 == null) {
|
if (TextUtils.equals(merchantAddress2, "") || merchantAddress2 == null) {
|
||||||
merchantAddress2 = "MERCHANT ADDRESS2";
|
merchantAddress2 = "MERCHANT ADDRESS2";
|
||||||
}
|
}
|
||||||
if (TextUtils.equals(merchantPhoneNo, "") || merchantPhoneNo == null) {
|
// if (TextUtils.equals(merchantPhoneNo, "") || merchantPhoneNo == null) {
|
||||||
merchantPhoneNo = "MERCHANT PHONENO";
|
// merchantPhoneNo = "MERCHANT PHONENO";
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
printer.appendPrnStr(receiptHeader, fontNormal, AlignEnum.CENTER,false);
|
printer.appendPrnStr(receiptHeader, fontNormal, AlignEnum.CENTER,false);
|
||||||
printer.appendPrnStr(merchantAddress, fontNormal, AlignEnum.CENTER,false);
|
printer.appendPrnStr(merchantAddress, fontNormal, AlignEnum.CENTER,false);
|
||||||
printer.appendPrnStr(merchantAddress2, fontNormal, AlignEnum.CENTER,false);
|
printer.appendPrnStr(merchantAddress2, fontNormal, AlignEnum.CENTER,false);
|
||||||
printer.appendPrnStr(merchantPhoneNo, fontNormal, AlignEnum.CENTER,false);
|
// printer.appendPrnStr(merchantPhoneNo, fontNormal, AlignEnum.CENTER,false);
|
||||||
emptyLine(2);
|
emptyLine(1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void printKeyInfo() {
|
protected void printKeyInfo() {
|
||||||
@ -936,15 +935,19 @@ public abstract class BaseXPrint {
|
|||||||
/* 17 Sept 2024 Yoma requested to changed slip design for QR*/
|
/* 17 Sept 2024 Yoma requested to changed slip design for QR*/
|
||||||
// printer.printColumnsString(new String[]{"MID :" + payDetail.getMerchantNo(), ""}, new int[]{3, 1}, new int[]{0, 2}, innerResultCallback);
|
// printer.printColumnsString(new String[]{"MID :" + payDetail.getMerchantNo(), ""}, new int[]{3, 1}, new int[]{0, 2}, innerResultCallback);
|
||||||
// printer.printColumnsString(new String[]{"TID :" + payDetail.getTerminalNo(), ""}, new int[]{3, 1}, new int[]{0, 2}, innerResultCallback);
|
// printer.printColumnsString(new String[]{"TID :" + payDetail.getTerminalNo(), ""}, new int[]{3, 1}, new int[]{0, 2}, innerResultCallback);
|
||||||
printer.appendPrnStr("MID :" + payDetail.getMerchantNo(), fontNormal, AlignEnum.LEFT,false);
|
if (payDetail.getTransactionType() == TransactionsType.MMQR.value){
|
||||||
printer.appendPrnStr("TID :" + payDetail.getTerminalNo(), fontNormal, AlignEnum.LEFT,false);
|
printer.appendPrnStr("SHORT CODE:" + payDetail.getMerchantNo(), fontNormal, AlignEnum.LEFT,false);
|
||||||
|
}else{
|
||||||
|
printer.appendPrnStr("MID :" + payDetail.getMerchantNo(), fontNormal, AlignEnum.LEFT,false);
|
||||||
|
printer.appendPrnStr("TID :" + payDetail.getTerminalNo(), fontNormal, AlignEnum.LEFT,false);
|
||||||
|
}
|
||||||
|
|
||||||
emptyLine(1);
|
emptyLine(1);
|
||||||
printer.appendPrnStr(transType.replace("_", " "),fontNormal, AlignEnum.CENTER,true);
|
printer.appendPrnStr(transType.replace("_", " "),fontNormal, AlignEnum.CENTER,true);
|
||||||
|
|
||||||
if (!(payDetail.getQrTransStatus() != 1 && (payDetail.getTransactionType() == TransactionsType.MMQR_REFUND.value || payDetail.getTransactionType() == TransactionsType.MMQR.value))) {
|
if (!(payDetail.getQrTransStatus() != 1 && (payDetail.getTransactionType() == TransactionsType.MMQR_REFUND.value || payDetail.getTransactionType() == TransactionsType.MMQR.value))) {
|
||||||
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
||||||
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
// printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -336,7 +336,7 @@ public class PrintXImpl extends BaseXPrint implements PrintX {
|
|||||||
|
|
||||||
|
|
||||||
if (!(payDetail.getQrTransStatus() != 1 && (payDetail.getTransactionType() == TransactionsType.MMQR_REFUND.value || payDetail.getTransactionType() == TransactionsType.MMQR.value))) {
|
if (!(payDetail.getQrTransStatus() != 1 && (payDetail.getTransactionType() == TransactionsType.MMQR_REFUND.value || payDetail.getTransactionType() == TransactionsType.MMQR.value))) {
|
||||||
emptyLine(2);
|
emptyLine(1);
|
||||||
}
|
}
|
||||||
// check is pin change
|
// check is pin change
|
||||||
|
|
||||||
|
|||||||
@ -1665,4 +1665,15 @@ public class SystemParamsOperation {
|
|||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getTerminalIdForEreceipt();
|
return params.getTerminalIdForEreceipt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTerminalName() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getTerminalName();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerminalName(String description) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setTerminalName(description);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -47,6 +47,7 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
private String ereceiptAddress = "http://receipt-nest.utsmyanmar.com"; //for on prime
|
private String ereceiptAddress = "http://receipt-nest.utsmyanmar.com"; //for on prime
|
||||||
// private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt"; //for uat
|
// private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt"; //for uat
|
||||||
|
|
||||||
|
private String terminalName = "";
|
||||||
|
|
||||||
private String terminalCapability = "E0E8C8";
|
private String terminalCapability = "E0E8C8";
|
||||||
|
|
||||||
@ -1009,6 +1010,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
this.terminalIdForEreceipt = data;
|
this.terminalIdForEreceipt = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTerminalName() {
|
||||||
|
return terminalName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerminalName(String terminalName) {
|
||||||
|
this.terminalName = terminalName;
|
||||||
|
}
|
||||||
|
|
||||||
/* // 流水号起始
|
/* // 流水号起始
|
||||||
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
||||||
// 批次号起始
|
// 批次号起始
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user