feat: sales page

This commit is contained in:
efrilm
2025-08-02 10:50:48 +07:00
parent e825e5daed
commit 45b348684e
17 changed files with 1371 additions and 138 deletions
@@ -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 !=