Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
B
Byodv2
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
Dio Maulana
Byodv2
Commits
7a75e7bb
Commit
7a75e7bb
authored
Oct 14, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor change pada viewbill page
parent
b29fe28b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
473 additions
and
409 deletions
+473
-409
config.json
assets/config.json
+1
-1
api.dart
lib/api/api.dart
+6
-1
helper.dart
lib/helper/helper.dart
+15
-9
main.dart
lib/main.dart
+1
-1
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+450
-397
No files found.
assets/config.json
View file @
7a75e7bb
{
"base_url"
:
"https://
cc79-125-165-111-49.ap.ngrok.io
/"
,
"base_url"
:
"https://
neo.ravku.com
/"
,
"title"
:
"Ravintola Dev BYOD"
,
"isResponsive"
:
true
,
"debug"
:
true
...
...
lib/api/api.dart
View file @
7a75e7bb
...
...
@@ -93,7 +93,11 @@ class Api {
"order_id"
:
orderID
,
"session_id"
:
sessionId
,
"from"
:
fromByod
,
"url_lookup"
:
(
debug
)
?
'https://www.ravintola.web.id/'
:
(
urlType
==
typeUrlTiga
)
?
getUrlLookUp
()
:
''
,
"url_lookup"
:
(
debug
)
?
'https://www.ravintola.web.id/'
:
(
urlType
==
typeUrlTiga
)
?
getUrlLookUp
()
:
''
,
"customer_lat"
:
latitude
,
"customer_long"
:
longitude
,
"type_url"
:
urlType
,
...
...
@@ -162,6 +166,7 @@ class Api {
setIsPickup
(
jsonObject
[
'data'
][
'is_pickup'
]);
setOpenTime
(
jsonObject
[
'data'
][
'open_time'
]);
setCloseTime
(
jsonObject
[
'data'
][
'close_time'
]);
setTableNumber
(
jsonObject
[
'data'
][
'table_number'
]
??
''
);
if
(
jsonObject
[
'data'
][
'payment_mode'
]
!=
null
)
{
setPaymentMode
(
jsonObject
[
'data'
][
'payment_mode'
]);
}
...
...
lib/helper/helper.dart
View file @
7a75e7bb
...
...
@@ -67,11 +67,13 @@ Future<dynamic> sendTele(String teks, String namaFungsi) async {
//**get orderStatus and color status */
String
getOrderStatus
(
int
status
)
{
if
(
status
==
completeOrder
)
{
return
'
Complete
'
;
return
'
Processed
'
;
}
else
if
(
status
==
cancelOrder
)
{
return
'Canceld'
;
return
'Cancel
e
d'
;
}
else
if
(
status
==
processingOrder
)
{
return
'Preparing'
;
return
'Processing'
;
}
else
if
(
status
==
approvedOrder
)
{
return
'Approved'
;
}
else
{
return
'Pending'
;
}
...
...
@@ -81,9 +83,11 @@ Color getOrderStatusColor(int status) {
if
(
status
==
completeOrder
)
{
return
successColor
;
}
else
if
(
status
==
cancelOrder
)
{
return
cancelColorButton
;
return
dangerColor
;
}
else
if
(
status
==
processingOrder
)
{
return
processingColor
;
}
else
if
(
status
==
approvedOrder
)
{
return
approvedColor
;
}
else
{
return
pendingColor
;
}
...
...
@@ -348,12 +352,12 @@ String textButtonCheckout(int orderState) {
orderState
==
orderStateInproses
||
orderState
==
orderStateReady
))
{
return
'Pesanan Diproses'
;
}
else
if
(
orderState
==
orderStateDone
)
{
return
'B
uat Pesanan Baru
'
;
}
else
if
(
paymentMethod
==
openBill
&&
orderState
!=
orderStateCanceled
)
{
return
'B
ayar
'
;
}
else
if
(
orderState
==
orderStateCanceled
)
{
return
'Transaksi Dibatalkan'
;
}
else
{
return
''
;
return
'
Bayar
'
;
}
}
...
...
@@ -426,6 +430,7 @@ const Color textInButton = Colors.white;
const
Color
textCancelColor
=
Color
(
0xff333333
);
const
Color
successColor
=
Colors
.
green
;
const
Color
processingColor
=
Colors
.
blue
;
const
Color
approvedColor
=
Colors
.
blue
;
const
Color
pendingColor
=
Colors
.
amber
;
const
Color
disabledColor
=
Colors
.
grey
;
// const Color selectedColor = Color.fromARGB(255, 225, 250, 5);
...
...
@@ -480,9 +485,10 @@ const int maxLengthTextField = 100;
//** untuk nampilin orderan preparing atau compelete */
const
int
cancelOrder
=
-
1
;
const
int
completeOrder
=
2
;
const
int
pendingOrder
=
0
;
const
int
processingOrder
=
1
;
const
int
approvedOrder
=
1
;
const
int
processingOrder
=
2
;
const
int
completeOrder
=
99
;
//** untuk nampilin orderan preparing atau compelete */
//** constanta order status bill */
...
...
lib/main.dart
View file @
7a75e7bb
...
...
@@ -43,7 +43,7 @@ bool isExcelso = false;
bool
isResponsive
=
false
;
final
GlobalKey
<
NavigatorState
>
navigatorKey
=
GlobalKey
<
NavigatorState
>();
String
defaultTitle
=
'Ravintola - BYOD'
;
bool
debug
=
false
;
// set true pada config.json jika ingin
ada log pri
nt
bool
debug
=
false
;
// set true pada config.json jika ingin
mode developme
nt
String
browserName
=
'Wrong platform'
;
String
browserVersion
=
''
;
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
7a75e7bb
...
...
@@ -917,392 +917,35 @@ class CoreBill extends StatelessWidget {
width:
widthScreen
,
child:
Column
(
children:
[
GestureDetector
(
onTap:
()
{
if
(
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
{
if
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
{
if
(
dataBill
[
0
].
state
==
orderStateCreated
)
{
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
getTableMode
()
==
tableIndividu
)
{
EasyLoading
.
showToast
(
'Status orderan anda menunggu untuk disetujui'
);
}
else
{
if
(
paymentMode
==
closebill
&&
memberinfo
.
id
==
''
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
if
(
paymentMode
==
closebill
&&
memberinfo
.
id
!=
''
)
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
title:
defaultText
(
context
,
"Pilih cara pembayaran"
,
style:
modalPaymentStyle
(),
),
content:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
defaultText
(
context
,
'Pembayaran online menggunakan saldo eWallet atau Virtual Account'
,
textAlign:
TextAlign
.
left
,
style:
modalPaymentStyle
(
font:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
const
SizedBox
(
height:
8
,
),
GestureDetector
(
onTap:
()
{
String
titlePayment
;
String
customerName
=
getCustomerName
();
bool
isIndividu
;
if
(
paymentMode
==
openBill
)
{
isIndividu
=
true
;
titlePayment
=
'Semua Bill'
;
}
else
{
isIndividu
=
false
;
titlePayment
=
customerName
;
}
if
(
outStandingAll
>
0
)
{
if
(
paymentMode
==
closebill
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
{
Navigator
.
pop
(
context
);
buttonDialog
(
context
,
dataBill
,
outStandingAll
,
widthScreen
);
}
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Online - Rp
${formatNumber().format(outStandingAll)}
'
),
),
const
SizedBox
(
height:
16
,
),
defaultText
(
context
,
'Pembayaran dengan saldo member excelso CRM'
,
textAlign:
TextAlign
.
left
,
style:
modalPaymentStyle
(
font:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
const
SizedBox
(
height:
8
,
),
GestureDetector
(
onTap:
()
{
if
(
outStandingAll
>
0
)
{
if
(
outStandingTopayMember
<=
0
)
{
EasyLoading
.
showToast
(
'Tidak ada tagihan / Tidak ada balance'
);
}
else
{
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => Payment(
// dataBill: dataBill,
// isIndividu: true,
// outstandingIndividu:
// outStandingTopayMember, // karena hanya excelso untuk saat ini jadi overide outstandingindividu dulu
// outstandingAll:
// outStandingAll,
// title:
// 'Dengan Balance',
// isUsingBalance:
// true)));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
PaymentBalance
(
outStanding:
outStandingAll
,
balanceMember:
amountParseToIntCrm
(
memberinfo
.
balance
),
orderId:
dataBill
[
0
].
id
,
),
),
);
}
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Excelso CRM Balance - Rp
${formatNumber().format(outStandingTopayMember)}
'
),
),
const
SizedBox
(
height:
16
,
),
defaultText
(
context
,
'Pembayaran dengan e-Voucher excelso CRM'
,
textAlign:
TextAlign
.
left
,
style:
modalPaymentStyle
(
font:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
const
SizedBox
(
height:
8
,
),
GestureDetector
(
onTap:
()
{
int
indexVoucher
=
dataBill
[
0
]
.
paymentList
.
indexWhere
((
element
)
=>
element
.
method
==
payVoucher
);
if
(
indexVoucher
!=
-
1
)
{
// check apakah sudah pernah melakukan pembayran voucher
EasyLoading
.
showToast
(
'Voucher telah digunakan pada orderan ini'
);
}
else
if
(
outStandingAll
>
0
)
{
if
(
indexDataIndividu
==
-
1
)
{
EasyLoading
.
showToast
(
'Kamu Belum Memiliki Orderan'
);
}
else
{
context
.
read
<
VoucherListBloc
>()
.
getVoucherList
();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => Payment(
// dataBill: dataBill,
// isIndividu: false,
// indexIndividu:
// indexDataIndividu,
// isVoucher: true,
// outstandingIndividu:
// outStandingIndividu,
// outstandingAll:
// outStandingAll,
// title: 'Voucher',
// ),
// ),
// );
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
PaymentVoucher
(
outstandingAll:
outStandingAll
,
dataBill:
dataBill
,
),
),
);
}
}
else
{
EasyLoading
.
showToast
(
'Tidak ada tagihan'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Excelso CRM Voucher'
,
),
),
const
SizedBox
(
height:
16
,
),
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
const
ButtonComponent
(
buttonColor:
Colors
.
transparent
,
teksButton:
'Batal'
,
teksButtonColor:
textColorBlack
,
),
)
],
),
);
},
);
}
else
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
title:
defaultText
(
context
,
"Pilih cara pembayaran"
,
style:
modalPaymentStyle
(),
),
content:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
GestureDetector
(
onTap:
()
{
if
(
outStandingAll
>
0
)
{
if
(
paymentMode
==
closebill
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
{
Navigator
.
pop
(
context
);
buttonDialog
(
context
,
dataBill
,
outStandingAll
,
widthScreen
);
}
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Bayar Sebagian'
),
),
const
SizedBox
(
height:
16
,
),
GestureDetector
(
onTap:
()
{
if
(
outStandingAll
>
0
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Bayar Seluruhnya - Rp
${formatNumber().format(outStandingAll)}
'
),
),
const
SizedBox
(
height:
16
,
),
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
const
ButtonComponent
(
buttonColor:
Colors
.
transparent
,
teksButton:
'Batal'
,
teksButtonColor:
textColorBlack
,
),
),
],
),
);
},
);
// buttonDialogAllPayment(
// context,
// dataBill,
// customerName,
// outStandingIndividu,
// outStandingAll,
// paymentMode,
// onTapCashier,
// widthScreen,
// memberinfo,
// branchCode,
// brandCode,
// );
}
}
}
}
},
child:
Container
(
margin:
const
EdgeInsets
.
only
(
top:
12
),
height:
43
,
width:
double
.
infinity
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
roundedButtonComponent
),
color:
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
?
buttonColor
:
disabledColor
,
),
child:
Center
(
child:
defaultText
(
context
,
textButtonCheckout
(
dataBill
[
0
].
state
),
style:
buttonBottomBill
(),
),
),
),
),
(!
getIsDeliveryPickup
()
&&
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
?
ButtonPayment
(
dataBill:
dataBill
,
paymentMode:
paymentMode
,
branchCode:
branchCode
,
brandCode:
brandCode
,
customerName:
customerName
,
outStandingAll:
outStandingAll
,
widthScreen:
widthScreen
,
outStandingTopayMember:
outStandingTopayMember
,
indexDataIndividu:
indexDataIndividu
,
memberinfo:
memberinfo
,
)
:
const
SizedBox
(),
(
getIsDeliveryPickup
())
?
ButtonPayment
(
dataBill:
dataBill
,
paymentMode:
paymentMode
,
branchCode:
branchCode
,
brandCode:
brandCode
,
customerName:
customerName
,
outStandingAll:
outStandingAll
,
widthScreen:
widthScreen
,
outStandingTopayMember:
outStandingTopayMember
,
indexDataIndividu:
indexDataIndividu
,
memberinfo:
memberinfo
,
)
:
const
SizedBox
(),
(!
getIsDeliveryPickup
())
?
(
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
?
Column
(
...
...
@@ -1555,6 +1198,397 @@ Note: Ganti outlet akan menyebabkan orderan anda saat ini hilang
}
}
class
ButtonPayment
extends
StatelessWidget
{
const
ButtonPayment
({
Key
?
key
,
required
this
.
dataBill
,
required
this
.
paymentMode
,
required
this
.
branchCode
,
required
this
.
brandCode
,
required
this
.
customerName
,
required
this
.
outStandingAll
,
required
this
.
widthScreen
,
required
this
.
outStandingTopayMember
,
required
this
.
indexDataIndividu
,
required
this
.
memberinfo
,
})
:
super
(
key:
key
);
final
List
<
Bill
>
dataBill
;
final
int
paymentMode
;
final
String
branchCode
;
final
String
brandCode
;
final
String
customerName
;
final
int
outStandingAll
;
final
double
widthScreen
;
final
int
outStandingTopayMember
;
final
int
indexDataIndividu
;
final
MemberInfo
memberinfo
;
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
()
{
if
(
dataBill
[
0
].
tableStatus
==
tableStatusOpen
)
{
if
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
{
if
(
dataBill
[
0
].
state
==
orderStateCreated
)
{
Api
.
setToPendingOrder
();
context
.
read
<
ViewBillBloc
>().
getBill
();
}
else
if
(
dataBill
[
0
].
state
==
orderStatePending
&&
getTableMode
()
==
tableIndividu
)
{
EasyLoading
.
showToast
(
'Status orderan anda menunggu untuk disetujui'
);
}
else
{
if
(
paymentMode
==
closebill
&&
memberinfo
.
id
==
''
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
if
(
paymentMode
==
closebill
&&
memberinfo
.
id
!=
''
)
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
title:
defaultText
(
context
,
"Pilih cara pembayaran"
,
style:
modalPaymentStyle
(),
),
content:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
defaultText
(
context
,
'Pembayaran online menggunakan saldo eWallet atau Virtual Account'
,
textAlign:
TextAlign
.
left
,
style:
modalPaymentStyle
(
font:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
const
SizedBox
(
height:
8
,
),
GestureDetector
(
onTap:
()
{
String
titlePayment
;
String
customerName
=
getCustomerName
();
bool
isIndividu
;
if
(
paymentMode
==
openBill
)
{
isIndividu
=
true
;
titlePayment
=
'Semua Bill'
;
}
else
{
isIndividu
=
false
;
titlePayment
=
customerName
;
}
if
(
outStandingAll
>
0
)
{
if
(
paymentMode
==
closebill
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
{
Navigator
.
pop
(
context
);
buttonDialog
(
context
,
dataBill
,
outStandingAll
,
widthScreen
);
}
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Online - Rp
${formatNumber().format(outStandingAll)}
'
),
),
const
SizedBox
(
height:
16
,
),
defaultText
(
context
,
'Pembayaran dengan saldo member excelso CRM'
,
textAlign:
TextAlign
.
left
,
style:
modalPaymentStyle
(
font:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
const
SizedBox
(
height:
8
,
),
GestureDetector
(
onTap:
()
{
if
(
outStandingAll
>
0
)
{
if
(
outStandingTopayMember
<=
0
)
{
EasyLoading
.
showToast
(
'Tidak ada tagihan / Tidak ada balance'
);
}
else
{
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => Payment(
// dataBill: dataBill,
// isIndividu: true,
// outstandingIndividu:
// outStandingTopayMember, // karena hanya excelso untuk saat ini jadi overide outstandingindividu dulu
// outstandingAll:
// outStandingAll,
// title:
// 'Dengan Balance',
// isUsingBalance:
// true)));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
PaymentBalance
(
outStanding:
outStandingAll
,
balanceMember:
amountParseToIntCrm
(
memberinfo
.
balance
),
orderId:
dataBill
[
0
].
id
,
),
),
);
}
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Excelso CRM Balance - Rp
${formatNumber().format(outStandingTopayMember)}
'
),
),
const
SizedBox
(
height:
16
,
),
defaultText
(
context
,
'Pembayaran dengan e-Voucher excelso CRM'
,
textAlign:
TextAlign
.
left
,
style:
modalPaymentStyle
(
font:
12
,
fontWeight:
FontWeight
.
w400
,
),
),
const
SizedBox
(
height:
8
,
),
GestureDetector
(
onTap:
()
{
int
indexVoucher
=
dataBill
[
0
]
.
paymentList
.
indexWhere
((
element
)
=>
element
.
method
==
payVoucher
);
if
(
indexVoucher
!=
-
1
)
{
// check apakah sudah pernah melakukan pembayran voucher
EasyLoading
.
showToast
(
'Voucher telah digunakan pada orderan ini'
);
}
else
if
(
outStandingAll
>
0
)
{
if
(
indexDataIndividu
==
-
1
)
{
EasyLoading
.
showToast
(
'Kamu Belum Memiliki Orderan'
);
}
else
{
context
.
read
<
VoucherListBloc
>()
.
getVoucherList
();
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (_) => Payment(
// dataBill: dataBill,
// isIndividu: false,
// indexIndividu:
// indexDataIndividu,
// isVoucher: true,
// outstandingIndividu:
// outStandingIndividu,
// outstandingAll:
// outStandingAll,
// title: 'Voucher',
// ),
// ),
// );
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=>
PaymentVoucher
(
outstandingAll:
outStandingAll
,
dataBill:
dataBill
,
),
),
);
}
}
else
{
EasyLoading
.
showToast
(
'Tidak ada tagihan'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Excelso CRM Voucher'
,
),
),
const
SizedBox
(
height:
16
,
),
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
const
ButtonComponent
(
buttonColor:
Colors
.
transparent
,
teksButton:
'Batal'
,
teksButtonColor:
textColorBlack
,
),
)
],
),
);
},
);
}
else
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
title:
defaultText
(
context
,
"Pilih cara pembayaran"
,
style:
modalPaymentStyle
(),
),
content:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
GestureDetector
(
onTap:
()
{
if
(
outStandingAll
>
0
)
{
if
(
paymentMode
==
closebill
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
{
Navigator
.
pop
(
context
);
buttonDialog
(
context
,
dataBill
,
outStandingAll
,
widthScreen
);
}
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Bayar Sebagian'
),
),
const
SizedBox
(
height:
16
,
),
GestureDetector
(
onTap:
()
{
if
(
outStandingAll
>
0
)
{
addPayment
(
context
,
dataBill
[
0
].
id
,
branchCode
,
brandCode
,
customerName
,
payCard
,
fullPayment
,
''
,
outStandingAll
,
);
}
else
{
EasyLoading
.
showToast
(
'Semua Tagihan Sudah Dibayar'
);
}
},
child:
ButtonComponent
(
buttonColor:
buttonColor
,
teksButton:
'Bayar Seluruhnya - Rp
${formatNumber().format(outStandingAll)}
'
),
),
const
SizedBox
(
height:
16
,
),
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
const
ButtonComponent
(
buttonColor:
Colors
.
transparent
,
teksButton:
'Batal'
,
teksButtonColor:
textColorBlack
,
),
),
],
),
);
},
);
// buttonDialogAllPayment(
// context,
// dataBill,
// customerName,
// outStandingIndividu,
// outStandingAll,
// paymentMode,
// onTapCashier,
// widthScreen,
// memberinfo,
// branchCode,
// brandCode,
// );
}
}
}
}
},
child:
Container
(
margin:
const
EdgeInsets
.
only
(
top:
12
),
height:
43
,
width:
double
.
infinity
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
roundedButtonComponent
),
color:
(
isCanButtonCheckoutToTap
(
dataBill
[
0
].
state
))
?
buttonColor
:
disabledColor
,
),
child:
Center
(
child:
defaultText
(
context
,
textButtonCheckout
(
dataBill
[
0
].
state
),
style:
buttonBottomBill
(),
),
),
),
);
}
}
class
DeliveryPickupDetail
extends
StatelessWidget
{
DeliveryPickupDetail
({
Key
?
key
,
...
...
@@ -1610,14 +1644,8 @@ class DeliveryPickupDetail extends StatelessWidget {
children:
[
defaultText
(
context
,
"Close: "
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
),
defaultText
(
context
,
getCloseTime
(),
maxLines:
1
,
"Open Hour:
${getOpenTime()}
-
${getCloseTime()}
"
,
maxLines:
2
,
overFlow:
TextOverflow
.
ellipsis
,
),
],
...
...
@@ -1635,7 +1663,7 @@ class DeliveryPickupDetail extends StatelessWidget {
),
defaultText
(
context
,
getPickupTime
()
,
"
${getPickupTime()}
:00"
,
maxLines:
1
,
overFlow:
TextOverflow
.
ellipsis
,
),
...
...
@@ -1765,6 +1793,9 @@ Apakah ingin melanjutkan ?''';
String
closeOutlet
=
getCloseTime
();
String
hourClose
=
closeOutlet
.
split
(
':'
)[
0
];
String
minuteClose
=
closeOutlet
.
split
(
':'
)[
1
];
String
openOutlet
=
getOpenTime
();
String
hourOpen
=
openOutlet
.
split
(
':'
)[
0
];
String
minuteOpen
=
openOutlet
.
split
(
':'
)[
1
];
// TimeOfDay timeClose = TimeOfDay(
// hour: int.parse(hourClose),
// minute: int.parse(minuteClose),
...
...
@@ -1773,12 +1804,20 @@ Apakah ingin melanjutkan ?''';
var
dateNow
=
DateFormat
(
'yyyy-MM-dd'
).
format
(
now
);
String
dateTimeCloseOutletString
=
"
$dateNow
$hourClose
:
$minuteClose
:00"
;
String
dateTimeOpenOutletString
=
"
$dateNow
$hourOpen
:
$minuteOpen
:00"
;
DateTime
dateTimeCloseOutlet
=
DateTime
.
parse
(
dateTimeCloseOutletString
);
DateTime
dateTimeOpenOutlet
=
DateTime
.
parse
(
dateTimeOpenOutletString
);
DateTime
dateSelectedPickupTime
=
DateTime
(
now
.
year
,
now
.
month
,
now
.
day
,
value
.
hour
,
value
.
minute
);
final
difference
=
final
difference
Close
=
dateTimeCloseOutlet
.
difference
(
dateSelectedPickupTime
);
final
differenceOpen
=
dateTimeOpenOutlet
.
difference
(
dateSelectedPickupTime
);
final
differenceFromNow
=
dateSelectedPickupTime
.
difference
(
now
);
if
(
differenceFromNow
.
inMinutes
<
0
)
{
...
...
@@ -1794,7 +1833,7 @@ Apakah ingin melanjutkan ?''';
);
return
;
}
if
(
difference
.
inMinutes
<
59
)
{
if
(
difference
Close
.
inMinutes
<
59
)
{
buttonDialogGlobal
(
context
,
'Informasi'
,
...
...
@@ -1807,6 +1846,20 @@ Apakah ingin melanjutkan ?''';
);
return
;
}
if
(
differenceOpen
.
inMinutes
<
0
)
{
buttonDialogGlobal
(
context
,
'Informasi'
,
'Pickup Hanya Bisa Dilakukan Setelah Outlet Buka'
,
'OK'
,
'Close'
,
ontapClose
,
ontapClose
,
isOkeButtonShow:
false
,
);
return
;
}
// String timeToset = value.format(context);
final
hourString
=
value
.
hour
.
toString
().
padLeft
(
2
,
'0'
);
final
minuteString
=
...
...
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