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({
|
||||
'ids': ids,
|
||||
'action': action.toApiParam(),
|
||||
if (template != null) 'email_type': 'email_template_$template',
|
||||
if (template != null) 'email_type': '$template',
|
||||
}));
|
||||
|
||||
final InvoiceListResponse invoiceResponse =
|
||||
|
|
|
|||
|
|
@ -670,21 +670,6 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
|||
..parameters.entityType = EntityType.invoice.apiValue
|
||||
..parameters.entityId = invoice.id));
|
||||
} 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>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
|
@ -733,7 +718,6 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
|||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EntityAction.cloneToOther:
|
||||
cloneToDialog(context: context, invoice: invoice);
|
||||
|
|
|
|||
|
|
@ -385,7 +385,11 @@ Middleware<AppState> _bulkEmailInvoices(InvoiceRepository repository) {
|
|||
|
||||
repository
|
||||
.bulkAction(
|
||||
store.state.credentials, action.invoiceIds, EntityAction.sendEmail)
|
||||
store.state.credentials,
|
||||
action.invoiceIds,
|
||||
EntityAction.sendEmail,
|
||||
template: action.template,
|
||||
)
|
||||
.then((List<InvoiceEntity> invoices) {
|
||||
store.dispatch(BulkEmailInvoicesSuccess(invoices));
|
||||
if (action.completer != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue