78 lines
3.2 KiB
Dart
78 lines
3.2 KiB
Dart
import 'package:aman_kassa_flutter/core/models/close_day_data.dart';
|
|
import 'package:aman_kassa_flutter/core/models/transaction_item.dart';
|
|
import 'package:aman_kassa_flutter/shared/shared_styles.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
class CloseDayShowContainer extends StatelessWidget {
|
|
final CloseDayData data;
|
|
DateFormat dateFormat = DateFormat("dd.MM.yyyy HH:mm:ss");
|
|
CloseDayShowContainer(this.data);
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(data.title ?? 'Отчет: Закрытие дня POS'),
|
|
),
|
|
body: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Container(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('Общий итоги', style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15) ),
|
|
Table(
|
|
children: [
|
|
TableRow(children: [
|
|
TableCell(child: Text('Оплат:', style: productTextStyle,)),
|
|
TableCell(child: Text('${data.paymentCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
|
TableCell(child: Text('${data.paymentAmount} T', textAlign: TextAlign.end, style: productTextStyle)),
|
|
]),
|
|
TableRow(children: [
|
|
TableCell(child: Text('Возвратов:', style: productTextStyle,)),
|
|
TableCell(child: Text('${data.refundCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
|
TableCell(child: Text('${data.refundAmount} T', textAlign: TextAlign.end, style: productTextStyle)),
|
|
]),
|
|
TableRow(children: [
|
|
TableCell(child: Text('Итого:', style: productTextStyle,)),
|
|
TableCell(child: Text('${data.totalCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
|
TableCell(child: Text('${data.totalAmount} T', textAlign: TextAlign.end, style: productTextStyle)),
|
|
]),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Divider(),
|
|
Expanded(
|
|
child: ListView.separated(
|
|
itemCount: data.items.length,
|
|
separatorBuilder: (BuildContext context, int index) {
|
|
return Divider();
|
|
},
|
|
itemBuilder: (BuildContext context, int index) {
|
|
TransactionItem item = data.items.elementAt(index);
|
|
return ListTile(
|
|
title: Text(item.cardNumber),
|
|
subtitle: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(dateFormat.format(item.date)),
|
|
],
|
|
),
|
|
trailing: Text('${item.amount / 100} T'),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|
|
|