Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
This commit is contained in:
commit
20088c6712
|
@ -0,0 +1,7 @@
|
|||
USE `vn`;
|
||||
|
||||
ALTER TABLE `vn`.`payMethod`
|
||||
ADD COLUMN `code` VARCHAR(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' NULL AFTER `id`;
|
||||
|
||||
UPDATE `vn`.`payMethod` SET `code` = 'bankDraft' WHERE (`id` = '4');
|
||||
UPDATE `vn`.`payMethod` SET `code` = 'card' WHERE (`id` = '5');
|
|
@ -33,16 +33,18 @@
|
|||
<p>
|
||||
<section>
|
||||
<span>{{ $t('sections.pay.method') }}:</span>
|
||||
<strong>{{client.payMethodName}}</strong>
|
||||
<strong>{{payMethod.name}}</strong>
|
||||
</section>
|
||||
<section v-if="client.payMethodId != 5">
|
||||
<section v-if="payMethod.code != 'card'">
|
||||
<span>{{ $t('sections.pay.day') }}:</span>
|
||||
<strong>{{ $t('sections.pay.dueDay', [client.dueDay]) }}</strong>
|
||||
<strong>{{ $t('sections.pay.dueDay', [payMethod.dueDay]) }}</strong>
|
||||
</section>
|
||||
</p>
|
||||
|
||||
<p v-if="client.payMethodId == 4" v-html="$t('sections.pay.accountImplicates', [client.accountAddress])"></p>
|
||||
<p v-else-if="client.payMethodId == 5">
|
||||
<p v-if="payMethod.code == 'bankDraft'"
|
||||
v-html="$t('sections.pay.accountImplicates', [accountAddress])">
|
||||
</p>
|
||||
<p v-else-if="payMethod.code == 'card'">
|
||||
{{ $t('sections.pay.cardImplicates') }}
|
||||
</p>
|
||||
|
||||
|
|
|
@ -6,29 +6,27 @@ const emailFooter = new Component('email-footer');
|
|||
module.exports = {
|
||||
name: 'payment-update',
|
||||
async serverPrefetch() {
|
||||
this.client = await this.fetchClient(this.clientId);
|
||||
this.payMethod = await this.fetchPayMethod(this.clientId);
|
||||
|
||||
if (!this.client)
|
||||
if (!this.payMethod)
|
||||
throw new Error('Something went wrong');
|
||||
},
|
||||
computed: {
|
||||
accountAddress: function() {
|
||||
return this.iban.slice(-4);
|
||||
return this.payMethod.iban.slice(-4);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// Redmine #1854 Replace payMethodId by code
|
||||
fetchClient(id) {
|
||||
fetchPayMethod(clientId) {
|
||||
return db.findOne(
|
||||
`SELECT
|
||||
c.dueDay,
|
||||
c.iban,
|
||||
pm.id payMethodId,
|
||||
pm.name payMethodName
|
||||
pm.name,
|
||||
pm.code
|
||||
FROM client c
|
||||
JOIN payMethod pm ON pm.id = c.payMethodFk
|
||||
JOIN account.user u ON u.id = c.id
|
||||
WHERE c.id = :clientId`, {clientId: id});
|
||||
WHERE c.id = :clientId`, {clientId: clientId});
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
Loading…
Reference in New Issue