Bug: email quotes
This commit is contained in:
parent
3370ed8829
commit
e78b28218a
|
|
@ -1,11 +1,14 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/client/client_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/credit/credit_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/invoice/invoice_email_view.dart';
|
||||
import 'package:invoiceninja_flutter/ui/invoice/invoice_email_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
|
|
@ -67,21 +70,31 @@ class EmailCreditVM extends EmailEntityVM {
|
|||
final state = store.state;
|
||||
|
||||
return EmailCreditVM(
|
||||
isLoading: state.isLoading,
|
||||
isSaving: state.isSaving,
|
||||
company: state.company,
|
||||
invoice: credit,
|
||||
client: state.clientState.map[credit.clientId],
|
||||
loadClient: () {
|
||||
store.dispatch(LoadClient(clientId: credit.clientId));
|
||||
},
|
||||
onSendPressed: (context, template, subject, body) =>
|
||||
store.dispatch(EmailCreditRequest(
|
||||
completer: popCompleter(context, true),
|
||||
creditId: credit.id,
|
||||
template: template,
|
||||
subject: subject,
|
||||
body: body,
|
||||
)));
|
||||
isLoading: state.isLoading,
|
||||
isSaving: state.isSaving,
|
||||
company: state.company,
|
||||
invoice: credit,
|
||||
client: state.clientState.map[credit.clientId],
|
||||
loadClient: () {
|
||||
store.dispatch(LoadClient(clientId: credit.clientId));
|
||||
},
|
||||
onSendPressed: (context, template, subject, body) {
|
||||
final completer = snackBarCompleter<Null>(
|
||||
context, AppLocalization.of(context).emailedCredit,
|
||||
shouldPop: isMobile(context));
|
||||
if (!isMobile(context)) {
|
||||
completer.future.then((value) {
|
||||
viewEntity(entity: credit, context: context);
|
||||
});
|
||||
}
|
||||
store.dispatch(EmailCreditRequest(
|
||||
completer: completer,
|
||||
creditId: credit.id,
|
||||
template: template,
|
||||
subject: subject,
|
||||
body: body,
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,31 +93,32 @@ class EmailInvoiceVM extends EmailEntityVM {
|
|||
final state = store.state;
|
||||
|
||||
return EmailInvoiceVM(
|
||||
isLoading: state.isLoading,
|
||||
isSaving: state.isSaving,
|
||||
company: state.company,
|
||||
invoice: invoice,
|
||||
client: state.clientState.map[invoice.clientId] ??
|
||||
ClientEntity(id: invoice.clientId),
|
||||
loadClient: () {
|
||||
store.dispatch(LoadClient(clientId: invoice.clientId));
|
||||
},
|
||||
onSendPressed: (context, template, subject, body) {
|
||||
final completer = snackBarCompleter<Null>(
|
||||
context, AppLocalization.of(context).emailedInvoice,
|
||||
shouldPop: isMobile(context));
|
||||
if (!isMobile(context)) {
|
||||
completer.future.then((value) {
|
||||
viewEntity(entity: invoice, context: context);
|
||||
});
|
||||
}
|
||||
store.dispatch(EmailInvoiceRequest(
|
||||
completer: completer,
|
||||
invoiceId: invoice.id,
|
||||
template: template,
|
||||
subject: subject,
|
||||
body: body,
|
||||
));
|
||||
});
|
||||
isLoading: state.isLoading,
|
||||
isSaving: state.isSaving,
|
||||
company: state.company,
|
||||
invoice: invoice,
|
||||
client: state.clientState.map[invoice.clientId] ??
|
||||
ClientEntity(id: invoice.clientId),
|
||||
loadClient: () {
|
||||
store.dispatch(LoadClient(clientId: invoice.clientId));
|
||||
},
|
||||
onSendPressed: (context, template, subject, body) {
|
||||
final completer = snackBarCompleter<Null>(
|
||||
context, AppLocalization.of(context).emailedInvoice,
|
||||
shouldPop: isMobile(context));
|
||||
if (!isMobile(context)) {
|
||||
completer.future.then((value) {
|
||||
viewEntity(entity: invoice, context: context);
|
||||
});
|
||||
}
|
||||
store.dispatch(EmailInvoiceRequest(
|
||||
completer: completer,
|
||||
invoiceId: invoice.id,
|
||||
template: template,
|
||||
subject: subject,
|
||||
body: body,
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/client/client_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/quote/quote_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/invoice/invoice_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/invoice/invoice_email_view.dart';
|
||||
import 'package:invoiceninja_flutter/ui/invoice/invoice_email_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
|
|
@ -67,21 +70,31 @@ class EmailQuoteVM extends EmailEntityVM {
|
|||
final state = store.state;
|
||||
|
||||
return EmailQuoteVM(
|
||||
isLoading: state.isLoading,
|
||||
isSaving: state.isSaving,
|
||||
company: state.company,
|
||||
invoice: quote,
|
||||
client: state.clientState.map[quote.clientId],
|
||||
loadClient: () {
|
||||
store.dispatch(LoadClient(clientId: quote.clientId));
|
||||
},
|
||||
onSendPressed: (context, template, subject, body) =>
|
||||
store.dispatch(EmailQuoteRequest(
|
||||
completer: popCompleter(context, true),
|
||||
quoteId: quote.id,
|
||||
template: template,
|
||||
subject: subject,
|
||||
body: body,
|
||||
)));
|
||||
isLoading: state.isLoading,
|
||||
isSaving: state.isSaving,
|
||||
company: state.company,
|
||||
invoice: quote,
|
||||
client: state.clientState.map[quote.clientId],
|
||||
loadClient: () {
|
||||
store.dispatch(LoadClient(clientId: quote.clientId));
|
||||
},
|
||||
onSendPressed: (context, template, subject, body) {
|
||||
final completer = snackBarCompleter<Null>(
|
||||
context, AppLocalization.of(context).emailedQuote,
|
||||
shouldPop: isMobile(context));
|
||||
if (!isMobile(context)) {
|
||||
completer.future.then((value) {
|
||||
viewEntity(entity: quote, context: context);
|
||||
});
|
||||
}
|
||||
store.dispatch(EmailInvoiceRequest(
|
||||
completer: completer,
|
||||
invoiceId: quote.id,
|
||||
template: template,
|
||||
subject: subject,
|
||||
body: body,
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue