Commit 63fcc40d authored by Dio Maulana's avatar Dio Maulana

add bayar sebagian dan seluruhnya utk openbill

parent ecb565e5
......@@ -907,7 +907,8 @@ class CoreBill extends StatelessWidget {
Api.setToPendingOrder();
getBillFunc(context);
} else if (dataBill[0].state ==
orderStatePending) {
orderStatePending &&
getTableMode() == tableIndividu) {
EasyLoading.showToast(
'Status orderan anda menunggu untuk disetujui');
} else {
......@@ -1132,27 +1133,133 @@ class CoreBill extends StatelessWidget {
child: ButtonComponent(
buttonColor: buttonColor,
teksButton:
'Excelso CRM Voucher'),
'Excelso CRM Voucher',
),
),
const SizedBox(
height: 16,
),
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: const ButtonComponent(
buttonColor: Colors.transparent,
teksButton: 'Batal',
teksButtonColor: textColorBlack,
),
)
],
),
);
},
);
} else {
buttonDialogAllPayment(
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: defaultText(
context,
dataBill,
"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,
outStandingIndividu,
payCard,
fullPayment,
'',
outStandingAll,
);
} else {
Navigator.pop(context);
buttonDialog(
context,
dataBill,
outStandingAll,
paymentMode,
onTapCashier,
widthScreen,
memberinfo,
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,
// );
}
}
}
......@@ -2275,14 +2382,10 @@ Future<dynamic> buttonDialog(BuildContext context, List<Bill> dataBill,
context: context,
builder: (BuildContext context) => AlertDialog(
title: defaultText(context, "Nominal Bayar"),
content: SizedBox(
height: MediaQuery.of(context).size.height * 0.3,
width: widthScreen * widhtDialog,
child: Column(
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.12,
child: Column(
Column(
children: [
TextField(
// autofocus: true,
......@@ -2306,12 +2409,16 @@ Future<dynamic> buttonDialog(BuildContext context, List<Bill> dataBill,
child: defaultText(
context,
"Min ${formatNumber().format(amountParseToInt(dataBill[0].dokuMinPay))} - Max ${formatNumber().format(outStandingAll)}",
style: viewbillStyle(
font: 14,
),
),
)
],
),
const SizedBox(
height: 10,
),
SizedBox(height: MediaQuery.of(context).size.height * 0.01),
GestureDetector(
onTap: () {
if (nominalController.text != '') {
......@@ -2331,62 +2438,54 @@ Future<dynamic> buttonDialog(BuildContext context, List<Bill> dataBill,
EasyLoading.showToast(
'Maksimal bayar ${formatNumber().format(outStandingAll)}');
} else {
Navigator.push(
addPayment(
context,
MaterialPageRoute(
builder: (_) => Payment(
dataBill: dataBill,
isIndividu: true,
outstandingIndividu: inputAmount,
outstandingAll: outStandingAll,
title: ''),
),
dataBill[0].id,
getBranchPref(),
getBrand(),
getCustomerName(),
payCard,
partialPayment,
'',
inputAmount,
);
}
}
},
child: Container(
height: MediaQuery.of(context).size.height * heightTombol,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(roundedButton),
color: buttonColor),
child: Align(
child: defaultText(
context,
"OK",
style:
textStyleNormalFont(context, color: textInButton),
),
),
child: ButtonComponent(
buttonColor: buttonColor,
teksButton: 'Bayar',
),
// child: Container(
// height: MediaQuery.of(context).size.height * heightTombol,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(roundedButton),
// color: buttonColor),
// child: Align(
// child: defaultText(
// context,
// "OK",
// style:
// textStyleNormalFont(context, color: textInButton),
// ),
// ),
// ),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
const SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Container(
height: MediaQuery.of(context).size.height * heightTombol,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(roundedButton),
color: cancelColorButton,
),
child: Align(
child: Text(
"Batal",
style: textStyleNormalFont(
context,
color: textCancelColor,
),
),
),
child: const ButtonComponent(
buttonColor: Colors.transparent,
teksButton: 'Batal',
teksButtonColor: textColorBlack,
),
)
],
),
),
));
}
......
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