refs #084200 primer commit companyI18n

This commit is contained in:
Carlos Satorres 2023-03-22 14:54:59 +01:00
parent b5394d3925
commit d05ddef5fa
3 changed files with 17 additions and 8 deletions

View File

@ -0,0 +1,9 @@
-- vn.companyI18n definition
CREATE TABLE `companyI18n` (
`companyFk` smallint(5) unsigned NOT NULL,
`lang` char(2) CHARACTER SET utf8mb3 NOT NULL,
`footnotes` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL,
PRIMARY KEY (`companyFk`,`lang`),
CONSTRAINT `companyI18n_FK` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

View File

@ -8,7 +8,7 @@
<p
v-if="company.footnotes"
class="privacy"
v-html="$t(`law.${company.footnotes}`)">
v-html="$18n.locale(`${company.footnotes}`)">
</p>
</div>
</div>

View File

@ -8,13 +8,13 @@ module.exports = {
methods: {
getCompany(code) {
return db.findOne(`
SELECT
c.footnotes,
c.code
FROM company c
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
WHERE c.code = ?`, [code]);
SELECT
(SELECT ci.footnotes FROM companyI18n ci WHERE ci.companyFk = c.id) AS footnotes,
c.code
FROM company c
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
WHERE c.code = ?`);
}
},
props: ['leftText', 'companyCode', 'centerText']