diff --git a/back/model-config.json b/back/model-config.json index 3140d7cd3..d7c5410ad 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -37,5 +37,8 @@ }, "WorkerTeamCollegues": { "dataSource": "vn" + }, + "Sip": { + "dataSource": "vn" } } \ No newline at end of file diff --git a/back/models/sip.json b/back/models/sip.json new file mode 100644 index 000000000..de6af8ad8 --- /dev/null +++ b/back/models/sip.json @@ -0,0 +1,38 @@ +{ + "name": "Sip", + "base": "VnModel", + "options": { + "mysql": { + "table": "pbx.sip" + } + }, + "properties": { + "code": { + "type": "Number", + "id": true, + "mysql": { + "columnName": "extension" + } + }, + "password": { + "type": "string", + "mysql": { + "columnName": "secret" + } + }, + "name": { + "type": "string", + "mysql": { + "columnName": "caller_id" + } + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "user_id" + } + } +} + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 497803c4c..2d5c8cb33 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,13 +19,4 @@ services: - NODE_ENV volumes: - /containers/salix:/etc/salix - - /mnt/storage/pdfs:/var/lib/salix/pdfs - mailer: - image: registry.verdnatura.es/salix-mailer:${TAG} - restart: unless-stopped - build: - context: services/mailer - environment: - - NODE_ENV - volumes: - - /containers/vn-mailer:/etc/vn-mailer \ No newline at end of file + - /mnt/storage/pdfs:/var/lib/salix/pdfs \ No newline at end of file diff --git a/e2e/helpers/nightmare.js b/e2e/helpers/nightmare.js index 62a408d21..f88396fbf 100644 --- a/e2e/helpers/nightmare.js +++ b/e2e/helpers/nightmare.js @@ -2,12 +2,19 @@ import Nightmare from 'nightmare'; export default function createNightmare(width = 1280, height = 720) { - const nightmare = new Nightmare({show: process.env.E2E_SHOW, typeInterval: 10, x: 0, y: 0, waitTimeout: 2000}) - .viewport(width, height); + const nightmare = new Nightmare({ + show: process.env.E2E_SHOW, + typeInterval: 10, + x: 0, + y: 0, + waitTimeout: 2000 + }).viewport(width, height); - nightmare.on('console', (type, message) => { + nightmare.on('console', (type, message, ...args) => { if (type === 'error') fail(message); + else + console[type](message, ...args); }); nightmare.header('Accept-Language', 'en'); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d7cb35447..932ecc845 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -35,7 +35,7 @@ export default { cancelButton: `vn-button[href="#!/client/index"]` }, clientDescriptor: { - moreMenu: `vn-client-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, + moreMenu: `vn-client-descriptor vn-icon-menu > div > vn-icon`, simpleTicketButton: 'vn-client-descriptor vn-popover > div > div.content > div > div.list > ul > li' }, clientBasicData: { @@ -189,7 +189,7 @@ export default { cancelButton: `button[ui-sref="item.index"]` }, itemDescriptor: { - moreMenu: `vn-item-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, + moreMenu: `vn-item-descriptor vn-icon-menu > div > vn-icon`, moreMenuRegularizeButton: `vn-item-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`, regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`, regularizeWarehouseAutocomplete: `#warehouse`, @@ -303,7 +303,7 @@ export default { createButton: `${components.vnSubmit}` }, ticketDescriptor: { - moreMenu: `vn-ticket-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, + moreMenu: `vn-ticket-descriptor vn-icon-menu > div > vn-icon`, moreMenuAddToTurn: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`, moreMenuDeleteTicket: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(2)`, acceptDeleteTicketButton: `vn-ticket-descriptor button[response="ACCEPT"]`, @@ -338,7 +338,7 @@ export default { saleDescriptorPopover: 'vn-ticket-sale vn-item-descriptor-popover > vn-popover', saleDescriptorPopoverSummaryButton: 'vn-item-descriptor-popover a[href="#!/item/1/summary"]', saleButton: `vn-left-menu a[ui-sref="ticket.card.sale"]`, - descriptorItemDiaryButton: `vn-item-descriptor > vn-card > div > vn-horizontal.quicklinks.ng-scope > vn-horizontal > a > vn-icon > i`, + descriptorItemDiaryButton: `vn-item-descriptor .quicklinks.ng-scope > vn-horizontal > a > vn-icon > i`, newItemButton: 'vn-float-button[icon="add"]', firstSaleText: `vn-table div > vn-tbody > vn-tr:nth-child(1)`, firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(3) > img', diff --git a/e2e/paths/item-module/09_regularize_item.spec.js b/e2e/paths/item-module/09_regularize_item.spec.js index fa1f98449..07ceb4e62 100644 --- a/e2e/paths/item-module/09_regularize_item.spec.js +++ b/e2e/paths/item-module/09_regularize_item.spec.js @@ -145,10 +145,10 @@ describe('Item regularize path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search for the ticket with id 22 once again', async() => { + it('should search for the ticket with id 23 once again', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:22') + .type(selectors.ticketsIndex.searchTicketInput, 'id:23') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -158,7 +158,7 @@ describe('Item regularize path', () => { it(`should now click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.searchResult, '22') + .waitForTextInElement(selectors.ticketsIndex.searchResult, '23') .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); diff --git a/front/core/components/array-model/array-model.js b/front/core/components/array-model/array-model.js index 00f7ea9a4..e1bbb7eea 100644 --- a/front/core/components/array-model/array-model.js +++ b/front/core/components/array-model/array-model.js @@ -154,7 +154,7 @@ export default class ArrayModel extends ModelProxy { let aType = typeof a; - if (aType === typeof b) + if (aType === typeof b) { switch (aType) { case 'string': return a.localeCompare(b); @@ -166,6 +166,7 @@ export default class ArrayModel extends ModelProxy { if (a instanceof Date && b instanceof Date) return a.getTime() - b.getTime(); } + } if (a === undefined) return -1; @@ -183,11 +184,12 @@ export default class ArrayModel extends ModelProxy { let mergedWhere = []; let wheres = [dst.where, src.where]; - for (let where of wheres) + for (let where of wheres) { if (Array.isArray(where)) mergedWhere = mergedWhere.concat(where); else if (where) mergedWhere.push(where); + } switch (mergedWhere.length) { case 0: diff --git a/front/core/components/button-menu/button-menu.html b/front/core/components/button-menu/button-menu.html index a4a46f7fe..80323a9d9 100644 --- a/front/core/components/button-menu/button-menu.html +++ b/front/core/components/button-menu/button-menu.html @@ -1,13 +1,13 @@
+ on-select="$ctrl.onDropDownSelect(value)" + ng-click="$ctrl.onDropDownClick($event)">
\ No newline at end of file diff --git a/front/core/components/button-menu/button-menu.js b/front/core/components/button-menu/button-menu.js index dd9b5b133..41f26cfbe 100644 --- a/front/core/components/button-menu/button-menu.js +++ b/front/core/components/button-menu/button-menu.js @@ -8,6 +8,7 @@ export default class ButtonMenu extends Input { super($element, $scope); this.$transclude = $transclude; this.input = this.element.querySelector('.mdl-button'); + $element.on('click', e => this.onClick(e)); } get model() { @@ -42,11 +43,16 @@ export default class ButtonMenu extends Input { } onClick(event) { + if (event.defaultPrevented) return; event.preventDefault(); this.emit('open'); this.showDropDown(); } + onDropDownClick(event) { + event.preventDefault(); + } + onDropDownSelect(value) { this.field = value; this.emit('change', {value}); @@ -70,7 +76,7 @@ export default class ButtonMenu extends Input { 'limit', 'searchFunction' ]); - this.$.dropDown.show(this.input); + this.$.dropDown.show(this.element); } } ButtonMenu.$inject = ['$element', '$scope', '$transclude']; diff --git a/front/core/components/button-menu/style.scss b/front/core/components/button-menu/style.scss index 740822cde..53dbb963a 100644 --- a/front/core/components/button-menu/style.scss +++ b/front/core/components/button-menu/style.scss @@ -1,17 +1,19 @@ -vn-button-menu{ +vn-button-menu { position: relative; + cursor: pointer; + .button-menu__button { padding: 0 10px; } - vn-label{ + vn-label { float: left; margin-top: 1px; } - vn-icon{ + vn-icon { float: left; margin-top: 3px; } - vn-icon.button-menu__arrow_down{ + vn-icon.button-menu__arrow_down { margin: 6px 0 0 5px; } } \ No newline at end of file diff --git a/front/core/components/drop-down/drop-down.js b/front/core/components/drop-down/drop-down.js index c24f1c8c6..123df1994 100755 --- a/front/core/components/drop-down/drop-down.js +++ b/front/core/components/drop-down/drop-down.js @@ -110,8 +110,8 @@ export default class DropDown extends Component { show(parent, search) { this._activeOption = -1; this.search = search; - this.buildList(); this.$.popover.show(parent || this.parent); + this.buildList(); } /** @@ -218,6 +218,7 @@ export default class DropDown extends Component { } onLoadMoreClick(event) { + if (event.defaultPrevented) return; event.preventDefault(); this.model.loadMore(); } @@ -225,7 +226,10 @@ export default class DropDown extends Component { onContainerClick(event) { if (event.defaultPrevented) return; let index = getPosition(this.ul, event); - if (index != -1) this.selectOption(index); + if (index != -1) { + event.preventDefault(); + this.selectOption(index); + } } onDocKeyDown(event) { diff --git a/front/core/components/icon-menu/icon-menu.html b/front/core/components/icon-menu/icon-menu.html index 8ace39c5d..f59f24125 100644 --- a/front/core/components/icon-menu/icon-menu.html +++ b/front/core/components/icon-menu/icon-menu.html @@ -1,14 +1,11 @@
- - - + + + on-select="$ctrl.onDropDownSelect(value)" + ng-click="$ctrl.onDropDownClick($event)">
\ No newline at end of file diff --git a/front/core/components/icon-menu/style.scss b/front/core/components/icon-menu/style.scss index 154196508..06f66127f 100644 --- a/front/core/components/icon-menu/style.scss +++ b/front/core/components/icon-menu/style.scss @@ -1,4 +1,6 @@ vn-icon-menu { + cursor: pointer; + vn-drop-down { font-family: 'vn-font' } diff --git a/front/core/components/popover/style.scss b/front/core/components/popover/style.scss index b44554439..b912adb9d 100644 --- a/front/core/components/popover/style.scss +++ b/front/core/components/popover/style.scss @@ -6,6 +6,7 @@ left: 0; right: 0; bottom: 0; + color: initial; opacity: 0; transform: translateY(-.6em); diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index 0ae9895bf..e66b46634 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -12,7 +12,7 @@ vn-app { top: 0; left: 0; width: 100%; - z-index: 1; + z-index: 5; box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); .logo { @@ -27,5 +27,29 @@ vn-app { } .main-view { padding-top: 4em; + + vn-main-block { + display: block; + margin: 0 auto; + padding-left: 16em; + + .left-block { + position: fixed; + z-index: 5; + top: 4em; + left: 0; + bottom: 0; + width: 16em; + min-width: 16em; + background-color: white; + box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); + overflow: auto; + } + .right-block { + width: 16em; + min-width: 16em; + padding-left: 1em; + } + } } } diff --git a/front/salix/styles/descriptor.scss b/front/salix/styles/descriptor.scss new file mode 100644 index 000000000..18f08adf6 --- /dev/null +++ b/front/salix/styles/descriptor.scss @@ -0,0 +1,74 @@ + +@import "./effects"; +@import "./colors"; +@import "./padding"; + +.vn-descriptor { + box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); + + & > .header { + display: flex; + background: $main-01; + color: white; + justify-content: space-between; + align-items: stretch; + color: white; + + & > * { + min-width: 1.8em; + @extend %clickable; + display: flex; + align-items: center; + justify-content: center; + padding: .5em; + + & > vn-icon { + font-size: 1.8em; + } + } + } + & > .body { + @extend .pad-small; + + & > * { + @extend .pad-small; + } + & > .icons { + display: flex; + align-items: center; + justify-content: center; + padding: 0; + + & > vn-icon { + @extend .pad-small; + color: #666; + opacity: .4; + font-size: 1.5em; + + &.bright { + color: $main-01; + opacity: 1; + } + } + } + & > .quicklinks { + display: flex; + align-items: center; + justify-content: center; + padding: 0; + + & > a { + @extend .pad-small; + + & > vn-icon { + font-size: 1.8em; + padding: 0; + + & > i { + line-height: 36px + } + } + } + } + } +} \ No newline at end of file diff --git a/front/salix/styles/index.js b/front/salix/styles/index.js index d80763912..9e0d1ee49 100644 --- a/front/salix/styles/index.js +++ b/front/salix/styles/index.js @@ -7,7 +7,8 @@ import './background.scss'; import './border.scss'; import './font-style.scss'; import './misc.scss'; -import './summary.scss'; import './colors.scss'; import './effects.scss'; import './order-product.scss'; +import './summary.scss'; +import './descriptor.scss'; diff --git a/front/salix/styles/misc.scss b/front/salix/styles/misc.scss index edca86f95..851936e6e 100644 --- a/front/salix/styles/misc.scss +++ b/front/salix/styles/misc.scss @@ -161,91 +161,6 @@ vn-tool-bar { } } -vn-main-block { - display: block; - margin: 0 auto; - - .left-block { - position: fixed; - z-index: 1; - top: 4em; - left: 0; - bottom: 0; - width: 16em; - min-width: 16em; - background-color: white; - box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); - overflow: auto; - } - & > vn-horizontal > vn-one > [ui-view] { - padding-left: 16em; - } - .right-block { - width: 16em; - min-width: 16em; - padding-left: 1em; - } -} - -.vn-descriptor { - .header { - background: $main-01; - color: white; - justify-content: space-between; - align-items: stretch; - - & > vn-icon { - padding: .1em; - font-size: 2.5em; - } - & > a , & > vn-icon-menu { - @extend %clickable; - display: flex; - align-items: center; - padding: .5em; - color: white; - text-decoration: none; - - & > vn-icon { - font-size: 1.8em; - } - - & vn-drop-down{ - color: initial; - } - } - } - .footer { - text-align: center; - & > vn-icon { - color: #666; - opacity: .4; - padding: 0 5% 0 5%; - font-size: 1.5em; - } - & > vn-icon.bright { - color: $main-01; - opacity: 1; - } - } - - .quicklinks { - justify-content: center; - align-items: center; - - & > a { - & > vn-icon { - font-size: 1.8em; - padding: 0; - } - - & > vn-icon i { - line-height: 36px - } - } - } -} - .vn-list { max-width: 36em; margin: 0 auto; diff --git a/front/salix/styles/summary.scss b/front/salix/styles/summary.scss index d636f4c29..70fda5461 100644 --- a/front/salix/styles/summary.scss +++ b/front/salix/styles/summary.scss @@ -48,15 +48,6 @@ } vn-label-value > section { margin-bottom: .3em; - - & > vn-label { - display: block; - font-size: .9em; - - &::after { - content: initial; - } - } } } } diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html index 450714055..27042bdfc 100644 --- a/modules/agency/front/descriptor/index.html +++ b/modules/agency/front/descriptor/index.html @@ -1,4 +1,4 @@ - +
@@ -14,7 +14,7 @@ on-change="$ctrl.onMoreChange(value)"> - +
@@ -41,9 +41,8 @@ value="{{$ctrl.zone.price | currency: '€': 2}}"> - - - +
+
- +
+
- - - - +
+
+
+
{{$ctrl.claim.id}}
@@ -29,32 +29,32 @@ - - - - - - - - - - - - - - - - - +
+ +
+
diff --git a/modules/client/front/descriptor/index.html b/modules/client/front/descriptor/index.html index aacf522dc..abb3f39b6 100644 --- a/modules/client/front/descriptor/index.html +++ b/modules/client/front/descriptor/index.html @@ -1,5 +1,5 @@ - - +
+
@@ -16,76 +16,78 @@ on-change="$ctrl.onMoreChange(value)" on-open="$ctrl.onMoreOpen()"> - -
-
{{$ctrl.client.name}}
- - - - - - - - - -
- - - - - - - - - - - - - - - + +
\ No newline at end of file diff --git a/modules/item/front/descriptor/index.html b/modules/item/front/descriptor/index.html index 2742b5f26..09df4d520 100644 --- a/modules/item/front/descriptor/index.html +++ b/modules/item/front/descriptor/index.html @@ -1,5 +1,5 @@ - - +
+
@@ -16,9 +16,9 @@ on-change="$ctrl.onMoreChange(value)" on-open="$ctrl.onMoreOpen()"> - - - +
+
+
- +

Visible

@@ -41,7 +41,9 @@

{{$ctrl.item.available}}

- +
+
+
{{$ctrl.item.id}}
@@ -54,11 +56,9 @@ label="{{tag.tag.name}}" value="{{tag.value}}"> - - - - - + +
+
{ - console.log(res); this.possibleStowaways = res.data; }); } diff --git a/modules/item/front/ticket-descriptor/index.html b/modules/item/front/ticket-descriptor/index.html index 63594f49b..d392559fc 100644 --- a/modules/item/front/ticket-descriptor/index.html +++ b/modules/item/front/ticket-descriptor/index.html @@ -1,5 +1,5 @@ - - +
+
@@ -16,94 +16,96 @@ on-change="$ctrl.onMoreChange(value)" on-open="$ctrl.onMoreOpen()"> - -
-
{{::$ctrl.client.name}}
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - + +
diff --git a/modules/item/front/ticket-descriptor/index.js b/modules/item/front/ticket-descriptor/index.js index bada14293..a98e3b934 100644 --- a/modules/item/front/ticket-descriptor/index.js +++ b/modules/item/front/ticket-descriptor/index.js @@ -28,7 +28,6 @@ class Controller { } changeShipped(response) { - console.log(response); if (response === 'ACCEPT') { let params = {shipped: this.newShipped}; this.$http.patch(`/ticket/api/Tickets/${this.ticket.id}/`, params).then(() => { diff --git a/modules/item/front/ticket-descriptor/removeStowaway.js b/modules/item/front/ticket-descriptor/removeStowaway.js index 0ab62b69e..f152d3bdf 100644 --- a/modules/item/front/ticket-descriptor/removeStowaway.js +++ b/modules/item/front/ticket-descriptor/removeStowaway.js @@ -35,7 +35,6 @@ class Controller { let json = encodeURIComponent(JSON.stringify(filter)); this.$http.get(`/api/Stowaways?filter=${json}`).then(res => { - console.log(res.data); this.ticketStowaways = res.data; this.$scope.dialog.show(); }); diff --git a/modules/order/front/descriptor/index.html b/modules/order/front/descriptor/index.html index 6931f6dc6..51776be31 100644 --- a/modules/order/front/descriptor/index.html +++ b/modules/order/front/descriptor/index.html @@ -1,66 +1,68 @@ - - +
+
- - -
- - - - - - - - - - - - - - - - - - +
- - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + + + + + + + +
+ +
+
diff --git a/services/db/install/dump/fixtures.sql b/services/db/install/dump/fixtures.sql index 4b92486b0..f5b8f4b75 100644 --- a/services/db/install/dump/fixtures.sql +++ b/services/db/install/dump/fixtures.sql @@ -345,27 +345,28 @@ INSERT INTO `vn`.`invoiceOut`(`id`,`ref`, `serial`, `amount`, `issued`,`clientFk INSERT INTO `vn`.`ticket`(`id`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `created`) VALUES - (1 , 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY) , DATE_ADD(CURDATE(), INTERVAL -15 DAY) , 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY) ), - (2 , 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -10 DAY) , DATE_ADD(CURDATE(), INTERVAL -10 DAY) , 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY) ), - (3 , 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL -5 DAY) , DATE_ADD(CURDATE(), INTERVAL -5 DAY) , 102, 'address 22', 122, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY) ), - (4 , 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL -4 DAY) , DATE_ADD(CURDATE(), INTERVAL -4 DAY) , 102, 'address 22', 122, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -4 DAY) ), - (5 , 3, 3, 3, DATE_ADD(CURDATE(), INTERVAL -3 DAY) , DATE_ADD(CURDATE(), INTERVAL -3 DAY) , 103, 'address 23', 123, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -3 DAY) ), - (6 , 3, 3, 4, DATE_ADD(CURDATE(), INTERVAL -2 DAY) , DATE_ADD(CURDATE(), INTERVAL -2 DAY) , 103, 'address 23', 123, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -2 DAY) ), - (7 , 4, 4, 4, DATE_ADD(CURDATE(), INTERVAL -1 DAY) , DATE_ADD(CURDATE(), INTERVAL -1 DAY) , 104, 'address 24', 124, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -1 DAY) ), - (8 , 1, 1, 4, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 104, 'address 24', 124, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (9 , 5, 5, 4, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 105, 'address 25', 125, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)), - (10, 6, 5, 5, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH), 105, 'address 25', 125, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)), - (11, 7, 1, 1, CURDATE() , CURDATE() , 101, 'address 21', 121, NULL, 0, CURDATE() ), - (12, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), - (13, 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL +2 MONTH), DATE_ADD(CURDATE(), INTERVAL +2 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +2 MONTH)), - (14, 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL +3 MONTH), DATE_ADD(CURDATE(), INTERVAL +3 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +3 MONTH)), - (15, 3, 3, 3, DATE_ADD(CURDATE(), INTERVAL +4 MONTH), DATE_ADD(CURDATE(), INTERVAL +4 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +4 MONTH)), - (16, 1, 1, 1, CURDATE() , CURDATE() , 101, 'address 21', 121, NULL, 0, CURDATE() ), - (17, 4, 4, 4, CURDATE() , CURDATE() , 106, 'address 26', 126, NULL, 0, CURDATE() ), - (18, 4, 4, 4, CURDATE() , CURDATE() , 107, 'address 27', 127, NULL, 0, CURDATE() ), - (19, 5, 5, 4, CURDATE() , CURDATE() , 108, 'address 28', 128, NULL, 0, CURDATE() ), - (20, 5, 5, 4, CURDATE() , CURDATE() , 108, 'address 28', 128, NULL, 0, CURDATE() ), - (21, 5, 5, 4, CURDATE() , CURDATE() , 110, 'address 29', 129, NULL, 1, CURDATE() ); + (1 , 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY) , DATE_ADD(CURDATE(), INTERVAL -15 DAY) , 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY) ), + (2 , 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -10 DAY) , DATE_ADD(CURDATE(), INTERVAL -10 DAY) , 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY) ), + (3 , 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL -5 DAY) , DATE_ADD(CURDATE(), INTERVAL -5 DAY) , 102, 'address 22', 122, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY) ), + (4 , 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL -4 DAY) , DATE_ADD(CURDATE(), INTERVAL -4 DAY) , 102, 'address 22', 122, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -4 DAY) ), + (5 , 3, 3, 3, DATE_ADD(CURDATE(), INTERVAL -3 DAY) , DATE_ADD(CURDATE(), INTERVAL -3 DAY) , 103, 'address 23', 123, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -3 DAY) ), + (6 , 3, 3, 4, DATE_ADD(CURDATE(), INTERVAL -2 DAY) , DATE_ADD(CURDATE(), INTERVAL -2 DAY) , 103, 'address 23', 123, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -2 DAY) ), + (7 , 4, 4, 4, DATE_ADD(CURDATE(), INTERVAL -1 DAY) , DATE_ADD(CURDATE(), INTERVAL -1 DAY) , 104, 'address 24', 124, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -1 DAY) ), + (8 , 1, 1, 4, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 104, 'address 24', 124, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH) ), + (9 , 5, 5, 4, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 105, 'address 25', 125, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -2 MONTH) ), + (10, 6, 5, 5, DATE_ADD(CURDATE(), INTERVAL -3 MONTH), DATE_ADD(CURDATE(), INTERVAL -3 MONTH), 105, 'address 25', 125, NULL, 0, DATE_ADD(CURDATE(), INTERVAL -3 MONTH) ), + (11, 7, 1, 1, CURDATE() , CURDATE() , 101, 'address 21', 121, NULL, 0, CURDATE() ), + (12, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +1 MONTH) ), + (13, 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL +2 MONTH), DATE_ADD(CURDATE(), INTERVAL +2 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +2 MONTH) ), + (14, 2, 2, 2, DATE_ADD(CURDATE(), INTERVAL +3 MONTH), DATE_ADD(CURDATE(), INTERVAL +3 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +3 MONTH) ), + (15, 3, 3, 3, DATE_ADD(CURDATE(), INTERVAL +4 MONTH), DATE_ADD(CURDATE(), INTERVAL +4 MONTH), 101, 'address 21', 121, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +4 MONTH) ), + (16, 1, 1, 1, CURDATE(), CURDATE(), 101, 'address 21', 121, NULL, 0, CURDATE() ), + (17, 4, 4, 4, CURDATE(), CURDATE(), 106, 'address 26', 126, NULL, 0, CURDATE() ), + (18, 4, 4, 4, CURDATE(), CURDATE(), 107, 'address 27', 127, NULL, 0, CURDATE() ), + (19, 5, 5, 4, DATE_ADD(CURDATE(), INTERVAL +1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY), 108, 'address 28', 128, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY) ), + (20, 5, 5, 4, DATE_ADD(CURDATE(), INTERVAL +1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY), 108, 'address 28', 128, NULL, 0, DATE_ADD(CURDATE(), INTERVAL +1 DAY) ), + (21, 5, 5, 4, CURDATE(), CURDATE(), 110, 'address 29', 129, NULL, 1, CURDATE() ), + (22, 5, 5, 4, DATE_ADD(CURDATE(), INTERVAL +1 DAY), DATE_ADD(CURDATE(), INTERVAL +1 DAY), 108, 'address 28', 128, NULL, 1, DATE_ADD(CURDATE(), INTERVAL +1 DAY) ); INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`) VALUES @@ -394,8 +395,9 @@ INSERT INTO `vn`.`ticketTracking`(`id`, `ticketFk`, `stateFk`, `workerFk`, `crea (17, 17, 1 , 19, CURDATE()), (18, 18, 1 , 19, CURDATE()), (19, 19, 13, 19, CURDATE()), - (20, 20, 15, 19, CURDATE()), - (21, 21, 3 , 19, CURDATE()); + (20, 20, 13, 19, CURDATE()), + (21, 21, 3 , 19, CURDATE()), + (23, 21, 13, 19, CURDATE()); INSERT INTO `vn`.`stowaway`(`id`, `shipFk`, `created`) VALUES @@ -537,22 +539,24 @@ INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`, INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`) VALUES - (1, 1, 1 , 'Object1 Gem1 5', 5, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), - (2, 2, 1 , 'Object2 Gem2 3', 10, 1.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), - (3, 1, 1 , 'Object1 Gem1 5', 2, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), - (4, 4, 1 , 'Object4 Armor2 2', 20, 3.06, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), - (5, 1, 2 , 'Object1 Gem1 5', 10, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY)), - (6, 1, 3 , 'Object1 Gem1 5', 15, 6.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY)), - (7, 2, 11, 'Object2 Gem2 3', 15, 1.30, 0, 0, 0, CURDATE()), - (8, 4, 11, 'Object4 Armor2 2', 10, 3.26, 0, 0, 0, CURDATE()), - (9, 1, 16, 'Object1 Gem1 5', 5, 9.10, 0, 0, 0, CURDATE()), - (10, 2, 16, 'Object2 Gem2 3', 10, 1.07, 0, 0, 0, CURDATE()), - (11, 1, 16, 'Object1 Gem1 5', 2, 9.10, 0, 0, 0, CURDATE()), - (12, 4, 16, 'Object4 Armor2 2', 20, 3.06, 0, 0, 0, CURDATE()), - (13, 2, 8, 'Object2 Gem2 3', 15, 1.30, 0, 0, 0, CURDATE()), - (14, 1, 8, 'Object1 Gem1 5', 10, 2.30, 0, 0, 0, CURDATE()), - (15, 1, 19, 'Object1 Gem1 5', 10, 1.50, 0, 0, 0, CURDATE()), - (16, 2, 20, 'Object2 Gem2 3', 15, 1.30, 0, 0, 0, CURDATE()); + (1, 1, 1 , 'Object1 Gem1 5', 5, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), + (2, 2, 1 , 'Object2 Gem2 3', 10, 1.07, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), + (3, 1, 1 , 'Object1 Gem1 5', 2, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), + (4, 4, 1 , 'Object4 Armor2 2', 20, 3.06, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -15 DAY)), + (5, 1, 2 , 'Object1 Gem1 5', 10, 9.10, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -10 DAY)), + (6, 1, 3 , 'Object1 Gem1 5', 15, 6.50, 0, 0, 0, DATE_ADD(CURDATE(), INTERVAL -5 DAY)), + (7, 2, 11, 'Object2 Gem2 3', 15, 1.30, 0, 0, 0, CURDATE()), + (8, 4, 11, 'Object4 Armor2 2', 10, 3.26, 0, 0, 0, CURDATE()), + (9, 1, 16, 'Object1 Gem1 5', 5, 9.10, 0, 0, 0, CURDATE()), + (10, 2, 16, 'Object2 Gem2 3', 10, 1.07, 0, 0, 0, CURDATE()), + (11, 1, 16, 'Object1 Gem1 5', 2, 9.10, 0, 0, 0, CURDATE()), + (12, 4, 16, 'Object4 Armor2 2', 20, 3.06, 0, 0, 0, CURDATE()), + (13, 2, 8, 'Object2 Gem2 3', 15, 1.30, 0, 0, 0, CURDATE()), + (14, 1, 8, 'Object1 Gem1 5', 10, 2.30, 0, 0, 0, CURDATE()), + (15, 1, 19, 'Object1 Gem1 5', 10, 1.50, 0, 0, 0, CURDATE()), + (16, 2, 20, 'Object2 Gem2 3', 15, 1.30, 0, 0, 0, CURDATE()), + (17, 2, 22, 'Object2 Gem2 3', 30, 2.30, 0, 0, 0, CURDATE()), + (18, 4, 22, 'Object4 Armor2 2', 20, 3.00, 0, 0, 0, CURDATE()); INSERT INTO `vn`.`saleChecked`(`saleFk`, `isChecked`) VALUES @@ -637,7 +641,18 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`) (16, 21, 0.002), (16, 28, 5.6), (16, 29, -4.6), - (16, 39, 0.01); + (16, 39, 0.01), + (17, 15, 0.058), + (17, 21, 0.002), + (17, 28, 5.6), + (17, 29, -4.6), + (17, 39, 0.01), + (18, 15, 0.051), + (18, 22, -0.001), + (18, 28, 20.72), + (18, 29, -19.72), + (18, 37, 2), + (18, 39, 0.01); INSERT INTO `vn`.`saleTracking`(`saleFk`, `isChecked`, `created`, `originalQuantity`, `workerFk`, `actionFk`, `id`, `stateFk`) VALUES @@ -1064,4 +1079,11 @@ INSERT INTO `vn`.`ticketService`(`id`, `description`, `quantity`, `price`, `taxC VALUES (1, 'delivery charge', 1, 2.00, 1, 1), (2, 'training course', 1, 10.00, 1, 2), - (3, 'delivery charge', 1, 5.50, 1, 11); \ No newline at end of file + (3, 'delivery charge', 1, 5.50, 1, 11); + +INSERT INTO `pbx`.`sip`(`user_id`, `extension`, `secret`, `caller_id`) + VALUES + (1, 1010, '123456', 'employee'), + (3, 1101, '123456', 'agency'), + (5, 1102, '123456', 'administrative'), + (9, 1201, '123456', 'developer'); \ No newline at end of file diff --git a/services/mailer/.gitignore b/services/mailer/.gitignore deleted file mode 100644 index 3c3629e64..000000000 --- a/services/mailer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/services/mailer/Dockerfile b/services/mailer/Dockerfile deleted file mode 100644 index 29e87585e..000000000 --- a/services/mailer/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM node:lts-slim - -RUN npm -g install pm2 -COPY . /app -WORKDIR /app -CMD ["pm2-docker", "./server/server.js"] diff --git a/services/mailer/application/auth.js b/services/mailer/application/auth.js deleted file mode 100644 index 49918eb57..000000000 --- a/services/mailer/application/auth.js +++ /dev/null @@ -1,75 +0,0 @@ -var database = require('./database.js'); -let config = require('./config.js'); - -module.exports = { - /** - * Initialize auth. - * @param {Object} request Request object - * @param {Object} response Response object - * @param {Object} next Next object - */ - init: function(request, response, next) { - this.request = request; - this.response = response; - this.next = next; - - this.validateToken(); - }, - - /** - * Validate auth token. - */ - validateToken: function() { - let query = 'SELECT userId, ttl, created FROM salix.AccessToken WHERE id = ?'; - - database.pool.query(query, [this.getToken()], (error, result) => { - let token = result[0]; - - if (error || result.length == 0) - return this.response.status(401).send({message: 'Invalid token'}); - - if (this.isTokenExpired(token.created, token.ttl)) - return this.response.status(401).send({message: 'Token expired'}); - - // Set proxy host - let proxy = config.proxy; - - if (!proxy) - proxy = { - host: 'localhost', - port: 80 - }; - - this.request.proxyHost = `http://${proxy.host}:${proxy.port}`; - this.request.user = { - id: token.userId, - token: this.getToken() - }; - this.next(); - }); - }, - - /** - * Get request token. - * @return {String} Token - */ - getToken: function() { - return this.request.headers.authorization || this.request.query.token; - }, - - /** - * Checks if the token has expired. - * @param {String} created Creation date - * @param {Integer} ttl Ttl seconds - * @return {Boolean} %true if the token has expired - */ - isTokenExpired: function(created, ttl) { - let date = new Date(created); - let currentDate = new Date(); - - date.setSeconds(date.getSeconds() + ttl); - - if (currentDate > date) - return true; - } -}; diff --git a/services/mailer/application/config.js b/services/mailer/application/config.js deleted file mode 100644 index f0f0dfea6..000000000 --- a/services/mailer/application/config.js +++ /dev/null @@ -1,34 +0,0 @@ -require('require-yaml'); -const fs = require('fs-extra'); -const packageJson = require('../package.json'); -let configPath = `/etc/${packageJson.name}`; -let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'; - -let config = require('./config/datasources.json'); -let configFiles = [ - `${configPath}/datasources.json`, - `${configPath}/datasources.${env}.json` -]; - -for (let configFile of configFiles) { - if (fs.existsSync(configFile)) - Object.assign(config, require(configFile)); -} - -let proxyConf = {}; -let proxyFiles = [ - '../../nginx/config.yml', - `${configPath}/config.yml`, - `${configPath}/config.${env}.yml` -]; - -for (let proxyFile of proxyFiles) { - if (fs.existsSync(proxyFile)) - Object.assign(proxyConf, require(proxyFile)); -} - -config.proxy = proxyConf; -config.package = packageJson; -config.env = env; - -module.exports = config; diff --git a/services/mailer/application/config/datasources.json b/services/mailer/application/config/datasources.json deleted file mode 100644 index 6d489ec36..000000000 --- a/services/mailer/application/config/datasources.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "app": { - "port": 3000, - "debug": false, - "defaultLanguage": "es", - "senderMail": "noreply@localhost", - "senderName": "MySender" - }, - "mysql": { - "host": "localhost", - "port": 3306, - "database": "vn", - "user": "root", - "password": "root" - }, - "smtp": { - "host": "localhost", - "port": 465, - "secure": true, - "auth": { - "user": "noreply", - "pass": "" - }, - "tls": { - "rejectUnauthorized": false - }, - "pool": true - } -} \ No newline at end of file diff --git a/services/mailer/application/database.js b/services/mailer/application/database.js deleted file mode 100644 index 4fe4a0ba9..000000000 --- a/services/mailer/application/database.js +++ /dev/null @@ -1,33 +0,0 @@ -var mysql = require('mysql'); -let config = require('./config.js'); - -module.exports = { - /** - * Pool instance - */ - pool: null, - - /** - * Start database pool - */ - init: function() { - this.pool = mysql.createPool(config.mysql); - - this.pool.getConnection(function(error, connection) { - if (error) { - throw new Error('Can\'t connect to database: ' + error.code); - } else if (config.app.debug) { - console.log('Database connection stablished'); - } - }); - }, - - /** - * Set test environment mail. - */ - testEmail: function() { - this.pool.query('SELECT fakeEmail as email FROM vn.config', function(error, qryRs) { - config.smtp.testEmail = qryRs[0].email; - }); - } -}; diff --git a/services/mailer/application/locale.js b/services/mailer/application/locale.js deleted file mode 100644 index f9737fea3..000000000 --- a/services/mailer/application/locale.js +++ /dev/null @@ -1,42 +0,0 @@ -var fs = require('fs'); -var config = require('./config.js'); -var path = require('path'); - -module.exports = { -/** - * Returns template locale - * @param {String} template - Template name - * @param {String} countryCode - Language code - * @param {Object} cb - Callback - */ - load: function(template, countryCode, cb) { - var localeFile = path.join(__dirname, 'template', `${template}`, 'locale', `${countryCode}.json`); - var defaultLocaleFile = path.join(__dirname, 'template', `${template}`, 'locale', `${config.app.defaultLanguage}.json`); - - fs.stat(localeFile, (error, stats) => { - if (error) { - fs.stat(defaultLocaleFile, (error, stats) => { - if (error) - return cb(new Error('Translation not found for template ' + template)); - - cb(null, {locale: require(defaultLocaleFile)}); - }); - } else { - cb(null, {locale: require(localeFile)}); - } - }); - }, - -/** - * Parse locale text - * @param {String} text - Locale text - * @param {Object} params - Locale params - * @return {String} - Returns parsed text - */ - parseText: function(text, params) { - for (var key in params) { - text = text.replace(`%${key}%`, params[key]); - } - return text; - } -}; diff --git a/services/mailer/application/mail.js b/services/mailer/application/mail.js deleted file mode 100644 index 27d25e39a..000000000 --- a/services/mailer/application/mail.js +++ /dev/null @@ -1,112 +0,0 @@ -var nodemailer = require('nodemailer'); -var config = require('./config.js'); -var template = require('./template.js'); -var database = require('./database.js'); - -/** - * Mail module - */ -module.exports = { - transporter: null, - /** - * Load mail config. - */ - init: function() { - this.transporter = nodemailer.createTransport(config.smtp); - - this.transporter.verify(function(error, success) { - if (error) { - console.error(error); - } else if (config.app.debug) { - console.log('SMTP connection stablished'); - } - }); - - }, - - /** - * Send email. - * @param {Object} recipient - Mail destinatary - * @param {String} subject - Subject - * @param {String} body - Mail body - * @param {Object} attachments - Mail attachments - * @param {Object} params - Params - * @param {Object} cb - Callback - */ - send: function(recipient, subject, body, attachments, params, cb) { - let mailOptions = { - from: '"' + config.app.senderName + '" <' + config.app.senderMail + '>', - to: recipient, - subject: subject, - html: body, - attachments - }; - - if (config.env != 'production') - mailOptions.to = config.app.senderMail; - - this.transporter.sendMail(mailOptions, (error, info) => { - try { - let status = (error ? error.message : 'OK'); - this.log(params.sender, params.recipient, recipient, subject, body, params.message, status); - - if (error) - return cb(new Error('Email not sent: ' + error)); - - if (config.app.debug) - console.log('Mail sent ' + info.messageId + ' [' + info.response + ']'); - - cb(); - } catch (e) { - throw e; - } - }); - }, - - /** - * Send email with template. - * @param {String} tplName - Template name - * @param {Object} params - Params object - * @param {Object} cb - Callback - */ - sendWithTemplate: function(tplName, params, cb) { - template.get(tplName, params, (error, result) => { - if (error) - return cb(error); - - // Custom attachments - if (params.attachments) - params.attachments.forEach(function(attachment) { - result.attachments.push(attachment); - }); - - this.send(result.recipient, result.subject, result.body, result.attachments, params, error => { - if (error) - return cb(error); - - cb(); - }); - }); - }, - - /** - * Add mail log - * @param {Integer} senderId - Sender id - * @param {Integer} recipientId - Recipient id - * @param {String} sender - Sender email - * @param {String} subject - Mail subject - * @param {String} body - Mail body - * @param {String} plainTextBody - Mail plain text body - * @param {String} status - Mail status - */ - log: function(senderId, recipientId, sender, subject, body, plainTextBody, status) { - let qry = `INSERT INTO mail(senderFk, recipientFk, sender, replyTo, subject, body, plainTextBody, sent, status) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`; - let qryParams = [senderId, recipientId, sender, config.app.senderMail, subject, body, plainTextBody, 1, status]; - - database.pool.query(qry, qryParams, function(error, result) { - if (config.app.debug && error) - console.log('Mail log: ' + error); - }); - } -}; diff --git a/services/mailer/application/route/notification.js b/services/mailer/application/route/notification.js deleted file mode 100644 index 7787cd8a7..000000000 --- a/services/mailer/application/route/notification.js +++ /dev/null @@ -1,288 +0,0 @@ -var express = require('express'); -var router = new express.Router(); -var config = require('../config.js'); -var mail = require('../mail.js'); -var template = require('../template.js'); -var httpRequest = require('request'); -var auth = require('../auth.js'); - -// Auth middleware -var requestToken = function(request, response, next) { - auth.init(request, response, next); -}; - -// Printer setup -router.get('/printer-setup/:clientId', requestToken, function(request, response) { - mail.sendWithTemplate('printer-setup', {clientId: request.params.clientId}, error => { - if (error) - return response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -// Printer setup preview -router.get('/printer-setup/:clientId/preview', requestToken, function(request, response) { - template.get('printer-setup', {clientId: request.params.clientId, isPreview: true}, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - -// Client welcome -router.get('/client-welcome/:clientId', requestToken, function(request, response) { - mail.sendWithTemplate('client-welcome', {clientId: request.params.clientId}, error => { - if (error) - return response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -// Client welcome preview -router.get('/client-welcome/:clientId/preview', requestToken, function(request, response) { - template.get('client-welcome', {clientId: request.params.clientId, isPreview: true}, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - -// Client SEPA CORE -router.get('/sepa-core/:companyId/:clientId', requestToken, function(request, response) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId - }; - - let path = `${request.proxyHost}/print/manuscript/sepa-core/${params.companyId}/${params.clientId}`; - let options = { - url: path, - method: 'GET', - headers: { - 'Authorization': request.headers.authorization - } - } - - let httpStream = httpRequest(options, function(error, httpResponse, body) { - if (error || httpResponse.statusCode != 200) - return response.status(400).json({message: error}); - }); - - if (httpStream) - params.attachments = [{filename: 'sepa-core.pdf', content: httpStream}]; - - mail.sendWithTemplate('sepa-core', params, error => { - if (error) - return response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -// Client SEPA CORE preview -router.get('/sepa-core/:companyId/:clientId/preview', requestToken, function(request, response) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId, - token: request.user.token, - isPreview: true - }; - - template.get('sepa-core', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - -// First debtor letter -router.get('/letter-debtor-st/:companyId/:clientId', requestToken, function(request, response) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId, - token: request.user.token - }; - - let path = `${request.proxyHost}/print/manuscript/letter-debtor/${params.companyId}/${params.clientId}`; - let options = { - url: path, - method: 'GET', - headers: { - 'Authorization': request.user.token - } - } - - let httpStream = httpRequest(options, function(error, httpResponse, body) { - if (error || httpResponse.statusCode != 200) - return response.status(400).json({message: error}); - }); - - if (httpStream) - params.attachments = [{filename: 'extracto.pdf', content: httpStream}]; - - mail.sendWithTemplate('letter-debtor-st', params, error => { - if (error) - return response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -// First debtor letter preview -router.get('/letter-debtor-st/:companyId/:clientId/preview', requestToken, function(request, response) { - template.get('letter-debtor-st', { - clientId: request.params.clientId, - companyId: request.params.companyId, - token: request.user.token, - isPreview: true - }, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - -// Second debtor letter -router.get('/letter-debtor-nd/:companyId/:clientId', requestToken, function(request, response) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId, - token: request.user.token - }; - - let path = `${request.proxyHost}/print/manuscript/letter-debtor/${params.companyId}/${params.clientId}`; - let options = { - url: path, - method: 'GET', - headers: { - 'Authorization': request.headers.authorization - } - } - - let httpStream = httpRequest(options, function(error, httpResponse, body) { - if (error || httpResponse.statusCode != 200) - return response.status(400).json({message: error}); - }); - - if (httpStream) - params.attachments = [{filename: 'extracto.pdf', content: httpStream}]; - - mail.sendWithTemplate('letter-debtor-nd', params, error => { - if (error) - return response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -// Second debtor letter preview -router.get('/letter-debtor-nd/:companyId/:clientId/preview', requestToken, function(request, response) { - template.get('letter-debtor-nd', { - clientId: request.params.clientId, - companyId: request.params.companyId, - token: request.user.token, - isPreview: true - }, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - -// Payment method changes -router.get('/payment-update/:clientId', requestToken, function(request, response) { - mail.sendWithTemplate('payment-update', {clientId: request.params.clientId}, error => { - if (error) - return response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -// Send notification to alias creditInsurance on client deactivate -router.get('/client-deactivate/:clientId', requestToken, function(request, response) { - var params = { - alias: 'creditInsurance', - code: 'clientDeactivate', - bodyParams: { - clientId: request.params.clientId - } - }; - - mail.sendWithTemplate('notification-alias', params, error => { - if (error) - response.status(400).json({message: error.message}); - - return response.json(); - }); -}); - -module.exports = router; - - -// Single user notification -/* router.post('/:recipient/noticeUserSend', function(request, response) { - var params = { - recipient: request.params.recipient, - sender: request.body.sender, - category: request.body.category, - message: request.body.message - }; - - if (params.sender == params.recipient) - return; - - let query = `SELECT COUNT(*) isEnabled - FROM noticeSubscription s - JOIN noticeCategory c ON c.id = s.noticeCategoryFk AND c.isEnabled - WHERE c.keyName = ? AND s.userFk = ?`; - - database.pool.query(query, [params.category, params.recipient, params.sender], (error, result) => { - mail.sendWithTemplate('notification-notice', params, result => { - return response.json(result); - }); - }); -}); */ - -// Send notification to all user subscribed to category -/* router.post('/:category/noticeCategorySend', function(request, response) { - var params = { - sender: request.body.sender, - category: request.params.category, - message: request.body.message - }; - - let query = `SELECT s.userFk id FROM noticeSubscription s JOIN noticeCategory - c ON c.id = s.noticeCategoryFk AND c.isEnabled WHERE c.keyName = ? AND s.userFk != ?`; - - database.pool.query(query, [params.category, params.sender], (error, result) => { - result.forEach(function(user) { - params.recipient = user.id; - - mail.sendWithTemplate('notification-notice', params, result => { - return response.json(result); - }); - }, this); - }); -}); */ - -// Send system notification -/* router.post('/:recipient/noticeSystemSend', function(request, response) { - var params = { - recipient: request.params.recipient, - sender: settings.smtp().auth.id, - category: request.body.category, - message: request.body.message - }; - - mail.sendWithTemplate('notification-notice', params, result => { - return response.json(result); - }); -}); */ \ No newline at end of file diff --git a/services/mailer/application/router.js b/services/mailer/application/router.js deleted file mode 100644 index c8e32b564..000000000 --- a/services/mailer/application/router.js +++ /dev/null @@ -1,49 +0,0 @@ -var express = require('express'); -var router = new express.Router(); -var fs = require('fs'); -var path = require('path'); - -// Mailer default page -router.get('/', function(request, response) { - response.json({}); -}); - -// Notifications -router.use('/notification', require('./route/notification.js')); - -// Serve static images -router.use('/static/:template/:image', function(request, response) { - let imagePath = path.join(__dirname, '/template/', request.params.template, '/image/', request.params.image); - - fs.stat(imagePath, function(error) { - if (error) - return response.json({message: 'Image not found'}); - - let readStream = fs.createReadStream(imagePath); - - readStream.on('open', function() { - let contentType = getContentType(imagePath); - - if (contentType) - response.setHeader('Content-type', getContentType(imagePath)); - - readStream.pipe(response); - }); - }); -}); - -function getContentType(path) { - let types = { - png: 'image/png', - svg: 'image/svg+xml', - gif: 'image/gif', - jpeg: 'image/jpeg', - jpg: 'image/jpeg' - }; - - let extension = path.split('.')[1]; - - return types[extension]; -} - -module.exports = router; diff --git a/services/mailer/application/template.js b/services/mailer/application/template.js deleted file mode 100644 index 1e9c92fde..000000000 --- a/services/mailer/application/template.js +++ /dev/null @@ -1,234 +0,0 @@ -var fs = require('fs'); -var mustache = require('mustache'); -var locale = require('./locale.js'); -var inlineCss = require('inline-css'); -var path = require('path'); - -module.exports = { -/** - * Get template. - * @param {String} template - Template name - * @param {Object} countryCode - Language code - * @param {Object} params - Params - * @param {Object} cb - Callback - */ - get: function(template, params, cb) { - var templatePath = path.join(__dirname, 'template', `${template}`, `index.html`); - var classPath = path.join(__dirname, 'template', `${template}`, `${template}.js`); - var stylePath = path.join(__dirname, 'template', `${template}`, 'style.css'); - - fs.stat(templatePath, (error, stat) => { - if (error) - return cb(new Error('Template ' + template + ' not found')); - - let TemplateClass = require(classPath); - let instance = new TemplateClass(); - - let getRenderedStyles = (error, body) => { - if (error) - return cb(error); - - this.renderStyles(stylePath, body, (error, body) => { - if (error) - return cb(error); - - // Check if has a subject param - params.subject = params.subject || instance.subject; - - if (params.subject == undefined) { - // Try to find a subject from Html source - let title = body.match(new RegExp('(.*?)', 'i')); - - if (title) - params.subject = title[1]; - } - - this.getAttachments(template, body, params.isPreview, (error, result) => { - if (error) - return cb(error); - - cb(null, {recipient: instance.recipient, subject: params.subject, body: result.body, attachments: result.attachments}); - }); - }); - }; - - let getDataCb = () => { - this.render(templatePath, instance, (error, result) => getRenderedStyles(error, result)); - }; - - instance.getData(params, (error, result) => { - if (error) - return cb(error); - - locale.load(template, instance.countryCode, (error, result) => { - if (error) - return cb(error); - - instance._ = result.locale; - instance.isPreview = params.isPreview; - - getDataCb(null, result); - }); - }); - }); - }, - -/** - * Render template - * @param {String} path - Template path - * @param {Object} data - Params - * @param {Object} cb - Callback - */ - render: function(path, data, cb) { - fs.readFile(path, 'utf8', (error, body) => { - // Find matching sub-templates - let regexp = new RegExp(/\{\{\$\.(.*?)\}\}/, 'ig'); - let subTpl = body.match(regexp); - - if (!subTpl) { - mustache.parse(body); - return cb(null, mustache.render(body, data)); - } - - let parentBody = body; - this.renderSub(parentBody, subTpl, data, regexp, (error, body) => { - if (error) - return cb(error); - - mustache.parse(body); - cb(null, mustache.render(body, data)); - }); - }); - }, - -/** - * Render sub-template - * @param {String} body - Raw body - * @param {Object} subTpl - Sub-template name - * @param {Object} data - Params - * @param {Object} regexp - Regexp - * @param {Object} cb - Callback - */ - renderSub: function(body, subTpl, data, regexp, cb) { - let index = 1; - - subTpl.forEach(keyName => { - subTplName = keyName.replace(regexp, '$1'); - - this.get(subTplName, data, (error, result) => { - if (error) - return cb(error); - - let subTplBody = result.body; - body = body.replace(keyName, subTplBody); - - if (index === subTpl.length) - cb(null, body); - - index++; - }); - - }); - }, - -/** - * Render template style. - * @param {String} path - Stylesheet path - * @param {String} body - Rendered html - * @param {Object} cb - Callback - */ - renderStyles: function(stylePath, html, cb) { - // Common components - let comPath = path.join(__dirname, '../', 'static', 'css', 'component.css'); - - fs.readFile(comPath, 'utf8', (error, comCss) => { - fs.stat(stylePath, error => { - if (error) - return cb(new Error('Template stylesheet not found')); - - fs.readFile(stylePath, 'utf8', (error, css) => { - let style = ''; - let body = style + html; - let options = {url: ' '}; - - inlineCss(body, options) - .then(function(body) { - cb(null, body); - }); - }); - }); - }); - }, - -/** - * Get template attachments - * @param {String} template - Template name - * @param {String} body - template body - * @param {Object} cb - Callback - */ - getAttachments: function(template, body, isPreview, cb) { - let attachments = []; - let tplAttachments = body.match(new RegExp('src="cid:(.*?)"', 'ig')); - - if (!tplAttachments) - tplAttachments = {}; - - // Template default attachments - for (var i = 0; i < tplAttachments.length; i++) { - let src = tplAttachments[i].replace('src="cid:', '').replace('"', '').split('/'); - let attachmentTpl = src[0]; - let attachment = src[1]; - - if (isPreview) { - let attachmentPath = `/mailer/static/${attachmentTpl}/${attachment}`; - body = body.replace(tplAttachments[i], `src="${attachmentPath}"`); - } else { - let attachmentPath = path.join(__dirname, 'template', `${attachmentTpl}`, 'image', attachment); - let attachmentName = attachmentTpl + '/' + attachment; - attachments.push({filename: attachmentName, path: attachmentPath, cid: attachmentName}); - } - } - - if (isPreview) - return cb(null, {body: body, attachments: attachments}); - - // Template attachment files - let attachmentsPath = path.join(__dirname, 'template', `${template}`, 'attachment.json'); - - fs.stat(attachmentsPath, (error, stats) => { - if (error) - return cb(null, {body: body, attachments: attachments}); - - let attachObj = require(attachmentsPath); - - for (var i = 0; i < attachObj.length; i++) { - let filename = attachObj[i]; - let attachmentPath = path.join(__dirname, 'template', `${template}`, 'attachment', filename); - - attachments.push({filename: filename, path: attachmentPath, cid: filename}); - } - - this.checkAttachments(attachments, error => { - if (error) - return cb(error); - cb(null, {body: body, attachments: attachments}); - }); - }); - }, - -/** -* Check all template attachments -* @param {Object} attachments - Attachments object -* @param {Object} cb - Callback -*/ - checkAttachments: function(attachments, cb) { - for (var i = 0; i < attachments.length; i++) { - var attachment = attachments[i]; - fs.stat(attachment.path, error => { - if (error) - return cb(new Error(`Could not load attachment file ${attachment.path}`)); - }); - } - cb(); - } -}; \ No newline at end of file diff --git a/services/mailer/application/template/client-welcome/attachment.json b/services/mailer/application/template/client-welcome/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/client-welcome/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/client-welcome/client-welcome.js b/services/mailer/application/template/client-welcome/client-welcome.js deleted file mode 100644 index 7cf435d0e..000000000 --- a/services/mailer/application/template/client-welcome/client-welcome.js +++ /dev/null @@ -1,46 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class ClientWelcome { - getData(params, cb) { - let query = `SELECT - c.id clientId, - CONCAT(w.name, ' ', w.firstName) name, - w.phone AS phone, - CONCAT(wu.name, '@verdnatura.es') AS email, - u.name AS userName, - LOWER(ct.code) countryCode, - c.email recipient - FROM client c - JOIN account.user u ON u.id = c.id - LEFT JOIN worker w ON w.id = c.salesPersonFk - LEFT JOIN account.user wu ON wu.id = w.userFk - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - - database.pool.query(query, [params.clientId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - }); - } - - get salesPersonName() { - if (this.name) - return `
${this._.salesPersonNameText}: ${this.name}
`; - } - - get salesPersonPhone() { - if (this.phone) - return `
${this._.salesPersonPhoneText}: ${format.phone(this.phone)}
`; - } - - get salesPersonEmail() { - if (this.email) - return `
${this._.salesPersonEmailText}: ` + - `${this.email}
`; - } -}; diff --git a/services/mailer/application/template/client-welcome/index.html b/services/mailer/application/template/client-welcome/index.html deleted file mode 100644 index 6d25bcd7e..000000000 --- a/services/mailer/application/template/client-welcome/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - {{_.subject}} - - - -
-
- - {{$.header}} - - - -
-

{{_.title}}

-
- - - -
-

{{_.dear}}

-

{{{_.bodyDescription}}}

-

-

{{_.clientNumber}} {{clientId}}
-
{{_.user}} {{userName}}
-
{{_.password}} ******** {{{_.passwordResetText}}}
-

- -

{{_.sectionHowToBuyTitle}}

-

{{_.sectionHowToBuyDescription}}

-
    -
  1. {{_.sectionHowToBuyRequeriment1}}
  2. -
  3. {{_.sectionHowToBuyRequeriment2}}
  4. -
  5. {{_.sectionHowToBuyRequeriment3}}
  6. -
-

{{_.sectionHowToBuyStock}}

-

{{_.sectionHowToBuyDelivery}}

- -

{{_.sectionHowToPayTitle}}

-

{{_.sectionHowToPayDescription}}

-
    -
  • {{{_.sectionHowToPayOption1}}}
  • -
  • {{{_.sectionHowToPayOption2}}}
  • -
- -

{{_.sectionToConsiderTitle}}

-

{{_.sectionToConsiderDescription}}

- -

{{_.sectionClaimsPolicyTitle}}

-

{{_.sectionClaimsPolicyDescription}}

-

{{{_.doubtsText}}}

-

- {{{salesPersonName}}} - {{{salesPersonPhone}}} - {{{salesPersonEmail}}} -

-
- - - - {{$.footer}} - -
-
- - \ No newline at end of file diff --git a/services/mailer/application/template/client-welcome/locale/es.json b/services/mailer/application/template/client-welcome/locale/es.json deleted file mode 100644 index 95a903e5c..000000000 --- a/services/mailer/application/template/client-welcome/locale/es.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "subject": "¡Le damos la bienvenida!", - "title": "¡LE DAMOS LA BIENVENIDA!", - "dear": "Estimado cliente,", - "bodyDescription": "Sus datos para poder comprar en la web de verdnatura (
https://www.verdnatura.es) o en nuestras aplicaciones para iOS y Android (Ver tutorial de uso), son:", - "clientNumber": "Identificador de cliente:", - "user": "Usuario:", - "password": "Contraseña:", - "passwordResetText": "(Haga clic en \"¿Has olvidado tu contraseña?\")", - "sectionHowToBuyTitle": "Cómo hacer un pedido", - "sectionHowToBuyDescription": "Para realizar un pedido en nuestra web, debe configurarlo indicando:", - "sectionHowToBuyRequeriment1": "Si quiere recibir el pedido (por agencia o por nuestro propio reparto) o si lo prefiere recoger en alguno de nuestros almacenes.", - "sectionHowToBuyRequeriment2": "La fecha en la que quiera recibir el pedido (se preparará el día anterior).", - "sectionHowToBuyRequeriment3": "La dirección de entrega o el almacén donde quiera recoger el pedido.", - "sectionHowToBuyStock": "En nuestra web y aplicaciones puedes visualizar el stock disponible de flor cortada, verdes, plantas, complementos y artificial. Tenga en cuenta que dicho stock puede variar en función de la fecha seleccionada al configurar el pedido. Es importante CONFIRMAR los pedidos para que la mercancía quede reservada.", - "sectionHowToBuyDelivery": "El reparto se realiza de lunes a sábado según la zona en la que se encuentre. Por regla general, los pedidos que se entregan por agencia, deben estar confirmados y pagados antes de las 17h del día en que se preparan (el día anterior a recibirlos), aunque esto puede variar si el pedido se envía a través de nuestro reparto y según la zona.", - "sectionHowToPayTitle": "Cómo pagar", - "sectionHowToPayDescription": "Las formas de pago admitidas en Verdnatura son:", - "sectionHowToPayOption1": "Con tarjeta a través de nuestra plataforma web (al confirmar el pedido).", - "sectionHowToPayOption2": "Mediante giro bancario mensual, modalidad que hay que solicitar y tramitar.", - "sectionToConsiderTitle": "Cosas a tener en cuenta", - "sectionToConsiderDescription": "Verdnatura vende EXCLUSIVAMENTE a profesionales, por lo que debe remitirnos el Modelo 036 ó 037, para comprobar que está dado/a de alta en el epígrafe correspondiente al comercio de flores.", - "sectionClaimsPolicyTitle": "POLÍTICA DE RECLAMACIONES", - "sectionClaimsPolicyDescription": "Verdnatura aceptará las reclamaciones que se realicen dentro de los dos días naturales siguientes a la recepción del pedido (incluyendo el mismo día de la recepción). Pasado este plazo no se aceptará ninguna reclamación.", - "doubtsText": "Cualquier duda que le surja, no dude en consultarla, ¡estamos para atenderle!", - "salesPersonNameText": "Soy tu comercial y mi nombre es", - "salesPersonPhoneText": "Teléfono y whatsapp", - "salesPersonEmailText": "Dirección de e-mail" -} \ No newline at end of file diff --git a/services/mailer/application/template/client-welcome/style.css b/services/mailer/application/template/client-welcome/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/template/default/image/download.svg b/services/mailer/application/template/default/image/download.svg deleted file mode 100644 index b05bc05c8..000000000 --- a/services/mailer/application/template/default/image/download.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/services/mailer/application/template/default/image/preview.svg b/services/mailer/application/template/default/image/preview.svg deleted file mode 100644 index 09a2a6bca..000000000 --- a/services/mailer/application/template/default/image/preview.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/services/mailer/application/template/footer/footer.js b/services/mailer/application/template/footer/footer.js deleted file mode 100644 index 555e70b10..000000000 --- a/services/mailer/application/template/footer/footer.js +++ /dev/null @@ -1,21 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class Footer { - getData(params, cb) { - let query = `SELECT - socialName, - LOWER(ct.code) countryCode - FROM client c - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - database.pool.query(query, [params.clientId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - }); - } -}; diff --git a/services/mailer/application/template/footer/image/action.png b/services/mailer/application/template/footer/image/action.png deleted file mode 100644 index 2cd16c453..000000000 Binary files a/services/mailer/application/template/footer/image/action.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/facebook.png b/services/mailer/application/template/footer/image/facebook.png deleted file mode 100644 index 7ab54c538..000000000 Binary files a/services/mailer/application/template/footer/image/facebook.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/header.png b/services/mailer/application/template/footer/image/header.png deleted file mode 100644 index 3c063ae44..000000000 Binary files a/services/mailer/application/template/footer/image/header.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/info.png b/services/mailer/application/template/footer/image/info.png deleted file mode 100644 index fb75cbc4e..000000000 Binary files a/services/mailer/application/template/footer/image/info.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/instagram.png b/services/mailer/application/template/footer/image/instagram.png deleted file mode 100644 index 66550c4a5..000000000 Binary files a/services/mailer/application/template/footer/image/instagram.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/linkedin.png b/services/mailer/application/template/footer/image/linkedin.png deleted file mode 100644 index 0d191e5ae..000000000 Binary files a/services/mailer/application/template/footer/image/linkedin.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/pinterest.png b/services/mailer/application/template/footer/image/pinterest.png deleted file mode 100644 index 4d7b28ef8..000000000 Binary files a/services/mailer/application/template/footer/image/pinterest.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/twitter.png b/services/mailer/application/template/footer/image/twitter.png deleted file mode 100644 index c4a8ab0c1..000000000 Binary files a/services/mailer/application/template/footer/image/twitter.png and /dev/null differ diff --git a/services/mailer/application/template/footer/image/youtube.png b/services/mailer/application/template/footer/image/youtube.png deleted file mode 100644 index 11871deb5..000000000 Binary files a/services/mailer/application/template/footer/image/youtube.png and /dev/null differ diff --git a/services/mailer/application/template/footer/index.html b/services/mailer/application/template/footer/index.html deleted file mode 100644 index 484f5c2b8..000000000 --- a/services/mailer/application/template/footer/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - -
-

{{_.fiscalAddress}}

-

{{_.privacy}}

-

{{_.privacyLaw}}

-
- \ No newline at end of file diff --git a/services/mailer/application/template/footer/locale/es.json b/services/mailer/application/template/footer/locale/es.json deleted file mode 100644 index 1ad532d34..000000000 --- a/services/mailer/application/template/footer/locale/es.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "actionButton": "Visita nuestra Web", - "infoButton": "Ayúdanos a mejorar", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/mailer/application/template/footer/locale/fr.json b/services/mailer/application/template/footer/locale/fr.json deleted file mode 100644 index 4953874ff..000000000 --- a/services/mailer/application/template/footer/locale/fr.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "actionButton": "Visitez notre site web", - "infoButton": "Aidez-nous à améliorer", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/mailer/application/template/footer/style.css b/services/mailer/application/template/footer/style.css deleted file mode 100644 index f35364e8c..000000000 --- a/services/mailer/application/template/footer/style.css +++ /dev/null @@ -1,54 +0,0 @@ -.buttons { - background-color: #FFF; - text-align: center; - width: 100% -} - -.buttons a { - text-decoration: none; - font-size: 18px; - color: #fff -} - -.buttons .btn { - background-color: #333; - min-width: 300px; - height: 72px; - display: inline-block; - text-align: center -} - -.buttons .btn .text { - display: inline-block; - padding-top: 22px -} - -.buttons .btn .icon { - background-color: #95d831; - text-align: center; - padding-top: 22px; - float: right; - height: 50px; - width: 70px -} - -.footer { - background-color: #555; - text-align: center; - padding: 20px 0 -} - -.footer a { - text-decoration: none; - margin-right: 5px -} - -.footer a img { - margin: 0 -} - -.privacy { - padding: 20px 0; - font-size: 10px; - font-weight: 100 -} \ No newline at end of file diff --git a/services/mailer/application/template/header/header.js b/services/mailer/application/template/header/header.js deleted file mode 100644 index a6d1d6194..000000000 --- a/services/mailer/application/template/header/header.js +++ /dev/null @@ -1,21 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class Header { - getData(params, cb) { - let query = `SELECT - c.name AS clientName, - LOWER(ct.code) countryCode - FROM client c - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - database.pool.query(query, [params.clientId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - }); - } -}; diff --git a/services/mailer/application/template/header/image/logo.png b/services/mailer/application/template/header/image/logo.png deleted file mode 100644 index 3c063ae44..000000000 Binary files a/services/mailer/application/template/header/image/logo.png and /dev/null differ diff --git a/services/mailer/application/template/header/index.html b/services/mailer/application/template/header/index.html deleted file mode 100644 index 6e4fcf8a4..000000000 --- a/services/mailer/application/template/header/index.html +++ /dev/null @@ -1,3 +0,0 @@ -
- VerdNatura -
diff --git a/services/mailer/application/template/header/locale/es.json b/services/mailer/application/template/header/locale/es.json deleted file mode 100644 index 7a73a41bf..000000000 --- a/services/mailer/application/template/header/locale/es.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/services/mailer/application/template/header/style.css b/services/mailer/application/template/header/style.css deleted file mode 100644 index 4ea8ee36d..000000000 --- a/services/mailer/application/template/header/style.css +++ /dev/null @@ -1,3 +0,0 @@ -.banner img { - width: 100% -} \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-nd/attachment.json b/services/mailer/application/template/letter-debtor-nd/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/letter-debtor-nd/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-nd/index.html b/services/mailer/application/template/letter-debtor-nd/index.html deleted file mode 100644 index aa4379519..000000000 --- a/services/mailer/application/template/letter-debtor-nd/index.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - {{_.subject}} - - - -
-
- - {{$.header}} - - - -
-

{{_.title}}

-
- - - -
-

{{_.dear}}

- -

{{_.bodyDescription}}

-

{{_.termLimits}}

-

- {{_.payMethod}} - -

    -
  1. {{_.payMethodOption1}}
  2. -
  3. {{_.payMethodOption2}}
  4. -
-

-

- {{_.legalActions}} -

    -
  1. {{_.legalActionsOption1}}
  2. -
  3. {{_.legalActionsOption2}}
  4. -
  5. {{_.legalActionsOption3}}
  6. -
-

- -

{{_.contact}}

- -

{{_.waitingForNews}}

-

{{_.conclusion}}

- -

-

-
{{bankName}}
-
{{iban}}
-
-
{{_.accountTransferData}}
-
-
-

- - {{#isPreview}} - -
-
- Ver adjunto -
- Ver adjunto -
-
- - -
-
- Descargar adjunto -
- Descargar PDF -
-
- {{/isPreview}} -
- - - - - {{$.footer}} - -
-
- - \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-nd/letter-debtor-nd.js b/services/mailer/application/template/letter-debtor-nd/letter-debtor-nd.js deleted file mode 100644 index be0f996e1..000000000 --- a/services/mailer/application/template/letter-debtor-nd/letter-debtor-nd.js +++ /dev/null @@ -1,39 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class LetterDebtorNd { - getData(params, cb) { - let query = `SELECT - sa.iban, - be.name AS bankName, - LOWER(ct.code) countryCode, - c.email recipient - FROM client c - JOIN company AS cny - JOIN supplierAccount AS sa ON sa.id = cny.supplierAccountFk - JOIN bankEntity be ON be.id = sa.bankEntityFk - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ? AND cny.id = ?`; - - this.clientId = params.clientId; - this.companyId = params.companyId; - this.token = params.token; - - database.pool.query(query, [params.clientId, params.companyId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - - cb(); - }); - } - - get previewAttachments() { - if (this.isPreview) - return `` + - '
Descargar adjunto
' + - 'extracto.pdf
'; - } -}; diff --git a/services/mailer/application/template/letter-debtor-nd/locale/es.json b/services/mailer/application/template/letter-debtor-nd/locale/es.json deleted file mode 100644 index 1f8790eba..000000000 --- a/services/mailer/application/template/letter-debtor-nd/locale/es.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "subject": "Reiteración de aviso por saldo deudor", - "title": "AVISO REITERADO", - "dear": "Estimado cliente,", - "bodyDescription": "Nos dirigimos a Vd. nuevamente para informarle que sigue pendiente su deuda con nuestra empresa, tal y como puede comprobar en el extracto adjunto.", - "termLimits": "Dado que los plazos de pago acordados están ampliamente superados, no procede mayor dilación en la liquidación del importe adeudado.", - "payMethod": "Para ello dispone de las siguientes formas de pago:", - "payMethodOption1": "Pago online desde nuestra web", - "payMethodOption2": "Ingreso o transferencia al número de cuenta que detallamos al pie de esta carta, indicando el número de cliente.", - "legalActions": "En caso de no ser atendido este apremio de pago, nos veremos obligados a iniciar las acciones legales que procedan, entre las que están:", - "legalActionsOption1": "Inclusión en ficheros negativos sobre solvencia patrimonial y crédito.", - "legalActionsOption2": "Reclamación judicial", - "legalActionsOption3": "Cesión de deuda a una empresa de gestión de cobro", - "contact": "Para consultas, puede ponerse en contacto con nosotros en el 96 324 21 00.", - "waitingForNews": "En espera de sus noticias", - "conclusion": "Gracias por su atención.", - "accountTransferData": "Datos para transferencia bancaria" -} \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-nd/style.css b/services/mailer/application/template/letter-debtor-nd/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/template/letter-debtor-st/attachment.json b/services/mailer/application/template/letter-debtor-st/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/letter-debtor-st/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-st/index.html b/services/mailer/application/template/letter-debtor-st/index.html deleted file mode 100644 index a3b07e677..000000000 --- a/services/mailer/application/template/letter-debtor-st/index.html +++ /dev/null @@ -1,69 +0,0 @@ - - - - {{_.subject}} - - - -
-
- - {{$.header}} - - - -
-

{{_.title}}

-
- - - -
-

{{_.dear}}

- -

{{_.bodyDescription}}

-

{{_.viewExtract}}

-

{{_.validData}}

-

{{_.payMethod}}

-

{{_.conclusion}}

- -

-

-
{{bankName}}
-
{{iban}}
-
-
{{_.accountTransferData}}
-
-
-

- - {{#isPreview}} - -
-
- Ver adjunto -
- Ver adjunto -
-
- - -
-
- Descargar adjunto -
- Descargar PDF -
-
- {{/isPreview}} -
- - - - - {{$.footer}} - -
-
- - \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-st/letter-debtor-st.js b/services/mailer/application/template/letter-debtor-st/letter-debtor-st.js deleted file mode 100644 index 43ccb7a25..000000000 --- a/services/mailer/application/template/letter-debtor-st/letter-debtor-st.js +++ /dev/null @@ -1,39 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class LetterDebtorSt { - getData(params, cb) { - let query = `SELECT - sa.iban, - be.name AS bankName, - LOWER(ct.code) countryCode, - c.email recipient - FROM client c - JOIN company AS cny - JOIN supplierAccount AS sa ON sa.id = cny.supplierAccountFk - JOIN bankEntity be ON be.id = sa.bankEntityFk - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ? AND cny.id = ?`; - - this.clientId = params.clientId; - this.companyId = params.companyId; - this.token = params.token; - - database.pool.query(query, [params.clientId, params.companyId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - - cb(); - }); - } - - get previewAttachments() { - if (this.isPreview) - return `` + - '
Descargar adjunto
' + - 'extracto.pdf
'; - } -}; diff --git a/services/mailer/application/template/letter-debtor-st/locale/es.json b/services/mailer/application/template/letter-debtor-st/locale/es.json deleted file mode 100644 index 558b18753..000000000 --- a/services/mailer/application/template/letter-debtor-st/locale/es.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "subject": "Aviso inicial por saldo deudor", - "title": "AVISO INICIAL", - "dear": "Estimado cliente,", - "bodyDescription": "Por el presente escrito le comunicamos que, según nuestros datos contables, su cuenta tiene un saldo pendiente de liquidar.", - "viewExtract": "Le solicitamos compruebe que el extracto adjunto corresponde con los datos de que Vd. dispone. Nuestro departamento de administración le aclarará gustosamente cualquier duda que pueda tener, e igualmente le facilitará cualquier documento que solicite.", - "validData": "Si al comprobar los datos aportados resultaran correctos, le rogamos proceda a regularizar su situación.", - "payMethod": "Si no desea desplazarse personalmente hasta nuestras oficinas, puede realizar el pago mediante transferencia bancaria a la cuenta que figura al pie del comunicado, indicando su número de cliente, o bien puede realizar el pago online desde nuestra página web.", - "conclusion": "De antemano le agradecemos su amable colaboración.", - "accountTransferData": "Datos para transferencia bancaria" -} \ No newline at end of file diff --git a/services/mailer/application/template/letter-debtor-st/style.css b/services/mailer/application/template/letter-debtor-st/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/template/notification-alias/attachment.json b/services/mailer/application/template/notification-alias/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/notification-alias/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/notification-alias/index.html b/services/mailer/application/template/notification-alias/index.html deleted file mode 100644 index 6e79e1278..000000000 --- a/services/mailer/application/template/notification-alias/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - {{_.subject}} - - - -
-
- - {{$.header}} - - - -
-

{{_.title}}

-
- - - -
-

{{_.hello}} #{{alias}}

-

{{message}}

-
- - - - {{$.footer}} - -
-
- - \ No newline at end of file diff --git a/services/mailer/application/template/notification-alias/locale/es.json b/services/mailer/application/template/notification-alias/locale/es.json deleted file mode 100644 index 6e39b7f63..000000000 --- a/services/mailer/application/template/notification-alias/locale/es.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "subject": "Has recibido una nueva notificación", - "title": "Nueva notificación", - "hello": "Hola,", - "notificationCode": { - "clientDeactivate": { - "subject": "Gestionar baja de contrato", - "message": "El cliente con id %clientId% está clasificado, por favor, gestione la baja del contrato primero." - } - } -} \ No newline at end of file diff --git a/services/mailer/application/template/notification-alias/notification-alias.js b/services/mailer/application/template/notification-alias/notification-alias.js deleted file mode 100644 index 937e1bf8c..000000000 --- a/services/mailer/application/template/notification-alias/notification-alias.js +++ /dev/null @@ -1,29 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var locale = require(path.join(__dirname, '../../locale.js')); - -module.exports = class NotificationAlias { - getData(params, cb) { - this.params = params; - - let query = `SELECT alias, CONCAT(alias, '@verdnatura.es') AS recipient - FROM account.mailAlias - WHERE alias = ?`; - - database.pool.query(query, [params.alias], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - }); - } - - get subject() { - return this._.notificationCode[this.params.code].subject; - } - - get message() { - return locale.parseText(this._.notificationCode[this.params.code].message, this.params.bodyParams); - } -}; diff --git a/services/mailer/application/template/notification-alias/style.css b/services/mailer/application/template/notification-alias/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/template/notification-notice/attachment.json b/services/mailer/application/template/notification-notice/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/notification-notice/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/notification-notice/index.html b/services/mailer/application/template/notification-notice/index.html deleted file mode 100644 index c1e206078..000000000 --- a/services/mailer/application/template/notification-notice/index.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - {{_.subject}} - - - -
- -
- VerdNatura -
- - - -
-

{{_.title}}

-
- - - -
-

Hola, {{recipientName}}

-

{{_.bodyDescription}} {{senderName}}:

-

"{{message}}"

-

{{_.noticeDescription}} '{{categoryName}}'. {{_.unsubscribe}}

-
- - - - - - - - - - - -
-

{{_.fiscalAddress}}

-

{{_.privacy}}

-

{{_.privacyLaw}}

-
- -
- - \ No newline at end of file diff --git a/services/mailer/application/template/notification-notice/locale/es.json b/services/mailer/application/template/notification-notice/locale/es.json deleted file mode 100644 index 21cab5f37..000000000 --- a/services/mailer/application/template/notification-notice/locale/es.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "subject": "Has recibido una nueva notificación", - "title": "Nueva notificación", - "hello": "Hola", - "bodyDescription": "Has recibido la siguiente notificación de", - "noticeDescription": "Recibes esta notificación porque estás suscrito a", - "unsubscribe": "Puedes dejar de recibir estas notificaciones desde 'Notificaciones > Configuración' en cualquier aplicación de VerdNatura.", - "actionButton": "Visita nuestra Web", - "infoButton": "Ayúdanos a mejorar", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla _ www.verdnatura.es _ clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/mailer/application/template/notification-notice/notification-notice.js b/services/mailer/application/template/notification-notice/notification-notice.js deleted file mode 100644 index 493261913..000000000 --- a/services/mailer/application/template/notification-notice/notification-notice.js +++ /dev/null @@ -1,28 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); - -module.exports = class NotificationNotice { - getData(params, cb) { - let query = `SELECT - LOWER(ct.code) countryCode, - c.email recipient, - nc.name categoryName, - recipient.name recipientName, - sender.name senderName - FROM client c - JOIN account.user recipient ON recipient.id = c.id - JOIN country ct ON ct.id = c.countryFk - JOIN noticeCategory nc ON nc.keyName = ? - JOIN account.user sender ON sender.id = ? - WHERE c.id = ?`; - database.pool.query(query, [params.category, params.sender, params.recipient], (error, result) => { - if (error || result.length == 0) - return cb({status: 'REJECT', data: {message: 'No data found', error: error}}); - - Object.assign(this, result[0]); - this.message = params.message; - - cb({status: 'ACCEPT', data: {}}); - }); - } -}; diff --git a/services/mailer/application/template/payment-update/attachment.json b/services/mailer/application/template/payment-update/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/payment-update/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/payment-update/index.html b/services/mailer/application/template/payment-update/index.html deleted file mode 100644 index 78d6612c4..000000000 --- a/services/mailer/application/template/payment-update/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - {{_.subject}} - - - -
-
- - {{$.header}} - - - -
-

{{_.title}}

-
- - - -
-

{{_.dear}}

-

{{_.bodyDescription}}

-

-

{{_.paymentMethod}} {{payMethodName}}
- {{{paymentDay}}} -

-

{{paymentAdvice}}

-

{{_.notifyError}}

-
- - - - {{$.footer}} - -
-
- - \ No newline at end of file diff --git a/services/mailer/application/template/payment-update/locale/es.json b/services/mailer/application/template/payment-update/locale/es.json deleted file mode 100644 index 1216dcd99..000000000 --- a/services/mailer/application/template/payment-update/locale/es.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "subject": "Cambios en las condiciones de pago", - "title": "Cambio en las condiciones", - "dear": "Estimado cliente,", - "bodyDescription": "Le informamos que han cambiado las condiciones de pago de su cuenta. A continuación le indicamos las nuevas condiciones:", - "paymentMethod": "Método de pago:", - "paymentDay": "Día de pago:", - "everyMonth": "de cada mes", - "cardPaymentAdvice": "Su modo de pago actual implica que deberá abonar el importe de los pedidos realizados en el mismo día para que se puedan enviar.", - "accountPaymentAdviceBefore": "Su modo de pago actual implica que se le pasará un cargo a la cuenta", - "accountPaymentAdviceAfter": "por el importe pendiente, al vencimiento establecido en las condiciones.", - "notifyError": "En el caso de detectar algún error en los datos indicados o para cualquier aclaración, debe dirigirse a su comercial." -} \ No newline at end of file diff --git a/services/mailer/application/template/payment-update/locale/fr.json b/services/mailer/application/template/payment-update/locale/fr.json deleted file mode 100644 index c8780141b..000000000 --- a/services/mailer/application/template/payment-update/locale/fr.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "subject": "Changement des C.G.V", - "title": "Changement des C.G.V", - "dear": "Chèr client,", - "bodyDescription": "Nous vous informons que les conditions de paiement ont changé. Voici les nouvelles conditions:", - "paymentMethod": "Méthode de paiement:", - "paymentDay": "Date paiement:", - "everyMonth": "de chaque mois", - "cardPaymentAdvice": "Avec votre mode de règlement vous devrez payer le montant des commandes avant son départ.", - "accountPaymentAdviceBefore": "Avec ce mode de règlement nous vous passerons un prélèvement automatique sur votre compte bancaire", - "accountPaymentAdviceAfter": "pour le montant dû, au date à terme établi en nos conditions.", - "notifyError": "Pour tout renseignement contactez votre commercial.." -} \ No newline at end of file diff --git a/services/mailer/application/template/payment-update/payment-update.js b/services/mailer/application/template/payment-update/payment-update.js deleted file mode 100644 index 9d75f20b3..000000000 --- a/services/mailer/application/template/payment-update/payment-update.js +++ /dev/null @@ -1,43 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class PaymentUpdate { - getData(params, cb) { - let query = `SELECT - pm.id payMethodFk, - pm.name payMethodName, - c.dueDay, - c.iban, - LOWER(ct.code) countryCode, - c.email recipient - FROM client c - JOIN payMethod pm ON pm.id = c.payMethodFk - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - - this.clientId = params.clientId; - - database.pool.query(query, [params.clientId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - }); - } - - get paymentDay() { - if (this.payMethodFk != 5) - return `
${this._.paymentDay} ${this.dueDay} ${this._.everyMonth}
`; - } - - get paymentAdvice() { - switch (this.payMethodFk) { - case 4: - return `${this._.accountPaymentAdviceBefore} ${format.partialAccountAddress(this.iban)} ${this._.accountPaymentAdviceAfter}`; - case 5: - return this._.cardPaymentAdvice; - } - } -}; diff --git a/services/mailer/application/template/payment-update/style.css b/services/mailer/application/template/payment-update/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/template/printer-setup/attachment.json b/services/mailer/application/template/printer-setup/attachment.json deleted file mode 100644 index 7294783a8..000000000 --- a/services/mailer/application/template/printer-setup/attachment.json +++ /dev/null @@ -1 +0,0 @@ -["model.ezp"] \ No newline at end of file diff --git a/services/mailer/application/template/printer-setup/attachment/model.ezp b/services/mailer/application/template/printer-setup/attachment/model.ezp deleted file mode 100644 index 297df3d21..000000000 Binary files a/services/mailer/application/template/printer-setup/attachment/model.ezp and /dev/null differ diff --git a/services/mailer/application/template/printer-setup/index.html b/services/mailer/application/template/printer-setup/index.html deleted file mode 100644 index ee021281c..000000000 --- a/services/mailer/application/template/printer-setup/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - {{_.subject}} - - - -
-
- - {{$.header}} - - - -
-

{{_.title}}

-
- - - -
-

{{_.dear}}

-

{{_.bodyDescription}}

-

{{{_.followGuide}}}

-

{{{_.downloadFrom}}}

- -

{{_.sectionQLabelTitle}}

- -

{{_.sectionQLabelDescription}}

- -
    -
  1. {{_.sectionQLabelStep1}}
  2. -
  3. {{_.sectionQLabelStep2}}
  4. -
  5. {{_.sectionQLabelStep3}}
  6. -
  7. {{{_.sectionQLabelStep4}}}
  8. -
  9. {{_.sectionQLabelStep5}}
  10. -
  11. {{_.sectionQLabelStep6}}
  12. -
  13. {{_.sectionQLabelStep7}}
  14. -
  15. {{_.sectionQLabelStep8}}
  16. -
  17. {{{_.sectionQLabelStep9}}}
  18. -
  19. {{_.sectionQLabelStep10}}
  20. -
  21. {{_.sectionQLabelStep11}}
  22. -
  23. {{_.sectionQLabelStep12}}
  24. -
  25. {{_.sectionQLabelStep13}}
  26. -
  27. {{_.sectionQLabelStep14}}
  28. -
  29. {{_.sectionQLabelStep15}}
  30. -
- -

{{_.sectionHelpTitle}}

- -

{{_.sectionHelpDescription}}

-

{{{_.sectionHelpDownloadRemoteSupport}}}

- -

- {{{salesPersonName}}} - {{{salesPersonPhone}}} - {{{salesPersonEmail}}} -

-
- - - - {{$.footer}} - -
-
- - \ No newline at end of file diff --git a/services/mailer/application/template/printer-setup/locale/es.json b/services/mailer/application/template/printer-setup/locale/es.json deleted file mode 100644 index 08c28c113..000000000 --- a/services/mailer/application/template/printer-setup/locale/es.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "subject": "Instalación y configuración de impresora", - "title": "¡GRACIAS POR SU CONFIANZA!", - "dear": "Estimado cliente,", - "bodyDescription": "Siga las intrucciones especificadas en este correo para llevar a cabo la instalación de la impresora.", - "followGuide": "Puede utilizar como guía, el video del montaje del ribon y la cinta https://www.youtube.com/watch?v=qhb0kgQF3o8. También necesitará el QLabel, el programa para imprimir las cintas.", - "downloadFrom": "Puede descargarlo desde este enlace http://ww.godexintl.com/es1/download/downloads/Download/2996", - "sectionQLabelTitle": "Utilización de QLabel", - "sectionQLabelDescription": "Para utilizar el programa de impresión de cintas siga estos pasos:", - "sectionQLabelStep1": "Abra el programa QLabel.", - "sectionQLabelStep2": "Haga clic en el icono de la barra superior superior de la \"carpeta\".", - "sectionQLabelStep3": "Seleccione el archivo plantilla llamado \"model.ezp\".", - "sectionQLabelStep4": "Haga clic encima del texto con el boton secundario del ratón.", - "sectionQLabelStep5": "Elija la primera opcion \"setup\".", - "sectionQLabelStep6": "Cambie el texto para imprimir.", - "sectionQLabelStep7": "Haga clic en el boton \"Ok\".", - "sectionQLabelStep8": "Desplácese con el raton para ver la medida máxima.", - "sectionQLabelStep9": "Haga clic encima del texto con el botón secundario del ratón.", - "sectionQLabelStep10": "Elija la primera opcion \"Setup printer\".", - "sectionQLabelStep11": "Haga clic en la primera pestalla \"Label Setup\".", - "sectionQLabelStep12": "Modifique la propidad \"Paper Height\".", - "sectionQLabelStep13": "Haga clic en el boton \"Ok\".", - "sectionQLabelStep14": "Haga clic sobre el icono de la impresora.", - "sectionQLabelStep15": "Haga clic en \"Print\".", - "sectionHelpTitle": "¿Necesita ayuda?", - "sectionHelpDescription": "Si necesita ayuda, descárguese nuestro programa de soporte para poder conectarnos remotamente a su equipo y hacerle la instalación. Proporciónenos un horario de contacto para atenderle, y contactaremos con usted.", - "sectionHelpDownloadRemoteSupport": "Puede descargarse el programa desde este enlace http://soporte.verdnatura.es.", - "salesPersonNameText": "Soy su comercial y mi nombre es", - "salesPersonPhoneText": "Teléfono y whatsapp", - "salesPersonEmailText": "Dirección de e-mail" -} \ No newline at end of file diff --git a/services/mailer/application/template/printer-setup/printer-setup.js b/services/mailer/application/template/printer-setup/printer-setup.js deleted file mode 100644 index d17add406..000000000 --- a/services/mailer/application/template/printer-setup/printer-setup.js +++ /dev/null @@ -1,46 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class PrinterSetup { - getData(params, cb) { - let query = `SELECT - CONCAT(w.name, ' ', w.firstName) name, - w.phone AS phone, - CONCAT(u.name, '@verdnatura.es') AS email, - LOWER(ct.code) countryCode, - c.email recipient - FROM client c - LEFT JOIN worker w ON w.id = c.salesPersonFk - LEFT JOIN account.user u ON u.id = w.userFk - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - - this.clientId = params.clientId; - this.isPreview = params.isPreview; - - database.pool.query(query, [params.clientId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - }); - } - - get salesPersonName() { - if (this.name) - return `
${this._.salesPersonNameText}: ${this.name}
`; - } - - get salesPersonPhone() { - if (this.phone) - return `
${this._.salesPersonPhoneText}: ${format.phone(this.phone)}
`; - } - - get salesPersonEmail() { - if (this.email) - return `
${this._.salesPersonEmailText}: ` + - `${this.email}
`; - } -}; diff --git a/services/mailer/application/template/printer-setup/style.css b/services/mailer/application/template/printer-setup/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/template/sepa-core/attachment.json b/services/mailer/application/template/sepa-core/attachment.json deleted file mode 100644 index 0637a088a..000000000 --- a/services/mailer/application/template/sepa-core/attachment.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/services/mailer/application/template/sepa-core/index.html b/services/mailer/application/template/sepa-core/index.html deleted file mode 100644 index 1acdae3fc..000000000 --- a/services/mailer/application/template/sepa-core/index.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - {{_.subject}} - - - - - - \ No newline at end of file diff --git a/services/mailer/application/template/sepa-core/locale/es.json b/services/mailer/application/template/sepa-core/locale/es.json deleted file mode 100644 index 48eaadf3a..000000000 --- a/services/mailer/application/template/sepa-core/locale/es.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "subject": "Solicitud de domiciliación bancaria", - "title": "CAMBIOS EN SU FORMA DE PAGO", - "dear": "Estimado cliente,", - "bodyDescription": "Para poder tramitar su solicitud de cambio de su forma de pago a giro bancario, le adjuntamos los documentos correspondientes a la Ley de Pago, que tiene que cumplimentar y enviarnos.", - "conclusion": "Gracias por su atención." -} \ No newline at end of file diff --git a/services/mailer/application/template/sepa-core/sepa-core.js b/services/mailer/application/template/sepa-core/sepa-core.js deleted file mode 100644 index ec19dd29b..000000000 --- a/services/mailer/application/template/sepa-core/sepa-core.js +++ /dev/null @@ -1,32 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class SepaCore { - getData(params, cb) { - let query = `SELECT - CONCAT(w.name, ' ', w.firstName) name, - w.phone AS phone, - CONCAT(u.name, '@verdnatura.es') AS email, - LOWER(ct.code) countryCode, - c.email recipient - FROM client c - LEFT JOIN worker w ON w.id = c.salesPersonFk - LEFT JOIN account.user u ON u.id = w.userFk - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - - this.clientId = params.clientId; - this.companyId = params.companyId; - this.token = params.token; - - database.pool.query(query, [params.clientId], (error, result) => { - if (error || result.length == 0) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - - cb(); - }); - } -}; diff --git a/services/mailer/application/template/sepa-core/style.css b/services/mailer/application/template/sepa-core/style.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/services/mailer/application/util/format.js b/services/mailer/application/util/format.js deleted file mode 100644 index 52e997a72..000000000 --- a/services/mailer/application/util/format.js +++ /dev/null @@ -1,41 +0,0 @@ -let database = require('../database.js'); - -module.exports = { - - /** - * Devuelve el iban - * @param {String} addressNumber - Dirección de cuenta bancaria - * @param {Object} cb - Callback - */ - accountAddressIban: function(addressNumber, cb) { - database.pool.query('SELECT vn2008.cc_to_iban(?) AS iban', [addressNumber], function(error, result) { - cb(result[0].iban); - }); - }, - - /** - * Obtiene el numero de cuenta completo incluyendo iban - * @param {String} addressNumber - Dirección de cuenta bancaria - * @return {String} Cuenta bancaria formateada - */ - accountAddress: function(addressNumber) { - if (!addressNumber) return; - var formattedAccountAddress = addressNumber.replace(/(.{4})/g, '$1-'); - return formattedAccountAddress.substring(0, formattedAccountAddress.length - 1); - }, - - /** - * Devuelve el numero de cuenta mostrando únicamente los últimos 4 dígitos. - * @param {String} addressNumber - Dirección de cuenta bancaria - * @return {String} Cuenta bancaria formateada - */ - partialAccountAddress: function(addressNumber) { - if (!addressNumber) return; - let address = this.accountAddress(addressNumber); - return address.substring(0, 19).replace(/[0-9]/g, 'X') + address.substring(19, 24); - }, - - phone: function(number) { - return number; - } -}; diff --git a/services/mailer/application/util/system.js b/services/mailer/application/util/system.js deleted file mode 100644 index 358346184..000000000 --- a/services/mailer/application/util/system.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - /** - * Obtiene las variables de entorno - * @param {String} env - Nombre de la variable de entorno - * @return {String} Valor de la variable de entorno - */ - getEnv: function(env) { - return process.env[env]; - } -}; diff --git a/services/mailer/package.json b/services/mailer/package.json deleted file mode 100644 index 17bd23567..000000000 --- a/services/mailer/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "vn-mailer", - "version": "0.0.1", - "description": "Servidor de envío de correos", - "main": "server/server.js", - "dependencies": { - "body-parser": "^1.17.2", - "express": "^4.15.3", - "inline-css": "^2.2.2", - "mustache": "^2.3.0", - "mysql": "^2.13.0", - "nodemailer": "^4.0.1", - "path": "^0.12.7", - "request": "^2.83.0", - "require-yaml": "0.0.1", - "fs-extra": "^5.0.0" - }, - "repository": { - "type": "git", - "url": "https://git.verdnatura.es/salix" - }, - "license": "GPL-3.0" -} diff --git a/services/mailer/server/server.js b/services/mailer/server/server.js deleted file mode 100644 index 27f189211..000000000 --- a/services/mailer/server/server.js +++ /dev/null @@ -1,35 +0,0 @@ -var express = require('express'); -var app = module.exports = express(); -var bodyParser = require('body-parser'); -var config = require('../application/config.js'); -var mail = require('../application/mail.js'); -var database = require('../application/database.js'); -var path = require('path'); - -// Body parser middleware -app.use(bodyParser.json()); -app.use(bodyParser.urlencoded({extended: true})); - -app.use('/static', express.static(path.join(__dirname, '../static'))); - -// Load routes -app.use('/', require('../application/router.js')); - -app.start = function(port) { - var listener = app.listen(port ? port : config.app.port, function() { - var servicePath = 'http://' + listener.address().address + ':' + listener.address().port; - mail.init(); - database.init(); - - if (config.app.debug) { - let packageJson = require('../package.json'); - console.log(`Web server ${packageJson.name} listening at: ${servicePath}`); - console.log(`${packageJson.name} service debug mode enabled`); - } - }); - return listener; -}; - -if (require.main === module) { - app.start(); -} diff --git a/services/mailer/static/css/component.css b/services/mailer/static/css/component.css deleted file mode 100644 index 2621048c3..000000000 --- a/services/mailer/static/css/component.css +++ /dev/null @@ -1,217 +0,0 @@ -body { - padding: 0; - margin: 0 -} - -img { - margin: 0 -} - -.wrapper { - background-color: #EEE -} - -.container { - font-family: arial, sans-serif; - max-width: 600px; - min-width: 320px; - font-size: 16px; - margin: 0 auto; - color: #555 -} - -.title { - background-color: #95d831; - text-align: center; - padding: 35px 0 -} - -.title h1 { - font-size: 32px; - color: #333; - margin: 0 -} - -.body { - background-color:#FFF; - padding: 20px -} - -.body a { - color: #8dba25 -} - -.body h1 { - color: #999 -} - -.body h3 { - font-size: 16px -} - -.panel { - border: 1px solid #DDD; - margin-bottom: 10px; - position: relative; - padding:10px -} - -.row { - margin-bottom: 15px; - overflow: hidden -} - -.row .text { - margin-bottom: 5px -} - -.row .control { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box -} - -.row .text, .row .control { - overflow: hidden -} - -.row .description { - position: relative; - padding-top: 2px; - overflow: hidden; - font-size: 11px; - display: block; - color: #999 -} - -.row .line { - border-bottom: 1px solid #DDD; - border-right: 1px solid #DDD; - border-left: 1px solid #DDD; - margin-top: 10px; - color: #999; - padding: 5px -} - -.row .description span { - background-color: #FFF; - margin: -5px 0 0 50px; - display: block; - padding: 5px; - float: left -} - -.row:last-child { - margin-bottom: 0 -} - -.row.inline .text { - margin-bottom: 0; - width: 40%; - float: left -} - -.row.inline .control { - font-weight: bold; - padding-left: 20px; - color: #000; - width: 60%; - float: left -} - -.row.inline .description { - position: static; - overflow: visible -} - -.box { - border-top: 1px solid #CCC; - border-right: 1px solid #CCC; - border-bottom: 1px solid #CCC; - font-weight: bold; - text-align: center; - padding-top: 4px; - width: 25px; - height: 21px; - color: #000; - float: left -} - -.box.crossed { - font-weight: 100; - font-size: 16px -} - -.row .control .box:first-child { - border-left: 1px solid #CCC; -} - -.font.small { - font-size: 10px -} - -.font.verticalAlign { - height: 27px; - line-height: 27px -} - -.font.centered { - height: 27px; - line-height: 27px; - text-align: center -} - -.verticalText { - -moz-transform: rotate(90deg); - -webkit-transform: rotate(90deg); - transform: rotate(90deg); - position: absolute; - text-align: center; - font-size: .65em; - width: 200px; - right: -115px; - top: 50% -} - -.attachment { - overflow: hidden; - margin-top: 10px -} - -.attachment-icon { - float: left -} - -.attachment span { - padding: 16px 0 0 10px; - float: left -} - -.columns { - overflow: hidden -} - -.columns .size100 { - width: 100%; - float: left -} - -.columns .size75 { - width: 75%; - float: left -} - -.columns .size50 { - width: 50%; - float: left -} - -.columns .size33 { - width: 33.33%; - float: left -} - -.columns .size25 { - width: 25%; - float: left -} \ No newline at end of file diff --git a/services/nginx/nginx.development.mst b/services/nginx/nginx.development.mst index 55adc8645..0fc3dbd1c 100644 --- a/services/nginx/nginx.development.mst +++ b/services/nginx/nginx.development.mst @@ -31,9 +31,6 @@ http { } {{/services}} - location ~ ^/mailer(?:/(.*)?)$ { - proxy_pass http://127.0.0.1:{{defaultPort}}/$1$is_args$args; - } location ~ ^/static(?:/(.*)?)$ { proxy_pass http://127.0.0.1:{{devServerPort}}/$1$is_args$args; } diff --git a/services/nginx/nginx.mst b/services/nginx/nginx.mst index ef57f0afc..39d72115d 100644 --- a/services/nginx/nginx.mst +++ b/services/nginx/nginx.mst @@ -14,10 +14,6 @@ server { } {{/services}} - location ~ ^/mailer(?:/(.*))?$ { - resolver 127.0.0.11; - proxy_pass http://mailer:{{defaultPort}}/$1$is_args$args; - } location ~ ^/static(?:/(.*))?$ { alias /salix/dist/$1; autoindex on; diff --git a/services/print/.gitignore b/services/print/.gitignore deleted file mode 100644 index 3c3629e64..000000000 --- a/services/print/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/services/print/Dockerfile b/services/print/Dockerfile deleted file mode 100644 index 79ec29c2f..000000000 --- a/services/print/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM vn-loopback:latest - -COPY print /app -WORKDIR /app -CMD ["pm2-docker", "./server/server.js"] diff --git a/services/print/application/auth.js b/services/print/application/auth.js deleted file mode 100644 index b314397ad..000000000 --- a/services/print/application/auth.js +++ /dev/null @@ -1,80 +0,0 @@ -var database = require('./database.js'); -let config = require('./config.js'); - -module.exports = { - -/** - * Initialize auth - * @param {Object} request - Request object - * @param {Object} response - Response object - * @param {Object} next - Next object - */ - init: function(request, response, next) { - this.request = request; - this.response = response; - this.next = next; - - this.validateToken(); - }, - -/** - * Validate auth token - */ - validateToken: async function() { - let query = 'SELECT userId, ttl, created FROM salix.AccessToken WHERE id = ?'; - - try { - let [result] = await database.pool.query(query, [this.getToken()]); - let token = result[0]; - - if (result.length == 0) - throw new Error('Invalid token'); - - if (this.isTokenExpired(token.created, token.ttl)) - throw new Error('Token expired'); - - // Set proxy host - let proxy = config.proxy; - - if (!proxy) - proxy = { - host: 'localhost', - port: 80 - }; - - this.request.proxyHost = `http://${proxy.host}:${proxy.port}`; - this.request.user = { - id: token.userId, - token: this.getToken() - }; - this.next(); - } catch (e) { - this.response.status(401).send({message: e.message}); - this.next(e); - } - }, - -/** - * Get request token - * @return {String} Token - */ - getToken: function() { - return this.request.headers.authorization || this.request.query.token; - }, - -/** - * Checks if the token has expired - * @param {String} created - Creation date - * @param {Integer} ttl - Ttl seconds - * @return {Boolean} True if the token has expired - */ - isTokenExpired: function(created, ttl) { - let date = new Date(created); - let currentDate = new Date(); - - date.setSeconds(date.getSeconds() + ttl); - - if (currentDate > date) - return true; - } -}; \ No newline at end of file diff --git a/services/print/application/config.js b/services/print/application/config.js deleted file mode 100644 index e1b9eb8d0..000000000 --- a/services/print/application/config.js +++ /dev/null @@ -1,30 +0,0 @@ -require('require-yaml'); -const fs = require('fs-extra'); -const package = require('../package.json'); -let configPath = `/config/${package.name}`; -let nginxConfigPath = '/config/nginx'; - -let env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development'; - -if (env === 'development') { - configPath = `${__dirname}/config`; - nginxConfigPath = '../../nginx'; -} - -let config = require(`${configPath}/datasources.json`); -let configEnvFile = `${configPath}/datasources.${env}.json`; - -if (fs.existsSync(configEnvFile)) - Object.assign(config, require(configEnvFile)); - -let proxyConf = require(`${nginxConfigPath}/config.yml`); -let proxyEnvFile = `${nginxConfigPath}/config.${env}.yml`; - -if (fs.existsSync(proxyEnvFile)) - Object.assign(proxyConf, require(proxyEnvFile)); - -config.proxy = proxyConf; -config.package = package; -config.env = env; - -module.exports = config; \ No newline at end of file diff --git a/services/print/application/config/datasources.json b/services/print/application/config/datasources.json deleted file mode 100644 index 8f8a4228e..000000000 --- a/services/print/application/config/datasources.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": { - "port": 3000, - "debug": false, - "defaultLanguage": "es" - }, - "mysql": { - "host": "localhost", - "port": 3306, - "database": "vn", - "user": "root", - "password": "root" - }, - "pdf": { - "format": "A4", - "border": "1.5cm" - } -} \ No newline at end of file diff --git a/services/print/application/database.js b/services/print/application/database.js deleted file mode 100644 index a27fbab55..000000000 --- a/services/print/application/database.js +++ /dev/null @@ -1,16 +0,0 @@ -var mysql = require('mysql2/promise'); -let config = require('./config.js'); - -module.exports = { - /** - * Pool instance - */ - pool: null, - - /** - * Start database pool - */ - init: function() { - this.pool = mysql.createPool(config.mysql); - } -}; \ No newline at end of file diff --git a/services/print/application/locale.js b/services/print/application/locale.js deleted file mode 100644 index f9737fea3..000000000 --- a/services/print/application/locale.js +++ /dev/null @@ -1,42 +0,0 @@ -var fs = require('fs'); -var config = require('./config.js'); -var path = require('path'); - -module.exports = { -/** - * Returns template locale - * @param {String} template - Template name - * @param {String} countryCode - Language code - * @param {Object} cb - Callback - */ - load: function(template, countryCode, cb) { - var localeFile = path.join(__dirname, 'template', `${template}`, 'locale', `${countryCode}.json`); - var defaultLocaleFile = path.join(__dirname, 'template', `${template}`, 'locale', `${config.app.defaultLanguage}.json`); - - fs.stat(localeFile, (error, stats) => { - if (error) { - fs.stat(defaultLocaleFile, (error, stats) => { - if (error) - return cb(new Error('Translation not found for template ' + template)); - - cb(null, {locale: require(defaultLocaleFile)}); - }); - } else { - cb(null, {locale: require(localeFile)}); - } - }); - }, - -/** - * Parse locale text - * @param {String} text - Locale text - * @param {Object} params - Locale params - * @return {String} - Returns parsed text - */ - parseText: function(text, params) { - for (var key in params) { - text = text.replace(`%${key}%`, params[key]); - } - return text; - } -}; diff --git a/services/print/application/route/manuscript.js b/services/print/application/route/manuscript.js deleted file mode 100644 index 1facac2be..000000000 --- a/services/print/application/route/manuscript.js +++ /dev/null @@ -1,171 +0,0 @@ -var express = require('express'); -var router = new express.Router(); -var template = require('../template.js'); -var config = require('../config.js'); -var pdf = require('html-pdf'); -var path = require('path'); -var auth = require('../auth.js'); - -// Auth middleware -var requestToken = function(request, response, next) { - auth.init(request, response, next); -}; - -// Sepa core -router.get('/sepa-core/:companyId/:clientId', requestToken, function(request, response, next) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId - }; - - template.get('sepa-core', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - pdf.create(result.body, config.pdf).toStream(function(error, stream) { - if (error) - throw Error(error); - - response.setHeader('Content-Disposition', 'attachment; filename="sepa-core.pdf"'); - response.setHeader('Content-type', 'application/pdf'); - stream.pipe(response); - }); - }); -}); - -// Sepa core html preview -router.get('/sepa-core/:companyId/:clientId/preview', requestToken, function(request, response, next) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId, - isPreview: true - }; - - template.get('sepa-core', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - - // Debtor letter -router.get('/letter-debtor/:companyId/:clientId', requestToken, function(request, response, next) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId - }; - - template.get('letter-debtor', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - pdf.create(result.body, config.pdf).toStream(function(error, stream) { - if (error) - throw Error(error); - - response.setHeader('Content-Disposition', 'attachment; filename="extracto.pdf"'); - response.setHeader('Content-type', 'application/pdf'); - stream.pipe(response); - }); - }); -}); - - // Debtor letter html preview -router.get('/letter-debtor/:companyId/:clientId/preview', requestToken, function(request, response, next) { - let params = { - clientId: request.params.clientId, - companyId: request.params.companyId, - isPreview: true - }; - - template.get('letter-debtor', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - response.send(result.body); - }); -}); - - // Delivery note -router.get('/delivery-note/:ticketId/preview', requestToken, function(request, response) { - let params = { - ticketId: request.params.ticketId, - isPreview: true - }; - - template.get('delivery-note', params, (error, result) => { - if (error) - return response.status(400).json(error); - - response.send(result.body); - }); -}); - -router.get('/delivery-note/:ticketId', requestToken, function(request, response, next) { - let params = { - ticketId: request.params.ticketId - }; - - template.get('delivery-note', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - pdf.create(result.body, config.pdf).toStream(function(error, stream) { - if (error) - throw Error(error); - - stream.pipe(response); - }); - }); -}); - -router.get('/claim-pickup/:claimId/preview', requestToken, function(request, response) { - let params = { - claimId: request.params.claimId, - isPreview: true - }; - - template.get('claim-pickup', params, (error, result) => { - if (error) - return response.status(400).json(error); - - response.send(result.body); - }); -}); - -router.get('/claim-pickup/:claimId', requestToken, function(request, response) { - let params = { - claimId: request.params.claimId - }; - - template.get('claim-pickup', params, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - pdf.create(result.body, config.pdf).toStream(function(error, stream) { - if (error) - throw Error(error); - stream.pipe(response); - }); - }); -}); - -module.exports = router; - - // store pdf -/* router.post('/sepa-core/:clientId', function(request, response, next) { - template.get('sepa-core', {recipient: request.params.clientId}, (error, result) => { - if (error) - return response.status(400).json({message: error.message}); - - pdf.create(result.body).toFile('./tmp/test.pdf', function(error, result) { - if (error) - return response.status(400).json({message: error}); - - console.log(result); - return response.json(); - }); - }); - }); - */ diff --git a/services/print/application/router.js b/services/print/application/router.js deleted file mode 100644 index a9ebe1acf..000000000 --- a/services/print/application/router.js +++ /dev/null @@ -1,31 +0,0 @@ -var express = require('express'); -var router = new express.Router(); -var fs = require('fs'); -var path = require('path'); - -// Default page -router.get('/', function(request, response) { - response.json({}); -}); - -// Manuscripts -router.use('/manuscript', require('./route/manuscript.js')); - -// Serve static images -router.use('/static/:template/:image', function(request, response) { - let imagePath = path.join(__dirname, '/template/', request.params.template, '/image/', request.params.image); - - fs.stat(imagePath, function(error) { - if (error) - return response.json({message: 'Image not found'}); - - let readStream = fs.createReadStream(imagePath); - - readStream.on('open', function() { - readStream.pipe(response); - }); - }); -}); - - -module.exports = router; diff --git a/services/print/application/template.js b/services/print/application/template.js deleted file mode 100644 index 67ff4af9b..000000000 --- a/services/print/application/template.js +++ /dev/null @@ -1,256 +0,0 @@ -var fs = require('fs'); -var mustache = require('mustache'); -var locale = require('./locale.js'); -var inlineCss = require('inline-css'); -var path = require('path'); - -module.exports = { - -/** - * Get template. - * @param {String} template - Template name - * @param {Object} countryCode - Language code - * @param {Object} params - Params - * @param {Object} cb - Callback - */ - get: function(template, params, cb) { - var templatePath = path.join(__dirname, 'template', `${template}`, `index.html`); - var classPath = path.join(__dirname, 'template', `${template}`, `${template}.js`); - var stylePath = path.join(__dirname, 'template', `${template}`, 'style.css'); - - fs.stat(templatePath, (error, stat) => { - if (error) - return cb(new Error('Template ' + template + ' not found')); - - let TemplateClass = require(classPath); - let instance = new TemplateClass(); - - let getRenderedStyles = (error, body) => { - if (error) - return cb(error); - - this.renderStyles(stylePath, body, (error, body) => { - if (error) - return cb(error); - - // Check if has a subject param - params.subject = params.subject || instance.subject; - - if (params.subject == undefined) { - // Try to find a subject from Html source - let title = body.match(new RegExp('(.*?)', 'i')); - - if (title) - params.subject = title[1]; - } - - this.renderImages(template, body, params.isPreview, (error, body) => { - if (error) - return cb(error); - - cb(null, {body: body}); - }); - }); - }; - - let getDataCb = () => { - this.render(templatePath, params, instance, (error, result) => getRenderedStyles(error, result)); - }; - - instance.getData(params, (error, result) => { - if (error) - return cb(error); - - locale.load(template, instance.countryCode, (error, result) => { - if (error) - return cb(error); - - instance._ = result.locale; - instance.isPreview = params.isPreview; - getDataCb(null, result); - }); - }); - }); - }, - -/** - * Render template - * @param {String} path - Template path - * @param {Object} data - Params - * @param {Object} cb - Callback - */ - render: function(path, params, data, cb) { - fs.readFile(path, 'utf8', (error, body) => { - // Find matching sub-templates - let regexp = new RegExp(/\{\{\$\.(.*?)\}\}/, 'ig'); - let subTpl = body.match(regexp); - - if (!subTpl) { - mustache.parse(body); - return cb(null, mustache.render(body, data)); - } - - let parentBody = body; - this.renderSub(parentBody, subTpl, data, regexp, (error, body) => { - if (error) - return cb(error); - - mustache.parse(body); - cb(null, mustache.render(body, data)); - }); - }); - }, - - renderSub: function(body, subTpl, params, regexp, cb) { - let index = 1; - - subTpl.forEach(keyName => { - subTplName = keyName.replace(regexp, '$1'); - - this.get(subTplName, params, (error, result) => { - if (error) - return cb(error); - - let subTplBody = result.body; - body = body.replace(keyName, subTplBody); - - if (index === subTpl.length) - cb(null, body); - - index++; - }); - - }); - }, - -/** - * Render template style. - * @param {String} path - Stylesheet path - * @param {String} body - Rendered html - * @param {Object} cb - Callback - */ - renderStyles: function(stylePath, html, cb) { - // Common components - let comPath = path.join(__dirname, '../', 'static', 'css', 'common.css'); - - fs.readFile(comPath, 'utf8', (error, comCss) => { - fs.stat(stylePath, error => { - if (error) - return cb(new Error('Template stylesheet not found')); - - fs.readFile(stylePath, 'utf8', (error, css) => { - let style = ''; - let body = style + html; - let options = {url: ' '}; - - inlineCss(body, options) - .then(function(body) { - cb(null, body); - }); - }); - }); - }); - }, - -/** - * Render template images - * @param {String} template - Template name - * @param {String} body - template body - * @param {Object} cb - Callback - */ - renderImages: function(template, body, isPreview, cb) { - let tplImages = body.match(new RegExp('src="cid:(.*?)"', 'ig')); - - if (!tplImages) - tplImages = {}; - - // Template default attachments - for (var i = 0; i < tplImages.length; i++) { - let src = tplImages[i].replace('src="cid:', '').replace('"', '').split('/'); - let attachmentTpl = src[0]; - let attachment = src[1]; - - if (isPreview) { - let imagePath = `/print/static/${attachmentTpl}/${attachment}`; - body = body.replace(tplImages[i], `src="${imagePath}"`); - } else { - let imagePath = path.join(__dirname, 'template', attachmentTpl, 'image', attachment); - body = body.replace(tplImages[i], `src="file:///${imagePath}"`); - } - } - - cb(null, body); - }, - - /** - * Get template attachments - * @param {String} template - Template name - * @param {String} body - template body - * @param {Object} cb - Callback - */ - getAttachments: function(template, body, isPreview, cb) { - let attachments = []; - let tplAttachments = body.match(new RegExp('src="cid:(.*?)"', 'ig')); - - if (!tplAttachments) - tplAttachments = {}; - - // Template default attachments - for (var i = 0; i < tplAttachments.length; i++) { - let src = tplAttachments[i].replace('src="cid:', '').replace('"', '').split('/'); - let attachmentTpl = src[0]; - let attachment = src[1]; - - if (isPreview) { - let attachmentPath = `/mailer/static/${attachmentTpl}/${attachment}`; - body = body.replace(tplAttachments[i], `src="${attachmentPath}"`); - } else { - let attachmentPath = path.join(__dirname, 'template', `${attachmentTpl}`, 'image', attachment); - let attachmentName = attachmentTpl + '/' + attachment; - attachments.push({filename: attachmentName, path: attachmentPath, cid: attachmentName}); - } - } - - if (isPreview) - return cb(null, {body: body, attachments: attachments}); - - // Template attachment files - let attachmentsPath = path.join(__dirname, 'template', `${template}`, 'attachment.json'); - - fs.stat(attachmentsPath, (error, stats) => { - if (error) - return cb(null, {body: body, attachments: attachments}); - - let attachObj = require(attachmentsPath); - - for (var i = 0; i < attachObj.length; i++) { - let filename = attachObj[i]; - let attachmentPath = path.join(__dirname, 'template', `${template}`, 'attachment', filename); - - attachments.push({filename: filename, path: attachmentPath, cid: filename}); - } - - this.checkAttachments(attachments, error => { - if (error) - return cb(error); - cb(null, {body: body, attachments: attachments}); - }); - }); - }, - -/** -* Check all template attachments -* @param {Object} attachments - Attachments object -* @param {Object} cb - Callback -*/ - checkAttachments: function(attachments, cb) { - for (var i = 0; i < attachments.length; i++) { - var attachment = attachments[i]; - fs.stat(attachment.path, error => { - if (error) - return cb(new Error(`Could not load attachment file ${attachment.path}`)); - }); - } - cb(); - } -}; \ No newline at end of file diff --git a/services/print/application/template/claim-pickup/claim-pickup.js b/services/print/application/template/claim-pickup/claim-pickup.js deleted file mode 100644 index 43641a633..000000000 --- a/services/print/application/template/claim-pickup/claim-pickup.js +++ /dev/null @@ -1,56 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -let strftime = require('strftime'); - -module.exports = class ClaimPickup { - async getData(params, cb) { - let qryData = ` - SELECT - c.id clientId, - cl.id claimId, - LOWER(ct.code) AS countryCode, - c.email AS recipient, - c.socialName, - c.name AS clientName, - c.street, - c.postcode, - c.city, - c.fi, - p.name AS province, - ct.country - FROM claim cl - JOIN client c ON c.id = cl.clientFk - JOIN country ct ON ct.id = c.countryFk - LEFT JOIN province p ON p.id = c.provinceFk - WHERE cl.id = ?`; - - let qryLines = ` - SELECT - s.id, - s.quantity, - s.concept, - cb.quantity claimQuantity - FROM claimBeginning cb - JOIN sale s ON s.id = cb.saleFk - WHERE cb.claimFk = ?`; - - try { - let [data] = await database.pool.query(qryData, [params.claimId]); - - if (!data) - throw new Error('No body data found'); - - let [lines] = await database.pool.query(qryLines, [params.claimId]); - - Object.assign(this, data[0]); - this.lines = lines; - cb(); - } catch (e) { - cb(e); - } - } - - get currentDate() { - return strftime('%d-%m-%Y', new Date()); - } -}; diff --git a/services/print/application/template/claim-pickup/image/action.png b/services/print/application/template/claim-pickup/image/action.png deleted file mode 100644 index 2cd16c453..000000000 Binary files a/services/print/application/template/claim-pickup/image/action.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/facebook.png b/services/print/application/template/claim-pickup/image/facebook.png deleted file mode 100644 index 7ab54c538..000000000 Binary files a/services/print/application/template/claim-pickup/image/facebook.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/header.png b/services/print/application/template/claim-pickup/image/header.png deleted file mode 100644 index 3c063ae44..000000000 Binary files a/services/print/application/template/claim-pickup/image/header.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/info.png b/services/print/application/template/claim-pickup/image/info.png deleted file mode 100644 index fb75cbc4e..000000000 Binary files a/services/print/application/template/claim-pickup/image/info.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/instagram.png b/services/print/application/template/claim-pickup/image/instagram.png deleted file mode 100644 index 66550c4a5..000000000 Binary files a/services/print/application/template/claim-pickup/image/instagram.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/linkedin.png b/services/print/application/template/claim-pickup/image/linkedin.png deleted file mode 100644 index 0d191e5ae..000000000 Binary files a/services/print/application/template/claim-pickup/image/linkedin.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/logo.png b/services/print/application/template/claim-pickup/image/logo.png deleted file mode 100644 index 55e26fec6..000000000 Binary files a/services/print/application/template/claim-pickup/image/logo.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/logo.svg b/services/print/application/template/claim-pickup/image/logo.svg deleted file mode 100644 index 51baf46d3..000000000 --- a/services/print/application/template/claim-pickup/image/logo.svg +++ /dev/null @@ -1,48 +0,0 @@ - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/services/print/application/template/claim-pickup/image/pinterest.png b/services/print/application/template/claim-pickup/image/pinterest.png deleted file mode 100644 index 4d7b28ef8..000000000 Binary files a/services/print/application/template/claim-pickup/image/pinterest.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/twitter.png b/services/print/application/template/claim-pickup/image/twitter.png deleted file mode 100644 index c4a8ab0c1..000000000 Binary files a/services/print/application/template/claim-pickup/image/twitter.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/image/youtube.png b/services/print/application/template/claim-pickup/image/youtube.png deleted file mode 100644 index 11871deb5..000000000 Binary files a/services/print/application/template/claim-pickup/image/youtube.png and /dev/null differ diff --git a/services/print/application/template/claim-pickup/index.html b/services/print/application/template/claim-pickup/index.html deleted file mode 100644 index a242ab5c3..000000000 --- a/services/print/application/template/claim-pickup/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - {{_.subject}} - - - - - {{$.header}} - - - -
-
-
-
-

{{_.title}}

-
-
{{_.claim}}:
-
{{claimId}}
-
-
-
{{_.client}}:
-
{{clientId}}
-
-
-
{{_.date}}:
-
{{currentDate}}
-
-
-
-
-
-
{{_.clientData}}
-

- {{clientName}} -

-
- {{street}} -
-
- {{postcode}}, {{city}} ({{province}}) -
-
- {{country}} -
-
-
-
- -
-
-
{{_.quantity}}
-
{{_.claims}}
-
{{_.reference}}
-
{{_.concept}}
-
- {{#lines}} -
-
{{quantity}} 
-
{{claimQuantity}} 
-
{{id}} 
-
{{concept}} 
-
- {{/lines}} -
-
-
 
-
-
-
-

{{clientName}}

-
-
-
-
 
-
-

- {{_.agencyContact}} -

-

- {{{_.agencyContactData}}} -

-
- - - - {{$.footer}} - - - \ No newline at end of file diff --git a/services/print/application/template/claim-pickup/locale/es.json b/services/print/application/template/claim-pickup/locale/es.json deleted file mode 100644 index 90b124beb..000000000 --- a/services/print/application/template/claim-pickup/locale/es.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "title": "ORD. RECOGIDA", - "claim": "RECLAMACIÓN", - "client": "CLIENTE", - "date": "DATE", - "clientData": "Datos del cliente", - "quantity": "Cantidad", - "claims": "Reclama", - "reference": "Referencia", - "concept": "Concepto", - "agencyContact": "Para agilizar su recogida, por favor, póngase en contacto con la oficina de integrados.", - "agencyContactData": "Tlf: 96 166 77 88 - Ana Gómez (agomezf@integra2.es)", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/print/application/template/claim-pickup/style.css b/services/print/application/template/claim-pickup/style.css deleted file mode 100644 index 5b1e628d6..000000000 --- a/services/print/application/template/claim-pickup/style.css +++ /dev/null @@ -1,22 +0,0 @@ -img { - margin: 0 -} - -.body { - font-family: arial, sans-serif; - max-width: 90%; - margin: 0 auto; - font-size: 14px; - color: #000 -} - -body .title { - text-align: center; - padding-bottom: 20px -} - -body .title h1 { - font-size: 16px; - color: #333; - margin: 0 -} \ No newline at end of file diff --git a/services/print/application/template/delivery-note/delivery-note.js b/services/print/application/template/delivery-note/delivery-note.js deleted file mode 100644 index 452bf58be..000000000 --- a/services/print/application/template/delivery-note/delivery-note.js +++ /dev/null @@ -1,179 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class DeliveryNote { - async getData(params, cb) { - let qryHead = `SELECT - c.id clientId, - c.name clientName, - c.socialName, - c.street, - c.fi, - c.postcode, - c.city, - p.name province, - ct.country, - a.street, - a.city, - a.postalCode, - t.shipped, - tg.gestdoc_id AS docId, - g.odbc_date AS docDate - FROM ticket t - JOIN client c ON c.id = t.clientFk - JOIN address a ON a.id = t.addressFk - JOIN province p ON p.id = a.provinceFk - JOIN country ct ON ct.id = p.countryFk - LEFT JOIN vn2008.tickets_gestdoc tg ON tg.Id_Ticket = t.id - LEFT JOIN vn2008.gestdoc g ON g.id = tg.gestdoc_id - WHERE t.id = ?`; - - let qryBuys = `SELECT - s.id, - s.itemFk, - s.concept, - s.quantity, - s.price, - s.price - SUM(IF(tcs.tarifa_componentes_series_id = 6, - sc.value, - 0)) netPrice, - s.discount, - i.size, - i.stems, - ic.type taxType, - i.category, - it.id itemTypeId, - o.code AS origin, - i.inkFk, - s.ticketFk, - ita.tag1, - ita.val1, - ita.tag2, - ita.val2, - ita.tag3, - ita.val3 - FROM sale s - LEFT JOIN saleComponent sc ON sc.saleFk = s.id - LEFT JOIN bi.tarifa_componentes tc ON sc.componentFk = tc.Id_Componente - LEFT JOIN bi.tarifa_componentes_series tcs ON tcs.tarifa_componentes_series_id = tc.tarifa_componentes_series_id - LEFT JOIN item i ON i.id = s.itemFk - LEFT JOIN ticket t ON t.id = s.ticketFk - LEFT JOIN origin o ON o.id = i.originFk - INNER JOIN supplier sp ON sp.id = t.companyFk - INNER JOIN itemType it ON it.id = i.typeFk - LEFT JOIN - (SELECT * - FROM - (SELECT tt.countryFk, tcc.taxClassFk, tc.type - FROM taxClassCode tcc - JOIN taxCode tc ON tc.id = tcc.taxCodeFk - JOIN taxType tt ON tt.id = tc.taxTypeFk - WHERE tcc.effectived <= '2018-01-29 13:00:00' - ORDER BY tcc.effectived DESC) tx - GROUP BY tx.countryFk, tx.taxClassFk) ic ON ic.countryFk = sp.countryFk - AND ic.taxClassFk = i.taxClassFk - JOIN vn.itemTagArranged ita ON ita.itemFk = s.itemFk - WHERE s.ticketFk = ? - GROUP BY s.id - ORDER BY (it.isPackaging), s.concept, s.itemFk`; - let qryTax = 'CALL vn.ticketGetTaxAdd(?)'; - let qryPackaging = `SELECT - t.*, i.name, p.itemFk - FROM vn.ticketPackaging t - JOIN vn.packaging p ON p.id = t.packagingFk - JOIN vn.item i ON i.id = p.itemFk - WHERE t.ticketFk = ? - ORDER BY itemFk`; - try { - let [headDetail] = await database.pool.query(qryHead, [params.ticketId]); - Object.assign(this, headDetail[0]); - - if (!headDetail) - throw new Error('No head data found'); - - let bodyDetail = await database.pool.query(qryBuys, [params.ticketId]); - this.buys = bodyDetail[0]; - - if (!bodyDetail) - throw new Error('No body data found'); - - let [ticketTax] = await database.pool.query(qryTax, [params.ticketId]); - this.ticketTax = ticketTax[0]; - - let packaging = await database.pool.query(qryPackaging, [params.ticketId]); - this.packaging = packaging[0]; - - this.ticketId = params.ticketId; - this.shipped = format.date(this.shipped); - this.docDate = format.date(this.docDate, '%d-%m-%Y %T'); - - this.setSubTotal(); - this.formatBuys(); - this.formatPackages(); - this.setTotalTaxes(); - this.setTotal(); - this.formatTaxes(); - cb(); - } catch (e) { - cb(e); - } - } - - get hasPackages() { - if (this.packaging.length) - return true; - } - - setSubTotal() { - this.subTotal = 0.00; - - this.buys.forEach(buy => { - buy.netPrice = buy.quantity * buy.price * (1 - buy.discount / 100); - this.subTotal += buy.netPrice; - }); - } - - formatBuys() { - this.buys.forEach(buy => { - buy.itemFk = format.code(buy.itemFk, '000000'); - buy.quantity = parseInt(buy.quantity); - buy.price = format.currency(buy.price); - buy.discount = format.currency(buy.discount); - buy.netPrice = format.currency(buy.netPrice); - }); - - this.subTotal = format.currency(this.subTotal); - } - - formatPackages() { - this.packaging.forEach(item => { - item.itemFk = format.code(item.itemFk, '000000'); - }); - } - - setTotalTaxes() { - this.totalBase = 0.00; - this.totalTax = 0.00; - - this.ticketTax.forEach(tax => { - this.totalBase += parseFloat(tax.Base); - this.totalTax += parseFloat(tax.tax); - }); - } - - setTotal() { - this.total = format.currency(this.totalBase + this.totalTax); - } - - formatTaxes() { - this.ticketTax.forEach(tax => { - tax.Base = format.currency(tax.Base); - tax.vatPercent = format.percent(tax.vatPercent); - tax.tax = format.currency(tax.tax); - }); - - this.totalBase = format.currency(this.totalBase); - this.totalTax = format.currency(this.totalTax); - } -}; diff --git a/services/print/application/template/delivery-note/image/action.png b/services/print/application/template/delivery-note/image/action.png deleted file mode 100644 index 2cd16c453..000000000 Binary files a/services/print/application/template/delivery-note/image/action.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/facebook.png b/services/print/application/template/delivery-note/image/facebook.png deleted file mode 100644 index 7ab54c538..000000000 Binary files a/services/print/application/template/delivery-note/image/facebook.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/header.png b/services/print/application/template/delivery-note/image/header.png deleted file mode 100644 index 3c063ae44..000000000 Binary files a/services/print/application/template/delivery-note/image/header.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/info.png b/services/print/application/template/delivery-note/image/info.png deleted file mode 100644 index fb75cbc4e..000000000 Binary files a/services/print/application/template/delivery-note/image/info.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/instagram.png b/services/print/application/template/delivery-note/image/instagram.png deleted file mode 100644 index 66550c4a5..000000000 Binary files a/services/print/application/template/delivery-note/image/instagram.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/linkedin.png b/services/print/application/template/delivery-note/image/linkedin.png deleted file mode 100644 index 0d191e5ae..000000000 Binary files a/services/print/application/template/delivery-note/image/linkedin.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/logo.png b/services/print/application/template/delivery-note/image/logo.png deleted file mode 100644 index 55e26fec6..000000000 Binary files a/services/print/application/template/delivery-note/image/logo.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/logo.svg b/services/print/application/template/delivery-note/image/logo.svg deleted file mode 100644 index 51baf46d3..000000000 --- a/services/print/application/template/delivery-note/image/logo.svg +++ /dev/null @@ -1,48 +0,0 @@ - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/services/print/application/template/delivery-note/image/pinterest.png b/services/print/application/template/delivery-note/image/pinterest.png deleted file mode 100644 index 4d7b28ef8..000000000 Binary files a/services/print/application/template/delivery-note/image/pinterest.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/twitter.png b/services/print/application/template/delivery-note/image/twitter.png deleted file mode 100644 index c4a8ab0c1..000000000 Binary files a/services/print/application/template/delivery-note/image/twitter.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/image/youtube.png b/services/print/application/template/delivery-note/image/youtube.png deleted file mode 100644 index 11871deb5..000000000 Binary files a/services/print/application/template/delivery-note/image/youtube.png and /dev/null differ diff --git a/services/print/application/template/delivery-note/index.html b/services/print/application/template/delivery-note/index.html deleted file mode 100644 index 1cdebe8a7..000000000 --- a/services/print/application/template/delivery-note/index.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - {{_.subject}} - - - - - {{$.header}} - - - -
-
-
-
-

ALBARÁN

-
-
CLIENTE:
-
{{clientId}}
-
-
-
ALBARÁN:
-
{{ticketId}}
-
-
-
FECHA:
-
{{shipped}}
-
-
-
-
-
-
Dirección de entrega
-

- {{clientName}} -

-
- {{street}} -
-
- {{postcode}}, {{city}} ({{province}}) -
-
- {{country}} -
-
- -
-
Datos fiscales
-
- {{socialName}} -
-
- {{street}} -
-
- {{fi}} -
-
-
-
- -
-
-
Ref
-
Cant.
-
Concepto
-
PVP/u
-
Dto
-
IVA
-
Importe
-
- {{#buys}} -
-
{{itemFk}}
-
{{quantity}}
-
-
{{concept}}
-
- - {{tag1}} {{val1}} - - {{tag2}} {{val2}} - - {{tag3}} {{val3}} - -
-
-
{{price}}
-
{{discount}}
-
{{taxType}}
-
{{netPrice}}
-
- {{/buys}} -
-
Subtotal {{1+1}}
-
{{subTotal}}
-
-
-
-
- {{#hasPackages}} -

Cajas y cubos

-
-
-
Id
-
Concepto
-
Cantidad
-
- {{#packaging}} -
-
{{itemFk}}
-
{{name}}
-
{{quantity}}
-
- {{/packaging}} -
- {{/hasPackages}} - {{^hasPackages}} {{/hasPackages}} - -
-
Firma digital
- -
{{docDate}}
-
-
-
-

Desglose impositivo

-
-
-
Tipo
-
Base imp.
-
Tasa
-
Cuota
-
- {{#ticketTax}} -
-
{{name}}
-
{{Base}}
-
{{vatPercent}}
-
{{tax}}
-
- {{/ticketTax}} -
-
Subtotal
-
{{totalBase}}
-
{{totalTax}}
-
-
-
Total
-
{{total}}
-
-
-
-
-
- - - - {{$.footer}} - - - \ No newline at end of file diff --git a/services/print/application/template/delivery-note/locale/es.json b/services/print/application/template/delivery-note/locale/es.json deleted file mode 100644 index e5453e858..000000000 --- a/services/print/application/template/delivery-note/locale/es.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "title": "Orden de domiciliación de adeudo directo SEPA CORE", - "toCompleteBySupplier": "A cumplimentar por el acreedor", - "toCompleteByClient": "A cumplimentar por el deudor", - "bodyDescription": "Mediante la firma de esta orden de domiciliación, el deudor autoriza (A) al acreedor a enviar instrucciones a la entidad del deudor para adeudar su cuenta y (B) a la entidad para efectuar los adeudos en su cuenta siguiendo las instrucciones del acreedor.Como parte de sus derechos, el deudor está legitimado al reembolso por su entidad en los términos y condiciones del contrato suscrito con la misma. La solicitud de reembolso deberá efectuarse dentro de las ocho semanas que adeudo en cuenta. Puede obtener información adicional sobre sus derechos en su entidad financiera.", - "orderReference": "Referencia de la orden de domiciliación", - "supplierIdentifier": "Identificador del acreedor", - "supplierName": "Nombre del acreedor", - "supplierStreet": "Dirección", - "supplierLocation": "CP - Población - Provincia", - "supplierCountry": "País", - "clientAdvice": "Debe llevar a su Entidad Bancaria una copia del documento firmado para que lo registre y evitar la devolución.", - "clientName": "Nombre del deudor/es", - "clientStreet": "Dirección del deudor", - "clientLocation": "CP - Población - Provincia", - "clientCountry": "País del deudor", - "swift": "Swift BIC", - "accountNumber": "Número de cuenta - IBAN", - "accountHolder": "(Titular/es de la cuenta de cargo)", - "accountNumberFormat": "En España el IBAN consta de 24 posiciones comenzando siempre por ES", - "paymentType": "Tipo de pago", - "recurrent": "Recurrente", - "unique": "Único", - "signLocation": "Fecha - Localidad", - "sign": "Firma del deudor y sello", - "mandatoryFields": "TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE.", - "sendOrder": "UNA VEZ FIRMADA ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA Y ES RECOMENDABLE FACILITAR UNA COPIA A SU ENTIDAD BANCARIA.", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/print/application/template/delivery-note/style.css b/services/print/application/template/delivery-note/style.css deleted file mode 100644 index 5b1e628d6..000000000 --- a/services/print/application/template/delivery-note/style.css +++ /dev/null @@ -1,22 +0,0 @@ -img { - margin: 0 -} - -.body { - font-family: arial, sans-serif; - max-width: 90%; - margin: 0 auto; - font-size: 14px; - color: #000 -} - -body .title { - text-align: center; - padding-bottom: 20px -} - -body .title h1 { - font-size: 16px; - color: #333; - margin: 0 -} \ No newline at end of file diff --git a/services/print/application/template/footer/footer.js b/services/print/application/template/footer/footer.js deleted file mode 100644 index 412ed7579..000000000 --- a/services/print/application/template/footer/footer.js +++ /dev/null @@ -1,20 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class Footer { - async getData(params, cb) { - let query = `SELECT - socialName - FROM client c - JOIN country ct ON ct.id = c.countryFk - WHERE c.id = ?`; - try { - let [result] = await database.pool.query(query, [params.clientId]); - Object.assign(this, result[0]); - } catch (e) { - return cb(new Error('No template data found')); - } - cb(); - } -}; diff --git a/services/print/application/template/footer/image/action.png b/services/print/application/template/footer/image/action.png deleted file mode 100644 index 2cd16c453..000000000 Binary files a/services/print/application/template/footer/image/action.png and /dev/null differ diff --git a/services/print/application/template/footer/image/facebook.png b/services/print/application/template/footer/image/facebook.png deleted file mode 100644 index 7ab54c538..000000000 Binary files a/services/print/application/template/footer/image/facebook.png and /dev/null differ diff --git a/services/print/application/template/footer/image/info.png b/services/print/application/template/footer/image/info.png deleted file mode 100644 index fb75cbc4e..000000000 Binary files a/services/print/application/template/footer/image/info.png and /dev/null differ diff --git a/services/print/application/template/footer/image/instagram.png b/services/print/application/template/footer/image/instagram.png deleted file mode 100644 index 66550c4a5..000000000 Binary files a/services/print/application/template/footer/image/instagram.png and /dev/null differ diff --git a/services/print/application/template/footer/image/linkedin.png b/services/print/application/template/footer/image/linkedin.png deleted file mode 100644 index 0d191e5ae..000000000 Binary files a/services/print/application/template/footer/image/linkedin.png and /dev/null differ diff --git a/services/print/application/template/footer/image/pinterest.png b/services/print/application/template/footer/image/pinterest.png deleted file mode 100644 index 4d7b28ef8..000000000 Binary files a/services/print/application/template/footer/image/pinterest.png and /dev/null differ diff --git a/services/print/application/template/footer/image/twitter.png b/services/print/application/template/footer/image/twitter.png deleted file mode 100644 index c4a8ab0c1..000000000 Binary files a/services/print/application/template/footer/image/twitter.png and /dev/null differ diff --git a/services/print/application/template/footer/image/youtube.png b/services/print/application/template/footer/image/youtube.png deleted file mode 100644 index 11871deb5..000000000 Binary files a/services/print/application/template/footer/image/youtube.png and /dev/null differ diff --git a/services/print/application/template/footer/index.html b/services/print/application/template/footer/index.html deleted file mode 100644 index 9f45f493c..000000000 --- a/services/print/application/template/footer/index.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -

{{_.phytosanitary}}

- -
\ No newline at end of file diff --git a/services/print/application/template/footer/locale/es.json b/services/print/application/template/footer/locale/es.json deleted file mode 100644 index 04a61fddd..000000000 --- a/services/print/application/template/footer/locale/es.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "phytosanitary": "VERDNATURA LEVANTE SL - Pasaporte Fitosanitario R.P. Generalitat Valenciana - Nº Comerciante: ES17462130", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/print/application/template/footer/style.css b/services/print/application/template/footer/style.css deleted file mode 100644 index ab17d11d1..000000000 --- a/services/print/application/template/footer/style.css +++ /dev/null @@ -1,13 +0,0 @@ -footer, footer p { - text-align: center; - font-size: 12px -} - -footer .page-footer { - border-bottom: 2px solid #CCC; - padding-bottom: 2px -} - - #pageFooter { - zoom: 0.55 -} \ No newline at end of file diff --git a/services/print/application/template/header/header.js b/services/print/application/template/header/header.js deleted file mode 100644 index 7c8d0649c..000000000 --- a/services/print/application/template/header/header.js +++ /dev/null @@ -1,9 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -var format = require(path.join(__dirname, '../../util/format.js')); - -module.exports = class Header { - getData(params, cb) { - cb(); - } -}; diff --git a/services/print/application/template/header/image/logo.png b/services/print/application/template/header/image/logo.png deleted file mode 100644 index 27c560449..000000000 Binary files a/services/print/application/template/header/image/logo.png and /dev/null differ diff --git a/services/print/application/template/header/image/logo.svg b/services/print/application/template/header/image/logo.svg deleted file mode 100644 index 51baf46d3..000000000 --- a/services/print/application/template/header/image/logo.svg +++ /dev/null @@ -1,48 +0,0 @@ - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/services/print/application/template/header/index.html b/services/print/application/template/header/index.html deleted file mode 100644 index 52c09db06..000000000 --- a/services/print/application/template/header/index.html +++ /dev/null @@ -1,5 +0,0 @@ -
- -
{{_.mercantileRegistry}}
-
{{_.fiscalAddress}}
-
\ No newline at end of file diff --git a/services/print/application/template/header/locale/es.json b/services/print/application/template/header/locale/es.json deleted file mode 100644 index 86dbe5e58..000000000 --- a/services/print/application/template/header/locale/es.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "mercantileRegistry": "CIF: B97367486 Registro Mercantil de Valencia, Tomo 8041, Libro 5334, Folio 160, sección 8, Hoja V 102076", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es" -} \ No newline at end of file diff --git a/services/print/application/template/header/style.css b/services/print/application/template/header/style.css deleted file mode 100644 index b82ac9749..000000000 --- a/services/print/application/template/header/style.css +++ /dev/null @@ -1,10 +0,0 @@ -header.report { - border-bottom: 1px solid #DDD; - padding-bottom: 10px; - font-size: 12px; - text-align: center -} - -header #logo { - margin-bottom: 10px -} \ No newline at end of file diff --git a/services/print/application/template/letter-debtor/image/action.png b/services/print/application/template/letter-debtor/image/action.png deleted file mode 100644 index 2cd16c453..000000000 Binary files a/services/print/application/template/letter-debtor/image/action.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/facebook.png b/services/print/application/template/letter-debtor/image/facebook.png deleted file mode 100644 index 7ab54c538..000000000 Binary files a/services/print/application/template/letter-debtor/image/facebook.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/header.png b/services/print/application/template/letter-debtor/image/header.png deleted file mode 100644 index 3c063ae44..000000000 Binary files a/services/print/application/template/letter-debtor/image/header.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/info.png b/services/print/application/template/letter-debtor/image/info.png deleted file mode 100644 index fb75cbc4e..000000000 Binary files a/services/print/application/template/letter-debtor/image/info.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/instagram.png b/services/print/application/template/letter-debtor/image/instagram.png deleted file mode 100644 index 66550c4a5..000000000 Binary files a/services/print/application/template/letter-debtor/image/instagram.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/linkedin.png b/services/print/application/template/letter-debtor/image/linkedin.png deleted file mode 100644 index 0d191e5ae..000000000 Binary files a/services/print/application/template/letter-debtor/image/linkedin.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/logo.png b/services/print/application/template/letter-debtor/image/logo.png deleted file mode 100644 index 55e26fec6..000000000 Binary files a/services/print/application/template/letter-debtor/image/logo.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/logo.svg b/services/print/application/template/letter-debtor/image/logo.svg deleted file mode 100644 index 51baf46d3..000000000 --- a/services/print/application/template/letter-debtor/image/logo.svg +++ /dev/null @@ -1,48 +0,0 @@ - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/services/print/application/template/letter-debtor/image/pinterest.png b/services/print/application/template/letter-debtor/image/pinterest.png deleted file mode 100644 index 4d7b28ef8..000000000 Binary files a/services/print/application/template/letter-debtor/image/pinterest.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/twitter.png b/services/print/application/template/letter-debtor/image/twitter.png deleted file mode 100644 index c4a8ab0c1..000000000 Binary files a/services/print/application/template/letter-debtor/image/twitter.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/image/youtube.png b/services/print/application/template/letter-debtor/image/youtube.png deleted file mode 100644 index 11871deb5..000000000 Binary files a/services/print/application/template/letter-debtor/image/youtube.png and /dev/null differ diff --git a/services/print/application/template/letter-debtor/index.html b/services/print/application/template/letter-debtor/index.html deleted file mode 100644 index 68094db50..000000000 --- a/services/print/application/template/letter-debtor/index.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - {{_.subject}} - - - - - {{$.header}} - - - -
-
-
-
-

EXTRACTO

-
-
CLIENTE:
-
{{clientId}}
-
-
-
FECHA:
-
{{currentDate}}
-
-
-
-
-
-
Datos de cliente
-

- {{clientName}} -

-
- {{street}} -
-
- {{postcode}}, {{city}} ({{province}}) -
-
- {{country}} -
-
-
-
- -
-
-
Fecha
-
Concepto
-
Facturado
-
Pagado
-
Saldo
-
- {{#lines}} -
-
{{issued}} 
-
{{ref}} 
-
{{debtOut}} 
-
{{debtIn}} 
-
{{balance}} 
-
- {{/lines}} -
-
Total
-
{{totalDebtOut}}
-
{{totalDebtIn}}
-
{{totalBalance}}
-
-
-
- - - - {{$.footer}} - - - \ No newline at end of file diff --git a/services/print/application/template/letter-debtor/letter-debtor.js b/services/print/application/template/letter-debtor/letter-debtor.js deleted file mode 100644 index 51ec0223e..000000000 --- a/services/print/application/template/letter-debtor/letter-debtor.js +++ /dev/null @@ -1,89 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -let strftime = require('strftime'); - -module.exports = class LetterDebtor { - async getData(params, cb) { - let qryData = `SELECT - c.id clientId, - LOWER(ct.code) AS countryCode, - c.email AS recipient, - c.socialName AS clientName, - c.street, - c.postcode, - c.city, - c.fi, - p.name AS province, - ct.country - FROM client c - JOIN country ct ON ct.id = c.countryFk - LEFT JOIN province p ON p.id = c.provinceFk - WHERE c.id = ?`; - - let qryLines = `CALL vn.clientGetDebtDiary(?, ?)`; - - try { - let [data] = await database.pool.query(qryData, [params.clientId]); - - if (!data) - throw new Error('No body data found'); - - let [lines] = await database.pool.query(qryLines, [params.clientId, params.companyId]); - - Object.assign(this, data[0]); - - this.lines = lines[0]; - this.formatLines(); - this.getBalance(); - cb(); - } catch (e) { - cb(e); - } - } - - get currentDate() { - return strftime('%d-%m-%Y', new Date()); - } - - formatLines() { - this.lines.forEach(line => { - if (line.issued) - line.issued = strftime('%d-%m-%Y', line.issued); - }); - } - - getBalance() { - let balance = 0.00; - this.lines.forEach(line => { - if (line.debtOut) - balance += parseFloat(line.debtOut); - - if (line.debtIn) - balance -= parseFloat(line.debtIn); - - line.balance = parseFloat(balance.toFixed(2)); - }); - } - - totalDebtOut() { - let debtOut = 0.00; - this.lines.forEach(line => { - debtOut += line.debtOut ? parseFloat(line.debtOut) : 0; - }); - - return debtOut.toFixed(2); - } - - totalDebtIn() { - let debtIn = 0.00; - this.lines.forEach(line => { - debtIn += line.debtIn ? parseFloat(line.debtIn) : 0; - }); - - return debtIn.toFixed(2); - } - - totalBalance() { - return this.totalDebtOut() - this.totalDebtIn(); - } -}; diff --git a/services/print/application/template/letter-debtor/locale/es.json b/services/print/application/template/letter-debtor/locale/es.json deleted file mode 100644 index e5453e858..000000000 --- a/services/print/application/template/letter-debtor/locale/es.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "title": "Orden de domiciliación de adeudo directo SEPA CORE", - "toCompleteBySupplier": "A cumplimentar por el acreedor", - "toCompleteByClient": "A cumplimentar por el deudor", - "bodyDescription": "Mediante la firma de esta orden de domiciliación, el deudor autoriza (A) al acreedor a enviar instrucciones a la entidad del deudor para adeudar su cuenta y (B) a la entidad para efectuar los adeudos en su cuenta siguiendo las instrucciones del acreedor.Como parte de sus derechos, el deudor está legitimado al reembolso por su entidad en los términos y condiciones del contrato suscrito con la misma. La solicitud de reembolso deberá efectuarse dentro de las ocho semanas que adeudo en cuenta. Puede obtener información adicional sobre sus derechos en su entidad financiera.", - "orderReference": "Referencia de la orden de domiciliación", - "supplierIdentifier": "Identificador del acreedor", - "supplierName": "Nombre del acreedor", - "supplierStreet": "Dirección", - "supplierLocation": "CP - Población - Provincia", - "supplierCountry": "País", - "clientAdvice": "Debe llevar a su Entidad Bancaria una copia del documento firmado para que lo registre y evitar la devolución.", - "clientName": "Nombre del deudor/es", - "clientStreet": "Dirección del deudor", - "clientLocation": "CP - Población - Provincia", - "clientCountry": "País del deudor", - "swift": "Swift BIC", - "accountNumber": "Número de cuenta - IBAN", - "accountHolder": "(Titular/es de la cuenta de cargo)", - "accountNumberFormat": "En España el IBAN consta de 24 posiciones comenzando siempre por ES", - "paymentType": "Tipo de pago", - "recurrent": "Recurrente", - "unique": "Único", - "signLocation": "Fecha - Localidad", - "sign": "Firma del deudor y sello", - "mandatoryFields": "TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE.", - "sendOrder": "UNA VEZ FIRMADA ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA Y ES RECOMENDABLE FACILITAR UNA COPIA A SU ENTIDAD BANCARIA.", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/print/application/template/letter-debtor/style.css b/services/print/application/template/letter-debtor/style.css deleted file mode 100644 index 5b1e628d6..000000000 --- a/services/print/application/template/letter-debtor/style.css +++ /dev/null @@ -1,22 +0,0 @@ -img { - margin: 0 -} - -.body { - font-family: arial, sans-serif; - max-width: 90%; - margin: 0 auto; - font-size: 14px; - color: #000 -} - -body .title { - text-align: center; - padding-bottom: 20px -} - -body .title h1 { - font-size: 16px; - color: #333; - margin: 0 -} \ No newline at end of file diff --git a/services/print/application/template/sepa-core/index.html b/services/print/application/template/sepa-core/index.html deleted file mode 100644 index 92cc6fb80..000000000 --- a/services/print/application/template/sepa-core/index.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - {{_.subject}} - - - - - {{$.header}} - - - -
- - -
-

{{_.title}}

-
- -
-
{{_.toCompleteBySupplier}}
-
-
{{_.orderReference}}
-
{{mandateCode}}
-
-
-
{{_.supplierIdentifier}}
-
ES89000B97367486
-
-
-
{{_.supplierName}}
-
{{supplierName}}
-
-
-
{{_.supplierStreet}}
-
{{supplierStreet}}
-
-
-
{{_.supplierLocation}}
-
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
-
-
-
{{_.supplierCountry}}
-
{{supplierCountry}}
-
-
- -

{{_.bodyDescription}}

-

{{_.clientAdvice}}

- -
-
{{_.toCompleteByClient}}
-
-
{{_.clientName}}
-
{{clientName}}
-
{{_.accountHolder}}
-
-
-
{{_.clientStreet}}
-
{{clientStreet}}
-
-
-
{{_.clientLocation}}
-
{{clientPostCode}}, {{clientCity}} ({{clientProvince}})
-
-
-
{{_.clientCountry}}
-
{{clientCountry}}
-
-
-
{{_.swift}}
-
- {{#swiftFields}} -
- {{/swiftFields}} -
-
-
-
{{_.accountNumber}}
-
-
ES
- {{#accountNumberFields}} -
- {{/accountNumberFields}} -
-
-
{{_.accountNumberFormat}}
-
-
-
-
{{_.paymentType}}
-
-
-
-
-
X
-
-
{{_.recurrent}}
-
-
O
-
-
-
-
-
{{_.unique}}
-
-
-
-
-
-
{{_.signLocation}}
-
{{currentDate}}, {{supplierProvince}}
-
-
-
{{_.sign}}
-
-
-
-

{{_.mandatoryFields}}

-

{{_.sendOrder}}

-
- - - - {{$.footer}} - - - \ No newline at end of file diff --git a/services/print/application/template/sepa-core/locale/es.json b/services/print/application/template/sepa-core/locale/es.json deleted file mode 100644 index e5453e858..000000000 --- a/services/print/application/template/sepa-core/locale/es.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "title": "Orden de domiciliación de adeudo directo SEPA CORE", - "toCompleteBySupplier": "A cumplimentar por el acreedor", - "toCompleteByClient": "A cumplimentar por el deudor", - "bodyDescription": "Mediante la firma de esta orden de domiciliación, el deudor autoriza (A) al acreedor a enviar instrucciones a la entidad del deudor para adeudar su cuenta y (B) a la entidad para efectuar los adeudos en su cuenta siguiendo las instrucciones del acreedor.Como parte de sus derechos, el deudor está legitimado al reembolso por su entidad en los términos y condiciones del contrato suscrito con la misma. La solicitud de reembolso deberá efectuarse dentro de las ocho semanas que adeudo en cuenta. Puede obtener información adicional sobre sus derechos en su entidad financiera.", - "orderReference": "Referencia de la orden de domiciliación", - "supplierIdentifier": "Identificador del acreedor", - "supplierName": "Nombre del acreedor", - "supplierStreet": "Dirección", - "supplierLocation": "CP - Población - Provincia", - "supplierCountry": "País", - "clientAdvice": "Debe llevar a su Entidad Bancaria una copia del documento firmado para que lo registre y evitar la devolución.", - "clientName": "Nombre del deudor/es", - "clientStreet": "Dirección del deudor", - "clientLocation": "CP - Población - Provincia", - "clientCountry": "País del deudor", - "swift": "Swift BIC", - "accountNumber": "Número de cuenta - IBAN", - "accountHolder": "(Titular/es de la cuenta de cargo)", - "accountNumberFormat": "En España el IBAN consta de 24 posiciones comenzando siempre por ES", - "paymentType": "Tipo de pago", - "recurrent": "Recurrente", - "unique": "Único", - "signLocation": "Fecha - Localidad", - "sign": "Firma del deudor y sello", - "mandatoryFields": "TODOS LOS CAMPOS HAN DE SER CUMPLIMENTADOS OBLIGATORIAMENTE.", - "sendOrder": "UNA VEZ FIRMADA ESTA ORDEN DE DOMICILIACIÓN DEBE SER ENVIADA AL ACREEDOR PARA SU CUSTODIA Y ES RECOMENDABLE FACILITAR UNA COPIA A SU ENTIDAD BANCARIA.", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla · www.verdnatura.es · clientes@verdnatura.es", - "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", - "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." -} \ No newline at end of file diff --git a/services/print/application/template/sepa-core/sepa-core.js b/services/print/application/template/sepa-core/sepa-core.js deleted file mode 100644 index b5a8910ee..000000000 --- a/services/print/application/template/sepa-core/sepa-core.js +++ /dev/null @@ -1,55 +0,0 @@ -var path = require('path'); -var database = require(path.join(__dirname, '../../database.js')); -let strftime = require('strftime'); - -module.exports = class SepaCore { - async getData(params, cb) { - let query = `SELECT - c.id clientId, - m.code mandateCode, - LOWER(ct.code) AS countryCode, - c.email AS recipient, - c.socialName AS clientName, - c.street AS clientStreet, - c.postcode AS clientPostCode, - c.city AS clientCity, - p.name AS clientProvince, - ct.country AS clientCountry, - s.name AS supplierName, - s.street AS supplierStreet, - sc.country AS supplierCountry, - s.postCode AS supplierPostCode, - s.city AS supplierCity, - sp.name AS supplierProvince - FROM client c - JOIN country ct ON ct.id = c.countryFk - LEFT JOIN province p ON p.id = c.provinceFk - LEFT JOIN mandate m ON m.clientFk = c.id AND m.finished IS NULL - LEFT JOIN supplier s ON s.id = m.companyFk - LEFT JOIN country sc ON sc.id = s.countryFk - LEFT JOIN province sp ON sp.id = s.provinceFk - WHERE c.id = ?`; - - let [result] = await database.pool.query(query, [params.clientId]); - - if (!result || !result.length) - return cb(new Error('No template data found')); - - Object.assign(this, result[0]); - cb(); - } - - // Swift BIC fields - get swiftFields() { - return new Array(11); - } - - // Account number fields - get accountNumberFields() { - return new Array(23); - } - - get currentDate() { - return strftime('%d-%m-%Y', new Date()); - } -}; diff --git a/services/print/application/template/sepa-core/style.css b/services/print/application/template/sepa-core/style.css deleted file mode 100644 index 5b1e628d6..000000000 --- a/services/print/application/template/sepa-core/style.css +++ /dev/null @@ -1,22 +0,0 @@ -img { - margin: 0 -} - -.body { - font-family: arial, sans-serif; - max-width: 90%; - margin: 0 auto; - font-size: 14px; - color: #000 -} - -body .title { - text-align: center; - padding-bottom: 20px -} - -body .title h1 { - font-size: 16px; - color: #333; - margin: 0 -} \ No newline at end of file diff --git a/services/print/application/util/format.js b/services/print/application/util/format.js deleted file mode 100644 index f03d3c636..000000000 --- a/services/print/application/util/format.js +++ /dev/null @@ -1,99 +0,0 @@ -let database = require('../database.js'); -let strftime = require('strftime'); - -module.exports = { - - /** - * Devuelve el iban - * @param {String} addressNumber - Dirección de cuenta bancaria - * @param {Object} cb - Callback - */ - accountAddressIban: function(addressNumber, cb) { - database.pool.query('SELECT vn2008.cc_to_iban(?) AS iban', [addressNumber], function(error, result) { - cb(result[0].iban); - }); - }, - - /** - * Obtiene el numero de cuenta completo incluyendo iban - * @param {String} addressNumber - Dirección de cuenta bancaria - * @return {String} Cuenta bancaria formateada - */ - accountAddress: function(addressNumber) { - var formattedAccountAddress = addressNumber.replace(/(.{4})/g, '$1-'); - return formattedAccountAddress.substring(0, formattedAccountAddress.length - 1); - }, - - /** - * Devuelve el numero de cuenta mostrando únicamente los últimos 4 dígitos. - * @param {String} addressNumber - Dirección de cuenta bancaria - * @return {String} Cuenta bancaria formateada - */ - partialAccountAddress: function(addressNumber) { - let address = this.accountAddress(addressNumber); - return address.substring(0, 19).replace(/[0-9]/g, 'X') + address.substring(19, 24); - }, - - phone: function(number) { - return number; - }, - -/** - * Format number - * @param {Integer} number Input number - * @return {Integer} Formatted number - */ - number: function(number, minDigits = 0, maxDigits = 2) { - let options = { - style: 'decimal', - minimumFractionDigits: minDigits, - maximumFractionDigits: maxDigits - }; - - return new Intl.NumberFormat('es-ES', options).format(number); - }, - -/** - * Format currency - * @param {Integer} ammount Input ammount - * @param {String} type Currency type [EUR, USD, ...] - * @return {Integer} Formatted currency - */ - currency: function(ammount, type = 'EUR', minDigits = 2, maxDigits = 2) { - let options = { - style: 'currency', - currency: type, - minimumFractionDigits: minDigits, - maximumFractionDigits: maxDigits - }; - - return new Intl.NumberFormat('es-ES', options).format(ammount); - }, - - percent: function(number, minDigits = 2, maxDigits = 2) { - let options = { - style: 'percent', - minimumFractionDigits: minDigits, - maximumFractionDigits: maxDigits - }; - - return new Intl.NumberFormat('es-ES', options).format(number); - }, - -/** - * Format date dd-mm-yyyy - * @param {Object} date - Date object - * @param {String} delimiter - Date delimiter - * @return {String} Formatted date - */ - date: function(date, format = '%d-%m-%Y') { - return strftime(format, date); - }, - - code: function(code, pad) { - code = String(code); - pad = String(pad); - - return pad.substring(0, (pad.length - code.length)) + code; - } -}; \ No newline at end of file diff --git a/services/print/application/util/system.js b/services/print/application/util/system.js deleted file mode 100644 index 358346184..000000000 --- a/services/print/application/util/system.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - /** - * Obtiene las variables de entorno - * @param {String} env - Nombre de la variable de entorno - * @return {String} Valor de la variable de entorno - */ - getEnv: function(env) { - return process.env[env]; - } -}; diff --git a/services/print/package-lock.json b/services/print/package-lock.json deleted file mode 100644 index 917153b80..000000000 --- a/services/print/package-lock.json +++ /dev/null @@ -1,1573 +0,0 @@ -{ - "name": "vn-print", - "version": "0.0.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" - } - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "optional": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "ansicolors": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz", - "integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8=" - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "optional": true - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "optional": true - }, - "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", - "optional": true - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=" - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" - }, - "body-parser": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", - "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", - "requires": { - "bytes": "3.0.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "~1.6.3", - "iconv-lite": "0.4.23", - "on-finished": "~2.3.0", - "qs": "6.5.2", - "raw-body": "2.3.3", - "type-is": "~1.6.16" - } - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" - }, - "cardinal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-1.0.0.tgz", - "integrity": "sha1-UOIcGwqjdyn5N33vGWtanOyTLuk=", - "requires": { - "ansicolors": "~0.2.1", - "redeyed": "~1.0.0" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "optional": true - }, - "cheerio": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", - "integrity": "sha1-qbqoYKP5tZWmuBsahocxIe06Jp4=", - "requires": { - "css-select": "~1.2.0", - "dom-serializer": "~0.1.0", - "entities": "~1.1.1", - "htmlparser2": "^3.9.1", - "lodash.assignin": "^4.0.9", - "lodash.bind": "^4.1.4", - "lodash.defaults": "^4.0.1", - "lodash.filter": "^4.4.0", - "lodash.flatten": "^4.2.0", - "lodash.foreach": "^4.3.0", - "lodash.map": "^4.4.0", - "lodash.merge": "^4.4.0", - "lodash.pick": "^4.2.1", - "lodash.reduce": "^4.4.0", - "lodash.reject": "^4.4.0", - "lodash.some": "^4.4.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "optional": true - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - }, - "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", - "optional": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" - }, - "cookiejar": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.1.tgz", - "integrity": "sha1-Qa1XsbVVlR7BcUEqgZQrHoIA00o=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "css-rules": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/css-rules/-/css-rules-1.0.3.tgz", - "integrity": "sha512-zdlrprCn9RutJI5n42OEydMNErhVRTzPd7hb7DzbOkgSEHERjOlRqKd4nWEDi+626vstikcjN8RRtG/b3p2T/g==", - "requires": { - "cssom": "^0.3.2" - } - }, - "css-select": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", - "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", - "requires": { - "boolbase": "~1.0.0", - "css-what": "2.1", - "domutils": "1.5.1", - "nth-check": "~1.0.1" - } - }, - "css-what": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", - "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=" - }, - "cssom": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.2.tgz", - "integrity": "sha1-uANhcMefB6kP8vFuIihAJ6JDhIs=" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "denque": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.2.3.tgz", - "integrity": "sha512-BOjyD1zPf7gqgXlXBCnCsz84cbRNfqpQNvWOUiw3Onu9s7a2afW2LyHzctoie/2KELfUoZkNHTnW02C3hCU20w==" - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", - "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" - } - } - }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" - }, - "domhandler": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", - "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", - "requires": { - "domelementtype": "1" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, - "requires": { - "jsbn": "~0.1.0" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" - }, - "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", - "optional": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "express": { - "version": "4.16.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", - "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", - "requires": { - "accepts": "~1.3.5", - "array-flatten": "1.1.1", - "body-parser": "1.18.2", - "content-disposition": "0.5.2", - "content-type": "~1.0.4", - "cookie": "0.3.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.1.1", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.3", - "qs": "6.5.1", - "range-parser": "~1.2.0", - "safe-buffer": "5.1.1", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "body-parser": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", - "requires": { - "bytes": "3.0.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.1", - "http-errors": "~1.6.2", - "iconv-lite": "0.4.19", - "on-finished": "~2.3.0", - "qs": "6.5.1", - "raw-body": "2.3.2", - "type-is": "~1.6.15" - } - }, - "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" - }, - "raw-body": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", - "unpipe": "1.0.0" - }, - "dependencies": { - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": ">= 1.3.1 < 2" - } - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" - } - } - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - } - } - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" - }, - "extract-css": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/extract-css/-/extract-css-1.2.0.tgz", - "integrity": "sha1-vlOQ9AnIWwy18buQKZx35RaIqN4=", - "requires": { - "batch": "^0.6.1", - "href-content": "^1.0.2", - "list-stylesheets": "^1.2.1", - "style-data": "^1.3.0" - } - }, - "extract-zip": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz", - "integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=", - "optional": true, - "requires": { - "concat-stream": "1.6.0", - "debug": "2.6.9", - "mkdirp": "0.5.0", - "yauzl": "2.4.1" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "optional": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "optional": true - }, - "fd-slicer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", - "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", - "optional": true, - "requires": { - "pend": "~1.2.0" - } - }, - "finalhandler": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - } - } - }, - "flatten": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", - "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "optional": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", - "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==" - }, - "forwarded": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" - }, - "fs-extra": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=" - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "optional": true - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "optional": true, - "requires": { - "ajv": "^5.1.0", - "har-schema": "^2.0.0" - } - }, - "hasha": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", - "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", - "optional": true, - "requires": { - "is-stream": "^1.0.1", - "pinkie-promise": "^2.0.0" - } - }, - "href-content": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/href-content/-/href-content-1.0.3.tgz", - "integrity": "sha1-vjI21iI1EceN4Yrv2cLNTo1TT4c=", - "requires": { - "remote-content": "^1.0.1" - } - }, - "html-pdf": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/html-pdf/-/html-pdf-2.2.0.tgz", - "integrity": "sha1-S8+Rwky1YOR6o/rP0DPg4b8kG5E=", - "requires": { - "phantomjs-prebuilt": "^2.1.4" - } - }, - "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", - "requires": { - "domelementtype": "^1.3.0", - "domhandler": "^2.3.0", - "domutils": "^1.5.1", - "entities": "^1.1.1", - "inherits": "^2.0.1", - "readable-stream": "^2.0.2" - } - }, - "http-errors": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", - "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.0", - "statuses": ">= 1.4.0 < 2" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "inline-css": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/inline-css/-/inline-css-2.4.0.tgz", - "integrity": "sha1-3wyZkDuhy68G/PXJMZ/5Gw8a7L8=", - "requires": { - "bluebird": "^3.5.1", - "cheerio": "^0.22.0", - "css-rules": "^1.0.3", - "extend": "^3.0.1", - "extract-css": "^1.2.0", - "flatten": "^1.0.2", - "object.pick": "^1.3.0", - "slick": "^1.12.2", - "specificity": "^0.3.2" - } - }, - "ipaddr.js": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", - "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "optional": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "optional": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "optional": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "optional": true - }, - "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "optional": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "optional": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "optional": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kew": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", - "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", - "optional": true - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "optional": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "list-stylesheets": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/list-stylesheets/-/list-stylesheets-1.2.1.tgz", - "integrity": "sha1-eX82xaRU8xE2kZc970Lk8Mxm3+s=", - "requires": { - "cheerio": "^0.22.0", - "extend": "^3.0.1", - "object.pick": "^1.3.0" - } - }, - "lodash.assignin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", - "integrity": "sha1-uo31+4QesKPoBEIysOJjqNxqKKI=" - }, - "lodash.bind": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", - "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" - }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" - }, - "lodash.filter": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.filter/-/lodash.filter-4.6.0.tgz", - "integrity": "sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4=" - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" - }, - "lodash.foreach": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", - "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" - }, - "lodash.map": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", - "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=" - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" - }, - "lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" - }, - "lodash.reduce": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", - "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" - }, - "lodash.reject": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz", - "integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=" - }, - "lodash.some": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", - "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=" - }, - "long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, - "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "mediaquery-text": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mediaquery-text/-/mediaquery-text-1.0.5.tgz", - "integrity": "sha512-xTMfHiICZHxijWFrb5rXjGUblQo2TrYmVnWFRhp2HESJQ1BGPmgAerq/t7Sm9i+79ZyUb1l0DMRsXGfHT119kQ==", - "requires": { - "cssom": "^0.3.0" - } - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" - }, - "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" - }, - "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", - "requires": { - "mime-db": "~1.33.0" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "optional": true - }, - "mkdirp": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", - "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "mustache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.0.tgz", - "integrity": "sha1-QCj3d4sXcIpImTCm5SrDvKDaQdA=" - }, - "mysql2": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-1.5.3.tgz", - "integrity": "sha512-Oov36YQSeciNP9SeqE7je4eWgeGADOorXLmsqhtxOJmPGUOJSNJT0s6/eq1Byy4nhXTRQUvlMHsI4Q/eMEs88Q==", - "requires": { - "cardinal": "1.0.0", - "denque": "1.2.3", - "generate-function": "^2.0.0", - "iconv-lite": "^0.4.18", - "long": "^4.0.0", - "lru-cache": "4.1.1", - "named-placeholders": "1.1.1", - "object-assign": "^4.1.1", - "readable-stream": "2.3.5", - "safe-buffer": "^5.0.1", - "seq-queue": "0.0.5", - "sqlstring": "2.3.1" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.0.3", - "util-deprecate": "~1.0.1" - } - }, - "sqlstring": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", - "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=" - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "named-placeholders": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz", - "integrity": "sha1-O3oNJiA910s6nfTJz7gnsvuQfmQ=", - "requires": { - "lru-cache": "2.5.0" - }, - "dependencies": { - "lru-cache": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", - "integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=" - } - } - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "nth-check": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", - "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", - "requires": { - "boolbase": "~1.0.0" - } - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "^3.0.1" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } - }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" - }, - "path": { - "version": "0.12.7", - "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", - "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", - "requires": { - "process": "^0.11.1", - "util": "^0.10.3" - } - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "optional": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "optional": true - }, - "phantomjs-prebuilt": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz", - "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=", - "optional": true, - "requires": { - "es6-promise": "^4.0.3", - "extract-zip": "^1.6.5", - "fs-extra": "^1.0.0", - "hasha": "^2.2.0", - "kew": "^0.7.0", - "progress": "^1.1.8", - "request": "^2.81.0", - "request-progress": "^2.0.1", - "which": "^1.2.10" - }, - "dependencies": { - "fs-extra": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", - "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "optional": true, - "requires": { - "graceful-fs": "^4.1.6" - } - } - } - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "optional": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "optional": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" - }, - "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", - "optional": true - }, - "proxy-addr": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", - "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.6.0" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "optional": true - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" - }, - "raw-body": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", - "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", - "requires": { - "bytes": "3.0.0", - "http-errors": "1.6.3", - "iconv-lite": "0.4.23", - "unpipe": "1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "redeyed": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz", - "integrity": "sha1-6WwZO0DAgWsArshCaY5hGF5VSYo=", - "requires": { - "esprima": "~3.0.0" - }, - "dependencies": { - "esprima": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.0.0.tgz", - "integrity": "sha1-U88kes2ncxPlUcOqLnM0LT+099k=" - } - } - }, - "remote-content": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remote-content/-/remote-content-1.0.2.tgz", - "integrity": "sha1-zsuiuo98KK0b/lAqI1X08r99EMU=", - "requires": { - "superagent": "^3.8.2" - } - }, - "request": { - "version": "2.87.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", - "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", - "optional": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", - "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", - "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" - } - }, - "request-progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz", - "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=", - "optional": true, - "requires": { - "throttleit": "^1.0.0" - } - }, - "require-yaml": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/require-yaml/-/require-yaml-0.0.1.tgz", - "integrity": "sha1-LhsY2RPDuqcqWk03O28Tjd0sMr0=", - "requires": { - "js-yaml": "3.11.0" - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" - }, - "dependencies": { - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" - } - } - }, - "seq-queue": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", - "integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4=" - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" - } - }, - "setprototypeof": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" - }, - "slick": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/slick/-/slick-1.12.2.tgz", - "integrity": "sha1-vQSN23TefRymkV+qSldXCzVQwtc=" - }, - "specificity": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.3.2.tgz", - "integrity": "sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A==" - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" - }, - "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", - "optional": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "tweetnacl": "~0.14.0" - } - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" - }, - "strftime": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/strftime/-/strftime-0.10.0.tgz", - "integrity": "sha1-s/D6QZKVICpaKJ9ta+n0kJphcZM=" - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "style-data": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/style-data/-/style-data-1.3.0.tgz", - "integrity": "sha1-tZcW3LCMQEY5Bv5V8E5HWOyRup0=", - "requires": { - "cheerio": "^0.22.0", - "extend": "^3.0.1", - "mediaquery-text": "^1.0.5", - "object.pick": "^1.3.0" - } - }, - "superagent": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", - "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", - "requires": { - "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", - "formidable": "^1.2.0", - "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - } - } - }, - "throttleit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz", - "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=", - "optional": true - }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "optional": true, - "requires": { - "punycode": "^1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true - }, - "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.18" - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "optional": true - }, - "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=" - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "requires": { - "inherits": "2.0.1" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", - "optional": true - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", - "optional": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yauzl": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", - "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", - "optional": true, - "requires": { - "fd-slicer": "~1.0.1" - } - } - } -} diff --git a/services/print/package.json b/services/print/package.json deleted file mode 100644 index b964769e8..000000000 --- a/services/print/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "vn-print", - "version": "0.0.1", - "description": "Servidor de impresión PDF", - "main": "server/server.js", - "dependencies": { - "body-parser": "^1.17.2", - "express": "^4.15.3", - "fs-extra": "^5.0.0", - "html-pdf": "^2.2.0", - "inline-css": "^2.2.2", - "mustache": "^2.3.0", - "mysql2": "^1.5.3", - "path": "^0.12.7", - "require-yaml": "0.0.1", - "strftime": "^0.10.0" - }, - "repository": { - "type": "git", - "url": "https://git.verdnatura.es/salix" - }, - "license": "GPL-3.0" -} diff --git a/services/print/server/server.js b/services/print/server/server.js deleted file mode 100644 index 91d4e5f67..000000000 --- a/services/print/server/server.js +++ /dev/null @@ -1,30 +0,0 @@ -var express = require('express'); -var app = module.exports = express(); -var bodyParser = require('body-parser'); -var config = require('../application/config.js'); -var database = require('../application/database.js'); - -// Body parser middleware -app.use(bodyParser.json()); -app.use(bodyParser.urlencoded({extended: true})); - -// Load routes -app.use('/', require('../application/router.js')); - -app.start = function(port) { - var listener = app.listen(port ? port : config.app.port, function() { - var servicePath = 'http://' + listener.address().address + ':' + listener.address().port; - database.init(); - - if (config.app.debug) { - let packageJson = require('../package.json'); - console.log(`Web server ${packageJson.name} listening at: ${servicePath}`); - console.log(`${packageJson.name} service debug mode enabled`); - } - }); - return listener; -}; - -if (require.main === module) { - app.start(); -} diff --git a/services/print/static/css/common.css b/services/print/static/css/common.css deleted file mode 100644 index 91379b956..000000000 --- a/services/print/static/css/common.css +++ /dev/null @@ -1,216 +0,0 @@ -body { - font-family: arial, sans-serif; - margin: 0 auto; - font-size: 1em; - zoom: 0.55 -} - -main { - padding: 20px 0 -} - -img { - margin: 0 -} - -p { - text-align: justify -} - -* { - box-sizing: border-box -} - -.panel { - border: 1px solid #DDD; - margin-bottom: 10px; - position: relative; - padding:10px -} - -.panel .header { - font-weight: bold -} - -.row { - margin-bottom: 15px; - overflow: hidden -} - -.row.small { - margin-bottom: 5px -} - -.row .text { - margin-bottom: 5px -} - -.row .control { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box -} - -.row .text, .row .control { - overflow: hidden -} - -.row .description { - position: relative; - padding-top: 2px; - overflow: hidden; - font-size: 9px; - display: block; - color: #999 -} - -.row .line { - border-bottom: 1px solid #DDD; - border-right: 1px solid #DDD; - border-left: 1px solid #DDD; - margin-top: 10px; - color: #999; - padding: 5px -} - -.row .description span { - background-color: #FFF; - margin: -5px 0 0 50px; - display: block; - padding: 5px; - float: left -} - -.row:last-child { - margin-bottom: 0 -} - -.row.inline .text { - margin-bottom: 0; - width: 40%; - float: left -} - -.row.inline .control { - font-weight: bold; - padding-left: 20px; - color: #000; - width: 60%; - float: left -} - -.row.inline .description { - position: static; - overflow: visible -} - -.box { - border-top: 1px solid #CCC; - border-right: 1px solid #CCC; - border-bottom: 1px solid #CCC; - font-weight: bold; - text-align: center; - padding-top: 4px; - width: 25px; - height: 21px; - color: #000; - float: left -} - -.box.crossed { - font-weight: 100; - font-size: 16px -} - -.row .control .box:first-child { - border-left: 1px solid #CCC; -} - -.font.small { - font-size: 10px -} - -.font.gray { - color: #555 -} - -.font.verticalAlign { - height: 27px; - line-height: 27px -} - -.font.centered { - height: 27px; - line-height: 27px; - text-align: center -} - -.verticalText { - -moz-transform: rotate(90deg); - -webkit-transform: rotate(90deg); - transform: rotate(90deg); - position: absolute; - text-align: center; - font-size: .65em; - width: 200px; - right: -115px; - top: 50% -} - -.columns { - overflow: hidden -} - -.columns .size100 { - width: 100%; - float: left -} - -.columns .size75 { - width: 75%; - float: left -} - -.columns .size50 { - width: 50%; - float: left -} - -.columns .size33 { - width: 33.33%; - float: left -} - -.columns .size25 { - width: 25%; - float: left -} - -.pull-left { - float: left -} - -.pull-right { - float: right -} - - -.grid { - border-bottom: 3px solid #888888 -} - -.grid .row { - padding: 5px; - margin-bottom: 0 -} - -.grid .header { - border-bottom: 1px solid #808080; - border-top: 1px solid #808080; - background-color: #c0c0c0; -} - - -.grid .row.inline > div { - float: left; -}