Invoice status 'Viewed' does not work #312
This commit is contained in:
parent
ed50b921b8
commit
05e93d6fdc
|
|
@ -16,6 +16,7 @@ class InvoiceStatusColors {
|
|||
kInvoiceStatusPastDue: _colorTheme.colorDanger,
|
||||
kInvoiceStatusCancelled: _colorTheme.colorLightGray,
|
||||
kInvoiceStatusReversed: _colorTheme.colorLightGray,
|
||||
kInvoiceStatusViewed: _colorTheme.colorWarning,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -63,6 +64,7 @@ class QuoteStatusColors {
|
|||
kQuoteStatusApproved: _colorTheme.colorPrimary,
|
||||
kQuoteStatusConverted: _colorTheme.colorSuccess,
|
||||
kQuoteStatusExpired: _colorTheme.colorDanger,
|
||||
kQuoteStatusViewed: _colorTheme.colorWarning,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ const kInvoiceStatuses = {
|
|||
kInvoiceStatusPaid: 'paid',
|
||||
kInvoiceStatusCancelled: 'cancelled',
|
||||
kInvoiceStatusReversed: 'reversed',
|
||||
kInvoiceStatusViewed: 'viewed',
|
||||
};
|
||||
|
||||
const String kRecurringInvoiceStatusDraft = '1';
|
||||
|
|
@ -185,6 +186,7 @@ const kRecurringInvoiceStatuses = {
|
|||
kRecurringInvoiceStatusPending: 'pending',
|
||||
};
|
||||
|
||||
const String kQuoteStatusViewed = '-2';
|
||||
const String kQuoteStatusExpired = '-1';
|
||||
const String kQuoteStatusDraft = '1';
|
||||
const String kQuoteStatusSent = '2';
|
||||
|
|
@ -197,6 +199,7 @@ const kQuoteStatuses = {
|
|||
kQuoteStatusSent: 'sent',
|
||||
kQuoteStatusApproved: 'approved',
|
||||
kQuoteStatusConverted: 'converted',
|
||||
kQuoteStatusViewed: 'viewed',
|
||||
};
|
||||
|
||||
const String kCreditStatusDraft = '1';
|
||||
|
|
|
|||
|
|
@ -686,18 +686,10 @@ abstract class InvoiceEntity extends Object
|
|||
}
|
||||
|
||||
for (final status in statuses) {
|
||||
if (status.id == statusId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (status.id == kInvoiceStatusPastDue && isPastDue) {
|
||||
if (status.id == statusId || status.id == calculatedStatusId) {
|
||||
return true;
|
||||
} else if (status.id == kInvoiceStatusUnpaid && isUnpaid && isSent) {
|
||||
return true;
|
||||
} else if (status.id == kInvoiceStatusViewed && isViewed) {
|
||||
return true;
|
||||
} else if (status.id == kRecurringInvoiceStatusPending && isPending) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -969,6 +961,10 @@ abstract class InvoiceEntity extends Object
|
|||
return kRecurringInvoiceStatusPending;
|
||||
}
|
||||
|
||||
if (isViewed) {
|
||||
return isInvoice ? kInvoiceStatusViewed : kQuoteStatusViewed;
|
||||
}
|
||||
|
||||
/*
|
||||
if (subEntityType == EntityType.quote && (invoiceId ?? '').isNotEmpty) {
|
||||
return kQuoteStatusApproved;
|
||||
|
|
|
|||
|
|
@ -76,13 +76,11 @@ class _InvitationListTile extends StatelessWidget {
|
|||
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||
title: Text(contact.fullNameWithEmail.isEmpty
|
||||
? client.displayName
|
||||
: contact.fullNameWithEmail),
|
||||
title: Text(contact.fullNameOrEmail),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 8),
|
||||
SizedBox(height: 4),
|
||||
if (invitation.sentDate.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
|
|
@ -107,7 +105,7 @@ class _InvitationListTile extends StatelessWidget {
|
|||
formatDate(invitation.viewedDate, context, showTime: true),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
|
|
|
|||
|
|
@ -96,6 +96,11 @@ class QuoteScreen extends StatelessWidget {
|
|||
..id = kQuoteStatusSent
|
||||
..name = localization.sent,
|
||||
),
|
||||
InvoiceStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kQuoteStatusViewed
|
||||
..name = localization.viewed,
|
||||
),
|
||||
InvoiceStatusEntity().rebuild(
|
||||
(b) => b
|
||||
..id = kQuoteStatusApproved
|
||||
|
|
|
|||
Loading…
Reference in New Issue