Fix for emailing POs
This commit is contained in:
parent
129828cc5d
commit
e7273ab725
|
|
@ -39,7 +39,7 @@ class CreditRepository {
|
|||
|
||||
Future<BuiltList<InvoiceEntity>> loadList(
|
||||
Credentials credentials, int createdAt, bool filterDeleted) async {
|
||||
String url = credentials.url+ '/credits?created_at=$createdAt';
|
||||
String url = credentials.url + '/credits?created_at=$createdAt';
|
||||
|
||||
if (filterDeleted) {
|
||||
url += '&filter_deleted_clients=true';
|
||||
|
|
@ -62,7 +62,7 @@ class CreditRepository {
|
|||
}
|
||||
|
||||
final url =
|
||||
credentials.url+ '/credits/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
credentials.url + '/credits/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
final dynamic response = await webClient.post(url, credentials.token,
|
||||
data: json.encode({
|
||||
'ids': ids,
|
||||
|
|
@ -87,7 +87,7 @@ class CreditRepository {
|
|||
dynamic response;
|
||||
|
||||
if (credit.isNew) {
|
||||
url = credentials.url+ '/credits?include=activities.history';
|
||||
url = credentials.url + '/credits?include=activities.history';
|
||||
} else {
|
||||
url =
|
||||
'${credentials.url}/credits/${credit.id}?include=activities.history';
|
||||
|
|
@ -122,7 +122,7 @@ class CreditRepository {
|
|||
String ccEmail,
|
||||
) async {
|
||||
final data = {
|
||||
'entity': '${credit.entityType}',
|
||||
'entity': '${EntityType.credit.apiValue}',
|
||||
'entity_id': credit.id,
|
||||
'template': 'email_template_$template',
|
||||
'body': body,
|
||||
|
|
@ -131,7 +131,7 @@ class CreditRepository {
|
|||
};
|
||||
|
||||
final dynamic response = await webClient.post(
|
||||
credentials.url+ '/emails', credentials.token,
|
||||
credentials.url + '/emails', credentials.token,
|
||||
data: json.encode(data));
|
||||
|
||||
final InvoiceItemResponse invoiceResponse =
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class InvoiceRepository {
|
|||
|
||||
Future<BuiltList<InvoiceEntity>> loadList(Credentials credentials, int page,
|
||||
int createdAt, bool filterDeleted) async {
|
||||
String url = credentials.url+
|
||||
String url = credentials.url +
|
||||
'/invoices?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt';
|
||||
|
||||
if (filterDeleted) {
|
||||
|
|
@ -63,7 +63,7 @@ class InvoiceRepository {
|
|||
}
|
||||
|
||||
final url =
|
||||
credentials.url+ '/invoices/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
credentials.url + '/invoices/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
final dynamic response = await webClient.post(url, credentials.token,
|
||||
data: json.encode({
|
||||
'ids': ids,
|
||||
|
|
@ -88,7 +88,7 @@ class InvoiceRepository {
|
|||
String url;
|
||||
|
||||
if (invoice.isNew) {
|
||||
url = credentials.url+ '/invoices?include=activities.history';
|
||||
url = credentials.url + '/invoices?include=activities.history';
|
||||
} else {
|
||||
url =
|
||||
'${credentials.url}/invoices/${invoice.id}?include=activities.history';
|
||||
|
|
@ -134,7 +134,7 @@ class InvoiceRepository {
|
|||
String ccEmail,
|
||||
) async {
|
||||
final data = {
|
||||
'entity': '${invoice.entityType}',
|
||||
'entity': '${EntityType.invoice.apiValue}',
|
||||
'entity_id': invoice.id,
|
||||
'template': 'email_template_$template',
|
||||
'body': body,
|
||||
|
|
@ -143,7 +143,7 @@ class InvoiceRepository {
|
|||
};
|
||||
|
||||
final dynamic response = await webClient.post(
|
||||
credentials.url+ '/emails', credentials.token,
|
||||
credentials.url + '/emails', credentials.token,
|
||||
data: json.encode(data));
|
||||
|
||||
final InvoiceItemResponse invoiceResponse =
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class PurchaseOrderRepository {
|
|||
int createdAt,
|
||||
//bool filterDeleted,
|
||||
) async {
|
||||
final url = credentials.url+
|
||||
final url = credentials.url +
|
||||
'/purchase_orders?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt';
|
||||
|
||||
/*
|
||||
|
|
@ -57,7 +57,7 @@ class PurchaseOrderRepository {
|
|||
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
|
||||
}
|
||||
|
||||
final url = credentials.url+
|
||||
final url = credentials.url +
|
||||
'/purchase_orders/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
final dynamic response = await webClient.post(url, credentials.token,
|
||||
data: json.encode({
|
||||
|
|
@ -87,7 +87,7 @@ class PurchaseOrderRepository {
|
|||
dynamic response;
|
||||
|
||||
if (purchaseOrder.isNew) {
|
||||
url = credentials.url+ '/purchase_orders?include=activities.history';
|
||||
url = credentials.url + '/purchase_orders?include=activities.history';
|
||||
} else {
|
||||
url =
|
||||
'${credentials.url}/purchase_orders/${purchaseOrder.id}?include=activities.history';
|
||||
|
|
@ -129,7 +129,7 @@ class PurchaseOrderRepository {
|
|||
String ccEmail,
|
||||
) async {
|
||||
final data = {
|
||||
'entity': '${purchaseOrder.entityType}',
|
||||
'entity': '${EntityType.purchaseOrder.apiValue}',
|
||||
'entity_id': purchaseOrder.id,
|
||||
'template': 'email_template_$template',
|
||||
'body': body,
|
||||
|
|
@ -138,7 +138,7 @@ class PurchaseOrderRepository {
|
|||
};
|
||||
|
||||
final dynamic response = await webClient.post(
|
||||
credentials.url+ '/emails', credentials.token,
|
||||
credentials.url + '/emails', credentials.token,
|
||||
data: json.encode(data));
|
||||
|
||||
final InvoiceItemResponse invoiceResponse =
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class QuoteRepository {
|
|||
|
||||
Future<BuiltList<InvoiceEntity>> loadList(Credentials credentials, int page,
|
||||
int createdAt, bool filterDeleted) async {
|
||||
String url = credentials.url+
|
||||
String url = credentials.url +
|
||||
'/quotes?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt';
|
||||
|
||||
if (filterDeleted) {
|
||||
|
|
@ -63,7 +63,7 @@ class QuoteRepository {
|
|||
}
|
||||
|
||||
final url =
|
||||
credentials.url+ '/quotes/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
credentials.url + '/quotes/bulk?per_page=$kMaxEntitiesPerBulkAction';
|
||||
final dynamic response = await webClient.post(url, credentials.token,
|
||||
data: json.encode({
|
||||
'ids': ids,
|
||||
|
|
@ -88,7 +88,7 @@ class QuoteRepository {
|
|||
dynamic response;
|
||||
|
||||
if (quote.isNew) {
|
||||
url = credentials.url+ '/quotes?include=activities.history';
|
||||
url = credentials.url + '/quotes?include=activities.history';
|
||||
} else {
|
||||
url = '${credentials.url}/quotes/${quote.id}?include=activities.history';
|
||||
}
|
||||
|
|
@ -131,7 +131,7 @@ class QuoteRepository {
|
|||
String ccEmail,
|
||||
) async {
|
||||
final data = {
|
||||
'entity': '${quote.entityType}',
|
||||
'entity': '${EntityType.quote.apiValue}',
|
||||
'entity_id': quote.id,
|
||||
'template': 'email_template_$template',
|
||||
'body': body,
|
||||
|
|
@ -140,7 +140,7 @@ class QuoteRepository {
|
|||
};
|
||||
|
||||
final dynamic response = await webClient.post(
|
||||
credentials.url+ '/emails', credentials.token,
|
||||
credentials.url + '/emails', credentials.token,
|
||||
data: json.encode(data));
|
||||
|
||||
final InvoiceItemResponse invoiceResponse =
|
||||
|
|
|
|||
Loading…
Reference in New Issue