feat: sync order

This commit is contained in:
efrilm
2025-08-03 14:39:15 +07:00
parent 3d1ae25bcf
commit 051b64e3a6
25 changed files with 1422 additions and 333 deletions
@@ -2,20 +2,19 @@ import 'dart:developer';
import 'package:enaklo_pos/core/components/spaces.dart';
import 'package:enaklo_pos/core/constants/colors.dart';
import 'package:enaklo_pos/core/extensions/date_time_ext.dart';
import 'package:enaklo_pos/core/extensions/int_ext.dart';
import 'package:enaklo_pos/core/utils/helper_pdf_service.dart';
import 'package:enaklo_pos/presentation/report/widgets/report_page_title.dart';
import 'package:flutter/material.dart';
import 'package:enaklo_pos/core/utils/permession_handler.dart';
import 'package:enaklo_pos/core/utils/transaction_sales_invoice.dart';
import 'package:enaklo_pos/data/models/response/order_remote_datasource.dart';
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
import 'package:horizontal_data_table/horizontal_data_table.dart';
class TransactionReportWidget extends StatelessWidget {
final String title;
final String searchDateFormatted;
final List<ItemOrder> transactionReport;
final List<Order> transactionReport;
final List<Widget>? headerWidgets;
const TransactionReportWidget({
super.key,
@@ -91,86 +90,88 @@ class TransactionReportWidget extends StatelessWidget {
alignment: Alignment.centerLeft,
child: Center(
child: Text(
transactionReport[index].total!.currencyFormatRp,
transactionReport[index]
.totalAmount!
.currencyFormatRp,
)),
),
Container(
width: 120,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(
transactionReport[index].subTotal!.currencyFormatRp,
)),
),
Container(
width: 100,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(
transactionReport[index].tax!.currencyFormatRp,
)),
),
Container(
width: 100,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(
int.parse(transactionReport[index]
.discountAmount!
.replaceAll('.00', ''))
.currencyFormatRp,
),
),
),
Container(
width: 100,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(
transactionReport[index]
.serviceCharge!
.currencyFormatRp,
),
),
),
Container(
width: 100,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(
transactionReport[index].totalItem.toString()),
),
),
Container(
width: 150,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(transactionReport[index].namaKasir!),
),
),
Container(
width: 230,
height: 52,
padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
alignment: Alignment.centerLeft,
child: Center(
child: Text(transactionReport[index]
.transactionTime!
.toFormattedDate()),
),
),
// Container(
// width: 120,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(
// transactionReport[index].subTotal!.currencyFormatRp,
// )),
// ),
// Container(
// width: 100,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(
// transactionReport[index].tax!.currencyFormatRp,
// )),
// ),
// Container(
// width: 100,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(
// int.parse(transactionReport[index]
// .discountAmount!
// .replaceAll('.00', ''))
// .currencyFormatRp,
// ),
// ),
// ),
// Container(
// width: 100,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(
// transactionReport[index]
// .serviceCharge!
// .currencyFormatRp,
// ),
// ),
// ),
// Container(
// width: 100,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(
// transactionReport[index].totalItem.toString()),
// ),
// ),
// Container(
// width: 150,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(transactionReport[index].namaKasir!),
// ),
// ),
// Container(
// width: 230,
// height: 52,
// padding: const EdgeInsets.fromLTRB(5, 0, 0, 0),
// alignment: Alignment.centerLeft,
// child: Center(
// child: Text(transactionReport[index]
// .transactionTime!
// .toFormattedDate()),
// ),
// ),
],
);
},