21 lines
544 B
Dart
21 lines
544 B
Dart
import 'package:pshared/models/payment/payment.dart';
|
|
|
|
|
|
class UploadHistoryTableController {
|
|
const UploadHistoryTableController();
|
|
|
|
String amountText(Payment payment) {
|
|
final receivedAmount = payment.lastQuote?.expectedSettlementAmount;
|
|
if (receivedAmount != null) {
|
|
return '${receivedAmount.amount} ${receivedAmount.currency}';
|
|
}
|
|
|
|
final fallbackAmount = payment.lastQuote?.debitAmount;
|
|
if (fallbackAmount != null) {
|
|
return '${fallbackAmount.amount} ${fallbackAmount.currency}';
|
|
}
|
|
|
|
return '-';
|
|
}
|
|
}
|