Choose template to use when emailing multiple invoices at once #472
This commit is contained in:
parent
2d7123d2c7
commit
9eb4ad2019
|
|
@ -68,7 +68,7 @@ class InvoiceRepository {
|
||||||
data: json.encode({
|
data: json.encode({
|
||||||
'ids': ids,
|
'ids': ids,
|
||||||
'action': action.toApiParam(),
|
'action': action.toApiParam(),
|
||||||
if (template != null) 'email_type': 'email_template_$template',
|
if (template != null) 'email_type': '$template',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
final InvoiceListResponse invoiceResponse =
|
final InvoiceListResponse invoiceResponse =
|
||||||
|
|
|
||||||
|
|
@ -670,21 +670,6 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
||||||
..parameters.entityType = EntityType.invoice.apiValue
|
..parameters.entityType = EntityType.invoice.apiValue
|
||||||
..parameters.entityId = invoice.id));
|
..parameters.entityId = invoice.id));
|
||||||
} else {
|
} else {
|
||||||
confirmCallback(
|
|
||||||
context: context,
|
|
||||||
message: localization.bulkEmailInvoices,
|
|
||||||
callback: (_) {
|
|
||||||
store.dispatch(BulkEmailInvoicesRequest(
|
|
||||||
completer: snackBarCompleter<Null>(
|
|
||||||
context,
|
|
||||||
invoiceIds.length == 1
|
|
||||||
? localization.emailedInvoice
|
|
||||||
: localization.emailedInvoices),
|
|
||||||
invoiceIds: invoiceIds,
|
|
||||||
));
|
|
||||||
});
|
|
||||||
|
|
||||||
if (false) {
|
|
||||||
final template = await showDialog<EmailTemplate>(
|
final template = await showDialog<EmailTemplate>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
|
|
@ -733,7 +718,6 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case EntityAction.cloneToOther:
|
case EntityAction.cloneToOther:
|
||||||
cloneToDialog(context: context, invoice: invoice);
|
cloneToDialog(context: context, invoice: invoice);
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,11 @@ Middleware<AppState> _bulkEmailInvoices(InvoiceRepository repository) {
|
||||||
|
|
||||||
repository
|
repository
|
||||||
.bulkAction(
|
.bulkAction(
|
||||||
store.state.credentials, action.invoiceIds, EntityAction.sendEmail)
|
store.state.credentials,
|
||||||
|
action.invoiceIds,
|
||||||
|
EntityAction.sendEmail,
|
||||||
|
template: action.template,
|
||||||
|
)
|
||||||
.then((List<InvoiceEntity> invoices) {
|
.then((List<InvoiceEntity> invoices) {
|
||||||
store.dispatch(BulkEmailInvoicesSuccess(invoices));
|
store.dispatch(BulkEmailInvoicesSuccess(invoices));
|
||||||
if (action.completer != null) {
|
if (action.completer != null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue