diff --git a/gulpfile.js b/gulpfile.js index b1a8968c0..5722981c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -57,10 +57,9 @@ gulp.task('services', ['copy'], function() { } }); -/* Nota (dani): Comentado para que no me borre el mock del Localizador gulp.task('clean', function() { return del(`${buildDir}/*`, {force: true}); -}); */ +}); // Spliting diff --git a/services/mailer/application/template/payment-update/payment-update.html b/services/mailer/application/template/payment-update/payment-update.html index a943ca94c..99d3a5e8b 100644 --- a/services/mailer/application/template/payment-update/payment-update.html +++ b/services/mailer/application/template/payment-update/payment-update.html @@ -24,7 +24,7 @@

{{_.bodyDescription}}

{{_.paymentMethod}}: {{payMethod}}
-
{{_.paymentDay}}: {{paymentDay}} {{_.everyMonth}}
+ {{{paymentDay}}}

{{paymentAdvice}}

{{_.notifyError}}

diff --git a/services/mailer/application/template/payment-update/payment-update.js b/services/mailer/application/template/payment-update/payment-update.js index 9034a2dd9..0bbf8b784 100644 --- a/services/mailer/application/template/payment-update/payment-update.js +++ b/services/mailer/application/template/payment-update/payment-update.js @@ -4,13 +4,20 @@ var format = require(path.join(__dirname, '../../util/format.js')); module.exports = class PaymentUpdate { getData(params, cb) { - let query = `SELECT pm.name AS payMethod, pm.id AS payMethodId, c.vencimiento AS paymentDay, c.CC AS accountAddress + let query = `SELECT pm.name AS payMethod, pm.id AS payMethodId, c.vencimiento AS payDay, c.CC AS accountAddress FROM Clientes AS c JOIN pay_met AS pm ON pm.id = c.pay_met_id WHERE Id_Cliente = ?`; database.pool.query(query, [params.userId], (error, result) => { Object.assign(this, result[0]); cb(); }); } + + get paymentDay() { + if (this.payMethodId != 5) { + return `
${this._.paymentDay}: ${this.payDay} ${this._.everyMonth}
`; + } + } + get paymentAdvice() { switch (this.payMethodId) { case 4: