|
|
|
@ -6,7 +6,6 @@ import android.content.Context;
|
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.content.res.Resources;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
import android.graphics.Typeface;
|
|
|
|
import android.graphics.Typeface;
|
|
|
|
import android.icu.util.LocaleData;
|
|
|
|
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.RemoteException;
|
|
|
|
import android.os.RemoteException;
|
|
|
|
import android.text.TextUtils;
|
|
|
|
import android.text.TextUtils;
|
|
|
|
@ -41,11 +40,7 @@ import com.utsmyanmar.paylibs.utils.iso_utils.TransactionType;
|
|
|
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
|
|
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
|
|
|
import com.utsmyanmar.paylibs.utils.print_utils.BitmapUtils;
|
|
|
|
import com.utsmyanmar.paylibs.utils.print_utils.BitmapUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
import java.util.Comparator;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Locale;
|
|
|
|
import java.util.Locale;
|
|
|
|
@ -201,10 +196,6 @@ public abstract class BaseXPrint {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void dotBreak(){
|
|
|
|
|
|
|
|
printer.appendPrnStr(new String(new char[29]).replace("\0", "."), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void dashBreak() {
|
|
|
|
protected void dashBreak() {
|
|
|
|
printer.appendPrnStr("-----------------------------", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr("-----------------------------", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
|
|
|
|
|
|
|
|
@ -501,6 +492,7 @@ public abstract class BaseXPrint {
|
|
|
|
|
|
|
|
|
|
|
|
protected void printTransDetailSummary(PayDetail payDetail) {
|
|
|
|
protected void printTransDetailSummary(PayDetail payDetail) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String MMK = "MMK";
|
|
|
|
String MMK = "MMK";
|
|
|
|
SettleData settleData = payDetail.getSettleDataObj();
|
|
|
|
SettleData settleData = payDetail.getSettleDataObj();
|
|
|
|
boolean isQrDecimalEnabled = SystemParamsOperation.getInstance().isQrDecimalEnable();
|
|
|
|
boolean isQrDecimalEnabled = SystemParamsOperation.getInstance().isQrDecimalEnable();
|
|
|
|
@ -515,19 +507,14 @@ public abstract class BaseXPrint {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (payDetail.getAccountType().equals("WALLET")) {
|
|
|
|
if (payDetail.getAccountType().equals("WALLET")) {
|
|
|
|
// printer.appendPrnStr("PAYMENT NAME: PAY BY QR", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr("PAYMENT NAME: QR", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printString("TYPE : " + "PAY BY QR");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
printer.appendPrnStr("CARD NAME:" + payDetail.getAccountType(), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr("CARD NAME:" + payDetail.getAccountType(), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// printer.appendPrnStr(" " + "COUNT " + " " + " TOTAL", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr(" " + "COUNT " + " " + " TOTAL", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("COUNT", "TOTAL", fontNormal, false);
|
|
|
|
printer.appendPrnStr("COUNT", "TOTAL", fontNormal, false);
|
|
|
|
// printer.printColumnsString(new String[]{"", "COUNT", "TOTAL"}, new int[]{2,1, 1}, new int[]{ 2,1, 2}, innerResultCallback);
|
|
|
|
// printer.printColumnsString(new String[]{"", "COUNT", "TOTAL"}, new int[]{2,1, 1}, new int[]{ 2,1, 2}, innerResultCallback);
|
|
|
|
// emptyLine(1);
|
|
|
|
// emptyLine(1);
|
|
|
|
emptyLine(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printer.appendPrnStr("(COUNT)TRANS", "AMOUNT(MMK)", fontNormal, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (settleData.getSaleCount() > 0)
|
|
|
|
if (settleData.getSaleCount() > 0)
|
|
|
|
printColumnString("SALES", settleData.getSaleCount(), settleData.getSaleAmount(), false);
|
|
|
|
printColumnString("SALES", settleData.getSaleCount(), settleData.getSaleAmount(), false);
|
|
|
|
// printer.appendPrnStr("SALES "+ countStringFormat(settleData.getSaleCount())+MMK+" "+ PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getSaleAmount()), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("SALES "+ countStringFormat(settleData.getSaleCount())+MMK+" "+ PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getSaleAmount()), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
@ -545,56 +532,52 @@ public abstract class BaseXPrint {
|
|
|
|
printColumnString("PREAUTH COMP", settleData.getPreAuthCompCount(), settleData.getPreAuthCompAmount(), false);
|
|
|
|
printColumnString("PREAUTH COMP", settleData.getPreAuthCompCount(), settleData.getPreAuthCompAmount(), false);
|
|
|
|
if (settleData.getPreAuthCompVoidCount() > 0)
|
|
|
|
if (settleData.getPreAuthCompVoidCount() > 0)
|
|
|
|
printColumnString("VOID PREAUTH COMPLETE", settleData.getPreAuthCompVoidCount(), settleData.getPreAuthCompVoidAmount(), true);
|
|
|
|
printColumnString("VOID PREAUTH COMPLETE", settleData.getPreAuthCompVoidCount(), settleData.getPreAuthCompVoidAmount(), true);
|
|
|
|
if (settleData.getWavePayCount() >= 0){
|
|
|
|
if (settleData.getWavePayCount() > 0){
|
|
|
|
// printColumnString("QR PAY", settleData.getWavePayCount(), settleData.getWavePayAmount(), false);
|
|
|
|
// printColumnString("QR PAY", settleData.getWavePayCount(), settleData.getWavePayAmount(), false);
|
|
|
|
// printer.appendPrnStr( "QR PAY " + countStringFormat(settleData.getWavePayCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWavePayAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "QR PAY " + countStringFormat(settleData.getWavePayCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWavePayAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "(" + settleData.getWavePayCount() + ")" + "QR PAY" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWavePayAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (settleData.getWaveRefundCount() >= 0) {
|
|
|
|
if (settleData.getWaveRefundCount() > 0) {
|
|
|
|
// printColumnString("QR REFUND", settleData.getWaveRefundCount(), settleData.getWaveRefundAmount(), true);
|
|
|
|
// printColumnString("QR REFUND", settleData.getWaveRefundCount(), settleData.getWaveRefundAmount(), true);
|
|
|
|
// printer.appendPrnStr( "QR REFUND " + countStringFormat(settleData.getWaveRefundCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWaveRefundAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "QR REFUND " + countStringFormat(settleData.getWaveRefundCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWaveRefundAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "(" + settleData.getWaveRefundCount() + ")" + "QR REFUND", "- " + PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWaveRefundAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// dashBreak();
|
|
|
|
dashBreak();
|
|
|
|
dotBreak();
|
|
|
|
|
|
|
|
// printColumnString("TOTAL", totalCount, totalAmount, false);
|
|
|
|
// printColumnString("TOTAL", totalCount, totalAmount, false);
|
|
|
|
// printer.appendPrnStr( "TOTAL " + countStringFormat(totalCount) + " " + "MMK", PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "TOTAL " + countStringFormat(totalCount) + " " + "MMK", PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "TOTAL", PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("GRAND TOTAL", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr("GRAND TOTAL", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
//// printer.appendPrnStr(" " + "COUNT " + " " + " TOTAL", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr(" " + "COUNT " + " " + " TOTAL", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("COUNT", "TOTAL", fontNormal, false);
|
|
|
|
printer.appendPrnStr("COUNT", "TOTAL", fontNormal, false);
|
|
|
|
//// printer.printColumnsString(new String[]{"", "COUNT", "TOTAL"}, new int[]{2,1, 1}, new int[]{ 2,1, 2}, innerResultCallback);
|
|
|
|
// printer.printColumnsString(new String[]{"", "COUNT", "TOTAL"}, new int[]{2,1, 1}, new int[]{ 2,1, 2}, innerResultCallback);
|
|
|
|
//// emptyLine(1);
|
|
|
|
// emptyLine(1);
|
|
|
|
// if (settleData.getSaleCount() > 0)
|
|
|
|
if (settleData.getSaleCount() > 0)
|
|
|
|
// printColumnString("SALES", settleData.getSaleCount(), settleData.getSaleAmount(), false);
|
|
|
|
printColumnString("SALES", settleData.getSaleCount(), settleData.getSaleAmount(), false);
|
|
|
|
//// printer.appendPrnStr("SALES "+ countStringFormat(settleData.getSaleCount())+MMK+" "+ PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getSaleAmount()), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("SALES "+ countStringFormat(settleData.getSaleCount())+MMK+" "+ PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getSaleAmount()), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// if (settleData.getVoidSaleCount() > 0)
|
|
|
|
if (settleData.getVoidSaleCount() > 0)
|
|
|
|
// printColumnString("VOID SALES", settleData.getVoidSaleCount(), settleData.getVoidSaleAmount(), true);
|
|
|
|
printColumnString("VOID SALES", settleData.getVoidSaleCount(), settleData.getVoidSaleAmount(), true);
|
|
|
|
// if (settleData.getCashAdvanceCount() > 0)
|
|
|
|
if (settleData.getCashAdvanceCount() > 0)
|
|
|
|
// printColumnString("CASH OUT", settleData.getCashAdvanceCount(), settleData.getCashAdvanceAmount(), false);
|
|
|
|
printColumnString("CASH OUT", settleData.getCashAdvanceCount(), settleData.getCashAdvanceAmount(), false);
|
|
|
|
// if (settleData.getPreAuthCount() > 0)
|
|
|
|
if (settleData.getPreAuthCount() > 0)
|
|
|
|
// printColumnString("PRE AUTH", settleData.getPreAuthCount(), settleData.getPreAuthAmount(), false);
|
|
|
|
printColumnString("PRE AUTH", settleData.getPreAuthCount(), settleData.getPreAuthAmount(), false);
|
|
|
|
// if (settleData.getPreAuthVoidCount() > 0)
|
|
|
|
if (settleData.getPreAuthVoidCount() > 0)
|
|
|
|
// printColumnString("VOID PREAUTH", settleData.getPreAuthVoidCount(), settleData.getPreAuthVoidAmount(), true);
|
|
|
|
printColumnString("VOID PREAUTH", settleData.getPreAuthVoidCount(), settleData.getPreAuthVoidAmount(), true);
|
|
|
|
// if (settleData.getRefundCount() > 0)
|
|
|
|
if (settleData.getRefundCount() > 0)
|
|
|
|
// printColumnString("REFUND", settleData.getRefundCount(), settleData.getRefundAmount(), true);
|
|
|
|
printColumnString("REFUND", settleData.getRefundCount(), settleData.getRefundAmount(), true);
|
|
|
|
// if (settleData.getPreAuthCompCount() > 0)
|
|
|
|
if (settleData.getPreAuthCompCount() > 0)
|
|
|
|
// printColumnString("PREAUTH COMP", settleData.getPreAuthCompCount(), settleData.getPreAuthCompAmount(), false);
|
|
|
|
printColumnString("PREAUTH COMP", settleData.getPreAuthCompCount(), settleData.getPreAuthCompAmount(), false);
|
|
|
|
// if (settleData.getPreAuthCompVoidCount() > 0)
|
|
|
|
if (settleData.getPreAuthCompVoidCount() > 0)
|
|
|
|
// printColumnString("VOID PREAUTH COMPLETE", settleData.getPreAuthCompVoidCount(), settleData.getPreAuthCompVoidAmount(), true);
|
|
|
|
printColumnString("VOID PREAUTH COMPLETE", settleData.getPreAuthCompVoidCount(), settleData.getPreAuthCompVoidAmount(), true);
|
|
|
|
// if (settleData.getWavePayCount() > 0) {
|
|
|
|
if (settleData.getWavePayCount() > 0) {
|
|
|
|
//// printColumnString("QR PAY", settleData.getWavePayCount(), settleData.getWavePayAmount(), false);
|
|
|
|
// printColumnString("QR PAY", settleData.getWavePayCount(), settleData.getWavePayAmount(), false);
|
|
|
|
// printer.appendPrnStr( "QR PAY " + countStringFormat(settleData.getWavePayCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWavePayAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "QR PAY " + countStringFormat(settleData.getWavePayCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWavePayAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// if (settleData.getWaveRefundCount() > 0){
|
|
|
|
if (settleData.getWaveRefundCount() > 0){
|
|
|
|
//// printColumnString("QR REFUND", settleData.getWaveRefundCount(), settleData.getWaveRefundAmount(), true);
|
|
|
|
// printColumnString("QR REFUND", settleData.getWaveRefundCount(), settleData.getWaveRefundAmount(), true);
|
|
|
|
// printer.appendPrnStr( "QR REFUND " + countStringFormat(settleData.getWaveRefundCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWaveRefundAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "QR REFUND " + countStringFormat(settleData.getWaveRefundCount()) + " " + "MMK" , PrintUtils.getInstance().getSeparatorNumberFormat(settleData.getWaveRefundAmount(), isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// dashBreak();
|
|
|
|
dashBreak();
|
|
|
|
//// printColumnString("TOTAL", totalCount, totalAmount, false);
|
|
|
|
// printColumnString("TOTAL", totalCount, totalAmount, false);
|
|
|
|
// printer.appendPrnStr( "TOTAL " + countStringFormat(totalCount) + " " + "MMK", PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
printer.appendPrnStr( "TOTAL " + countStringFormat(totalCount) + " " + "MMK", PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, isQrDecimalEnabled) , fontNormal, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("\n", fontNormal, AlignEnum.LEFT,false);
|
|
|
|
@ -673,8 +656,6 @@ public abstract class BaseXPrint {
|
|
|
|
printer.appendPrnStr(first + " " + second, fontSize, align,true);
|
|
|
|
printer.appendPrnStr(first + " " + second, fontSize, align,true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void print3ColumnsString(String first, String second, String third) {
|
|
|
|
protected void print3ColumnsString(String first, String second, String third) {
|
|
|
|
// printer.appendPrnStr(first + " " + second + " " + third, fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr(first + " " + second + " " + third, fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr(first + " " + second + " " + third, fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr(first + " " + second + " " + third, fontNormal, AlignEnum.LEFT,false);
|
|
|
|
@ -695,22 +676,23 @@ public abstract class BaseXPrint {
|
|
|
|
print2ColumnsString("AMOUNT", "");
|
|
|
|
print2ColumnsString("AMOUNT", "");
|
|
|
|
print2ColumnsString("REF NUM", "");
|
|
|
|
print2ColumnsString("REF NUM", "");
|
|
|
|
} else if (hostType == HostType.QR) {
|
|
|
|
} else if (hostType == HostType.QR) {
|
|
|
|
// print2ColumnsString("PAYMENT NAME", "");
|
|
|
|
print2ColumnsString("PAYMENT NAME", "");
|
|
|
|
// print2ColumnsString("DATE", "TIME");
|
|
|
|
print2ColumnsString("DATE", "TIME");
|
|
|
|
// print2ColumnsString("TRANSACTION", "TRACE NO");
|
|
|
|
print2ColumnsString("TRANSACTION", "TRACE NO");
|
|
|
|
// print2ColumnsString("TRXN ID", "");
|
|
|
|
print2ColumnsString("TRXN ID", "");
|
|
|
|
// print2ColumnsString("AMOUNT", "");
|
|
|
|
print2ColumnsString("AMOUNT", "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// breakingLine();
|
|
|
|
// breakingLine();
|
|
|
|
|
|
|
|
lineBreak();
|
|
|
|
|
|
|
|
|
|
|
|
long totalAmount = 0;
|
|
|
|
long totalAmount = 0;
|
|
|
|
|
|
|
|
|
|
|
|
for (PayDetail pay : lists) {
|
|
|
|
for (PayDetail pay : lists) {
|
|
|
|
|
|
|
|
|
|
|
|
boolean isNeedMinusSign = pay.getTransactionType() == TransactionsType.VOID.value || pay.getTransactionType() == TransactionsType.REFUND.value || pay.getTransactionType() == TransactionsType.MMQR_REFUND.value;
|
|
|
|
boolean isNeedMinusSign = pay.getTransactionType() == TransactionsType.VOID.value || pay.getTransactionType() == TransactionsType.REFUND.value || pay.getTransactionType() == TransactionsType.MMQR_REFUND.value;
|
|
|
|
boolean isDecimalEnabled = SystemParamsOperation.getInstance().isQrDecimalEnable();
|
|
|
|
boolean isDecimalEnabled = SystemParamsOperation.getInstance().isQrDecimalEnable();
|
|
|
|
|
|
|
|
|
|
|
|
if (hostType == HostType.MPU || hostType == HostType.VISA_MASTER) {
|
|
|
|
if (hostType == HostType.MPU || hostType == HostType.VISA_MASTER) {
|
|
|
|
print2ColumnsString(pay.getAccountType(), PrintUtils.getInstance().maskCardNumberPciDss(pay.getCardNo()));
|
|
|
|
print2ColumnsString(pay.getAccountType(), PrintUtils.getInstance().maskCardNumberPciDss(pay.getCardNo()));
|
|
|
|
print2ColumnsString("**/**", pay.getVoucherNo());
|
|
|
|
print2ColumnsString("**/**", pay.getVoucherNo());
|
|
|
|
@ -718,43 +700,20 @@ public abstract class BaseXPrint {
|
|
|
|
print2ColumnsString(pay.getReferNo(), "");
|
|
|
|
print2ColumnsString(pay.getReferNo(), "");
|
|
|
|
|
|
|
|
|
|
|
|
} else if (hostType == HostType.QR) {
|
|
|
|
} else if (hostType == HostType.QR) {
|
|
|
|
|
|
|
|
|
|
|
|
printString("TRANS ID:" + pay.getQrTransId());
|
|
|
|
|
|
|
|
printString("STATUS :" + pay.getTC());
|
|
|
|
|
|
|
|
printString("SOURCE :" +
|
|
|
|
|
|
|
|
(pay.getTransactionType() == TransactionsType.MMQR_REFUND.value
|
|
|
|
|
|
|
|
? "QR PAYMENT"
|
|
|
|
|
|
|
|
: pay.getCustomerMobile())
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
// printString("TXN NAME:" + pay.getTransType().replace("_", " "));
|
|
|
|
|
|
|
|
printString("DATE :" + POSUtil.getInstance().formatDisplayDate(pay.getTransDate()) + " " + pay.getTransTime());
|
|
|
|
|
|
|
|
printString("TRACE NO:" + pay.getVoucherNo());
|
|
|
|
|
|
|
|
if (pay.getTransactionType() == TransactionsType.MMQR_REFUND.value) {
|
|
|
|
if (pay.getTransactionType() == TransactionsType.MMQR_REFUND.value) {
|
|
|
|
printString("RRN :" + pay.getReferNo());
|
|
|
|
print2ColumnsString("QR PAYMENT", "");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
print2ColumnsString(pay.getCustomerMobile(), "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
print2ColumnsString(pay.getTransDate(), pay.getTransTime());
|
|
|
|
|
|
|
|
print2ColumnsString(pay.getTransType().replace("_", " "), pay.getVoucherNo());
|
|
|
|
|
|
|
|
if (pay.getTransactionType() == TransactionsType.MMQR_REFUND.value) {
|
|
|
|
|
|
|
|
print2ColumnsString(pay.getReferNo() + "(RRN)", "");
|
|
|
|
|
|
|
|
print2ColumnsString(isNeedMinusSign ? "-" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled) : "" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled), "");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
print2ColumnsString(pay.getQrTransId(), "");
|
|
|
|
|
|
|
|
print2ColumnsString(isNeedMinusSign ? "-" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled) : "" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled) , "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printString("AMOUNT :" +
|
|
|
|
|
|
|
|
(isNeedMinusSign
|
|
|
|
|
|
|
|
? "-" + PrintUtils.getInstance()
|
|
|
|
|
|
|
|
.getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled)
|
|
|
|
|
|
|
|
: PrintUtils.getInstance()
|
|
|
|
|
|
|
|
.getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled))
|
|
|
|
|
|
|
|
+ " " +"MMK");
|
|
|
|
|
|
|
|
dotBreak();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (pay.getTransactionType() == TransactionsType.MMQR_REFUND.value) {
|
|
|
|
|
|
|
|
// print2ColumnsString("QR PAYMENT", "");
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// print2ColumnsString(pay.getCustomerMobile(), "");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// print2ColumnsString(pay.getTransDate(), pay.getTransTime());
|
|
|
|
|
|
|
|
// print2ColumnsString(pay.getTransType().replace("_", " "), pay.getVoucherNo());
|
|
|
|
|
|
|
|
// if (pay.getTransactionType() == TransactionsType.MMQR_REFUND.value) {
|
|
|
|
|
|
|
|
// print2ColumnsString(pay.getReferNo() + "(RRN)", "");
|
|
|
|
|
|
|
|
// print2ColumnsString(isNeedMinusSign ? "-" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled) : "" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled), "");
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// print2ColumnsString(pay.getQrTransId(), "");
|
|
|
|
|
|
|
|
// print2ColumnsString(isNeedMinusSign ? "-" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled) : "" + PrintUtils.getInstance().getSeparatorNumberFormat(pay.getAmount(), isDecimalEnabled) , "");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -962,7 +921,7 @@ public abstract class BaseXPrint {
|
|
|
|
// merchantPhoneNo = "MERCHANT PHONENO";
|
|
|
|
// merchantPhoneNo = "MERCHANT PHONENO";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
if(TextUtils.equals(terminalName, "") || terminalName == null){
|
|
|
|
if(TextUtils.equals(terminalName, "") || terminalName == null){
|
|
|
|
terminalName = "";
|
|
|
|
terminalName = "Terminal Name";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// emptyLine(1);
|
|
|
|
// emptyLine(1);
|
|
|
|
// printer.appendPrnStr(receiptHeader, fontNormal, AlignEnum.CENTER,false);
|
|
|
|
// printer.appendPrnStr(receiptHeader, fontNormal, AlignEnum.CENTER,false);
|
|
|
|
@ -972,7 +931,8 @@ public abstract class BaseXPrint {
|
|
|
|
printer.appendPrnStr(merchantAddress3, fontNormal, AlignEnum.CENTER,false);
|
|
|
|
printer.appendPrnStr(merchantAddress3, fontNormal, AlignEnum.CENTER,false);
|
|
|
|
// printer.appendPrnStr(merchantPhoneNo, fontNormal, AlignEnum.CENTER,false);
|
|
|
|
// printer.appendPrnStr(merchantPhoneNo, fontNormal, AlignEnum.CENTER,false);
|
|
|
|
// emptyLine(1);
|
|
|
|
// emptyLine(1);
|
|
|
|
dotBreak();
|
|
|
|
// dashBreak();
|
|
|
|
|
|
|
|
lineBreak();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void printKeyInfo() {
|
|
|
|
protected void printKeyInfo() {
|
|
|
|
@ -1028,8 +988,10 @@ public abstract class BaseXPrint {
|
|
|
|
String traceNum = payDetail.getVoucherNo();
|
|
|
|
String traceNum = payDetail.getVoucherNo();
|
|
|
|
// String traceNum = SystemParamsOperation.getInstance().getCurrentSerialNum();
|
|
|
|
// String traceNum = SystemParamsOperation.getInstance().getCurrentSerialNum();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
batchNum = payDetail.getBatchNo();
|
|
|
|
batchNum = payDetail.getBatchNo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// printer.appendPrnStr("DATE :" + payDetail.getTransDate() + " TIME:" + payDetail.getTransTime(), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
// printer.appendPrnStr("DATE :" + payDetail.getTransDate() + " TIME:" + payDetail.getTransTime(), fontNormal, AlignEnum.LEFT,false);
|
|
|
|
printer.appendPrnStr("DATE :" + POSUtil.getInstance().formatDisplayDate(payDetail.getTransDate()), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("DATE :" + POSUtil.getInstance().formatDisplayDate(payDetail.getTransDate()), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("TIME :" + payDetail.getTransTime(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("TIME :" + payDetail.getTransTime(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
@ -1053,7 +1015,6 @@ public abstract class BaseXPrint {
|
|
|
|
|
|
|
|
|
|
|
|
emptyLine(1);
|
|
|
|
emptyLine(1);
|
|
|
|
printer.appendPrnStr(transType.replace("_", " "),fontNormal, AlignEnum.CENTER,true);
|
|
|
|
printer.appendPrnStr(transType.replace("_", " "),fontNormal, AlignEnum.CENTER,true);
|
|
|
|
// printer.appendPrnStr("TRAN TYPE :" + transType.replace("_", " "),fontNormal, AlignEnum.LEFT,false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
@ -1061,36 +1022,6 @@ public abstract class BaseXPrint {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void printDetailReportHeader(){
|
|
|
|
|
|
|
|
SimpleDateFormat date = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());
|
|
|
|
|
|
|
|
String printedDate = date.format(new Date());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
|
|
|
|
|
|
|
String printedTime = time.format(new Date());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printer.appendPrnStr("PRINTED DATE", printedDate, fontNormal, false);
|
|
|
|
|
|
|
|
printer.appendPrnStr("", printedTime, fontNormal, false);
|
|
|
|
|
|
|
|
printer.appendPrnStr("DETAIL REPORT", fontNormal , AlignEnum.CENTER, false);
|
|
|
|
|
|
|
|
dotBreak();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void printTranHeader(String title){
|
|
|
|
|
|
|
|
SimpleDateFormat date = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault());
|
|
|
|
|
|
|
|
String printedDate = date.format(new Date());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
|
|
|
|
|
|
|
|
String printedTime = time.format(new Date());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printer.appendPrnStr("PRINTED DATE", printedDate, fontNormal, false);
|
|
|
|
|
|
|
|
printer.appendPrnStr("", printedTime, fontNormal, false);
|
|
|
|
|
|
|
|
printer.appendPrnStr(title, fontNormal , AlignEnum.CENTER, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (payDetail.getTransactionType() == TransactionsType.MMQR.value && payDetail.getQrTransStatus() == 1) {
|
|
|
|
|
|
|
|
//// printer.appendPrnStr("TRACE NO:" + traceNum + " INV NO:" + invoiceNo, fontNormal, AlignEnum.LEFT,false);
|
|
|
|
|
|
|
|
// printer.appendPrnStr("INV NO :" + invoiceNo , fontNormal, AlignEnum.LEFT,false);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
dotBreak();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void printTransHeader(PayDetail payDetail, HostType hostType) {
|
|
|
|
protected void printTransHeader(PayDetail payDetail, HostType hostType) {
|
|
|
|
String invoiceNo = payDetail.getInvoiceNo().isEmpty() ? SystemParamsOperation.getInstance().getCurrentInvoiceNum() : payDetail.getInvoiceNo();
|
|
|
|
String invoiceNo = payDetail.getInvoiceNo().isEmpty() ? SystemParamsOperation.getInstance().getCurrentInvoiceNum() : payDetail.getInvoiceNo();
|
|
|
|
String transType = payDetail.getTransType();
|
|
|
|
String transType = payDetail.getTransType();
|
|
|
|
@ -1181,7 +1112,7 @@ public abstract class BaseXPrint {
|
|
|
|
printer.appendPrnStr("Secondary Ip : " + secIpPort[0], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Secondary Ip : " + secIpPort[0], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Secondary Port: " + secIpPort[1], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Secondary Port: " + secIpPort[1], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Currency Code : " + sp.getCurrencyType(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Currency Code : " + sp.getCurrencyType(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
dotBreak();
|
|
|
|
lineBreak();
|
|
|
|
// ---------- SECONDARY HOST (optional) ----------
|
|
|
|
// ---------- SECONDARY HOST (optional) ----------
|
|
|
|
if (!TextUtils.isEmpty(sp.getSecHostName())) {
|
|
|
|
if (!TextUtils.isEmpty(sp.getSecHostName())) {
|
|
|
|
printer.appendPrnStr("SECONDARY HOST", fontNormal, AlignEnum.LEFT, true);
|
|
|
|
printer.appendPrnStr("SECONDARY HOST", fontNormal, AlignEnum.LEFT, true);
|
|
|
|
@ -1194,7 +1125,7 @@ public abstract class BaseXPrint {
|
|
|
|
printer.appendPrnStr("Secondary Ip : " + secHostSecIp[0], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Secondary Ip : " + secHostSecIp[0], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Secondary Port: " + secHostSecIp[1], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Secondary Port: " + secHostSecIp[1], fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Currency Code : " + sp.getCurrencyType(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("Currency Code : " + sp.getCurrencyType(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
dotBreak();
|
|
|
|
lineBreak();
|
|
|
|
printer.appendPrnStr("App Version : " + getAppVersion(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
printer.appendPrnStr("App Version : " + getAppVersion(), fontNormal, AlignEnum.LEFT, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|