Reports
This commit is contained in:
parent
6d81d7ed15
commit
aa6c818f82
|
|
@ -564,6 +564,7 @@ abstract class ContactEntity extends Object
|
||||||
updatedAt: 0,
|
updatedAt: 0,
|
||||||
archivedAt: 0,
|
archivedAt: 0,
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
|
lastLogin: 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -603,6 +604,7 @@ abstract class ContactEntity extends Object
|
||||||
@BuiltValueField(wireName: 'custom_value4')
|
@BuiltValueField(wireName: 'custom_value4')
|
||||||
String get customValue4;
|
String get customValue4;
|
||||||
|
|
||||||
|
@nullable
|
||||||
@BuiltValueField(wireName: 'last_login')
|
@BuiltValueField(wireName: 'last_login')
|
||||||
int get lastLogin;
|
int get lastLogin;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -526,9 +526,6 @@ class _$ContactEntitySerializer implements StructuredSerializer<ContactEntity> {
|
||||||
'custom_value4',
|
'custom_value4',
|
||||||
serializers.serialize(object.customValue4,
|
serializers.serialize(object.customValue4,
|
||||||
specifiedType: const FullType(String)),
|
specifiedType: const FullType(String)),
|
||||||
'last_login',
|
|
||||||
serializers.serialize(object.lastLogin,
|
|
||||||
specifiedType: const FullType(int)),
|
|
||||||
];
|
];
|
||||||
if (object.password != null) {
|
if (object.password != null) {
|
||||||
result
|
result
|
||||||
|
|
@ -536,6 +533,12 @@ class _$ContactEntitySerializer implements StructuredSerializer<ContactEntity> {
|
||||||
..add(serializers.serialize(object.password,
|
..add(serializers.serialize(object.password,
|
||||||
specifiedType: const FullType(String)));
|
specifiedType: const FullType(String)));
|
||||||
}
|
}
|
||||||
|
if (object.lastLogin != null) {
|
||||||
|
result
|
||||||
|
..add('last_login')
|
||||||
|
..add(serializers.serialize(object.lastLogin,
|
||||||
|
specifiedType: const FullType(int)));
|
||||||
|
}
|
||||||
if (object.isChanged != null) {
|
if (object.isChanged != null) {
|
||||||
result
|
result
|
||||||
..add('isChanged')
|
..add('isChanged')
|
||||||
|
|
@ -1663,9 +1666,6 @@ class _$ContactEntity extends ContactEntity {
|
||||||
if (customValue4 == null) {
|
if (customValue4 == null) {
|
||||||
throw new BuiltValueNullFieldError('ContactEntity', 'customValue4');
|
throw new BuiltValueNullFieldError('ContactEntity', 'customValue4');
|
||||||
}
|
}
|
||||||
if (lastLogin == null) {
|
|
||||||
throw new BuiltValueNullFieldError('ContactEntity', 'lastLogin');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import 'package:invoiceninja_flutter/constants.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/client_model.dart';
|
import 'package:invoiceninja_flutter/data/models/client_model.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
||||||
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/static/industry_model.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/static/size_model.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/reports/reports_state.dart';
|
import 'package:invoiceninja_flutter/redux/reports/reports_state.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/reports/reports_screen.dart';
|
import 'package:invoiceninja_flutter/ui/reports/reports_screen.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/dates.dart';
|
import 'package:invoiceninja_flutter/utils/dates.dart';
|
||||||
|
|
@ -53,13 +55,22 @@ class ClientReportFields {
|
||||||
static const String contactLastLogin = 'contact_last_login';
|
static const String contactLastLogin = 'contact_last_login';
|
||||||
}
|
}
|
||||||
|
|
||||||
var memoizedClientReport = memo3((UserCompanyEntity userCompany,
|
var memoizedClientReport = memo5((
|
||||||
ReportsUIState reportsUIState,
|
UserCompanyEntity userCompany,
|
||||||
BuiltMap<String, ClientEntity> clientMap) =>
|
ReportsUIState reportsUIState,
|
||||||
clientReport(userCompany, reportsUIState, clientMap));
|
BuiltMap<String, ClientEntity> clientMap,
|
||||||
|
BuiltMap<String, IndustryEntity> industryMap,
|
||||||
|
BuiltMap<String, SizeEntity> sizeMap,
|
||||||
|
) =>
|
||||||
|
clientReport(userCompany, reportsUIState, clientMap, industryMap, sizeMap));
|
||||||
|
|
||||||
ReportResult clientReport(UserCompanyEntity userCompany,
|
ReportResult clientReport(
|
||||||
ReportsUIState reportsUIState, BuiltMap<String, ClientEntity> clientMap) {
|
UserCompanyEntity userCompany,
|
||||||
|
ReportsUIState reportsUIState,
|
||||||
|
BuiltMap<String, ClientEntity> clientMap,
|
||||||
|
BuiltMap<String, IndustryEntity> industryMap,
|
||||||
|
BuiltMap<String, SizeEntity> sizeMap,
|
||||||
|
) {
|
||||||
final List<List<ReportElement>> data = [];
|
final List<List<ReportElement>> data = [];
|
||||||
BuiltList<String> columns;
|
BuiltList<String> columns;
|
||||||
|
|
||||||
|
|
@ -105,15 +116,36 @@ ReportResult clientReport(UserCompanyEntity userCompany,
|
||||||
case ClientReportFields.publicNotes:
|
case ClientReportFields.publicNotes:
|
||||||
value = client.publicNotes;
|
value = client.publicNotes;
|
||||||
break;
|
break;
|
||||||
|
case ClientReportFields.industry:
|
||||||
|
value = industryMap[client.industryId].listDisplayName;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.size:
|
||||||
|
value = sizeMap[client.sizeId].listDisplayName;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.address1:
|
||||||
|
value = client.address1;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.address2:
|
||||||
|
value = client.address2;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.city:
|
||||||
|
value = client.city;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.state:
|
||||||
|
value = client.state;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.postCode:
|
||||||
|
value = client.postalCode;
|
||||||
|
break;
|
||||||
|
case ClientReportFields.phone:
|
||||||
|
value = client.phone;
|
||||||
|
break;
|
||||||
case ClientReportFields.idNumber:
|
case ClientReportFields.idNumber:
|
||||||
value = client.idNumber;
|
value = client.idNumber;
|
||||||
break;
|
break;
|
||||||
case ClientReportFields.vatNumber:
|
case ClientReportFields.vatNumber:
|
||||||
value = client.vatNumber;
|
value = client.vatNumber;
|
||||||
break;
|
break;
|
||||||
case ClientReportFields.state:
|
|
||||||
value = client.state;
|
|
||||||
break;
|
|
||||||
case ClientReportFields.createdAt:
|
case ClientReportFields.createdAt:
|
||||||
value = convertTimestampToDateString(client.createdAt);
|
value = convertTimestampToDateString(client.createdAt);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,8 @@ class ReportsScreenVM {
|
||||||
state.userCompany,
|
state.userCompany,
|
||||||
state.uiState.reportsUIState,
|
state.uiState.reportsUIState,
|
||||||
state.clientState.map,
|
state.clientState.map,
|
||||||
|
state.staticState.industryMap,
|
||||||
|
state.staticState.sizeMap,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue