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
23a8182d
Commit
23a8182d
authored
Sep 19, 2022
by
Dio Maulana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull to refresh viewbill
parent
427674c0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
174 additions
and
169 deletions
+174
-169
helper.dart
lib/helper/helper.dart
+1
-0
order_view_bill_new.dart
lib/ui/viewbill/order_view_bill_new.dart
+3
-3
view_bill_new.dart
lib/ui/viewbill/view_bill_new.dart
+170
-158
pubspec.lock
pubspec.lock
+0
-7
pubspec.yaml
pubspec.yaml
+0
-1
No files found.
lib/helper/helper.dart
View file @
23a8182d
...
...
@@ -245,6 +245,7 @@ double heightTombol = 0.06; // untuk dikalikan di height media query
//** core warna */
// const Color backgroundColor = Colors.white;
const
Color
backgroundColor
=
Color
(
0xffF4F4F4
);
const
Color
backgroundColorViewBill
=
Color
(
0xffE5E5E5
);
const
Color
backgroundWhite
=
Color
(
0xffFFFFFF
);
const
Color
dividerGrey
=
Color
(
0xff898A8D
);
const
textColorTabel
=
Color
(
0xff333333
);
...
...
lib/ui/viewbill/order_view_bill_new.dart
View file @
23a8182d
...
...
@@ -337,10 +337,10 @@ class _OrderViewBillNewState extends State<OrderViewBillNew> {
height:
11
,
)
:
const
SizedBox
(),
(
widget
.
lastItem
)
(
!
widget
.
lastItem
)
?
const
Divider
(
thickness:
1
,
color:
dividerGrey
,
thickness:
2
,
color:
backgroundColorViewBill
,
)
:
const
SizedBox
()
],
...
...
lib/ui/viewbill/view_bill_new.dart
View file @
23a8182d
...
...
@@ -5,7 +5,6 @@ import 'package:byod/helper/widget/style.dart';
import
'package:byod/ui/screen_responsive.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'package:uuid/uuid.dart'
;
import
'../../api/api.dart'
;
...
...
@@ -93,7 +92,18 @@ class ViewBillNew extends StatelessWidget {
return
SafeArea
(
child:
Scaffold
(
backgroundColor:
backgroundWhite
,
body:
BlocBuilder
<
ViewBillBloc
,
List
<
Bill
>>(
body:
RefreshIndicator
(
color:
buttonColor
,
backgroundColor:
backgroundColor
,
onRefresh:
()
{
return
Future
.
delayed
(
const
Duration
(
milliseconds:
1500
),
()
{
context
.
read
<
ViewBillBloc
>().
getBill
();
},
);
},
child:
BlocBuilder
<
ViewBillBloc
,
List
<
Bill
>>(
builder:
(
ctxViewBill
,
dataBill
)
{
if
(
dataBill
.
isNotEmpty
)
{
if
(
dataBill
[
0
].
id
==
defaultViewBill
)
{
...
...
@@ -114,70 +124,71 @@ class ViewBillNew extends StatelessWidget {
}
else
{
saveBillDetail
(
dataBill
);
int
totalService
=
0
;
int
totalServiceTax
=
0
;
//
int totalService = 0;
//
int totalServiceTax = 0;
int
individuTotalPayment
=
0
;
int
individuPaymentPaid
=
0
;
int
outStandingIndividu
=
0
;
//
int individuTotalPayment = 0;
//
int individuPaymentPaid = 0;
//
int outStandingIndividu = 0;
int
allPaymentPaid
=
0
;
//
int allPaymentPaid = 0;
int
outStandingAll
=
0
;
int
totalDiscount
=
0
;
bool
isIndividuHaveWaitingPayment
=
false
;
String
paymentToRedirect
=
''
;
String
paymentId
=
''
;
//
bool isIndividuHaveWaitingPayment = false;
//
String paymentToRedirect = '';
//
String paymentId = '';
// check payment pending ketika table di lock backend
bool
isStillHavePaymentPending
=
false
;
//
bool isStillHavePaymentPending = false;
if
(
dataBill
.
isNotEmpty
)
{
int
indexWherePendingPayment
=
dataBill
[
0
]
.
paymentList
.
indexWhere
((
element
)
=>
element
.
isApproved
==
false
);
if
(
indexWherePendingPayment
!=
-
1
)
{
isStillHavePaymentPending
=
true
;
}
//
int indexWherePendingPayment = dataBill[0]
//
.paymentList
//
.indexWhere((element) => element.isApproved == false);
//
if (indexWherePendingPayment != -1) {
//
isStillHavePaymentPending = true;
//
}
//service and servicetax
totalService
=
amountParseToInt
(
dataBill
[
0
].
totalService
);
totalServiceTax
=
amountParseToInt
(
dataBill
[
0
].
totalServiceTax
);
//
totalService = amountParseToInt(dataBill[0].totalService);
//
totalServiceTax =
//
amountParseToInt(dataBill[0].totalServiceTax);
for
(
var
x
in
dataBill
)
{
if
(
x
.
customerName
==
customerName
)
{
individuTotalPayment
=
x
.
totalPerCustomer
;
}
//
for (var x in dataBill) {
//
if (x.customerName == customerName) {
// //
individuTotalPayment = x.totalPerCustomer;
//
}
//service and tax
// for (var bd in x.billDetail) {
// totalService += amountParseToInt(bd.service);
// totalServiceTax += amountParseToInt(bd.serviceTax);
// //service and tax
// // for (var bd in x.billDetail) {
// // totalService += amountParseToInt(bd.service);
// // totalServiceTax += amountParseToInt(bd.serviceTax);
// // }
// }
}
if
(
dataBill
[
0
].
paymentList
.
isNotEmpty
)
{
for
(
var
p
in
dataBill
[
0
].
paymentList
)
{
// if (p.isApproved && p.customerNamePay == customerName) {
// individuPaymentPaid += amountParseToInt(p.amount);
// if (dataBill[0].paymentList.isNotEmpty) {
// for (var p in dataBill[0].paymentList) {
// // if (p.isApproved && p.customerNamePay == customerName) {
// // individuPaymentPaid += amountParseToInt(p.amount);
// // }
// if (p.isApproved) {
// allPaymentPaid += amountParseToInt(p.amount);
// }
if
(
p
.
isApproved
)
{
allPaymentPaid
+=
amountParseToInt
(
p
.
amount
);
}
if
(!
p
.
isApproved
)
{
if
(
p
.
paymentUrl
!=
''
&&
p
.
customerNamePay
==
customerName
)
{
isIndividuHaveWaitingPayment
=
true
;
paymentToRedirect
=
p
.
paymentUrl
;
paymentId
=
p
.
id
;
}
}
}
}
outStandingAll
=
amountParseToInt
(
dataBill
[
0
].
outStandingPay
);
// if (!p.isApproved) {
// if (p.paymentUrl != '' &&
// p.customerNamePay == customerName) {
// isIndividuHaveWaitingPayment = true;
// paymentToRedirect = p.paymentUrl;
// paymentId = p.id;
// }
// }
// }
// }
outStandingAll
=
amountParseToInt
(
dataBill
[
0
].
outStandingPay
);
totalDiscount
=
amountParseToInt
(
dataBill
[
0
].
discountTotal
);
outStandingIndividu
=
amountParseToInt
(
dataBill
[
0
].
outStandingIndividu
);
//
outStandingIndividu =
//
amountParseToInt(dataBill[0].outStandingIndividu);
}
void
ontapOkAfterCashier
()
async
{
...
...
@@ -219,9 +230,9 @@ class ViewBillNew extends StatelessWidget {
// Navigator.pop(context);
title
=
'Tutup Pesanan'
;
description
=
'''
Selesaikan transaksi dan tutup pesanan ?
Selesaikan transaksi dan tutup pesanan ?
Mohon menuju kasir untuk meminta bukti pembayaran'''
;
Mohon menuju kasir untuk meminta bukti pembayaran'''
;
// } else {
// // // Navigator.pop(context);
// // EasyLoading.showInfo('Tidak ada tagihan yang perlu dibayar');
...
...
@@ -270,6 +281,7 @@ Mohon menuju kasir untuk meminta bukti pembayaran''';
},
),
),
),
);
}
...
...
@@ -494,7 +506,7 @@ class CoreBill extends StatelessWidget {
height:
18
,
),
const
Divider
(
color:
backgroundColor
,
color:
backgroundColor
ViewBill
,
thickness:
24
,
),
const
SizedBox
(
...
...
@@ -519,12 +531,12 @@ class CoreBill extends StatelessWidget {
height:
11
,
),
const
Divider
(
color:
backgroundColor
,
color:
backgroundColor
ViewBill
,
thickness:
24
,
),
const
AddMoreOrder
(),
const
Divider
(
color:
backgroundColor
,
color:
backgroundColor
ViewBill
,
thickness:
24
,
),
RincianPembayaran
(
...
...
@@ -533,7 +545,7 @@ class CoreBill extends StatelessWidget {
outStandingAll:
outStandingAll
,
),
const
Divider
(
color:
backgroundColor
,
color:
backgroundColor
ViewBill
,
thickness:
24
,
),
],
...
...
pubspec.lock
View file @
23a8182d
...
...
@@ -261,13 +261,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.3"
pull_to_refresh:
dependency: "direct main"
description:
name: pull_to_refresh
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
scrollable_positioned_list:
dependency: "direct main"
description:
...
...
pubspec.yaml
View file @
23a8182d
...
...
@@ -34,7 +34,6 @@ dependencies:
http
:
^0.13.4
intl
:
^0.17.0
loading_animations
:
^2.2.0
pull_to_refresh
:
^2.0.0
scrollable_positioned_list
:
^0.3.4
shared_preferences
:
^2.0.15
shimmer
:
^2.0.0
...
...
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