Fix share product/quote columns option
This commit is contained in:
parent
15e9287c5f
commit
b347791bbe
|
|
@ -57,6 +57,8 @@ class UpdateSettingsTab implements PersistUI {
|
|||
|
||||
class UpdatedSetting implements PersistUI {}
|
||||
|
||||
class UpdatedSettingUI implements PersistUI {}
|
||||
|
||||
class UpdateSettingsTemplate implements PersistUI {
|
||||
UpdateSettingsTemplate({@required this.selectedTemplate});
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
|
|||
TypedReducer<SettingsUIState, UpdateSettingsTemplate>((state, action) {
|
||||
return state.rebuild((b) => b..selectedTemplate = action.selectedTemplate);
|
||||
}),
|
||||
TypedReducer<SettingsUIState, UpdatedSetting>((state, action) {
|
||||
TypedReducer<SettingsUIState, UpdatedSettingUI>((state, action) {
|
||||
return state
|
||||
.rebuild((b) => b..updatedAt = DateTime.now().millisecondsSinceEpoch);
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -1086,8 +1086,8 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
|||
],
|
||||
),
|
||||
if (settings.shareInvoiceQuoteColumns == false)
|
||||
Expanded(
|
||||
child: FormCard(
|
||||
FormCard(
|
||||
isLast: true,
|
||||
child: MultiSelectList(
|
||||
options: [
|
||||
ProductItemFields.item,
|
||||
|
|
@ -1131,7 +1131,6 @@ class _InvoiceDesignState extends State<InvoiceDesign>
|
|||
prefix: 'product',
|
||||
),
|
||||
),
|
||||
),
|
||||
if (company.isModuleEnabled(EntityType.task))
|
||||
FormCard(
|
||||
isLast: true,
|
||||
|
|
|
|||
|
|
@ -62,6 +62,14 @@ class InvoiceDesignVM {
|
|||
company: state.uiState.settingsUIState.company,
|
||||
onSettingsChanged: (settings) {
|
||||
store.dispatch(UpdateSettings(settings: settings));
|
||||
final newSetting = settings.shareInvoiceQuoteColumns ?? true;
|
||||
final oldSetting =
|
||||
state.uiState.settingsUIState.settings.shareInvoiceQuoteColumns ??
|
||||
true;
|
||||
if (newSetting != oldSetting) {
|
||||
// Need to force update the UI to show the new tabs
|
||||
store.dispatch(UpdatedSettingUI());
|
||||
}
|
||||
},
|
||||
onSavePressed: (context, entityTypes) {
|
||||
if (!state.isProPlan && !state.isTrial) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue