Feature Request: Filter Payments #542
This commit is contained in:
parent
8f53f0d106
commit
45cc0a3ccd
|
|
@ -1,5 +1,4 @@
|
|||
// Package imports:
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
|
@ -8,42 +7,6 @@ import 'package:invoiceninja_flutter/data/models/entities.dart';
|
|||
|
||||
part 'invoice_status_model.g.dart';
|
||||
|
||||
abstract class InvoiceStatusListResponse
|
||||
implements
|
||||
Built<InvoiceStatusListResponse, InvoiceStatusListResponseBuilder> {
|
||||
factory InvoiceStatusListResponse(
|
||||
[void updates(InvoiceStatusListResponseBuilder b)]) =
|
||||
_$InvoiceStatusListResponse;
|
||||
InvoiceStatusListResponse._();
|
||||
|
||||
@override
|
||||
@memoized
|
||||
int get hashCode;
|
||||
|
||||
BuiltList<InvoiceStatusEntity> get data;
|
||||
|
||||
static Serializer<InvoiceStatusListResponse> get serializer =>
|
||||
_$invoiceStatusListResponseSerializer;
|
||||
}
|
||||
|
||||
abstract class InvoiceStatusItemResponse
|
||||
implements
|
||||
Built<InvoiceStatusItemResponse, InvoiceStatusItemResponseBuilder> {
|
||||
factory InvoiceStatusItemResponse(
|
||||
[void updates(InvoiceStatusItemResponseBuilder b)]) =
|
||||
_$InvoiceStatusItemResponse;
|
||||
InvoiceStatusItemResponse._();
|
||||
|
||||
@override
|
||||
@memoized
|
||||
int get hashCode;
|
||||
|
||||
InvoiceStatusEntity get data;
|
||||
|
||||
static Serializer<InvoiceStatusItemResponse> get serializer =>
|
||||
_$invoiceStatusItemResponseSerializer;
|
||||
}
|
||||
|
||||
class InvoiceStatusFields {
|
||||
static const String name = 'name';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,109 +6,9 @@ part of 'invoice_status_model.dart';
|
|||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Serializer<InvoiceStatusListResponse> _$invoiceStatusListResponseSerializer =
|
||||
new _$InvoiceStatusListResponseSerializer();
|
||||
Serializer<InvoiceStatusItemResponse> _$invoiceStatusItemResponseSerializer =
|
||||
new _$InvoiceStatusItemResponseSerializer();
|
||||
Serializer<InvoiceStatusEntity> _$invoiceStatusEntitySerializer =
|
||||
new _$InvoiceStatusEntitySerializer();
|
||||
|
||||
class _$InvoiceStatusListResponseSerializer
|
||||
implements StructuredSerializer<InvoiceStatusListResponse> {
|
||||
@override
|
||||
final Iterable<Type> types = const [
|
||||
InvoiceStatusListResponse,
|
||||
_$InvoiceStatusListResponse
|
||||
];
|
||||
@override
|
||||
final String wireName = 'InvoiceStatusListResponse';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(
|
||||
Serializers serializers, InvoiceStatusListResponse object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[
|
||||
'data',
|
||||
serializers.serialize(object.data,
|
||||
specifiedType: const FullType(
|
||||
BuiltList, const [const FullType(InvoiceStatusEntity)])),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
InvoiceStatusListResponse deserialize(
|
||||
Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = new InvoiceStatusListResponseBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object value = iterator.current;
|
||||
switch (key) {
|
||||
case 'data':
|
||||
result.data.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(
|
||||
BuiltList, const [const FullType(InvoiceStatusEntity)]))
|
||||
as BuiltList<Object>);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$InvoiceStatusItemResponseSerializer
|
||||
implements StructuredSerializer<InvoiceStatusItemResponse> {
|
||||
@override
|
||||
final Iterable<Type> types = const [
|
||||
InvoiceStatusItemResponse,
|
||||
_$InvoiceStatusItemResponse
|
||||
];
|
||||
@override
|
||||
final String wireName = 'InvoiceStatusItemResponse';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(
|
||||
Serializers serializers, InvoiceStatusItemResponse object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[
|
||||
'data',
|
||||
serializers.serialize(object.data,
|
||||
specifiedType: const FullType(InvoiceStatusEntity)),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
InvoiceStatusItemResponse deserialize(
|
||||
Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = new InvoiceStatusItemResponseBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object value = iterator.current;
|
||||
switch (key) {
|
||||
case 'data':
|
||||
result.data.replace(serializers.deserialize(value,
|
||||
specifiedType: const FullType(InvoiceStatusEntity))
|
||||
as InvoiceStatusEntity);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$InvoiceStatusEntitySerializer
|
||||
implements StructuredSerializer<InvoiceStatusEntity> {
|
||||
@override
|
||||
|
|
@ -160,196 +60,6 @@ class _$InvoiceStatusEntitySerializer
|
|||
}
|
||||
}
|
||||
|
||||
class _$InvoiceStatusListResponse extends InvoiceStatusListResponse {
|
||||
@override
|
||||
final BuiltList<InvoiceStatusEntity> data;
|
||||
|
||||
factory _$InvoiceStatusListResponse(
|
||||
[void Function(InvoiceStatusListResponseBuilder) updates]) =>
|
||||
(new InvoiceStatusListResponseBuilder()..update(updates)).build();
|
||||
|
||||
_$InvoiceStatusListResponse._({this.data}) : super._() {
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
data, 'InvoiceStatusListResponse', 'data');
|
||||
}
|
||||
|
||||
@override
|
||||
InvoiceStatusListResponse rebuild(
|
||||
void Function(InvoiceStatusListResponseBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
InvoiceStatusListResponseBuilder toBuilder() =>
|
||||
new InvoiceStatusListResponseBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is InvoiceStatusListResponse && data == other.data;
|
||||
}
|
||||
|
||||
int __hashCode;
|
||||
@override
|
||||
int get hashCode {
|
||||
return __hashCode ??= $jf($jc(0, data.hashCode));
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper('InvoiceStatusListResponse')
|
||||
..add('data', data))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class InvoiceStatusListResponseBuilder
|
||||
implements
|
||||
Builder<InvoiceStatusListResponse, InvoiceStatusListResponseBuilder> {
|
||||
_$InvoiceStatusListResponse _$v;
|
||||
|
||||
ListBuilder<InvoiceStatusEntity> _data;
|
||||
ListBuilder<InvoiceStatusEntity> get data =>
|
||||
_$this._data ??= new ListBuilder<InvoiceStatusEntity>();
|
||||
set data(ListBuilder<InvoiceStatusEntity> data) => _$this._data = data;
|
||||
|
||||
InvoiceStatusListResponseBuilder();
|
||||
|
||||
InvoiceStatusListResponseBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_data = $v.data.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(InvoiceStatusListResponse other) {
|
||||
ArgumentError.checkNotNull(other, 'other');
|
||||
_$v = other as _$InvoiceStatusListResponse;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(InvoiceStatusListResponseBuilder) updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_$InvoiceStatusListResponse build() {
|
||||
_$InvoiceStatusListResponse _$result;
|
||||
try {
|
||||
_$result = _$v ?? new _$InvoiceStatusListResponse._(data: data.build());
|
||||
} catch (_) {
|
||||
String _$failedField;
|
||||
try {
|
||||
_$failedField = 'data';
|
||||
data.build();
|
||||
} catch (e) {
|
||||
throw new BuiltValueNestedFieldError(
|
||||
'InvoiceStatusListResponse', _$failedField, e.toString());
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
class _$InvoiceStatusItemResponse extends InvoiceStatusItemResponse {
|
||||
@override
|
||||
final InvoiceStatusEntity data;
|
||||
|
||||
factory _$InvoiceStatusItemResponse(
|
||||
[void Function(InvoiceStatusItemResponseBuilder) updates]) =>
|
||||
(new InvoiceStatusItemResponseBuilder()..update(updates)).build();
|
||||
|
||||
_$InvoiceStatusItemResponse._({this.data}) : super._() {
|
||||
BuiltValueNullFieldError.checkNotNull(
|
||||
data, 'InvoiceStatusItemResponse', 'data');
|
||||
}
|
||||
|
||||
@override
|
||||
InvoiceStatusItemResponse rebuild(
|
||||
void Function(InvoiceStatusItemResponseBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
InvoiceStatusItemResponseBuilder toBuilder() =>
|
||||
new InvoiceStatusItemResponseBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is InvoiceStatusItemResponse && data == other.data;
|
||||
}
|
||||
|
||||
int __hashCode;
|
||||
@override
|
||||
int get hashCode {
|
||||
return __hashCode ??= $jf($jc(0, data.hashCode));
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper('InvoiceStatusItemResponse')
|
||||
..add('data', data))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class InvoiceStatusItemResponseBuilder
|
||||
implements
|
||||
Builder<InvoiceStatusItemResponse, InvoiceStatusItemResponseBuilder> {
|
||||
_$InvoiceStatusItemResponse _$v;
|
||||
|
||||
InvoiceStatusEntityBuilder _data;
|
||||
InvoiceStatusEntityBuilder get data =>
|
||||
_$this._data ??= new InvoiceStatusEntityBuilder();
|
||||
set data(InvoiceStatusEntityBuilder data) => _$this._data = data;
|
||||
|
||||
InvoiceStatusItemResponseBuilder();
|
||||
|
||||
InvoiceStatusItemResponseBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_data = $v.data.toBuilder();
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(InvoiceStatusItemResponse other) {
|
||||
ArgumentError.checkNotNull(other, 'other');
|
||||
_$v = other as _$InvoiceStatusItemResponse;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(InvoiceStatusItemResponseBuilder) updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_$InvoiceStatusItemResponse build() {
|
||||
_$InvoiceStatusItemResponse _$result;
|
||||
try {
|
||||
_$result = _$v ?? new _$InvoiceStatusItemResponse._(data: data.build());
|
||||
} catch (_) {
|
||||
String _$failedField;
|
||||
try {
|
||||
_$failedField = 'data';
|
||||
data.build();
|
||||
} catch (e) {
|
||||
throw new BuiltValueNestedFieldError(
|
||||
'InvoiceStatusItemResponse', _$failedField, e.toString());
|
||||
}
|
||||
rethrow;
|
||||
}
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
class _$InvoiceStatusEntity extends InvoiceStatusEntity {
|
||||
@override
|
||||
final String id;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
// Package imports:
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||
|
||||
part 'payment_status_model.g.dart';
|
||||
|
||||
class PaymentStatusFields {
|
||||
static const String name = 'name';
|
||||
}
|
||||
|
||||
abstract class PaymentStatusEntity extends Object
|
||||
with EntityStatus, SelectableEntity
|
||||
implements Built<PaymentStatusEntity, PaymentStatusEntityBuilder> {
|
||||
factory PaymentStatusEntity() {
|
||||
return _$PaymentStatusEntity._(
|
||||
id: '',
|
||||
name: '',
|
||||
);
|
||||
}
|
||||
|
||||
PaymentStatusEntity._();
|
||||
|
||||
@override
|
||||
@memoized
|
||||
int get hashCode;
|
||||
|
||||
static Serializer<PaymentStatusEntity> get serializer =>
|
||||
_$paymentStatusEntitySerializer;
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'payment_status_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// BuiltValueGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Serializer<PaymentStatusEntity> _$paymentStatusEntitySerializer =
|
||||
new _$PaymentStatusEntitySerializer();
|
||||
|
||||
class _$PaymentStatusEntitySerializer
|
||||
implements StructuredSerializer<PaymentStatusEntity> {
|
||||
@override
|
||||
final Iterable<Type> types = const [
|
||||
PaymentStatusEntity,
|
||||
_$PaymentStatusEntity
|
||||
];
|
||||
@override
|
||||
final String wireName = 'PaymentStatusEntity';
|
||||
|
||||
@override
|
||||
Iterable<Object> serialize(
|
||||
Serializers serializers, PaymentStatusEntity object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object>[
|
||||
'id',
|
||||
serializers.serialize(object.id, specifiedType: const FullType(String)),
|
||||
'name',
|
||||
serializers.serialize(object.name, specifiedType: const FullType(String)),
|
||||
];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
PaymentStatusEntity deserialize(
|
||||
Serializers serializers, Iterable<Object> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = new PaymentStatusEntityBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object value = iterator.current;
|
||||
switch (key) {
|
||||
case 'id':
|
||||
result.id = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
case 'name':
|
||||
result.name = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class _$PaymentStatusEntity extends PaymentStatusEntity {
|
||||
@override
|
||||
final String id;
|
||||
@override
|
||||
final String name;
|
||||
|
||||
factory _$PaymentStatusEntity(
|
||||
[void Function(PaymentStatusEntityBuilder) updates]) =>
|
||||
(new PaymentStatusEntityBuilder()..update(updates)).build();
|
||||
|
||||
_$PaymentStatusEntity._({this.id, this.name}) : super._() {
|
||||
BuiltValueNullFieldError.checkNotNull(id, 'PaymentStatusEntity', 'id');
|
||||
BuiltValueNullFieldError.checkNotNull(name, 'PaymentStatusEntity', 'name');
|
||||
}
|
||||
|
||||
@override
|
||||
PaymentStatusEntity rebuild(
|
||||
void Function(PaymentStatusEntityBuilder) updates) =>
|
||||
(toBuilder()..update(updates)).build();
|
||||
|
||||
@override
|
||||
PaymentStatusEntityBuilder toBuilder() =>
|
||||
new PaymentStatusEntityBuilder()..replace(this);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(other, this)) return true;
|
||||
return other is PaymentStatusEntity && id == other.id && name == other.name;
|
||||
}
|
||||
|
||||
int __hashCode;
|
||||
@override
|
||||
int get hashCode {
|
||||
return __hashCode ??= $jf($jc($jc(0, id.hashCode), name.hashCode));
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (newBuiltValueToStringHelper('PaymentStatusEntity')
|
||||
..add('id', id)
|
||||
..add('name', name))
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
class PaymentStatusEntityBuilder
|
||||
implements Builder<PaymentStatusEntity, PaymentStatusEntityBuilder> {
|
||||
_$PaymentStatusEntity _$v;
|
||||
|
||||
String _id;
|
||||
String get id => _$this._id;
|
||||
set id(String id) => _$this._id = id;
|
||||
|
||||
String _name;
|
||||
String get name => _$this._name;
|
||||
set name(String name) => _$this._name = name;
|
||||
|
||||
PaymentStatusEntityBuilder();
|
||||
|
||||
PaymentStatusEntityBuilder get _$this {
|
||||
final $v = _$v;
|
||||
if ($v != null) {
|
||||
_id = $v.id;
|
||||
_name = $v.name;
|
||||
_$v = null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@override
|
||||
void replace(PaymentStatusEntity other) {
|
||||
ArgumentError.checkNotNull(other, 'other');
|
||||
_$v = other as _$PaymentStatusEntity;
|
||||
}
|
||||
|
||||
@override
|
||||
void update(void Function(PaymentStatusEntityBuilder) updates) {
|
||||
if (updates != null) updates(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_$PaymentStatusEntity build() {
|
||||
final _$result = _$v ??
|
||||
new _$PaymentStatusEntity._(
|
||||
id: BuiltValueNullFieldError.checkNotNull(
|
||||
id, 'PaymentStatusEntity', 'id'),
|
||||
name: BuiltValueNullFieldError.checkNotNull(
|
||||
name, 'PaymentStatusEntity', 'name'));
|
||||
replace(_$result);
|
||||
return _$result;
|
||||
}
|
||||
}
|
||||
|
||||
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
|
||||
|
|
@ -265,6 +265,13 @@ class FilterPaymentsByState implements PersistUI {
|
|||
final EntityState state;
|
||||
}
|
||||
|
||||
class FilterPaymentsByStatus implements PersistUI {
|
||||
FilterPaymentsByStatus(this.status);
|
||||
|
||||
final EntityStatus status;
|
||||
}
|
||||
|
||||
|
||||
class FilterPaymentsByCustom1 implements PersistUI {
|
||||
FilterPaymentsByCustom1(this.value);
|
||||
|
||||
|
|
|
|||
|
|
@ -235,11 +235,7 @@ class _ListFilterState extends State<ListFilter> {
|
|||
whenEmpty: localization.all,
|
||||
menuItembuilder: (dynamic value) {
|
||||
final state = value as EntityStatus;
|
||||
return Text(
|
||||
localization.lookup(state.name),
|
||||
overflow: TextOverflow.clip,
|
||||
maxLines: 1,
|
||||
);
|
||||
return Text(localization.lookup(state.name));
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ import 'package:flutter/material.dart';
|
|||
|
||||
// Package imports:
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/constants.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/static/payment_status_model.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
|
||||
|
|
@ -33,6 +35,49 @@ class PaymentScreen extends StatelessWidget {
|
|||
final userCompany = state.userCompany;
|
||||
final localization = AppLocalization.of(context);
|
||||
|
||||
final statuses = [
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusPartiallyUnapplied
|
||||
..name = localization.partiallyUnapplied,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusUnapplied
|
||||
..name = localization.unapplied,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusPending
|
||||
..name = localization.pending,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusCancelled
|
||||
..name = localization.cancelled,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusFailed
|
||||
..name = localization.failed,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusCompleted
|
||||
..name = localization.completed,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusPartiallyRefunded
|
||||
..name = localization.partiallyRefunded,
|
||||
),
|
||||
PaymentStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kPaymentStatusRefunded
|
||||
..name = localization.refunded,
|
||||
),
|
||||
];
|
||||
|
||||
return ListScaffold(
|
||||
entityType: EntityType.payment,
|
||||
onHamburgerLongPress: () => store.dispatch(StartPaymentMultiselect()),
|
||||
|
|
@ -47,6 +92,10 @@ class PaymentScreen extends StatelessWidget {
|
|||
onSelectedState: (EntityState state, value) {
|
||||
store.dispatch(FilterPaymentsByState(state));
|
||||
},
|
||||
statuses: statuses,
|
||||
onSelectedStatus: (EntityStatus status, value) {
|
||||
store.dispatch(FilterPaymentsByStatus(status));
|
||||
},
|
||||
),
|
||||
onCheckboxPressed: () {
|
||||
if (store.state.paymentListState.isInMultiselect()) {
|
||||
|
|
@ -87,6 +136,10 @@ class PaymentScreen extends StatelessWidget {
|
|||
onSelectedState: (EntityState state, value) {
|
||||
store.dispatch(FilterPaymentsByState(state));
|
||||
},
|
||||
statuses: statuses,
|
||||
onSelectedStatus: (EntityStatus status, value) {
|
||||
store.dispatch(FilterPaymentsByStatus(status));
|
||||
},
|
||||
onCheckboxPressed: () {
|
||||
if (store.state.paymentListState.isInMultiselect()) {
|
||||
store.dispatch(ClearPaymentMultiselect());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
// STARTER: lang key - do not remove comment
|
||||
'failed': 'Failed',
|
||||
'client_contacts': 'Client Contacts',
|
||||
'sync_from': 'Sync From',
|
||||
'inventory_threshold': 'Inventory Threshold',
|
||||
|
|
@ -93984,6 +93985,11 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
_localizedValues[localeCode]['client_contacts'] ??
|
||||
_localizedValues['en']['client_contacts'];
|
||||
|
||||
String get failed =>
|
||||
_localizedValues[localeCode]['failed'] ??
|
||||
_localizedValues['en']['failed'];
|
||||
|
||||
|
||||
// STARTER: lang field - do not remove comment
|
||||
|
||||
String lookup(String key) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue