fixes #5072 client.fiscal-data comprobar que tiene email #1278

Merged
alexandre merged 8 commits from 5072-comprobar-email-clientFiscalData into dev 2023-02-01 08:55:35 +00:00
3 changed files with 18 additions and 1 deletions
Showing only changes of commit 7e5f50e637 - Show all commits

View File

@ -0,0 +1,6 @@
UPDATE vn.client
SET isToBeMailed = FALSE
WHERE
mailAddress is NULL
AND email is NULL
AND isToBeMailed = TRUE;

View File

@ -259,5 +259,6 @@
"Try again": "Vuelve a intentarlo", "Try again": "Vuelve a intentarlo",
"Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9", "Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9",
"Failed to upload file": "Error al subir archivo", "Failed to upload file": "Error al subir archivo",
"The DOCUWARE PDF document does not exists": "The DOCUWARE PDF document does not exists" "The DOCUWARE PDF document does not exists": "The DOCUWARE PDF document does not exists",
"There is no assigned email for this client": "No hay correo asignado para este cliente"
} }

View File

@ -141,6 +141,16 @@ module.exports = Self => {
done(); done();
} }
Self.validateAsync('isToBeMailed', isToBeMailed, {
message: 'There is no assigned email for this client'
});
function isToBeMailed(err, done) {
if (this.isToBeMailed == true && !this.email)
err();
done();
}
Self.validateAsync('defaultAddressFk', isActive, Self.validateAsync('defaultAddressFk', isActive,
{message: 'Unable to default a disabled consignee'} {message: 'Unable to default a disabled consignee'}
); );