Schedule send

This commit is contained in:
Hillel Coren 2023-03-22 13:30:04 +02:00
parent 43a9df00e5
commit 9ae280f3b7
8 changed files with 10 additions and 21 deletions

View File

@ -75,11 +75,11 @@ abstract class ScheduleEntity extends Object
ScheduleEntity._();
static const TEMPLATE_EMAIL_STATEMENT = 'email_statement';
static const TEMPLATE_SCHEDULE_ENTITY = 'schedule_entity';
static const TEMPLATE_EMAIL_RECORD = 'email_record';
static const TEMPLATES = [
TEMPLATE_EMAIL_STATEMENT,
TEMPLATE_SCHEDULE_ENTITY,
TEMPLATE_EMAIL_RECORD,
];
@override

View File

@ -539,7 +539,7 @@ Future handleCreditAction(
createEntity(
context: context,
entity: ScheduleEntity().rebuild((b) => b
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
..parameters.entityType = EntityType.credit.apiValue
..parameters.entityId = credit.id));
} else {

View File

@ -659,7 +659,7 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
createEntity(
context: context,
entity: ScheduleEntity().rebuild((b) => b
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
..parameters.entityType = EntityType.invoice.apiValue
..parameters.entityId = invoice.id));
} else {

View File

@ -752,7 +752,7 @@ void handlePurchaseOrderAction(BuildContext context,
createEntity(
context: context,
entity: ScheduleEntity().rebuild((b) => b
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
..parameters.entityType = EntityType.purchaseOrder.apiValue
..parameters.entityId = purchaseOrder.id));
} else {

View File

@ -603,7 +603,7 @@ Future handleQuoteAction(
createEntity(
context: context,
entity: ScheduleEntity().rebuild((b) => b
..template = ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
..template = ScheduleEntity.TEMPLATE_EMAIL_RECORD
..parameters.entityType = EntityType.quote.apiValue
..parameters.entityId = quote.id));
} else {

View File

@ -170,11 +170,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
items: ScheduleEntity.TEMPLATES
.map((entry) => DropdownMenuItem(
value: entry,
child: Text(entry ==
ScheduleEntity
.TEMPLATE_SCHEDULE_ENTITY
? localization.emailRecord
: localization.lookup(entry)),
child: Text(localization.lookup(entry)),
))
.toList()),
DatePicker(
@ -190,7 +186,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
: null,
),
if (schedule.template !=
ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY) ...[
ScheduleEntity.TEMPLATE_EMAIL_RECORD) ...[
AppDropdownButton<String>(
labelText: localization.frequency,
value: schedule.frequencyId,
@ -334,7 +330,7 @@ class _ScheduleEditState extends State<ScheduleEdit> {
],
)
] else if (schedule.template ==
ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY) ...[
ScheduleEntity.TEMPLATE_EMAIL_RECORD) ...[
FormCard(
children: [
AppDropdownButton<String>(

View File

@ -41,9 +41,7 @@ class ScheduleListItem extends StatelessWidget {
final filterMatch = filter != null && filter.isNotEmpty
? schedule.matchesFilterValue(filter)
: (schedule.template == ScheduleEntity.TEMPLATE_SCHEDULE_ENTITY
? localization.emailRecord
: localization.lookup(schedule.template)) +
: localization.lookup(schedule.template) +
(schedule.frequencyId.isEmpty
? ''
: '' +

View File

@ -17,7 +17,6 @@ mixin LocalizationsProvider on LocaleCodeAware {
'en': {
// STARTER: lang key - do not remove comment
'email_record': 'Email Record',
'schedule_entity': 'Schedule Entity',
'invoice_product_columns': 'Invoice Product Columns',
'quote_product_columns': 'Quote Product Columns',
'minimum_payment_amount': 'Minimum Payment Amount',
@ -97399,10 +97398,6 @@ mixin LocalizationsProvider on LocaleCodeAware {
_localizedValues[localeCode]['quote_product_columns'] ??
_localizedValues['en']['quote_product_columns'];
String get scheduleEntity =>
_localizedValues[localeCode]['schedule_entity'] ??
_localizedValues['en']['schedule_entity'];
String get emailRecord =>
_localizedValues[localeCode]['email_record'] ??
_localizedValues['en']['email_record'];