merchant phone no added
This commit is contained in:
parent
4fffc9990e
commit
009ff28954
@ -53,6 +53,7 @@ import com.mob.utsmyanmar.viewmodel.SharedViewModel
|
|||||||
import com.utsmyanmar.paylibs.model.PayDetail
|
import com.utsmyanmar.paylibs.model.PayDetail
|
||||||
import com.utsmyanmar.paylibs.utils.POSUtil
|
import com.utsmyanmar.paylibs.utils.POSUtil
|
||||||
import com.utsmyanmar.paylibs.utils.PrintStatus
|
import com.utsmyanmar.paylibs.utils.PrintStatus
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
||||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@ -250,6 +251,13 @@ fun ReceiptPreview(
|
|||||||
.padding(20.dp),
|
.padding(20.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
|
val merchantPhoneNo = SystemParamsOperation.getInstance()
|
||||||
|
.merchantPhoneNo
|
||||||
|
?.takeIf { it.isNotBlank() }
|
||||||
|
val merchantMobileNo = SystemParamsOperation.getInstance()
|
||||||
|
.merchantMobileNo
|
||||||
|
?.takeIf { it.isNotBlank() }
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = "Transaction Receipt",
|
text = "Transaction Receipt",
|
||||||
style = MaterialTheme.typography.bodyMedium
|
style = MaterialTheme.typography.bodyMedium
|
||||||
@ -266,6 +274,22 @@ fun ReceiptPreview(
|
|||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
color = Color.Gray
|
color = Color.Gray
|
||||||
)
|
)
|
||||||
|
merchantPhoneNo?.let { phoneNo ->
|
||||||
|
Text(
|
||||||
|
text = phoneNo,
|
||||||
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
color = Color.Gray
|
||||||
|
)
|
||||||
|
}
|
||||||
|
merchantMobileNo?.let { mobileNo ->
|
||||||
|
Text(
|
||||||
|
text = mobileNo,
|
||||||
|
style = MaterialTheme.typography.labelLarge,
|
||||||
|
textAlign = TextAlign.Center,
|
||||||
|
color = Color.Gray
|
||||||
|
)
|
||||||
|
}
|
||||||
// Spacer(modifier = Modifier.height(4.dp))
|
// Spacer(modifier = Modifier.height(4.dp))
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
ReceiptDivider()
|
ReceiptDivider()
|
||||||
|
|||||||
@ -88,6 +88,7 @@ class TMSSetupsImpl : TMSSetups {
|
|||||||
ops.merchantName = m.name
|
ops.merchantName = m.name
|
||||||
ops.merchantAddress = m.address
|
ops.merchantAddress = m.address
|
||||||
ops.merchantPhoneNo = m.phone
|
ops.merchantPhoneNo = m.phone
|
||||||
|
ops.merchantMobileNo = m.mobile_phone
|
||||||
}
|
}
|
||||||
|
|
||||||
siriusResponse.address.takeIf { it.isNotEmpty() }?.let { ops.merchantAddress = it }
|
siriusResponse.address.takeIf { it.isNotEmpty() }?.let { ops.merchantAddress = it }
|
||||||
|
|||||||
@ -16,6 +16,8 @@ public class SiriusMerchant {
|
|||||||
|
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
|
private String mobile_phone;
|
||||||
|
|
||||||
public SiriusMerchant(String id, String name, String description, String address,String address2,String phone,String mobile) {
|
public SiriusMerchant(String id, String name, String description, String address,String address2,String phone,String mobile) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -50,6 +52,14 @@ public class SiriusMerchant {
|
|||||||
return mobile;
|
return mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMobile_phone() {
|
||||||
|
return mobile_phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobile_phone(String mobile_phone) {
|
||||||
|
this.mobile_phone = mobile_phone;
|
||||||
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,11 +176,13 @@ public class PrintReceipt {
|
|||||||
String merchantAddress = "";
|
String merchantAddress = "";
|
||||||
String merchantAddress2 = "";
|
String merchantAddress2 = "";
|
||||||
String merchantPhoneNo = "";
|
String merchantPhoneNo = "";
|
||||||
|
String merchantMobileNo = "";
|
||||||
|
|
||||||
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
||||||
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
||||||
merchantAddress2 = SystemParamsOperation.getInstance().getMerchantAddress2();
|
merchantAddress2 = SystemParamsOperation.getInstance().getMerchantAddress2();
|
||||||
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
||||||
|
merchantMobileNo = SystemParamsOperation.getInstance().getMerchantMobileNo();
|
||||||
|
|
||||||
if (TextUtils.equals(merchantName, "") || merchantName == null) {
|
if (TextUtils.equals(merchantName, "") || merchantName == null) {
|
||||||
merchantName = "MERCHANT NAME";
|
merchantName = "MERCHANT NAME";
|
||||||
@ -207,6 +209,9 @@ public class PrintReceipt {
|
|||||||
sunmiPrinterService.printText(merchantAddress + "\n", innerResultCallback);
|
sunmiPrinterService.printText(merchantAddress + "\n", innerResultCallback);
|
||||||
sunmiPrinterService.printText(merchantAddress2 + "\n", innerResultCallback);
|
sunmiPrinterService.printText(merchantAddress2 + "\n", innerResultCallback);
|
||||||
sunmiPrinterService.printText(merchantPhoneNo + "\n", innerResultCallback);
|
sunmiPrinterService.printText(merchantPhoneNo + "\n", innerResultCallback);
|
||||||
|
if (merchantMobileNo != null && !merchantMobileNo.trim().isEmpty()) {
|
||||||
|
sunmiPrinterService.printText(merchantMobileNo + "\n", innerResultCallback);
|
||||||
|
}
|
||||||
sunmiPrinterService.lineWrap(1, innerResultCallback);
|
sunmiPrinterService.lineWrap(1, innerResultCallback);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@ -817,12 +817,14 @@ public abstract class BaseXPrint {
|
|||||||
String merchantName = "";
|
String merchantName = "";
|
||||||
String merchantAddress = "";
|
String merchantAddress = "";
|
||||||
String merchantPhoneNo = "";
|
String merchantPhoneNo = "";
|
||||||
|
String merchantMobileNo = "";
|
||||||
List<String> wrappedAddressText = new ArrayList<>();
|
List<String> wrappedAddressText = new ArrayList<>();
|
||||||
|
|
||||||
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
||||||
receiptHeader = SystemParamsOperation.getInstance().getReceiptHeader();
|
receiptHeader = SystemParamsOperation.getInstance().getReceiptHeader();
|
||||||
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
||||||
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
||||||
|
merchantMobileNo = SystemParamsOperation.getInstance().getMerchantMobileNo();
|
||||||
|
|
||||||
if (receiptHeader == null || TextUtils.equals(receiptHeader, "") || receiptHeader.trim().isEmpty()) {
|
if (receiptHeader == null || TextUtils.equals(receiptHeader, "") || receiptHeader.trim().isEmpty()) {
|
||||||
receiptHeader = merchantName;
|
receiptHeader = merchantName;
|
||||||
@ -852,6 +854,9 @@ public abstract class BaseXPrint {
|
|||||||
sunmiPrinterService.printText(addressLine + "\n", innerResultCallback);
|
sunmiPrinterService.printText(addressLine + "\n", innerResultCallback);
|
||||||
}
|
}
|
||||||
sunmiPrinterService.printText(merchantPhoneNo + "\n", innerResultCallback);
|
sunmiPrinterService.printText(merchantPhoneNo + "\n", innerResultCallback);
|
||||||
|
if (merchantMobileNo != null && !merchantMobileNo.trim().isEmpty()) {
|
||||||
|
sunmiPrinterService.printText(merchantMobileNo + "\n", innerResultCallback);
|
||||||
|
}
|
||||||
sunmiPrinterService.lineWrap(1, innerResultCallback);
|
sunmiPrinterService.lineWrap(1, innerResultCallback);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@ -707,6 +707,11 @@ public class SystemParamsOperation {
|
|||||||
return paramsSettings.getMerchantPhoneNo();
|
return paramsSettings.getMerchantPhoneNo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMerchantMobileNo() {
|
||||||
|
SystemParamsSettings paramsSettings = getSystemParamsSettings();
|
||||||
|
return paramsSettings.getMerchantMobileNo();
|
||||||
|
}
|
||||||
|
|
||||||
public String getMerchantAddress2() {
|
public String getMerchantAddress2() {
|
||||||
SystemParamsSettings paramsSettings = getSystemParamsSettings();
|
SystemParamsSettings paramsSettings = getSystemParamsSettings();
|
||||||
return paramsSettings.getMerchantAddress2();
|
return paramsSettings.getMerchantAddress2();
|
||||||
@ -955,6 +960,12 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setMerchantMobileNo(String merchantMobileNo) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setMerchantMobileNo(merchantMobileNo);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public void setIpAddress(String ipAddress){
|
public void setIpAddress(String ipAddress){
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setIpAddress(ipAddress);
|
params.setIpAddress(ipAddress);
|
||||||
|
|||||||
@ -64,6 +64,8 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
|
|
||||||
private String merchantPhoneNo = "";
|
private String merchantPhoneNo = "";
|
||||||
|
|
||||||
|
private String merchantMobileNo = "";
|
||||||
|
|
||||||
private String systemPassword = "";
|
private String systemPassword = "";
|
||||||
|
|
||||||
private String settlementPassword = "";
|
private String settlementPassword = "";
|
||||||
@ -819,6 +821,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
return merchantPhoneNo;
|
return merchantPhoneNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setMerchantMobileNo(String merchantMobileNo) {
|
||||||
|
this.merchantMobileNo = merchantMobileNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getMerchantMobileNo() {
|
||||||
|
return merchantMobileNo;
|
||||||
|
}
|
||||||
|
|
||||||
protected void setSystemPassword(String systemPassword) {
|
protected void setSystemPassword(String systemPassword) {
|
||||||
this.systemPassword = systemPassword;
|
this.systemPassword = systemPassword;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user