feat: sales page
This commit is contained in:
@@ -32,10 +32,10 @@ class ConfirmPaymentPage extends StatefulWidget {
|
||||
final TableModel? table;
|
||||
|
||||
const ConfirmPaymentPage({
|
||||
Key? key,
|
||||
super.key,
|
||||
required this.isTable,
|
||||
this.table,
|
||||
}) : super(key: key);
|
||||
});
|
||||
|
||||
@override
|
||||
State<ConfirmPaymentPage> createState() => _ConfirmPaymentPageState();
|
||||
@@ -110,6 +110,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
child: Hero(
|
||||
tag: 'payment_confirmation_screen',
|
||||
child: Scaffold(
|
||||
backgroundColor: AppColors.white,
|
||||
body: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -401,7 +402,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
final subTotal =
|
||||
price - (discount / 100 * price);
|
||||
final finalTax = subTotal * (tax / 100);
|
||||
final finalDiscount = discount / 100 * subTotal;
|
||||
// final finalDiscount = discount / 100 * subTotal;
|
||||
// discountAmountValue = finalDiscount.toInt();
|
||||
// taxFinal = finalTax.toInt();
|
||||
return Text(
|
||||
@@ -653,14 +654,19 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
"π Fetching available tables for Bayar Nanti");
|
||||
isPayNow = false;
|
||||
isAddToOrder = false;
|
||||
|
||||
|
||||
// Debug: Check all tables first
|
||||
final allTables = await ProductLocalDatasource.instance.getAllTable();
|
||||
print("π All tables in database: ${allTables.length}");
|
||||
final allTables =
|
||||
await ProductLocalDatasource
|
||||
.instance
|
||||
.getAllTable();
|
||||
print(
|
||||
"π All tables in database: ${allTables.length}");
|
||||
allTables.forEach((table) {
|
||||
print("π Table: ${table.tableName} - Status: ${table.status} - ID: ${table.id}");
|
||||
print(
|
||||
"π Table: ${table.tableName} - Status: ${table.status} - ID: ${table.id}");
|
||||
});
|
||||
|
||||
|
||||
// Fetch available tables for Bayar Nanti
|
||||
context
|
||||
.read<GetTableStatusBloc>()
|
||||
@@ -683,14 +689,19 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
"π Fetching available tables for Bayar Nanti");
|
||||
isPayNow = false;
|
||||
isAddToOrder = false;
|
||||
|
||||
|
||||
// Debug: Check all tables first
|
||||
final allTables = await ProductLocalDatasource.instance.getAllTable();
|
||||
print("π All tables in database: ${allTables.length}");
|
||||
final allTables =
|
||||
await ProductLocalDatasource
|
||||
.instance
|
||||
.getAllTable();
|
||||
print(
|
||||
"π All tables in database: ${allTables.length}");
|
||||
allTables.forEach((table) {
|
||||
print("π Table: ${table.tableName} - Status: ${table.status} - ID: ${table.id}");
|
||||
print(
|
||||
"π Table: ${table.tableName} - Status: ${table.status} - ID: ${table.id}");
|
||||
});
|
||||
|
||||
|
||||
// Fetch available tables for Bayar Nanti
|
||||
context
|
||||
.read<GetTableStatusBloc>()
|
||||
@@ -1516,8 +1527,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
|
||||
await ProductLocalDatasource
|
||||
.instance
|
||||
.getDraftOrderById(
|
||||
selectTable!
|
||||
.orderId ??
|
||||
selectTable
|
||||
?.orderId ??
|
||||
0);
|
||||
|
||||
if (existingDraftOrder !=
|
||||
|
||||
Reference in New Issue
Block a user