split bill

This commit is contained in:
efrilm
2025-10-31 20:43:37 +07:00
parent 6b42cd86ff
commit 35f02e6b76
18 changed files with 1763 additions and 27 deletions
@@ -488,6 +488,12 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
}
void _confirmSplit() {
if (widget.state.customerName == '' || widget.state.customer == null) {
AppFlushbar.showError(context, 'Nama Pelanggan harus diisi');
return;
}
if (widget.state.splitType.isItem) {
int splitTotal = widget.state.totalAmount;
if (splitTotal > 0) {
@@ -510,6 +516,9 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
context.router.push(
PaymentRoute(
isSplit: true,
splitType: widget.state.splitType,
customerId: widget.state.customer?.id,
order: widget.state.order.copyWith(
orderItems: splitItems,
subtotal: splitTotal,
@@ -528,6 +537,9 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
widget.state.totalAmount <= totalAmount) {
context.router.push(
PaymentRoute(
isSplit: true,
splitType: widget.state.splitType,
customerId: widget.state.customer?.id,
order: widget.state.order.copyWith(
subtotal: widget.state.totalAmount,
totalAmount: widget.state.totalAmount,