Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dolan SelfService Topup
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Faizol
Dolan SelfService Topup
Commits
8d34c68a
Commit
8d34c68a
authored
Aug 09, 2023
by
Izol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust print , adjust validation topup gagal , error topup balance
parent
bbf42789
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
294 additions
and
279 deletions
+294
-279
MainActivity.kt
...rc/main/kotlin/com/example/self_service_3/MainActivity.kt
+2
-47
home_page.dart
lib/ui/pages/home_page.dart
+292
-232
No files found.
android/app/src/main/kotlin/com/example/self_service_3/MainActivity.kt
View file @
8d34c68a
...
@@ -301,51 +301,6 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
...
@@ -301,51 +301,6 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
)
)
print
(
"model ${Build.MODEL}"
)
print
(
"model ${Build.MODEL}"
)
// if (Build.MODEL == "T2s" || Build.MODEL == "T2Mini" || Build.MODEL == "T2mini") {
// 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
)
var
receiptLayout
=
ReceiptBuilder
(
570
)
.
setMarginTop
(
30
)
.
setMarginTop
(
30
)
.
setMarginLeft
(
30
)
.
setMarginLeft
(
30
)
...
@@ -389,7 +344,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
...
@@ -389,7 +344,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
.
addBlankSpace
(
10
)
.
addBlankSpace
(
10
)
.
addText
(
"Masa Berlaku...............: "
+
sdf
.
format
(
cardExpiry
))
.
addText
(
"Masa Berlaku...............: "
+
sdf
.
format
(
cardExpiry
))
.
addBlankSpace
(
10
)
.
addBlankSpace
(
10
)
if
(
status
==
"Berhasil"
){
if
(
status
==
"
Isi Saldo
Berhasil"
){
receiptLayout
.
addText
(
"Saldo Awal...................: Rp"
+
formatDecimalToPrice
(
prevBalance
.
toDouble
()).
toString
())
receiptLayout
.
addText
(
"Saldo Awal...................: Rp"
+
formatDecimalToPrice
(
prevBalance
.
toDouble
()).
toString
())
.
addBlankSpace
(
10
)
.
addBlankSpace
(
10
)
.
addText
(
"Isi Saldo.........................: Rp"
+
formatDecimalToPrice
(
denom
.
toDouble
()))
.
addText
(
"Isi Saldo.........................: Rp"
+
formatDecimalToPrice
(
denom
.
toDouble
()))
...
@@ -438,7 +393,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
...
@@ -438,7 +393,7 @@ class MainActivity : MethodChannel.MethodCallHandler, FlutterActivity(), MifareT
}
}
val
finalReceiptLayout
:
ReceiptBuilder
=
receiptLayout
val
finalReceiptLayout
:
ReceiptBuilder
=
receiptLayout
_mifareTicketing
?.
generateReceiptTopup
(
finalReceiptLayout
,
""
,
null
,
paperWidth
=
570F
,
isBluetooth
=
false
)
_mifareTicketing
?.
generateReceiptTopup
(
finalReceiptLayout
,
""
,
null
,
paperWidth
=
570F
,
isBluetooth
=
false
)
}
}
}
}
}
lib/ui/pages/home_page.dart
View file @
8d34c68a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment