reversal release
parent
f4ce7b85b9
commit
b23c505fc5
|
|
@ -11,6 +11,8 @@ class CloseDayData {
|
||||||
final int paymentCount;
|
final int paymentCount;
|
||||||
final num refundAmount;
|
final num refundAmount;
|
||||||
final int refundCount;
|
final int refundCount;
|
||||||
|
final num cancelAmount;
|
||||||
|
final int cancelCount;
|
||||||
|
|
||||||
final List<TransactionBean> items;
|
final List<TransactionBean> items;
|
||||||
CloseDayData({
|
CloseDayData({
|
||||||
|
|
@ -18,7 +20,8 @@ class CloseDayData {
|
||||||
this.items,
|
this.items,
|
||||||
this.totalAmount, this.totalCount,
|
this.totalAmount, this.totalCount,
|
||||||
this.paymentAmount, this.paymentCount,
|
this.paymentAmount, this.paymentCount,
|
||||||
this.refundAmount, this.refundCount
|
this.refundAmount, this.refundCount,
|
||||||
|
this.cancelAmount, this.cancelCount
|
||||||
});
|
});
|
||||||
|
|
||||||
static CloseDayData fromJson(Map<String, dynamic> json) {
|
static CloseDayData fromJson(Map<String, dynamic> json) {
|
||||||
|
|
@ -30,6 +33,8 @@ class CloseDayData {
|
||||||
paymentCount: json['paymentCount'],
|
paymentCount: json['paymentCount'],
|
||||||
refundAmount: json['refundAmount'],
|
refundAmount: json['refundAmount'],
|
||||||
refundCount: json['refundCount'],
|
refundCount: json['refundCount'],
|
||||||
|
cancelAmount: json['cancelAmount'],
|
||||||
|
cancelCount: json['cancelCount'],
|
||||||
items: (json['items'] as List).map((e) => TransactionBean.fromMap(e)).toList(),
|
items: (json['items'] as List).map((e) => TransactionBean.fromMap(e)).toList(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -42,6 +47,8 @@ class CloseDayData {
|
||||||
'paymentCount': paymentCount,
|
'paymentCount': paymentCount,
|
||||||
'refundAmount': refundAmount,
|
'refundAmount': refundAmount,
|
||||||
'refundCount': refundCount,
|
'refundCount': refundCount,
|
||||||
|
'cancelAmount': cancelAmount,
|
||||||
|
'cancelCount': cancelCount,
|
||||||
'items': items.map((e) => e.toJson()).toList(),
|
'items': items.map((e) => e.toJson()).toList(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -109,6 +109,8 @@ class BankService extends BaseService {
|
||||||
int paymentCount = 0;
|
int paymentCount = 0;
|
||||||
num refundAmount = 0;
|
num refundAmount = 0;
|
||||||
int refundCount = 0;
|
int refundCount = 0;
|
||||||
|
num cancelAmount = 0;
|
||||||
|
int cancelCount = 0;
|
||||||
|
|
||||||
for(Cd.TransactionBean item in items) {
|
for(Cd.TransactionBean item in items) {
|
||||||
if(item.type == 'PAYMENT') {
|
if(item.type == 'PAYMENT') {
|
||||||
|
|
@ -119,6 +121,10 @@ class BankService extends BaseService {
|
||||||
refundCount++;
|
refundCount++;
|
||||||
refundAmount += ( item.amount / 100 );
|
refundAmount += ( item.amount / 100 );
|
||||||
totalAmount -= ( item.amount / 100 );
|
totalAmount -= ( item.amount / 100 );
|
||||||
|
} else if(item.type == 'REVERSAL') {
|
||||||
|
cancelCount++;
|
||||||
|
cancelAmount += ( item.amount / 100 );
|
||||||
|
totalAmount -= ( item.amount / 100 );
|
||||||
}
|
}
|
||||||
totalCount++;
|
totalCount++;
|
||||||
}
|
}
|
||||||
|
|
@ -129,6 +135,7 @@ class BankService extends BaseService {
|
||||||
totalAmount: totalAmount, totalCount: totalCount,
|
totalAmount: totalAmount, totalCount: totalCount,
|
||||||
paymentAmount: paymentAmount, paymentCount: paymentCount,
|
paymentAmount: paymentAmount, paymentCount: paymentCount,
|
||||||
refundAmount: refundAmount, refundCount: refundCount,
|
refundAmount: refundAmount, refundCount: refundCount,
|
||||||
|
cancelAmount: cancelAmount, cancelCount: cancelCount,
|
||||||
);
|
);
|
||||||
return closeDayData;
|
return closeDayData;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,9 @@ class DataService extends BaseService {
|
||||||
CheckData checkData,
|
CheckData checkData,
|
||||||
CardData cardData}) async {
|
CardData cardData}) async {
|
||||||
try {
|
try {
|
||||||
checkData.cardData = cardData;
|
var json = cardData.toJson();
|
||||||
|
json['transactionType'] = VoucherTypeReturnPay;
|
||||||
|
checkData.cardData = CardData.fromJson(json);
|
||||||
String data = jsonEncode(checkData.toJson());
|
String data = jsonEncode(checkData.toJson());
|
||||||
|
|
||||||
log.i('token: $token');
|
log.i('token: $token');
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,11 @@ class _MyFloatingActionButtonState extends State<MyFloatingActionButton> {
|
||||||
|
|
||||||
double sheetHeight = 260;
|
double sheetHeight = 260;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
//print(widget.data.cardData.transactionType);
|
||||||
if (showFab) {
|
if (showFab) {
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,11 @@ class CloseDayShowContainer extends StatelessWidget {
|
||||||
TableCell(child: Text('${data.paymentCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
TableCell(child: Text('${data.paymentCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
||||||
TableCell(child: Text('${data.paymentAmount} T', textAlign: TextAlign.end, style: productTextStyle)),
|
TableCell(child: Text('${data.paymentAmount} T', textAlign: TextAlign.end, style: productTextStyle)),
|
||||||
]),
|
]),
|
||||||
|
TableRow(children: [
|
||||||
|
TableCell(child: Text('Отмен:', style: productTextStyle,)),
|
||||||
|
TableCell(child: Text('${data.cancelCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
||||||
|
TableCell(child: Text('${data.cancelAmount} T', textAlign: TextAlign.end, style: productTextStyle)),
|
||||||
|
]),
|
||||||
TableRow(children: [
|
TableRow(children: [
|
||||||
TableCell(child: Text('Возвратов:', style: productTextStyle,)),
|
TableCell(child: Text('Возвратов:', style: productTextStyle,)),
|
||||||
TableCell(child: Text('${data.refundCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
TableCell(child: Text('${data.refundCount}', textAlign: TextAlign.center, style: productTextStyle)),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue