Schedule send
This commit is contained in:
parent
43a9df00e5
commit
9ae280f3b7
|
|
@ -75,11 +75,11 @@ abstract class ScheduleEntity extends Object
|
||||||
ScheduleEntity._();
|
ScheduleEntity._();
|
||||||
|
|
||||||
static const TEMPLATE_EMAIL_STATEMENT = 'email_statement';
|
static const TEMPLATE_EMAIL_STATEMENT = 'email_statement';
|
||||||
static const TEMPLATE_SCHEDULE_ENTITY = 'schedule_entity';
|
static const TEMPLATE_EMAIL_RECORD = 'email_record';
|
||||||
|
|
||||||
static const TEMPLATES = [
|
static const TEMPLATES = [
|
||||||
TEMPLATE_EMAIL_STATEMENT,
|
TEMPLATE_EMAIL_STATEMENT,
|
||||||
TEMPLATE_SCHEDULE_ENTITY,
|
TEMPLATE_EMAIL_RECORD,
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -539,7 +539,7 @@ Future handleCreditAction(
|
||||||
createEntity(
|
createEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: ScheduleEntity().rebuild((b) => b
|
entity: ScheduleEntity().rebuild((b) => b
|
||||||
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
|
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
|
||||||
..parameters.entityType = EntityType.credit.apiValue
|
..parameters.entityType = EntityType.credit.apiValue
|
||||||
..parameters.entityId = credit.id));
|
..parameters.entityId = credit.id));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -659,7 +659,7 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
|
||||||
createEntity(
|
createEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: ScheduleEntity().rebuild((b) => b
|
entity: ScheduleEntity().rebuild((b) => b
|
||||||
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
|
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
|
||||||
..parameters.entityType = EntityType.invoice.apiValue
|
..parameters.entityType = EntityType.invoice.apiValue
|
||||||
..parameters.entityId = invoice.id));
|
..parameters.entityId = invoice.id));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -752,7 +752,7 @@ void handlePurchaseOrderAction(BuildContext context,
|
||||||
createEntity(
|
createEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: ScheduleEntity().rebuild((b) => b
|
entity: ScheduleEntity().rebuild((b) => b
|
||||||
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
|
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
|
||||||
..parameters.entityType = EntityType.purchaseOrder.apiValue
|
..parameters.entityType = EntityType.purchaseOrder.apiValue
|
||||||
..parameters.entityId = purchaseOrder.id));
|
..parameters.entityId = purchaseOrder.id));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -603,7 +603,7 @@ Future handleQuoteAction(
|
||||||
createEntity(
|
createEntity(
|
||||||
context: context,
|
context: context,
|
||||||
entity: ScheduleEntity().rebuild((b) => b
|
entity: ScheduleEntity().rebuild((b) => b
|
||||||
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
|
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
|
||||||
..parameters.entityType = EntityType.quote.apiValue
|
..parameters.entityType = EntityType.quote.apiValue
|
||||||
..parameters.entityId = quote.id));
|
..parameters.entityId = quote.id));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -170,11 +170,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
items: ScheduleEntity.TEMPLATES
|
items: ScheduleEntity.TEMPLATES
|
||||||
.map((entry) => DropdownMenuItem(
|
.map((entry) => DropdownMenuItem(
|
||||||
value: entry,
|
value: entry,
|
||||||
child: Text(entry ==
|
child: Text(localization.lookup(entry)),
|
||||||
ScheduleEntity
|
|
||||||
.TEMPLATE_SCHEDULE_ENTITY
|
|
||||||
? localization.emailRecord
|
|
||||||
: localization.lookup(entry)),
|
|
||||||
))
|
))
|
||||||
.toList()),
|
.toList()),
|
||||||
DatePicker(
|
DatePicker(
|
||||||
|
|
@ -190,7 +186,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
if (schedule.template !=
|
if (schedule.template !=
|
||||||
ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY) ...[
|
ScheduleEntity.TEMPLATE_EMAIL_RECORD) ...[
|
||||||
AppDropdownButton<String>(
|
AppDropdownButton<String>(
|
||||||
labelText: localization.frequency,
|
labelText: localization.frequency,
|
||||||
value: schedule.frequencyId,
|
value: schedule.frequencyId,
|
||||||
|
|
@ -334,7 +330,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
] else if (schedule.template ==
|
] else if (schedule.template ==
|
||||||
ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY) ...[
|
ScheduleEntity.TEMPLATE_EMAIL_RECORD) ...[
|
||||||
FormCard(
|
FormCard(
|
||||||
children: [
|
children: [
|
||||||
AppDropdownButton<String>(
|
AppDropdownButton<String>(
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,7 @@ class ScheduleListItem extends StatelessWidget {
|
||||||
|
|
||||||
final filterMatch = filter != null && filter.isNotEmpty
|
final filterMatch = filter != null && filter.isNotEmpty
|
||||||
? schedule.matchesFilterValue(filter)
|
? schedule.matchesFilterValue(filter)
|
||||||
: (schedule.template == ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
|
: localization.lookup(schedule.template) +
|
||||||
? localization.emailRecord
|
|
||||||
: localization.lookup(schedule.template)) +
|
|
||||||
(schedule.frequencyId.isEmpty
|
(schedule.frequencyId.isEmpty
|
||||||
? ''
|
? ''
|
||||||
: ' • ' +
|
: ' • ' +
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
'email_record': 'Email Record',
|
'email_record': 'Email Record',
|
||||||
'schedule_entity': 'Schedule Entity',
|
|
||||||
'invoice_product_columns': 'Invoice Product Columns',
|
'invoice_product_columns': 'Invoice Product Columns',
|
||||||
'quote_product_columns': 'Quote Product Columns',
|
'quote_product_columns': 'Quote Product Columns',
|
||||||
'minimum_payment_amount': 'Minimum Payment Amount',
|
'minimum_payment_amount': 'Minimum Payment Amount',
|
||||||
|
|
@ -97399,10 +97398,6 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['quote_product_columns'] ??
|
_localizedValues[localeCode]['quote_product_columns'] ??
|
||||||
_localizedValues['en']['quote_product_columns'];
|
_localizedValues['en']['quote_product_columns'];
|
||||||
|
|
||||||
String get scheduleEntity =>
|
|
||||||
_localizedValues[localeCode]['schedule_entity'] ??
|
|
||||||
_localizedValues['en']['schedule_entity'];
|
|
||||||
|
|
||||||
String get emailRecord =>
|
String get emailRecord =>
|
||||||
_localizedValues[localeCode]['email_record'] ??
|
_localizedValues[localeCode]['email_record'] ??
|
||||||
_localizedValues['en']['email_record'];
|
_localizedValues['en']['email_record'];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue