Not able to create invoice for project in sidebar filter
This commit is contained in:
parent
34d6281666
commit
d71c333f8f
|
|
@ -272,6 +272,12 @@ void handleProjectAction(
|
||||||
..projectId = project.id
|
..projectId = project.id
|
||||||
..clientId = project.clientId));
|
..clientId = project.clientId));
|
||||||
break;
|
break;
|
||||||
|
case EntityAction.newInvoice:
|
||||||
|
createEntity(
|
||||||
|
context: context,
|
||||||
|
entity: InvoiceEntity(state: state, client: client)
|
||||||
|
.rebuild((b) => b..projectId = project.id));
|
||||||
|
break;
|
||||||
case EntityAction.invoiceProject:
|
case EntityAction.invoiceProject:
|
||||||
String lastClientId = '';
|
String lastClientId = '';
|
||||||
bool hasMultipleClients = false;
|
bool hasMultipleClients = false;
|
||||||
|
|
@ -373,6 +379,8 @@ void handleProjectAction(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
print('## Error: action $action not handled in project_actions');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,10 +181,12 @@ class _EntitiesListTileState extends State<EntitiesListTile> {
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
final uiState = store.state.uiState;
|
final uiState = store.state.uiState;
|
||||||
final entity = widget.entity;
|
final entity = widget.entity;
|
||||||
|
|
||||||
if (uiState.filterEntityId != entity.id ||
|
if (uiState.filterEntityId != entity.id ||
|
||||||
uiState.filterEntityType != entity.entityType) {
|
uiState.filterEntityType != entity.entityType) {
|
||||||
store.dispatch(FilterByEntity(entity: entity));
|
store.dispatch(FilterByEntity(entity: entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
handleEntityAction(entity, EntityAction.newEntityType(widget.entityType));
|
handleEntityAction(entity, EntityAction.newEntityType(widget.entityType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,6 @@ class _ProjectOverviewState extends State<ProjectOverview> {
|
||||||
subtitle: memoizedInvoiceStatsForProject(
|
subtitle: memoizedInvoiceStatsForProject(
|
||||||
project.id, state.invoiceState.map)
|
project.id, state.invoiceState.map)
|
||||||
.present(localization.active, localization.archived),
|
.present(localization.active, localization.archived),
|
||||||
hideNew: true,
|
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue