Compare commits
No commits in common. "eafbecafbd9c4cb87dc6398e85351359deaba253" and "f958dfe572c22c56f0d21f6ff7ca7f3b5fd2369f" have entirely different histories.
eafbecafbd
...
f958dfe572
@ -36,7 +36,6 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
||||
@ -53,7 +52,6 @@ import com.mob.utsmyanmar.viewmodel.SharedViewModel
|
||||
import com.utsmyanmar.paylibs.model.PayDetail
|
||||
import com.utsmyanmar.paylibs.utils.POSUtil
|
||||
import com.utsmyanmar.paylibs.utils.PrintStatus
|
||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@ -251,50 +249,26 @@ fun ReceiptPreview(
|
||||
.padding(20.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
val merchantPhoneNo = SystemParamsOperation.getInstance()
|
||||
.merchantPhoneNo
|
||||
?.takeIf { it.isNotBlank() }
|
||||
val merchantMobileNo = SystemParamsOperation.getInstance()
|
||||
.merchantMobileNo
|
||||
?.takeIf { it.isNotBlank() }
|
||||
|
||||
Text(
|
||||
text = "Transaction Receipt",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = "MOB POS",
|
||||
style = MaterialTheme.typography.headlineLarge
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = state.payDetail?.merchantName.toString(),
|
||||
text = "Transaction Receipt",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = copyLabel,
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
textAlign = TextAlign.Center,
|
||||
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(16.dp))
|
||||
ReceiptDivider()
|
||||
ReceiptRow("Date", convertDateString(state.payDetail?.transDate.toString()))
|
||||
ReceiptRow("Time", state.payDetail?.transTime.toString())
|
||||
ReceiptRow("Merchant Name", state.payDetail?.merchantName.toString())
|
||||
ReceiptRow("TID", state.payDetail?.terminalNo.toString())
|
||||
ReceiptRow("Trace No", state.payDetail?.voucherNo.toString())
|
||||
ReceiptRow("Ref No", state.payDetail?.referNo.toString())
|
||||
@ -305,21 +279,17 @@ fun ReceiptPreview(
|
||||
if (prefix.isEmpty() && (state.payDetail?.transactionType ?: 0) == TransactionsType.CASH_OUT.value) "-$amt" else "$prefix$amt"
|
||||
})
|
||||
ReceiptRow("Card Type", state.payDetail?.accountType.toString())
|
||||
ReceiptRow("Card No", maskCardNumber(state.payDetail?.cardNo.orEmpty()))
|
||||
ReceiptRow("Card No", state.payDetail?.cardNo.toString())
|
||||
ReceiptRow("Status", if (isPreview) "SUCCESS" else state.payDetail?.let(::displayTransactionStatus).orEmpty())
|
||||
ReceiptDivider()
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = copyLabel,
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
color = Color.Gray
|
||||
)
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
Text(
|
||||
text = "Thank You",
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
|
||||
Text(
|
||||
text = "Please keep this receipt",
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
@ -327,11 +297,6 @@ fun ReceiptPreview(
|
||||
}
|
||||
}
|
||||
|
||||
private fun maskCardNumber(cardNumber: String): String {
|
||||
if (cardNumber.length <= 10) return cardNumber
|
||||
return cardNumber.take(6) + "*".repeat(cardNumber.length - 10) + cardNumber.takeLast(4)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ReceiptRow(
|
||||
label: String,
|
||||
|
||||
@ -88,7 +88,6 @@ class TMSSetupsImpl : TMSSetups {
|
||||
ops.merchantName = m.name
|
||||
ops.merchantAddress = m.address
|
||||
ops.merchantPhoneNo = m.phone
|
||||
ops.merchantMobileNo = m.mobile_phone
|
||||
}
|
||||
|
||||
siriusResponse.address.takeIf { it.isNotEmpty() }?.let { ops.merchantAddress = it }
|
||||
|
||||
@ -16,8 +16,6 @@ public class SiriusMerchant {
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String mobile_phone;
|
||||
|
||||
public SiriusMerchant(String id, String name, String description, String address,String address2,String phone,String mobile) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
@ -52,14 +50,6 @@ public class SiriusMerchant {
|
||||
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) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ -176,13 +176,11 @@ public class PrintReceipt {
|
||||
String merchantAddress = "";
|
||||
String merchantAddress2 = "";
|
||||
String merchantPhoneNo = "";
|
||||
String merchantMobileNo = "";
|
||||
|
||||
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
||||
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
||||
merchantAddress2 = SystemParamsOperation.getInstance().getMerchantAddress2();
|
||||
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
||||
merchantMobileNo = SystemParamsOperation.getInstance().getMerchantMobileNo();
|
||||
|
||||
if (TextUtils.equals(merchantName, "") || merchantName == null) {
|
||||
merchantName = "MERCHANT NAME";
|
||||
@ -209,9 +207,6 @@ public class PrintReceipt {
|
||||
sunmiPrinterService.printText(merchantAddress + "\n", innerResultCallback);
|
||||
sunmiPrinterService.printText(merchantAddress2 + "\n", innerResultCallback);
|
||||
sunmiPrinterService.printText(merchantPhoneNo + "\n", innerResultCallback);
|
||||
if (merchantMobileNo != null && !merchantMobileNo.trim().isEmpty()) {
|
||||
sunmiPrinterService.printText(merchantMobileNo + "\n", innerResultCallback);
|
||||
}
|
||||
sunmiPrinterService.lineWrap(1, innerResultCallback);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@ -817,14 +817,12 @@ public abstract class BaseXPrint {
|
||||
String merchantName = "";
|
||||
String merchantAddress = "";
|
||||
String merchantPhoneNo = "";
|
||||
String merchantMobileNo = "";
|
||||
List<String> wrappedAddressText = new ArrayList<>();
|
||||
|
||||
merchantName = SystemParamsOperation.getInstance().getMerchantName();
|
||||
receiptHeader = SystemParamsOperation.getInstance().getReceiptHeader();
|
||||
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
||||
merchantPhoneNo = SystemParamsOperation.getInstance().getMerchantPhoneNo();
|
||||
merchantMobileNo = SystemParamsOperation.getInstance().getMerchantMobileNo();
|
||||
|
||||
if (receiptHeader == null || TextUtils.equals(receiptHeader, "") || receiptHeader.trim().isEmpty()) {
|
||||
receiptHeader = merchantName;
|
||||
@ -854,9 +852,6 @@ public abstract class BaseXPrint {
|
||||
sunmiPrinterService.printText(addressLine + "\n", innerResultCallback);
|
||||
}
|
||||
sunmiPrinterService.printText(merchantPhoneNo + "\n", innerResultCallback);
|
||||
if (merchantMobileNo != null && !merchantMobileNo.trim().isEmpty()) {
|
||||
sunmiPrinterService.printText(merchantMobileNo + "\n", innerResultCallback);
|
||||
}
|
||||
sunmiPrinterService.lineWrap(1, innerResultCallback);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@ -707,11 +707,6 @@ public class SystemParamsOperation {
|
||||
return paramsSettings.getMerchantPhoneNo();
|
||||
}
|
||||
|
||||
public String getMerchantMobileNo() {
|
||||
SystemParamsSettings paramsSettings = getSystemParamsSettings();
|
||||
return paramsSettings.getMerchantMobileNo();
|
||||
}
|
||||
|
||||
public String getMerchantAddress2() {
|
||||
SystemParamsSettings paramsSettings = getSystemParamsSettings();
|
||||
return paramsSettings.getMerchantAddress2();
|
||||
@ -960,12 +955,6 @@ public class SystemParamsOperation {
|
||||
saveSystemParamsSettings(params);
|
||||
}
|
||||
|
||||
public void setMerchantMobileNo(String merchantMobileNo) {
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
params.setMerchantMobileNo(merchantMobileNo);
|
||||
saveSystemParamsSettings(params);
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress){
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
params.setIpAddress(ipAddress);
|
||||
|
||||
@ -64,8 +64,6 @@ public class SystemParamsSettings implements Serializable {
|
||||
|
||||
private String merchantPhoneNo = "";
|
||||
|
||||
private String merchantMobileNo = "";
|
||||
|
||||
private String systemPassword = "";
|
||||
|
||||
private String settlementPassword = "";
|
||||
@ -821,14 +819,6 @@ public class SystemParamsSettings implements Serializable {
|
||||
return merchantPhoneNo;
|
||||
}
|
||||
|
||||
protected void setMerchantMobileNo(String merchantMobileNo) {
|
||||
this.merchantMobileNo = merchantMobileNo;
|
||||
}
|
||||
|
||||
protected String getMerchantMobileNo() {
|
||||
return merchantMobileNo;
|
||||
}
|
||||
|
||||
protected void setSystemPassword(String systemPassword) {
|
||||
this.systemPassword = systemPassword;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user