third commit
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user