diff --git a/print/config/print.json b/print/config/print.json index e5bc72021..cb98421fc 100755 --- a/print/config/print.json +++ b/print/config/print.json @@ -24,5 +24,8 @@ "rejectUnauthorized": false }, "pool": true + }, + "storage": { + "root": "./e2e/dms" } } \ No newline at end of file diff --git a/print/report/rpt-delivery-note/index.js b/print/report/rpt-delivery-note/index.js index b282898a5..1a18bb180 100755 --- a/print/report/rpt-delivery-note/index.js +++ b/print/report/rpt-delivery-note/index.js @@ -1,6 +1,8 @@ const strftime = require('strftime'); const database = require(`${appPath}/lib/database`); +const config = require(`${appPath}/lib/config.js`); const UserException = require(`${appPath}/lib/exceptions/userException`); +const md5 = require('md5'); module.exports = { name: 'rpt-delivery-note', @@ -30,7 +32,9 @@ module.exports = { }, computed: { dmsPath() { - const hostPath = 'http://windows.verdnatura.es/signatures/tickets'; + const pathHash = md5(this.signature.id.toString()).substring(0, 3); + const hostPath = `file:///${config.storage.root}/${pathHash}`; + if (this.signature && this.signature.id) return `${hostPath}/${this.signature.id}.png`; },