Commit 07b8f4fd authored by Gandha Ryanto's avatar Gandha Ryanto

Merge remote-tracking branch 'origin/simplyfy-v2' into simplyfy-v2

parents 0716d907 01335cd2
......@@ -301,51 +301,6 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
)
print("model ${Build.MODEL}")
// if (Build.MODEL == "T2s" || Build.MODEL == "T2Mini" || Build.MODEL == "T2mini") {
if (Build.MODEL == "T2s" || Build.MODEL == "T2Mini") {
var text = """
[C]${companyName}
[C]${companyAddress}
[C]${companyPhone}
[C]--------------------------------
[L]xTanggal : ${sdf.format(timeNow)}
[L]xNo Transaksi : ${approvalCode}
[L] No Kartu : ${ticket.cardNumber.toString()}
[L]Masa Berlaku : ${sdf.format(cardExpiry)}"""
if(status == "Berhasil"){
text += """
[L]Saldo Awal : Rp${formatDecimalToPrice(prevBalance.toDouble()).toString()}
[L]Isi Saldo : Rp${formatDecimalToPrice(denom.toDouble()).toString()}
[L]Saldo Akhir : Rp${formatDecimalToPrice(ticket.balance!!.toDouble()).toString()}
[L]Biaya Layanan : Rp${formatDecimalToPrice(serviceCharge.toDouble()).toString()}
[L]Jumlah Bayar : Rp${formatDecimalToPrice(serviceChargeAmount.toDouble()).toString()}
[L]Metode Bayar : ${metodeBayar}
[L]Status : ${status}
[C]--------------------------------
[C]Top Up Berhasil
[C]powered by dolanapp.com
"""
} else {
text += """
[L]Saldo : Rp${formatDecimalToPrice(prevBalance.toDouble()).toString()}
[L]Biaya Layanan : Rp${formatDecimalToPrice(serviceCharge.toDouble()).toString()}
[L]Jumlah Bayar : Rp${formatDecimalToPrice(serviceChargeAmount.toDouble()).toString()}
[L]Metode Bayar : ${metodeBayar}
[L]Status : ${status}
[C]--------------------------------
[C]Top Up Gagal
[C]powered by dolanapp.com
"""
}
text = text.trimIndent()
_mifareTicketing?.generateReceiptTopup(
null,
text,
bitmapIcon,
paperWidth = 57F,
isBluetooth = true
)
}
else {
var receiptLayout = ReceiptBuilder(570)
.setMarginTop(30)
.setMarginLeft(30)
......@@ -389,7 +344,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
.addBlankSpace(10)
.addText("Masa Berlaku...............: " + sdf.format(cardExpiry))
.addBlankSpace(10)
if (status == "Berhasil"){
if (status == "Isi Saldo Berhasil"){
receiptLayout.addText("Saldo Awal...................: Rp" + formatDecimalToPrice(prevBalance.toDouble()).toString())
.addBlankSpace(10)
.addText("Isi Saldo.........................: Rp" + formatDecimalToPrice(denom.toDouble()))
......@@ -438,7 +393,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
}
val finalReceiptLayout: ReceiptBuilder = receiptLayout
_mifareTicketing?.generateReceiptTopup(finalReceiptLayout, "", null, paperWidth = 570F, isBluetooth = false)
}
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment