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 hasEmailAddress =>
|
||||
contacts.where((contact) => contact.email?.isNotEmpty).isNotEmpty;
|
||||
|
||||
static Serializer<VendorEntity> get serializer => _$vendorEntitySerializer;
|
||||
|
||||
bool get hasNameSet {
|
||||
|
|
|
|||
|
|
@ -549,17 +549,17 @@ void handlePurchaseOrderAction(BuildContext context,
|
|||
case EntityAction.bulkSendEmail:
|
||||
bool emailValid = true;
|
||||
purchaseOrders.forEach((purchaseOrder) {
|
||||
final client = state.clientState.get(
|
||||
(purchaseOrder as InvoiceEntity).clientId,
|
||||
final vendor = state.vendorState.get(
|
||||
(purchaseOrder as InvoiceEntity).vendorId,
|
||||
);
|
||||
if (!client.hasEmailAddress) {
|
||||
if (!vendor.hasEmailAddress) {
|
||||
emailValid = false;
|
||||
}
|
||||
});
|
||||
if (!emailValid) {
|
||||
showMessageDialog(
|
||||
context: context,
|
||||
message: localization.clientEmailNotSet,
|
||||
message: localization.vendorEmailNotSet,
|
||||
secondaryActions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
// STARTER: lang key - do not remove comment
|
||||
'vendor_email_not_set': 'Vendor does not have an email address set',
|
||||
'bulk_send_email': 'Send Email',
|
||||
'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['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
|
||||
|
||||
String lookup(String key) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue