Compare commits

..

No commits in common. "eafbecafbd9c4cb87dc6398e85351359deaba253" and "f958dfe572c22c56f0d21f6ff7ca7f3b5fd2369f" have entirely different histories.

7 changed files with 10 additions and 87 deletions

View File

@ -36,7 +36,6 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.mob.utsmyanmar.ui.components.appbar.AppBar 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.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
@ -251,50 +249,26 @@ 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 = "Transaction Receipt",
style = MaterialTheme.typography.bodyMedium
)
Spacer(modifier = Modifier.height(4.dp))
Text( Text(
text = "MOB POS", text = "MOB POS",
style = MaterialTheme.typography.headlineLarge style = MaterialTheme.typography.headlineLarge
) )
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
Text( 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, style = MaterialTheme.typography.labelLarge,
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(16.dp)) Spacer(modifier = Modifier.height(16.dp))
ReceiptDivider() ReceiptDivider()
ReceiptRow("Date", convertDateString(state.payDetail?.transDate.toString())) ReceiptRow("Date", convertDateString(state.payDetail?.transDate.toString()))
ReceiptRow("Time", state.payDetail?.transTime.toString()) ReceiptRow("Time", state.payDetail?.transTime.toString())
ReceiptRow("Merchant Name", state.payDetail?.merchantName.toString())
ReceiptRow("TID", state.payDetail?.terminalNo.toString()) ReceiptRow("TID", state.payDetail?.terminalNo.toString())
ReceiptRow("Trace No", state.payDetail?.voucherNo.toString()) ReceiptRow("Trace No", state.payDetail?.voucherNo.toString())
ReceiptRow("Ref No", state.payDetail?.referNo.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" if (prefix.isEmpty() && (state.payDetail?.transactionType ?: 0) == TransactionsType.CASH_OUT.value) "-$amt" else "$prefix$amt"
}) })
ReceiptRow("Card Type", state.payDetail?.accountType.toString()) 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()) ReceiptRow("Status", if (isPreview) "SUCCESS" else state.payDetail?.let(::displayTransactionStatus).orEmpty())
ReceiptDivider() ReceiptDivider()
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
Text(
text = copyLabel,
style = MaterialTheme.typography.labelLarge,
color = Color.Gray
)
Spacer(modifier = Modifier.height(8.dp))
Text( Text(
text = "Thank You", text = "Thank You",
style = MaterialTheme.typography.titleMedium style = MaterialTheme.typography.titleMedium
) )
Spacer(modifier = Modifier.height(4.dp)) Spacer(modifier = Modifier.height(4.dp))
Text( Text(
text = "Please keep this receipt", text = "Please keep this receipt",
style = MaterialTheme.typography.bodySmall 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 @Composable
fun ReceiptRow( fun ReceiptRow(
label: String, label: String,

View File

@ -88,7 +88,6 @@ 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 }

View File

@ -16,8 +16,6 @@ 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;
@ -52,14 +50,6 @@ 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;
} }

View File

@ -176,13 +176,11 @@ 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";
@ -209,9 +207,6 @@ 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();

View File

@ -817,14 +817,12 @@ 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;
@ -854,9 +852,6 @@ 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();

View File

@ -707,11 +707,6 @@ 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();
@ -960,12 +955,6 @@ 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);

View File

@ -64,8 +64,6 @@ 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 = "";
@ -821,14 +819,6 @@ 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;
} }