Purchase orders
This commit is contained in:
parent
f4f6aee5d9
commit
755e2f07ce
|
|
@ -456,6 +456,9 @@ abstract class VendorEntity extends Object
|
||||||
|
|
||||||
bool get hasUser => assignedUserId != null && assignedUserId.isNotEmpty;
|
bool get hasUser => assignedUserId != null && assignedUserId.isNotEmpty;
|
||||||
|
|
||||||
|
bool get hasEmailAddress =>
|
||||||
|
contacts.where((contact) => contact.email?.isNotEmpty).isNotEmpty;
|
||||||
|
|
||||||
static Serializer<VendorEntity> get serializer => _$vendorEntitySerializer;
|
static Serializer<VendorEntity> get serializer => _$vendorEntitySerializer;
|
||||||
|
|
||||||
bool get hasNameSet {
|
bool get hasNameSet {
|
||||||
|
|
|
||||||
|
|
@ -549,17 +549,17 @@ void handlePurchaseOrderAction(BuildContext context,
|
||||||
case EntityAction.bulkSendEmail:
|
case EntityAction.bulkSendEmail:
|
||||||
bool emailValid = true;
|
bool emailValid = true;
|
||||||
purchaseOrders.forEach((purchaseOrder) {
|
purchaseOrders.forEach((purchaseOrder) {
|
||||||
final client = state.clientState.get(
|
final vendor = state.vendorState.get(
|
||||||
(purchaseOrder as InvoiceEntity).clientId,
|
(purchaseOrder as InvoiceEntity).vendorId,
|
||||||
);
|
);
|
||||||
if (!client.hasEmailAddress) {
|
if (!vendor.hasEmailAddress) {
|
||||||
emailValid = false;
|
emailValid = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!emailValid) {
|
if (!emailValid) {
|
||||||
showMessageDialog(
|
showMessageDialog(
|
||||||
context: context,
|
context: context,
|
||||||
message: localization.clientEmailNotSet,
|
message: localization.vendorEmailNotSet,
|
||||||
secondaryActions: [
|
secondaryActions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'vendor_email_not_set': 'Vendor does not have an email address set',
|
||||||
'bulk_send_email': 'Send Email',
|
'bulk_send_email': 'Send Email',
|
||||||
'marked_purchase_order_as_sent':
|
'marked_purchase_order_as_sent':
|
||||||
'Successfully marked purchase order as sent',
|
'Successfully marked purchase order as sent',
|
||||||
|
|
@ -70805,6 +70806,10 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['cancelled_purchase_orders'] ??
|
_localizedValues[localeCode]['cancelled_purchase_orders'] ??
|
||||||
_localizedValues['en']['cancelled_purchase_orders'];
|
_localizedValues['en']['cancelled_purchase_orders'];
|
||||||
|
|
||||||
|
String get vendorEmailNotSet =>
|
||||||
|
_localizedValues[localeCode]['vendor_email_not_set'] ??
|
||||||
|
_localizedValues['en']['vendor_email_not_set'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue