Code formatting
This commit is contained in:
parent
eb0d17015d
commit
59db8b6a50
|
|
@ -50,7 +50,7 @@ class PaymentFields {
|
|||
static const String refunded = 'refunded';
|
||||
static const String transactionReference = 'transaction_reference';
|
||||
static const String date = 'date';
|
||||
static const String paymentTypeId = 'payment_type_id';
|
||||
static const String typeId = 'type_id';
|
||||
static const String client = 'client';
|
||||
static const String clientId = 'client_id';
|
||||
static const String invoiceId = 'invoice_id';
|
||||
|
|
@ -58,7 +58,7 @@ class PaymentFields {
|
|||
static const String privateNotes = 'private_notes';
|
||||
static const String exchangeRate = 'exchange_rate';
|
||||
static const String exchangeCurrencyId = 'exchange_currency_id';
|
||||
static const String paymentStatus = 'payment_status';
|
||||
static const String status = 'status';
|
||||
static const String gateway = 'gateway';
|
||||
static const String customValue1 = 'custom1';
|
||||
static const String customValue2 = 'custom2';
|
||||
|
|
@ -267,7 +267,7 @@ abstract class PaymentEntity extends Object
|
|||
case EntityFields.archivedAt:
|
||||
response = paymentA.archivedAt.compareTo(paymentB.archivedAt);
|
||||
break;
|
||||
case PaymentFields.paymentStatus:
|
||||
case PaymentFields.status:
|
||||
response = paymentA.statusId.compareTo(paymentB.statusId);
|
||||
break;
|
||||
case PaymentFields.customValue1:
|
||||
|
|
|
|||
|
|
@ -195,5 +195,7 @@ class AuthRepository {
|
|||
|
||||
String get _tokenName => kIsWeb
|
||||
? 'web_client'
|
||||
: Platform.isAndroid ? 'android_client' : 'ios_client';
|
||||
: Platform.isAndroid
|
||||
? 'android_client'
|
||||
: 'ios_client';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,8 +81,7 @@ class PaymentRepository {
|
|||
}
|
||||
|
||||
Future<PaymentEntity> refundPayment(
|
||||
Credentials credentials,
|
||||
PaymentEntity payment) async {
|
||||
Credentials credentials, PaymentEntity payment) async {
|
||||
final data = serializers.serializeWith(PaymentEntity.serializer, payment);
|
||||
dynamic response;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,20 +19,19 @@ class RecurringInvoiceRepository {
|
|||
final dynamic response = await webClient.get(
|
||||
'${credentials.url}/recurring_invoices/$entityId', credentials.token);
|
||||
|
||||
final InvoiceItemResponse recurringInvoiceResponse = serializers
|
||||
.deserializeWith(InvoiceItemResponse.serializer, response);
|
||||
final InvoiceItemResponse recurringInvoiceResponse =
|
||||
serializers.deserializeWith(InvoiceItemResponse.serializer, response);
|
||||
|
||||
return recurringInvoiceResponse.data;
|
||||
}
|
||||
|
||||
Future<BuiltList<InvoiceEntity>> loadList(
|
||||
Credentials credentials) async {
|
||||
Future<BuiltList<InvoiceEntity>> loadList(Credentials credentials) async {
|
||||
final String url = credentials.url + '/recurring_invoices?';
|
||||
|
||||
final dynamic response = await webClient.get(url, credentials.token);
|
||||
|
||||
final InvoiceListResponse recurringInvoiceResponse = serializers
|
||||
.deserializeWith(InvoiceListResponse.serializer, response);
|
||||
final InvoiceListResponse recurringInvoiceResponse =
|
||||
serializers.deserializeWith(InvoiceListResponse.serializer, response);
|
||||
|
||||
return recurringInvoiceResponse.data;
|
||||
}
|
||||
|
|
@ -43,16 +42,16 @@ class RecurringInvoiceRepository {
|
|||
final dynamic response = await webClient.post(url, credentials.token,
|
||||
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
|
||||
|
||||
final InvoiceListResponse recurringInvoiceResponse = serializers
|
||||
.deserializeWith(InvoiceListResponse.serializer, response);
|
||||
final InvoiceListResponse recurringInvoiceResponse =
|
||||
serializers.deserializeWith(InvoiceListResponse.serializer, response);
|
||||
|
||||
return recurringInvoiceResponse.data.toList();
|
||||
}
|
||||
|
||||
Future<InvoiceEntity> saveData(
|
||||
Credentials credentials, InvoiceEntity recurringInvoice) async {
|
||||
final data = serializers.serializeWith(
|
||||
InvoiceEntity.serializer, recurringInvoice);
|
||||
final data =
|
||||
serializers.serializeWith(InvoiceEntity.serializer, recurringInvoice);
|
||||
dynamic response;
|
||||
|
||||
if (recurringInvoice.isNew) {
|
||||
|
|
@ -66,8 +65,8 @@ class RecurringInvoiceRepository {
|
|||
await webClient.put(url, credentials.token, data: json.encode(data));
|
||||
}
|
||||
|
||||
final InvoiceItemResponse recurringInvoiceResponse = serializers
|
||||
.deserializeWith(InvoiceItemResponse.serializer, response);
|
||||
final InvoiceItemResponse recurringInvoiceResponse =
|
||||
serializers.deserializeWith(InvoiceItemResponse.serializer, response);
|
||||
|
||||
return recurringInvoiceResponse.data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,9 @@ class SettingsRepository {
|
|||
String path, EntityType type) async {
|
||||
final route = type == EntityType.company
|
||||
? 'companies'
|
||||
: type == EntityType.group ? 'group_settings' : 'clients';
|
||||
: type == EntityType.group
|
||||
? 'group_settings'
|
||||
: 'clients';
|
||||
final url = '${credentials.url}/$route/$entityId';
|
||||
|
||||
final dynamic response = await webClient.post(url, credentials.token,
|
||||
|
|
|
|||
|
|
@ -56,10 +56,12 @@ final selectedIdReducer = combineReducers<String>([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.client ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.client ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.client
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<ClientEntity>([
|
||||
|
|
|
|||
|
|
@ -152,7 +152,9 @@ abstract class SettingsUIState extends Object
|
|||
user: user ?? UserEntity(),
|
||||
entityType: client != null
|
||||
? EntityType.client
|
||||
: group != null ? EntityType.group : EntityType.company,
|
||||
: group != null
|
||||
? EntityType.group
|
||||
: EntityType.company,
|
||||
origClient: origClient ?? ClientEntity(),
|
||||
origGroup: origGroup ?? GroupEntity(),
|
||||
origCompany: origCompany ?? CompanyEntity(),
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ArchiveCompanyGatewaySuccess>(
|
||||
(selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) =>
|
||||
action.clearSelection
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.companyGateway
|
||||
? action.entityId
|
||||
|
|
|
|||
|
|
@ -44,10 +44,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.credit ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.credit ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.credit
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<InvoiceEntity>([
|
||||
|
|
|
|||
|
|
@ -28,10 +28,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.group ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.group ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.group
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<GroupEntity>([
|
||||
|
|
|
|||
|
|
@ -46,10 +46,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.invoice ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.invoice ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.invoice
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<InvoiceEntity>([
|
||||
|
|
|
|||
|
|
@ -56,8 +56,7 @@ abstract class InvoiceUIState extends Object
|
|||
implements Built<InvoiceUIState, InvoiceUIStateBuilder> {
|
||||
factory InvoiceUIState() {
|
||||
return _$InvoiceUIState._(
|
||||
listUIState:
|
||||
ListUIState(InvoiceFields.number, sortAscending: false),
|
||||
listUIState: ListUIState(InvoiceFields.number, sortAscending: false),
|
||||
editing: InvoiceEntity(),
|
||||
selectedId: '',
|
||||
);
|
||||
|
|
|
|||
|
|
@ -26,10 +26,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.payment ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.payment ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.payment
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<PaymentEntity>([
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ InvoiceItemEntity convertProductToInvoiceItem({
|
|||
..cost = cost
|
||||
..quantity = company.enableProductQuantity
|
||||
? product.quantity
|
||||
: company.defaultQuantity ? 1 : null
|
||||
: company.defaultQuantity
|
||||
? 1
|
||||
: null
|
||||
..customValue1 = product.customValue1
|
||||
..customValue2 = product.customValue2
|
||||
..taxName1 = product.taxName1
|
||||
|
|
|
|||
|
|
@ -44,10 +44,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.quote ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.quote ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.quote
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<InvoiceEntity>([
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ List<String> filteredRecurringInvoicesSelector(
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}).toList();
|
||||
|
||||
list.sort((recurringInvoiceAId, recurringInvoiceBId) {
|
||||
|
|
@ -101,7 +100,7 @@ List<String> filteredRecurringInvoicesSelector(
|
|||
}
|
||||
|
||||
var memoizedRecurringInvoiceStatsForClient = memo2(
|
||||
(String clientId, BuiltMap<String, InvoiceEntity> invoiceMap) =>
|
||||
(String clientId, BuiltMap<String, InvoiceEntity> invoiceMap) =>
|
||||
recurringInvoiceStatsForClient(clientId, invoiceMap));
|
||||
|
||||
EntityStats recurringInvoiceStatsForClient(
|
||||
|
|
@ -122,7 +121,7 @@ EntityStats recurringInvoiceStatsForClient(
|
|||
}
|
||||
|
||||
var memoizedRecurringInvoiceStatsForUser = memo2(
|
||||
(String userId, BuiltMap<String, InvoiceEntity> invoiceMap) =>
|
||||
(String userId, BuiltMap<String, InvoiceEntity> invoiceMap) =>
|
||||
recurringInvoiceStatsForUser(userId, invoiceMap));
|
||||
|
||||
EntityStats recurringInvoiceStatsForUser(
|
||||
|
|
@ -142,10 +141,8 @@ EntityStats recurringInvoiceStatsForUser(
|
|||
return EntityStats(countActive: countActive, countArchived: countArchived);
|
||||
}
|
||||
|
||||
|
||||
bool hasRecurringInvoiceChanges(InvoiceEntity recurringInvoice,
|
||||
BuiltMap<String, InvoiceEntity> recurringInvoiceMap) =>
|
||||
recurringInvoice.isNew
|
||||
? recurringInvoice.isChanged
|
||||
: recurringInvoice != recurringInvoiceMap[recurringInvoice.id];
|
||||
|
||||
|
|
|
|||
|
|
@ -26,10 +26,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, DeleteTokensSuccess>((selectedId, action) => ''),
|
||||
TypedReducer<String, ArchiveTokensSuccess>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.token ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.token
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<TokenEntity>([
|
||||
|
|
|
|||
|
|
@ -90,7 +90,9 @@ Reducer<bool> historyVisibleReducer = combineReducers([
|
|||
TypedReducer<bool, UpdateUserPreferences>((value, action) {
|
||||
return action.historyMode == AppSidebarMode.visible
|
||||
? true
|
||||
: action.historyMode == AppSidebarMode.float ? false : value;
|
||||
: action.historyMode == AppSidebarMode.float
|
||||
? false
|
||||
: value;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,9 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
|
|||
..isChanged = false
|
||||
..entityType = action.client != null
|
||||
? EntityType.client
|
||||
: action.group != null ? EntityType.group : state.entityType);
|
||||
: action.group != null
|
||||
? EntityType.group
|
||||
: state.entityType);
|
||||
}),
|
||||
TypedReducer<SettingsUIState, UpdateCompany>((state, action) {
|
||||
return state.rebuild((b) => b
|
||||
|
|
|
|||
|
|
@ -29,10 +29,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntitySelection>((selectedId, action) =>
|
||||
action.entityType == EntityType.user ? '' : selectedId),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.user ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.user
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<UserEntity>([
|
||||
|
|
|
|||
|
|
@ -26,10 +26,12 @@ Reducer<String> selectedIdReducer = combineReducers([
|
|||
TypedReducer<String, DeleteWebhooksSuccess>((selectedId, action) => ''),
|
||||
TypedReducer<String, ArchiveWebhooksSuccess>((selectedId, action) => ''),
|
||||
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
|
||||
TypedReducer<String, FilterByEntity>((selectedId, action) => action
|
||||
.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.webhook ? action.entityId : selectedId),
|
||||
TypedReducer<String, FilterByEntity>(
|
||||
(selectedId, action) => action.clearSelection
|
||||
? ''
|
||||
: action.entityType == EntityType.webhook
|
||||
? action.entityId
|
||||
: selectedId),
|
||||
]);
|
||||
|
||||
final editingReducer = combineReducers<WebhookEntity>([
|
||||
|
|
|
|||
|
|
@ -199,7 +199,9 @@ class _NotificationSelector extends StatelessWidget {
|
|||
child: IconText(
|
||||
text: showNoneAsCustom
|
||||
? localization.custom
|
||||
: hasMultipleUsers ? localization.none : localization.disabled,
|
||||
: hasMultipleUsers
|
||||
? localization.none
|
||||
: localization.disabled,
|
||||
icon: showNoneAsCustom
|
||||
? Icons.arrow_drop_down_circle
|
||||
: Icons.do_not_disturb_alt,
|
||||
|
|
|
|||
|
|
@ -129,7 +129,8 @@ class _ListFilterState extends State<ListFilter> {
|
|||
onPressed: () {
|
||||
_filterController.text = '';
|
||||
_focusNode.unfocus(
|
||||
disposition: UnfocusDisposition.previouslyFocusedChild);
|
||||
disposition:
|
||||
UnfocusDisposition.previouslyFocusedChild);
|
||||
widget.onFilterChanged(null);
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ class EntityPresenter {
|
|||
case EntityFields.state:
|
||||
return Text(entity.isActive
|
||||
? localization.active
|
||||
: entity.isArchived ? localization.archived : localization.deleted);
|
||||
: entity.isArchived
|
||||
? localization.archived
|
||||
: localization.deleted);
|
||||
case EntityFields.createdBy:
|
||||
return Text(
|
||||
state.userState.map[entity.createdUserId]?.listDisplayName ?? '');
|
||||
|
|
|
|||
|
|
@ -123,7 +123,9 @@ class SettingsViewer extends StatelessWidget {
|
|||
: null,
|
||||
localization.militaryTime: settings.enableMilitaryTime == true
|
||||
? localization.enabled
|
||||
: settings.enableMilitaryTime == false ? localization.disabled : null,
|
||||
: settings.enableMilitaryTime == false
|
||||
? localization.disabled
|
||||
: null,
|
||||
localization.language: settings.hasLanguage
|
||||
? staticState.languageMap[settings.languageId]?.name
|
||||
: null,
|
||||
|
|
@ -132,16 +134,24 @@ class SettingsViewer extends StatelessWidget {
|
|||
: null,
|
||||
localization.sendReminders: settings.sendReminders == true
|
||||
? localization.enabled
|
||||
: settings.sendReminders == false ? localization.disabled : null,
|
||||
: settings.sendReminders == false
|
||||
? localization.disabled
|
||||
: null,
|
||||
localization.clientPortal: settings.enablePortal == true
|
||||
? localization.enabled
|
||||
: settings.enablePortal == false ? localization.disabled : null,
|
||||
: settings.enablePortal == false
|
||||
? localization.disabled
|
||||
: null,
|
||||
localization.clientPortalTasks: settings.enablePortal == true
|
||||
? localization.enabled
|
||||
: settings.enablePortal == false ? localization.disabled : null,
|
||||
: settings.enablePortal == false
|
||||
? localization.disabled
|
||||
: null,
|
||||
localization.clientPortalDashboard: settings.enablePortal == true
|
||||
? localization.enabled
|
||||
: settings.enablePortal == false ? localization.disabled : null,
|
||||
: settings.enablePortal == false
|
||||
? localization.disabled
|
||||
: null,
|
||||
localization.paymentType: settings.hasDefaultPaymentTypeId
|
||||
? staticState.paymentTypeMap[settings.defaultPaymentTypeId]?.name
|
||||
: null,
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
class InvoicePresenter extends EntityPresenter {
|
||||
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
|
||||
return [
|
||||
InvoiceFields.status,
|
||||
InvoiceFields.number,
|
||||
InvoiceFields.client,
|
||||
InvoiceFields.amount,
|
||||
InvoiceFields.balance,
|
||||
InvoiceFields.status,
|
||||
InvoiceFields.date,
|
||||
InvoiceFields.dueDate,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@ import 'package:invoiceninja_flutter/utils/formatting.dart';
|
|||
class PaymentPresenter extends EntityPresenter {
|
||||
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
|
||||
return [
|
||||
PaymentFields.status,
|
||||
PaymentFields.number,
|
||||
PaymentFields.client,
|
||||
PaymentFields.amount,
|
||||
PaymentFields.invoiceNumber,
|
||||
PaymentFields.date,
|
||||
PaymentFields.transactionReference,
|
||||
PaymentFields.paymentStatus,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ class PaymentPresenter extends EntityPresenter {
|
|||
alignment: Alignment.centerRight,
|
||||
child: Text(formatNumber(payment.amount, context,
|
||||
clientId: payment.clientId)));
|
||||
case PaymentFields.paymentStatus:
|
||||
case PaymentFields.status:
|
||||
return EntityStatusChip(entity: payment);
|
||||
case PaymentFields.customValue1:
|
||||
return Text(payment.customValue1);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class _PaymentViewState extends State<PaymentView> {
|
|||
if ((payment.typeId ?? '').isNotEmpty) {
|
||||
final paymentType = state.staticState.paymentTypeMap[payment.typeId];
|
||||
if (paymentType != null) {
|
||||
fields[PaymentFields.paymentTypeId] = paymentType.name;
|
||||
fields[PaymentFields.typeId] = paymentType.name;
|
||||
}
|
||||
}
|
||||
if (payment.transactionReference.isNotEmpty) {
|
||||
|
|
|
|||
|
|
@ -103,8 +103,7 @@ class _ProductEditState extends State<ProductEdit> {
|
|||
..customValue1 = _custom1Controller.text.trim()
|
||||
..customValue2 = _custom2Controller.text.trim()
|
||||
..customValue3 = _custom3Controller.text.trim()
|
||||
..customValue4 = _custom4Controller.text.trim()
|
||||
);
|
||||
..customValue4 = _custom4Controller.text.trim());
|
||||
if (product != widget.viewModel.product) {
|
||||
widget.viewModel.onChanged(product);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ class QuoteEditDetailsVM extends EntityEditDetailsVM {
|
|||
clientList: state.clientState.list,
|
||||
onClientChanged: (context, quote, client) {
|
||||
if (client != null) {
|
||||
final exchangeRate = getExchangeRate(
|
||||
state.staticState.currencyMap,
|
||||
final exchangeRate = getExchangeRate(state.staticState.currencyMap,
|
||||
fromCurrencyId: company.currencyId,
|
||||
toCurrencyId: client.currencyId);
|
||||
store.dispatch(UpdateQuote(
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
class QuotePresenter extends EntityPresenter {
|
||||
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
|
||||
return [
|
||||
QuoteFields.status,
|
||||
QuoteFields.number,
|
||||
QuoteFields.client,
|
||||
QuoteFields.amount,
|
||||
QuoteFields.status,
|
||||
QuoteFields.date,
|
||||
QuoteFields.validUntil,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ class RecurringInvoiceEditDetailsVM extends EntityEditDetailsVM {
|
|||
clientList: state.clientState.list,
|
||||
onClientChanged: (context, invoice, client) {
|
||||
if (client != null) {
|
||||
final exchangeRate = getExchangeRate(
|
||||
state.staticState.currencyMap,
|
||||
final exchangeRate = getExchangeRate(state.staticState.currencyMap,
|
||||
fromCurrencyId: company.currencyId,
|
||||
toCurrencyId: client.currencyId);
|
||||
store.dispatch(UpdateRecurringInvoice(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ class RecurringInvoiceEditNotesVM extends EntityEditNotesVM {
|
|||
return RecurringInvoiceEditNotesVM(
|
||||
company: state.company,
|
||||
invoice: quote,
|
||||
onChanged: (InvoiceEntity quote) => store.dispatch(UpdateRecurringInvoice(quote)),
|
||||
onChanged: (InvoiceEntity quote) =>
|
||||
store.dispatch(UpdateRecurringInvoice(quote)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ class RecurringInvoiceEditVM extends EntityEditVM {
|
|||
},
|
||||
onItemsAdded: (items, clientId) {
|
||||
if (items.length == 1) {
|
||||
store.dispatch(EditRecurringInvoiceItem(recurringInvoice.lineItems.length));
|
||||
store.dispatch(
|
||||
EditRecurringInvoiceItem(recurringInvoice.lineItems.length));
|
||||
}
|
||||
store.dispatch(AddRecurringInvoiceItems(items));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
|
|||
class RecurringInvoicePresenter extends EntityPresenter {
|
||||
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
|
||||
return [
|
||||
RecurringInvoiceFields.status,
|
||||
RecurringInvoiceFields.invoiceNumber,
|
||||
RecurringInvoiceFields.client,
|
||||
RecurringInvoiceFields.amount,
|
||||
RecurringInvoiceFields.status,
|
||||
RecurringInvoiceFields.remainingCycles,
|
||||
RecurringInvoiceFields.nextSendDate,
|
||||
RecurringInvoiceFields.frequency,
|
||||
|
|
|
|||
|
|
@ -65,17 +65,13 @@ class RecurringInvoiceScreen extends StatelessWidget {
|
|||
store.dispatch(StartRecurringInvoiceMultiselect());
|
||||
}
|
||||
},
|
||||
customValues1: company.getCustomFieldValues(
|
||||
CustomFieldType.invoice1,
|
||||
customValues1: company.getCustomFieldValues(CustomFieldType.invoice1,
|
||||
excludeBlank: true),
|
||||
customValues2: company.getCustomFieldValues(
|
||||
CustomFieldType.invoice2,
|
||||
customValues2: company.getCustomFieldValues(CustomFieldType.invoice2,
|
||||
excludeBlank: true),
|
||||
customValues3: company.getCustomFieldValues(
|
||||
CustomFieldType.invoice3,
|
||||
customValues3: company.getCustomFieldValues(CustomFieldType.invoice3,
|
||||
excludeBlank: true),
|
||||
customValues4: company.getCustomFieldValues(
|
||||
CustomFieldType.invoice4,
|
||||
customValues4: company.getCustomFieldValues(CustomFieldType.invoice4,
|
||||
excludeBlank: true),
|
||||
onSelectedCustom1: (value) =>
|
||||
store.dispatch(FilterRecurringInvoicesByCustom1(value)),
|
||||
|
|
|
|||
|
|
@ -362,8 +362,8 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
|
|||
],
|
||||
),
|
||||
VariablesHelp(
|
||||
//showEmailVariables: true,
|
||||
),
|
||||
//showEmailVariables: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
EmailPreview(
|
||||
|
|
|
|||
|
|
@ -134,7 +134,9 @@ class TaskListItem extends StatelessWidget {
|
|||
style: TextStyle(
|
||||
color: task.isInvoiced
|
||||
? Colors.green
|
||||
: task.isRunning ? Colors.blue : Colors.grey,
|
||||
: task.isRunning
|
||||
? Colors.blue
|
||||
: Colors.grey,
|
||||
)),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -92,7 +92,9 @@ class _TaskViewState extends State<TaskView> {
|
|||
entity: project,
|
||||
statusColor: task.isInvoiced
|
||||
? Colors.green
|
||||
: task.isRunning ? Colors.blue : null,
|
||||
: task.isRunning
|
||||
? Colors.blue
|
||||
: null,
|
||||
label: localization.duration,
|
||||
value: formatDuration(task.calculateDuration),
|
||||
secondLabel: localization.amount,
|
||||
|
|
|
|||
|
|
@ -292,8 +292,12 @@ String formatDate(String value, BuildContext context,
|
|||
String format;
|
||||
if (!showDate) {
|
||||
format = showSeconds
|
||||
? company.settings.enableMilitaryTime ? 'H:mm:ss' : 'h:mm:ss a'
|
||||
: company.settings.enableMilitaryTime ? 'H:mm' : 'h:mm a';
|
||||
? company.settings.enableMilitaryTime
|
||||
? 'H:mm:ss'
|
||||
: 'h:mm:ss a'
|
||||
: company.settings.enableMilitaryTime
|
||||
? 'H:mm'
|
||||
: 'h:mm a';
|
||||
} else {
|
||||
final dateFormats = state.staticState.dateFormatMap;
|
||||
final dateFormatId = (company.settings.dateFormatId ?? '').isNotEmpty
|
||||
|
|
@ -302,8 +306,12 @@ String formatDate(String value, BuildContext context,
|
|||
format = dateFormats[dateFormatId].format;
|
||||
format += ' ' +
|
||||
(showSeconds
|
||||
? company.settings.enableMilitaryTime ? 'H:mm:ss' : 'h:mm:ss a'
|
||||
: company.settings.enableMilitaryTime ? 'H:mm' : 'h:mm a');
|
||||
? company.settings.enableMilitaryTime
|
||||
? 'H:mm:ss'
|
||||
: 'h:mm:ss a'
|
||||
: company.settings.enableMilitaryTime
|
||||
? 'H:mm'
|
||||
: 'h:mm a');
|
||||
}
|
||||
final formatter = DateFormat(format, localeSelector(state));
|
||||
final parsed = DateTime.tryParse(value);
|
||||
|
|
|
|||
Loading…
Reference in New Issue