third commit

This commit is contained in:
2026-07-31 17:06:52 +05:30
parent d9886880cc
commit 9891a69a5f
32 changed files with 2083 additions and 557 deletions

View File

@@ -12,6 +12,7 @@ import '../../../core/utils/formatters.dart';
import '../../../core/widgets/empty_state.dart';
import '../../../core/widgets/primary_button.dart';
import '../../../domain/entities/cart.dart';
import '../../customer/widgets/customer_capture_sheet.dart';
import '../providers/cart_controller.dart';
import 'cart_line_tile.dart';
import 'discount_sheet.dart';
@@ -404,7 +405,16 @@ class _Actions extends ConsumerWidget {
child: PrimaryButton(
label: 'CHARGE',
large: true,
onPressed: enabled ? () => context.push(AppRoutes.payment) : null,
onPressed: enabled
? () async {
// Ask once per bill, before payment. Skipping is one tap and
// leaves the sale as walk-in.
if (ref.read(cartControllerProvider).customer == null) {
await showCustomerCaptureSheet(context);
}
if (context.mounted) context.push(AppRoutes.payment);
}
: null,
trailing: enabled
? Text(
Formatters.money(cart.grandTotal),