From 1dc8cafc73f5858dccdcd70bb7c2a69b5e0da0d0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 30 Jan 2019 23:47:06 +0100 Subject: [PATCH 01/15] Style & translation fixes --- e2e/helpers/selectors.js | 8 +- front/core/components/input-number/index.html | 8 +- front/salix/components/app/app.html | 14 +- front/salix/components/app/app.js | 37 ++-- front/salix/components/app/style.scss | 63 +++--- front/salix/locale/es.yml | 2 + modules/agency/front/card/index.html | 2 +- modules/agency/front/create/index.html | 8 +- modules/agency/front/index/index.html | 2 +- modules/claim/front/card/index.html | 2 +- modules/claim/front/index/index.html | 2 +- modules/client/front/card/index.html | 2 +- modules/client/front/create/index.html | 8 +- modules/client/front/index/index.html | 2 +- modules/item/front/card/index.html | 2 +- modules/item/front/create/index.html | 8 +- modules/item/front/index/index.html | 2 +- modules/order/front/card/index.html | 2 +- modules/order/front/catalog/index.html | 190 +++++++++--------- modules/order/front/catalog/index.js | 2 +- modules/order/front/catalog/style.scss | 9 +- modules/order/front/create/index.html | 4 +- modules/order/front/filter/index.html | 186 ++++++++--------- modules/order/front/filter/index.js | 16 +- modules/order/front/filter/index.spec.js | 2 +- modules/order/front/filter/style.scss | 51 +++-- modules/order/front/index/index.html | 2 +- modules/ticket/front/card/index.html | 2 +- modules/ticket/front/create/index.html | 4 +- modules/ticket/front/index/index.html | 2 +- modules/ticket/front/summary/index.html | 58 +++--- modules/travel/front/index/index.html | 2 +- modules/worker/front/card/index.html | 2 +- modules/worker/front/index/index.html | 2 +- 34 files changed, 372 insertions(+), 336 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 4f8a5410d..ede784f6f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -270,11 +270,11 @@ export default { warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]', }, ticketSummary: { - sale: 'vn-ticket-summary [name="sales"] table > tbody > tr', - firstSaleItemId: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(2) > span', + sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr', + firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]', - firstSaleQuantity: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(4)', - firstSaleDiscount: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(6)' + firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(4)', + firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)' }, ticketsIndex: { newTicketButton: 'vn-ticket-index > a', diff --git a/front/core/components/input-number/index.html b/front/core/components/input-number/index.html index 1eb20fda3..894844375 100644 --- a/front/core/components/input-number/index.html +++ b/front/core/components/input-number/index.html @@ -5,8 +5,8 @@ + tabindex="-1" + translate-attr="{title: 'Remove'}">
@@ -28,8 +28,8 @@ + tabindex="-1" + translate-attr="{title: 'Add'}"> + ng-click="$ctrl.showLeftMenu()">
{{$ctrl.$state.current.description}}
+ +
+ ng-class="{shown: $ctrl.leftMenuShown || $ctrl.rightMenuShown}" + ng-click="$ctrl.hideMenus()">
\ No newline at end of file diff --git a/front/salix/components/app/app.js b/front/salix/components/app/app.js index 4ed4f6948..6a8ecb247 100644 --- a/front/salix/components/app/app.js +++ b/front/salix/components/app/app.js @@ -12,8 +12,8 @@ export default class App { $transitions.onStart({}, transition => { let state = transition.targetState().name(); - this.showMenuButton = state.split('.').length >= 3; - if (this.menuShown) this.hideMenu(); + this.showLeftMenuButton = state.split('.').length >= 3; + this.hideMenus(); }); } @@ -30,22 +30,31 @@ export default class App { return state && state != 'login'; } - get leftBlock() { - return this.$element[0].querySelector('.left-block'); + get leftMenu() { + return this.$element[0].querySelector('.left-menu'); } - showMenu() { - let leftBlock = this.leftBlock; - if (!leftBlock) return; - leftBlock.classList.add('shown'); - this.menuShown = true; + showLeftMenu() { + if (!this.leftMenu) return; + this.leftMenu.classList.add('shown'); + this.leftMenuShown = true; } - hideMenu() { - this.menuShown = false; - let leftBlock = this.leftBlock; - if (!leftBlock) return; - leftBlock.classList.remove('shown'); + showRightMenu() { + if (!this.rightMenu) return; + this.rightMenu.classList.add('shown'); + this.rightMenuShown = true; + } + + hideMenus() { + if (this.leftMenuShown) { + this.leftMenu.classList.remove('shown'); + this.leftMenuShown = false; + } + if (this.rightMenuShown) { + this.rightMenu.classList.remove('shown'); + this.rightMenuShown = false; + } } showMessage(message) { diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index ee2bca6bc..ddf4211f6 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -27,7 +27,7 @@ vn-app { padding: .3em; } & > .logo > img { - height: 1.6em; + height: 1.4em; display: block; } & > .show-menu { @@ -58,19 +58,24 @@ vn-app { &.padding { padding-top: $topbar-height; } - .index-block { + .content-block { @extend .margin-medium; + + form vn-horizontal { + & > * { + padding: .2em; + } + } } vn-main-block { display: block; margin: 0 auto; padding-left: $menu-width; - - .left-block { + + %side-menu { + display: block; position: fixed; z-index: 5; - top: $topbar-height; - left: 0; bottom: 0; width: $menu-width; min-width: $menu-width; @@ -78,21 +83,16 @@ vn-app { box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); overflow: auto; } - .content-block { - @extend .margin-medium; - - form vn-horizontal { - & > * { - padding: .2em; - } - } + .left-menu { + @extend %side-menu; + top: $topbar-height; + left: 0; } - .right-block { - width: $menu-width; - min-width: $menu-width; - padding-left: 1em; + .right-menu { + @extend %side-menu; + top: $topbar-height; + right: 0; } - } } & > .background { @@ -118,29 +118,32 @@ vn-app { } } & > .main-view { - .index-block { + .content-block { margin-left: 0; margin-right: 0; + + form vn-horizontal { + flex-direction: column; + } } vn-main-block { padding-left: 0; - .left-block { + %side-menu-mobile { top: 0; - transform: translateZ(0) translateX(-$menu-width); transition: transform 200ms ease-out; - + &.shown { transform: translateZ(0) translateX(0); } } - .content-block { - margin-left: 0; - margin-right: 0; - - form vn-horizontal { - flex-direction: column; - } + .left-menu { + @extend %side-menu-mobile; + transform: translateZ(0) translateX(-$menu-width); + } + .right-menu { + @extend %side-menu-mobile; + transform: translateZ(0) translateX($menu-width); } } } diff --git a/front/salix/locale/es.yml b/front/salix/locale/es.yml index 3e17d36c7..9c299c040 100644 --- a/front/salix/locale/es.yml +++ b/front/salix/locale/es.yml @@ -28,6 +28,8 @@ Order by: Ordenar por Order: Orden Ascendant: Ascendente Descendant: Descendente +Add: Añadir +Remove: Quitar # Modules diff --git a/modules/agency/front/card/index.html b/modules/agency/front/card/index.html index 7e2f11a72..2b981bf29 100644 --- a/modules/agency/front/card/index.html +++ b/modules/agency/front/card/index.html @@ -1,5 +1,5 @@ -
+
diff --git a/modules/agency/front/create/index.html b/modules/agency/front/create/index.html index c9630b236..43575d179 100644 --- a/modules/agency/front/create/index.html +++ b/modules/agency/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ -
- + +
diff --git a/modules/agency/front/index/index.html b/modules/agency/front/index/index.html index cf9c651f1..17b978b70 100644 --- a/modules/agency/front/index/index.html +++ b/modules/agency/front/index/index.html @@ -6,7 +6,7 @@ data="zones" auto-load="false"> -
+
-
+
diff --git a/modules/claim/front/index/index.html b/modules/claim/front/index/index.html index 0c7a821bb..99149ed81 100644 --- a/modules/claim/front/index/index.html +++ b/modules/claim/front/index/index.html @@ -6,7 +6,7 @@ data="claims" auto-load="false"> -
+
-
+
diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html index 1e9b18e99..dc80af713 100644 --- a/modules/client/front/create/index.html +++ b/modules/client/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ @@ -87,5 +87,5 @@ -
- + +
diff --git a/modules/client/front/index/index.html b/modules/client/front/index/index.html index c6aa4d110..07b394073 100644 --- a/modules/client/front/index/index.html +++ b/modules/client/front/index/index.html @@ -6,7 +6,7 @@ data="clients" auto-load="false"> -
+
-
+
diff --git a/modules/item/front/create/index.html b/modules/item/front/create/index.html index 544a10848..7cb96a024 100644 --- a/modules/item/front/create/index.html +++ b/modules/item/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ Cancel -
- + +
diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 50930d493..e2d2df6e5 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -6,7 +6,7 @@ data="items" auto-load="false"> -
+
-
+
diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index 6542ea976..c4ba3e49a 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -5,105 +5,101 @@ limit="50" data="items" on-data-change="$ctrl.onDataChange()" > - - - - - - - More than {{model.limit}} results - - - - - - - - +
+ + + + More than {{model.limit}} results + + + + + + + - -
- - - - - - - -

- {{::item.name}} -

- - {{::item.subName}} - - - - - - - - - - - - - - {{::item.available}} - from - {{::item.price | currency: ' €': 2}} - - - - - - - -
-
-
+
+ + +
+ + + + -
-
- - - No results - - - - - - - - - - - - + + +

+ {{::item.name}} +

+ + {{::item.subName}} + + + + + + + + + + + + + + {{::item.available}} + from + {{::item.price | currency: ' €': 2}} + + + + + + + +
+
+ + +
+
+ + + No results + + +
+ +
+ + diff --git a/modules/order/front/catalog/index.js b/modules/order/front/catalog/index.js index 2585c19f5..ec28df420 100644 --- a/modules/order/front/catalog/index.js +++ b/modules/order/front/catalog/index.js @@ -125,5 +125,5 @@ ngModule.component('vnOrderCatalog', { controller: Controller, bindings: { order: '<', - }, + } }); diff --git a/modules/order/front/catalog/style.scss b/modules/order/front/catalog/style.scss index 3849ff78b..84c6a6c74 100644 --- a/modules/order/front/catalog/style.scss +++ b/modules/order/front/catalog/style.scss @@ -8,13 +8,18 @@ vn-order-catalog { vn-one:first-child { padding-top: 2em; } - vn-one:nth-child(2) { padding-top: 0.5em; } - span { color: $secondary-font-color } } + & > .items { + padding-right: 16em; + + @media screen and (max-width: 800px) { + padding-right: 0; + } + } } \ No newline at end of file diff --git a/modules/order/front/create/index.html b/modules/order/front/create/index.html index fd76ed156..0f52e18ac 100644 --- a/modules/order/front/create/index.html +++ b/modules/order/front/create/index.html @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/modules/order/front/filter/index.html b/modules/order/front/filter/index.html index ebfa682c9..f4949c88a 100644 --- a/modules/order/front/filter/index.html +++ b/modules/order/front/filter/index.html @@ -1,101 +1,93 @@ + data="categories" + auto-load="true"> - - - - - - - - - - - - - - search - - - - keyboard_arrow_down - - - - - - - - - - search - - - - keyboard_arrow_down - - - - - - - - - - - - - {{$ctrl.category.value}} - - - - {{$ctrl.type.value}} - - - - {{::tag.value}} - - - - - - \ No newline at end of file +
+ + + + + + + + + + search + + + + keyboard_arrow_down + + + + + + + + search + + + + keyboard_arrow_down + + + + + + + + + + {{$ctrl.category.value}} + + + {{$ctrl.type.value}} + + + {{::tag.value}} + + +
\ No newline at end of file diff --git a/modules/order/front/filter/index.js b/modules/order/front/filter/index.js index 724f8ebb3..aa3f3cc3d 100644 --- a/modules/order/front/filter/index.js +++ b/modules/order/front/filter/index.js @@ -2,7 +2,8 @@ import ngModule from '../module'; import './style.scss'; class Controller { - constructor($http, $scope, $state, $compile, $transitions, $window) { + constructor($element, $http, $scope, $state, $compile, $transitions) { + this.$element = $element; this.$http = $http; this.$scope = $scope; this.$state = $state; @@ -13,6 +14,14 @@ class Controller { this.tags = []; } + $onInit() { + this.app.rightMenu = this.$element[0]; + } + + $onDestroy() { + this.app.rightMenu = null; + } + get order() { return this._order; } @@ -159,15 +168,16 @@ class Controller { } } -Controller.$inject = ['$http', '$scope', '$state', '$compile', '$transitions', '$window']; +Controller.$inject = ['$element', '$http', '$scope', '$state', '$compile', '$transitions']; ngModule.component('vnCatalogFilter', { template: require('./index.html'), controller: Controller, require: { catalog: '^vnOrderCatalog', + app: '^vnApp' }, bindings: { order: '<', - }, + } }); diff --git a/modules/order/front/filter/index.spec.js b/modules/order/front/filter/index.spec.js index 4be996ac8..3d9888c57 100644 --- a/modules/order/front/filter/index.spec.js +++ b/modules/order/front/filter/index.spec.js @@ -17,7 +17,7 @@ describe('Order', () => { $state.params.category = '{"id": 1, "value": "My Category"}'; $state.params.type = '{"id": 1, "value": "My type"}'; $state.current.name = 'my.current.state'; - controller = $componentController('vnCatalogFilter', {$scope, $state}); + controller = $componentController('vnCatalogFilter', {$element: null, $scope, $state}); controller.catalog = { $scope: $scope, getOrderBy: () => { diff --git a/modules/order/front/filter/style.scss b/modules/order/front/filter/style.scss index bb3857662..26c2324a5 100644 --- a/modules/order/front/filter/style.scss +++ b/modules/order/front/filter/style.scss @@ -1,31 +1,44 @@ @import "colors"; +@import "padding"; -vn-catalog-filter { +vn-catalog-filter > div { + & > .input { + @extend .pad-medium-h; + border-color: $lines; + border-bottom: 1px solid rgba($lines, 0.5); + } .item-category { + @extend .pad-small; justify-content: flex-start; align-items: flex-start; flex-wrap: wrap; - vn-icon { - background-color: $secondary-font-color; - border-radius: 50%; - cursor: pointer; + & > vn-one { + @extend .pad-small; + min-width: 33.33%; + text-align: center; + box-sizing: border-box; - i:before { - font-size: 32pt; - width: 1em; - height: 1em; + & > vn-icon { + @extend .pad-small; + background-color: $secondary-font-color; + border-radius: 50%; + cursor: pointer; + + &.active { + background-color: $main-01; + color: #FFF + } + & > i:before { + font-size: 32pt; + width: 1em; + height: 1em; + } } } - - vn-icon.active { - background-color: $main-01; - color: #FFF - } - - & > vn-one { - width: 33.33%; - text-align: center - } + } + .chips { + flex-wrap: wrap; + @extend .pad-medium; } } \ No newline at end of file diff --git a/modules/order/front/index/index.html b/modules/order/front/index/index.html index 2151e44db..887a599a1 100644 --- a/modules/order/front/index/index.html +++ b/modules/order/front/index/index.html @@ -5,7 +5,7 @@ limit="20" data="orders" auto-load="false"> -
+
-
+
diff --git a/modules/ticket/front/create/index.html b/modules/ticket/front/create/index.html index 0ae0aa588..81c04a7b1 100644 --- a/modules/ticket/front/create/index.html +++ b/modules/ticket/front/create/index.html @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 8c741932b..2f788df41 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -6,7 +6,7 @@ order="shipped ASC" auto-load="false"> -
+
diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 0a1b1f4f1..508cb8928 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -52,21 +52,21 @@

Sale

- - - - - - - - - - - - - - - - - - - - - - - - - - -
ItemDescriptionQuantityPriceDiscountAmount
+ + + + + Item + Description + Quantity + Price + Discount + Amount + + + + + - + + {{sale.itemFk | zeroFill:6}} - {{::sale.quantity}}{{::sale.price | currency:'€':2}}{{::sale.discount}} %{{::sale.quantity * sale.price | currency:'€':2}}
No results
+ + + {{::sale.quantity}} + {{::sale.price | currency:'€':2}} + {{::sale.discount}} % + {{::sale.quantity * sale.price | currency:'€':2}} + + + No results + + +

Packages

diff --git a/modules/travel/front/index/index.html b/modules/travel/front/index/index.html index d32e9a58f..0b4f19362 100644 --- a/modules/travel/front/index/index.html +++ b/modules/travel/front/index/index.html @@ -6,7 +6,7 @@ data="travels" auto-load="false"> -
+
-
+
diff --git a/modules/worker/front/index/index.html b/modules/worker/front/index/index.html index e3853083b..f06c0ce4c 100644 --- a/modules/worker/front/index/index.html +++ b/modules/worker/front/index/index.html @@ -5,7 +5,7 @@ limit="20" data="workers"> -
+
Date: Thu, 31 Jan 2019 00:33:43 +0100 Subject: [PATCH 02/15] Styles fixed, change language moved to user config popover --- e2e/helpers/extensions.js | 16 +-- front/core/components/searchbar/style.scss | 7 + .../salix/components/main-menu/main-menu.html | 16 --- front/salix/components/main-menu/main-menu.js | 28 +--- front/salix/components/main-menu/style.scss | 5 +- .../user-configuration-popover/index.html | 125 +++++++++--------- .../user-configuration-popover/index.js | 29 ++++ .../front/location-search-panel/index.html | 2 +- modules/agency/front/search-panel/index.html | 2 +- modules/claim/front/search-panel/index.html | 2 +- modules/client/front/search-panel/index.html | 2 +- modules/item/front/search-panel/index.html | 4 +- modules/order/front/search-panel/index.html | 2 +- modules/ticket/front/search-panel/index.html | 2 +- modules/travel/front/search-panel/index.html | 2 +- modules/worker/front/search-panel/index.html | 2 +- 16 files changed, 120 insertions(+), 126 deletions(-) diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 6b902e03a..dce0b54cf 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -73,17 +73,17 @@ let actions = { }, changeLanguageToEnglish: function(done) { - this.wait('#lang') - .evaluate(selector => { - return document.querySelector(selector).title; - }, '#lang') - .then(title => { - if (title === 'Change language') { + let langSelector = 'vn-user-configuration-popover vn-autocomplete[field="$ctrl.lang"]'; + + this.waitToClick('#user') + .wait(langSelector) + .waitToGetProperty(`${langSelector} input`, 'value') + .then(lang => { + if (lang === 'English1') { this.then(done) .catch(done); } else { - this.click('#lang') - .click('vn-main-menu [vn-id="langs-menu"] ul > li[name="en"]') + this.autocompleteSearch(langSelector, 'English') .then(done) .catch(done); } diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index c6b3bbb62..965df5f26 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -1,3 +1,5 @@ +@import "padding"; + vn-searchbar { padding-top: 6px; display: block; @@ -5,4 +7,9 @@ vn-searchbar { & > form > vn-horizontal > vn-icon-button { color: black; } +} + +.search-panel { + @extend .pad-large; + max-height: 44em; } \ No newline at end of file diff --git a/front/salix/components/main-menu/main-menu.html b/front/salix/components/main-menu/main-menu.html index 326d5e18b..b607450b8 100644 --- a/front/salix/components/main-menu/main-menu.html +++ b/front/salix/components/main-menu/main-menu.html @@ -5,22 +5,6 @@ class="unselectable"> {{currentUserName}}
- - - -
    -
  • - {{::lang.name}} -
  • -
-
* { cursor: pointer; - padding-left: .1em; + padding-left: .3em; &:hover { color: $main-01; @@ -21,7 +21,7 @@ vn-main-menu { & > #user { vertical-align: middle; font-weight: bold; - padding-right: .6em; + padding-right: .4em; } & > vn-icon, & > a > vn-icon { @@ -41,6 +41,7 @@ vn-main-menu { padding: .8em; border-radius: .1em; min-width: 8em; + white-space: nowrap; &:last-child { margin-bottom: 0; diff --git a/front/salix/components/user-configuration-popover/index.html b/front/salix/components/user-configuration-popover/index.html index b43ecdf62..3fe9a40a5 100644 --- a/front/salix/components/user-configuration-popover/index.html +++ b/front/salix/components/user-configuration-popover/index.html @@ -16,72 +16,67 @@ data="companiesData" order="code"> - -
- - - - - - - {{id}}: {{bank}} - - - - - - - - - - - - - - -
+ + + + {{id}}: {{bank}} + + + + + + + + +
\ No newline at end of file diff --git a/front/salix/components/user-configuration-popover/index.js b/front/salix/components/user-configuration-popover/index.js index 1f70b9641..18a8aae7e 100644 --- a/front/salix/components/user-configuration-popover/index.js +++ b/front/salix/components/user-configuration-popover/index.js @@ -1,6 +1,16 @@ import ngModule from '../../module'; import './style.scss'; +let languages = { + es: 'Español', + en: 'English', + ca: 'Català', + pt: 'Português', + fr: 'Français', + nl: 'Nederlands', + mn: 'Монгол хэл' +}; + class Controller { constructor($scope, $http, $state, vnApp, $translate) { this.$scope = $scope; @@ -9,6 +19,25 @@ class Controller { this.vnApp = vnApp; this.$translate = $translate; this.getUserConfig(); + + this.lang = $translate.use(); + this.langs = []; + + for (let code of $translate.getAvailableLanguageKeys()) { + this.langs.push({ + code: code, + name: languages[code] ? languages[code] : code + }); + } + } + + set lang(value) { + this._lang = value; + this.$translate.use(value); + } + + get lang() { + return this._lang; } set localBankFk(value) { diff --git a/modules/agency/front/location-search-panel/index.html b/modules/agency/front/location-search-panel/index.html index 01bdc7eba..9621f8b56 100644 --- a/modules/agency/front/location-search-panel/index.html +++ b/modules/agency/front/location-search-panel/index.html @@ -1,4 +1,4 @@ -
+
+
+
+
-
- +
+ +
+
+
+
Date: Thu, 31 Jan 2019 00:34:49 +0100 Subject: [PATCH 03/15] e2e extension fixes --- e2e/helpers/extensions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index dce0b54cf..a41b5855c 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -79,7 +79,7 @@ let actions = { .wait(langSelector) .waitToGetProperty(`${langSelector} input`, 'value') .then(lang => { - if (lang === 'English1') { + if (lang === 'English') { this.then(done) .catch(done); } else { From 70fc851841a7af71a1ee607b207a168350b8c23f Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 31 Jan 2019 00:39:40 +0100 Subject: [PATCH 04/15] Style fixes --- front/core/components/searchbar/style.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index 965df5f26..69badb905 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -10,6 +10,9 @@ vn-searchbar { } .search-panel { - @extend .pad-large; max-height: 44em; + + & > form { + @extend .pad-large; + } } \ No newline at end of file From 6074c52202c5aa1d0049f2d6ffea5809a8ce76fd Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 31 Jan 2019 00:43:49 +0100 Subject: [PATCH 05/15] Style fixes --- front/salix/components/app/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index ddf4211f6..e393ceaff 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -20,7 +20,7 @@ vn-app { z-index: 2; box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); height: $topbar-height; - padding: .3em; + padding: .4em; & > header { & > * { From 6bd4b94f11059886459b9fdac0fe2b5c23dc7eb4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 31 Jan 2019 01:05:02 +0100 Subject: [PATCH 06/15] Karma test fixed --- front/salix/components/user-configuration-popover/index.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/salix/components/user-configuration-popover/index.spec.js b/front/salix/components/user-configuration-popover/index.spec.js index 829ff674a..565c666c2 100644 --- a/front/salix/components/user-configuration-popover/index.spec.js +++ b/front/salix/components/user-configuration-popover/index.spec.js @@ -11,7 +11,7 @@ describe('Salix', () => { beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => { $httpBackend = _$httpBackend_; $scope = $rootScope.$new(); - controller = $componentController('vnUserConfigurationPopover', {$scope: $scope, $translate: null}); + controller = $componentController('vnUserConfigurationPopover', {$scope}); })); describe('localBankFk() setter', () => { From 4fb9d9a3f97c11395bc413c1713d2616aa52de80 Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 31 Jan 2019 07:08:26 +0100 Subject: [PATCH 07/15] autocomplete bug CR juan --- front/core/components/autocomplete/autocomplete.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/core/components/autocomplete/autocomplete.js b/front/core/components/autocomplete/autocomplete.js index 5cd812510..f651fd774 100755 --- a/front/core/components/autocomplete/autocomplete.js +++ b/front/core/components/autocomplete/autocomplete.js @@ -11,6 +11,7 @@ import './style.scss'; * @property {Array} data Static data for the autocomplete * @property {Object} intialData A initial data to avoid the server request used to get the selection * @property {Boolean} multiple Wether to allow multiple selection + * @property {Object} selection Current object selected * * @event change Thrown when value is changed */ @@ -293,7 +294,7 @@ ngModule.component('vnAutocomplete', { valueField: '@?', initialData: ' Date: Thu, 31 Jan 2019 07:18:07 +0100 Subject: [PATCH 08/15] agency module ACL's --- .../db/install/changes/1.2-CHECK/22-ACL.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 services/db/install/changes/1.2-CHECK/22-ACL.sql diff --git a/services/db/install/changes/1.2-CHECK/22-ACL.sql b/services/db/install/changes/1.2-CHECK/22-ACL.sql new file mode 100644 index 000000000..d388defa9 --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/22-ACL.sql @@ -0,0 +1,20 @@ +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('Zone','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('ZoneGeo','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('ZoneCalendar','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('ZoneIncluded','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('LabourHoliday','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('LabourHolidayType','*','READ','ALLOW','ROLE','employee'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('Zone','*','WRITE','ALLOW','ROLE','deliveryBoss'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'); +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +VALUES ('ZoneIncluded','*','WRITE','ALLOW','ROLE','deliveryBoss'); From 9cb97662d702c13c6badda3cefcf03c28ee4f886 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 31 Jan 2019 07:20:36 +0100 Subject: [PATCH 09/15] removed developer role from agency module --- modules/agency/front/routes.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/agency/front/routes.json b/modules/agency/front/routes.json index 708545fa6..90a281296 100644 --- a/modules/agency/front/routes.json +++ b/modules/agency/front/routes.json @@ -18,8 +18,7 @@ "url": "/index?q", "state": "zone.index", "component": "vn-zone-index", - "description": "Zones", - "acl": ["developer"] + "description": "Zones" }, { "url": "/create", "state": "zone.create", From cd895506782e2aea24b682a9e63502280d1e0c91 Mon Sep 17 00:00:00 2001 From: Bernat Date: Thu, 31 Jan 2019 09:10:40 +0100 Subject: [PATCH 10/15] #9670 export acl fix test --- .../specs/activeWorkersWithRole.spec.js | 2 +- .../methods/client/specs/listWorkers.spec.js | 2 +- .../db/install/changes/1.2-CHECK/22-ACL.sql | 20 ------------- services/db/install/dump/dumpedFixtures.sql | 28 +++++++++---------- 4 files changed, 16 insertions(+), 36 deletions(-) delete mode 100644 services/db/install/changes/1.2-CHECK/22-ACL.sql diff --git a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js index 91742695c..505026df0 100644 --- a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js +++ b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js @@ -7,7 +7,7 @@ describe('Client activeWorkersWithRole', () => { let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson'); - expect(result.length).toEqual(10); + expect(result.length).toEqual(11); expect(isSalesPerson).toBeTruthy(); }); diff --git a/modules/client/back/methods/client/specs/listWorkers.spec.js b/modules/client/back/methods/client/specs/listWorkers.spec.js index 86c0e5fe7..4b85e1c51 100644 --- a/modules/client/back/methods/client/specs/listWorkers.spec.js +++ b/modules/client/back/methods/client/specs/listWorkers.spec.js @@ -6,7 +6,7 @@ describe('Client listWorkers', () => { .then(result => { let amountOfEmployees = Object.keys(result).length; - expect(amountOfEmployees).toEqual(43); + expect(amountOfEmployees).toEqual(44); done(); }) .catch(done.fail); diff --git a/services/db/install/changes/1.2-CHECK/22-ACL.sql b/services/db/install/changes/1.2-CHECK/22-ACL.sql deleted file mode 100644 index d388defa9..000000000 --- a/services/db/install/changes/1.2-CHECK/22-ACL.sql +++ /dev/null @@ -1,20 +0,0 @@ -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('Zone','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('ZoneGeo','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('ZoneCalendar','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('ZoneIncluded','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('LabourHoliday','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('LabourHolidayType','*','READ','ALLOW','ROLE','employee'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('Zone','*','WRITE','ALLOW','ROLE','deliveryBoss'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'); -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) -VALUES ('ZoneIncluded','*','WRITE','ALLOW','ROLE','deliveryBoss'); diff --git a/services/db/install/dump/dumpedFixtures.sql b/services/db/install/dump/dumpedFixtures.sql index ea5dd66d0..7fe7bfd16 100644 --- a/services/db/install/dump/dumpedFixtures.sql +++ b/services/db/install/dump/dumpedFixtures.sql @@ -22,7 +22,7 @@ USE `account`; LOCK TABLES `role` WRITE; /*!40000 ALTER TABLE `role` DISABLE KEYS */; -INSERT INTO `role` VALUES (0,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2018-04-23 14:33:59'),(1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de departamento',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Departamento de gerencia',1,'2017-06-01 14:57:02','2017-06-01 14:57:51'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',0,'2018-02-16 14:07:10','2018-02-23 13:30:32'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',0,'2018-02-26 15:28:23','2019-01-21 12:57:21'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'creditInsurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2018-03-05 07:44:35'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'); +INSERT INTO `role` VALUES (0,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2018-04-23 14:33:59'),(1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de departamento',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Departamento de gerencia',1,'2017-06-01 14:57:02','2017-06-01 14:57:51'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',0,'2018-02-16 14:07:10','2018-02-23 13:30:32'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',0,'2018-02-26 15:28:23','2019-01-21 12:57:21'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'creditInsuranc','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2018-03-05 07:44:35'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'); /*!40000 ALTER TABLE `role` ENABLE KEYS */; UNLOCK TABLES; @@ -32,7 +32,7 @@ UNLOCK TABLES; LOCK TABLES `roleRole` WRITE; /*!40000 ALTER TABLE `roleRole` DISABLE KEYS */; -INSERT INTO `roleRole` VALUES (0,0),(0,1),(0,2),(0,3),(0,5),(0,6),(0,9),(0,11),(0,13),(0,15),(0,16),(0,17),(0,18),(0,19),(0,20),(0,21),(0,22),(0,30),(0,31),(0,32),(0,33),(0,34),(0,35),(0,36),(0,37),(0,38),(0,39),(0,40),(0,41),(0,42),(0,43),(0,44),(0,45),(0,47),(0,48),(0,49),(0,50),(0,51),(0,52),(0,53),(0,54),(0,55),(0,56),(0,57),(0,58),(0,59),(1,1),(1,2),(1,3),(1,6),(1,11),(2,2),(2,6),(2,11),(3,3),(3,6),(3,11),(5,1),(5,2),(5,3),(5,5),(5,6),(5,11),(5,13),(5,18),(5,19),(5,21),(5,33),(5,53),(6,6),(9,0),(9,1),(9,2),(9,3),(9,5),(9,6),(9,9),(9,11),(9,13),(9,15),(9,16),(9,17),(9,18),(9,19),(9,20),(9,21),(9,22),(9,30),(9,31),(9,32),(9,33),(9,34),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),(9,41),(9,42),(9,43),(9,44),(9,45),(9,47),(9,48),(9,49),(9,50),(9,51),(9,52),(9,53),(9,54),(9,55),(9,56),(9,57),(9,58),(9,59),(11,6),(11,11),(13,1),(13,2),(13,3),(13,6),(13,11),(13,13),(15,1),(15,2),(15,3),(15,6),(15,11),(15,15),(15,35),(16,1),(16,2),(16,3),(16,6),(16,11),(16,13),(16,15),(16,16),(16,35),(17,1),(17,2),(17,3),(17,5),(17,6),(17,11),(17,13),(17,17),(17,18),(17,19),(17,20),(17,21),(17,33),(17,35),(17,37),(17,39),(17,53),(18,1),(18,2),(18,3),(18,6),(18,11),(18,18),(19,1),(19,2),(19,3),(19,6),(19,11),(19,13),(19,18),(19,19),(19,21),(19,53),(20,1),(20,2),(20,3),(20,6),(20,11),(20,13),(20,20),(20,35),(21,1),(21,2),(21,3),(21,6),(21,11),(21,13),(21,18),(21,21),(21,53),(22,1),(22,2),(22,3),(22,6),(22,11),(22,13),(22,18),(22,21),(22,22),(22,53),(30,1),(30,2),(30,3),(30,5),(30,6),(30,11),(30,13),(30,18),(30,19),(30,20),(30,21),(30,22),(30,30),(30,33),(30,35),(30,53),(31,1),(31,2),(31,3),(31,6),(31,11),(31,31),(32,1),(32,2),(32,3),(32,6),(32,11),(32,32),(33,33),(34,1),(34,2),(34,3),(34,6),(34,11),(34,13),(34,33),(34,34),(35,1),(35,2),(35,3),(35,6),(35,11),(35,35),(36,1),(36,2),(36,3),(36,6),(36,11),(36,36),(36,44),(36,47),(37,1),(37,2),(37,3),(37,6),(37,11),(37,37),(38,1),(38,2),(38,3),(38,6),(38,11),(38,37),(38,38),(39,1),(39,2),(39,3),(39,5),(39,6),(39,11),(39,13),(39,18),(39,19),(39,21),(39,33),(39,39),(39,53),(40,1),(40,2),(40,3),(40,6),(40,11),(40,40),(41,1),(41,2),(41,3),(41,6),(41,11),(41,13),(41,40),(41,41),(42,1),(42,2),(42,3),(42,6),(42,11),(42,42),(43,1),(43,2),(43,3),(43,6),(43,11),(43,13),(43,42),(43,43),(44,1),(44,2),(44,3),(44,6),(44,11),(44,44),(45,1),(45,2),(45,3),(45,6),(45,11),(45,13),(45,44),(45,45),(47,1),(47,2),(47,3),(47,6),(47,11),(47,47),(48,1),(48,2),(48,3),(48,6),(48,11),(48,13),(48,47),(48,48),(49,1),(49,2),(49,3),(49,6),(49,11),(49,36),(49,44),(49,47),(49,49),(49,58),(50,1),(50,2),(50,3),(50,6),(50,11),(50,13),(50,36),(50,44),(50,47),(50,49),(50,50),(50,58),(50,59),(51,1),(51,2),(51,3),(51,6),(51,11),(51,51),(52,1),(52,2),(52,3),(52,6),(52,11),(52,13),(52,35),(52,51),(52,52),(53,1),(53,2),(53,3),(53,6),(53,11),(53,53),(54,1),(54,2),(54,3),(54,6),(54,11),(54,54),(55,1),(55,2),(55,3),(55,6),(55,11),(55,13),(55,54),(55,55),(56,1),(56,2),(56,3),(56,6),(56,11),(56,56),(57,1),(57,2),(57,3),(57,6),(57,11),(57,13),(57,56),(57,57),(58,1),(58,2),(58,3),(58,6),(58,11),(58,58),(59,1),(59,2),(59,3),(59,6),(59,11),(59,13),(59,58),(59,59); +INSERT INTO `roleRole` VALUES (0,0),(0,1),(0,2),(0,3),(0,5),(0,6),(0,9),(0,11),(0,13),(0,15),(0,16),(0,17),(0,18),(0,19),(0,20),(0,21),(0,22),(0,30),(0,31),(0,32),(0,33),(0,34),(0,35),(0,36),(0,37),(0,38),(0,39),(0,40),(0,41),(0,42),(0,43),(0,44),(0,45),(0,47),(0,48),(0,49),(0,50),(0,51),(0,52),(0,53),(0,54),(0,55),(0,56),(0,57),(0,58),(0,59),(0,60),(1,1),(1,2),(1,3),(1,6),(1,11),(2,2),(2,6),(2,11),(3,3),(3,6),(3,11),(5,1),(5,2),(5,3),(5,5),(5,6),(5,11),(5,13),(5,18),(5,19),(5,21),(5,33),(5,53),(6,6),(9,0),(9,1),(9,2),(9,3),(9,5),(9,6),(9,9),(9,11),(9,13),(9,15),(9,16),(9,17),(9,18),(9,19),(9,20),(9,21),(9,22),(9,30),(9,31),(9,32),(9,33),(9,34),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),(9,41),(9,42),(9,43),(9,44),(9,45),(9,47),(9,48),(9,49),(9,50),(9,51),(9,52),(9,53),(9,54),(9,55),(9,56),(9,57),(9,58),(9,59),(9,60),(11,6),(11,11),(13,1),(13,2),(13,3),(13,6),(13,11),(13,13),(15,1),(15,2),(15,3),(15,6),(15,11),(15,15),(15,35),(16,1),(16,2),(16,3),(16,6),(16,11),(16,13),(16,15),(16,16),(16,35),(17,1),(17,2),(17,3),(17,5),(17,6),(17,11),(17,13),(17,17),(17,18),(17,19),(17,20),(17,21),(17,33),(17,35),(17,37),(17,39),(17,53),(18,1),(18,2),(18,3),(18,6),(18,11),(18,18),(19,1),(19,2),(19,3),(19,6),(19,11),(19,13),(19,18),(19,19),(19,21),(19,53),(20,1),(20,2),(20,3),(20,6),(20,11),(20,13),(20,20),(20,35),(21,1),(21,2),(21,3),(21,6),(21,11),(21,13),(21,18),(21,21),(21,53),(22,1),(22,2),(22,3),(22,6),(22,11),(22,13),(22,18),(22,21),(22,22),(22,53),(30,1),(30,2),(30,3),(30,5),(30,6),(30,11),(30,13),(30,18),(30,19),(30,20),(30,21),(30,22),(30,30),(30,33),(30,35),(30,53),(31,1),(31,2),(31,3),(31,6),(31,11),(31,31),(32,1),(32,2),(32,3),(32,6),(32,11),(32,32),(33,33),(34,1),(34,2),(34,3),(34,6),(34,11),(34,13),(34,33),(34,34),(35,1),(35,2),(35,3),(35,6),(35,11),(35,35),(36,1),(36,2),(36,3),(36,6),(36,11),(36,36),(36,44),(36,47),(37,1),(37,2),(37,3),(37,6),(37,11),(37,37),(38,1),(38,2),(38,3),(38,6),(38,11),(38,37),(38,38),(39,1),(39,2),(39,3),(39,5),(39,6),(39,11),(39,13),(39,18),(39,19),(39,21),(39,33),(39,39),(39,53),(40,1),(40,2),(40,3),(40,6),(40,11),(40,40),(41,1),(41,2),(41,3),(41,6),(41,11),(41,13),(41,40),(41,41),(42,1),(42,2),(42,3),(42,6),(42,11),(42,42),(43,1),(43,2),(43,3),(43,6),(43,11),(43,13),(43,42),(43,43),(44,1),(44,2),(44,3),(44,6),(44,11),(44,44),(45,1),(45,2),(45,3),(45,6),(45,11),(45,13),(45,44),(45,45),(47,1),(47,2),(47,3),(47,6),(47,11),(47,47),(48,1),(48,2),(48,3),(48,6),(48,11),(48,13),(48,47),(48,48),(49,1),(49,2),(49,3),(49,6),(49,11),(49,36),(49,44),(49,47),(49,49),(49,58),(50,1),(50,2),(50,3),(50,6),(50,11),(50,13),(50,36),(50,44),(50,47),(50,49),(50,50),(50,58),(50,59),(51,1),(51,2),(51,3),(51,6),(51,11),(51,51),(52,1),(52,2),(52,3),(52,6),(52,11),(52,13),(52,35),(52,51),(52,52),(53,1),(53,2),(53,3),(53,6),(53,11),(53,53),(54,1),(54,2),(54,3),(54,6),(54,11),(54,54),(55,1),(55,2),(55,3),(55,6),(55,11),(55,13),(55,54),(55,55),(56,1),(56,2),(56,3),(56,6),(56,11),(56,56),(57,1),(57,2),(57,3),(57,6),(57,11),(57,13),(57,56),(57,57),(58,1),(58,2),(58,3),(58,6),(58,11),(58,58),(59,1),(59,2),(59,3),(59,6),(59,11),(59,13),(59,58),(59,59),(60,1),(60,2),(60,3),(60,5),(60,6),(60,11),(60,13),(60,18),(60,19),(60,21),(60,33),(60,36),(60,44),(60,47),(60,49),(60,50),(60,53),(60,58),(60,59),(60,60); /*!40000 ALTER TABLE `roleRole` ENABLE KEYS */; UNLOCK TABLES; @@ -42,7 +42,7 @@ UNLOCK TABLES; LOCK TABLES `roleInherit` WRITE; /*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */; -INSERT INTO `roleInherit` VALUES (9,0),(5,1),(13,1),(18,1),(31,1),(32,1),(34,1),(35,1),(37,1),(40,1),(42,1),(44,1),(47,1),(51,1),(53,1),(54,1),(56,1),(58,1),(1,2),(1,3),(30,5),(39,5),(11,6),(1,11),(2,11),(3,11),(16,13),(20,13),(21,13),(22,13),(34,13),(41,13),(43,13),(45,13),(48,13),(50,13),(52,13),(55,13),(57,13),(59,13),(16,15),(21,18),(5,19),(17,20),(30,20),(19,21),(22,21),(39,21),(30,22),(5,33),(34,33),(15,35),(20,35),(52,35),(49,36),(17,37),(38,37),(17,39),(41,40),(43,42),(36,44),(45,44),(36,47),(48,47),(50,49),(52,51),(21,53),(30,53),(55,54),(57,56),(49,58),(59,58),(50,59); +INSERT INTO `roleInherit` VALUES (9,0),(5,1),(13,1),(18,1),(31,1),(32,1),(34,1),(35,1),(37,1),(40,1),(42,1),(44,1),(47,1),(51,1),(53,1),(54,1),(56,1),(58,1),(1,2),(1,3),(30,5),(39,5),(60,5),(11,6),(1,11),(2,11),(3,11),(16,13),(20,13),(21,13),(22,13),(34,13),(41,13),(43,13),(45,13),(48,13),(50,13),(52,13),(55,13),(57,13),(59,13),(16,15),(21,18),(5,19),(17,20),(30,20),(19,21),(22,21),(39,21),(30,22),(5,33),(34,33),(15,35),(20,35),(52,35),(49,36),(17,37),(38,37),(17,39),(41,40),(43,42),(36,44),(45,44),(36,47),(48,47),(50,49),(60,50),(52,51),(21,53),(30,53),(55,54),(57,56),(49,58),(59,58),(50,59); /*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -55,7 +55,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:35 +-- Dump completed on 2019-01-31 8:14:32 USE `salix`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -80,7 +80,7 @@ USE `salix`; LOCK TABLES `ACL` WRITE; /*!40000 ALTER TABLE `ACL` DISABLE KEYS */; -INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','employee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','employee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','employee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','employee'),(30,'GreugeType','*','READ','ALLOW','ROLE','employee'),(31,'Mandate','*','READ','ALLOW','ROLE','employee'),(32,'MandateType','*','READ','ALLOW','ROLE','employee'),(33,'Company','*','READ','ALLOW','ROLE','employee'),(34,'Greuge','*','READ','ALLOW','ROLE','employee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','employee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','creditInsurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','creditInsurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','removes','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','*','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','salesPerson'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','employee'),(111,'ClientLog','*','READ','ALLOW','ROLE','employee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','employee'),(114,'Receipt','*','READ','ALLOW','ROLE','employee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','salesPerson'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','employee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','employee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'); +INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','employee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','employee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','employee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','employee'),(30,'GreugeType','*','READ','ALLOW','ROLE','employee'),(31,'Mandate','*','READ','ALLOW','ROLE','employee'),(32,'MandateType','*','READ','ALLOW','ROLE','employee'),(33,'Company','*','READ','ALLOW','ROLE','employee'),(34,'Greuge','*','READ','ALLOW','ROLE','employee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','employee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','creditInsurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','creditInsurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','removes','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','*','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','salesPerson'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','employee'),(111,'ClientLog','*','READ','ALLOW','ROLE','employee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','employee'),(114,'Receipt','*','READ','ALLOW','ROLE','employee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','salesPerson'),(123,'Worker','*','READ','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','employee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','employee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(134,'Zone','*','READ','ALLOW','ROLE','employee'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','WRITE','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','WRITE','ALLOW','ROLE','deliveryBoss'); /*!40000 ALTER TABLE `ACL` ENABLE KEYS */; UNLOCK TABLES; @@ -103,7 +103,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:35 +-- Dump completed on 2019-01-31 8:14:32 USE `vn`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -201,7 +201,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:35 +-- Dump completed on 2019-01-31 8:14:32 USE `vn2008`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -376,7 +376,7 @@ UNLOCK TABLES; LOCK TABLES `department` WRITE; /*!40000 ALTER TABLE `department` DISABLE KEYS */; -INSERT INTO `department` VALUES (1,'VERDNATURA',1,52,1,0,NULL,NULL,NULL,NULL,0),(22,'COMPRAS',29,30,NULL,72,49,596,2,5,0),(23,'CAMARA',23,23,NULL,72,49,604,2,6,0),(31,'INFORMATICA',40,41,NULL,72,44,127,3,9,0),(34,'CONTABILIDAD',35,36,NULL,0,NULL,NULL,NULL,NULL,0),(35,'FINANZAS',33,34,NULL,0,NULL,NULL,NULL,NULL,0),(36,'LABORAL',37,38,NULL,0,NULL,NULL,NULL,NULL,0),(37,'PRODUCCION',42,49,NULL,72,44,230,3,11,0),(38,'SACADO',47,48,NULL,72,37,230,4,14,1),(39,'ENCAJADO',45,46,NULL,72,37,230,4,12,1),(40,'CONTROLADORES',43,44,NULL,72,37,619,4,13,0),(41,'ADMINISTRACION',32,39,NULL,72,44,599,3,8,0),(42,'COMERCIAL',26,31,NULL,72,49,1002,2,3,0),(43,'VENTAS',27,28,NULL,0,NULL,NULL,NULL,NULL,0),(44,'GERENCIA',24,25,NULL,72,49,300,2,7,0),(45,'LOGISTICA',18,45,NULL,72,44,596,3,19,0),(46,'REPARTO',21,22,NULL,72,44,659,3,10,0),(47,'CARGA',15,16,NULL,0,NULL,NULL,NULL,NULL,0),(48,'ALMACENAJE',12,17,NULL,0,NULL,NULL,NULL,NULL,0),(49,'PROPIEDAD',10,11,NULL,72,NULL,1008,1,1,0),(51,'DESCARGA',13,14,NULL,0,NULL,NULL,NULL,NULL,0),(52,'CARGA AEREA',19,20,NULL,72,66,163,4,28,0),(53,'MARKETING Y COMUNICACIÓN',50,51,NULL,72,44,1238,0,0,0),(54,'ORNAMENTALES',54,54,NULL,72,44,433,3,21,0),(55,'TALLER Y CONFECCION',4,9,NULL,72,49,695,2,23,0),(56,'TALLER ARTIFICIAL',7,8,NULL,72,49,1780,2,24,0),(57,'SECO',5,6,NULL,0,NULL,NULL,NULL,NULL,0),(58,'CAMPOS',2,3,NULL,72,49,225,2,2,0),(59,'MANTENIMIENTO',52,53,NULL,72,37,230,4,16,0),(60,'RECLAMACIONES',60,60,NULL,72,42,563,3,20,0),(61,'VNH',61,61,NULL,73,44,1297,3,17,0),(63,'VENTAS FRANCIA',63,63,NULL,72,49,277,2,27,0),(64,'PLANTAS',64,64,NULL,72,49,617,2,25,0),(66,'VERDNAMADRID',66,66,NULL,72,44,163,3,18,0),(68,'COMPLEMENTOS',68,68,NULL,72,64,617,3,26,0),(69,'VERDNABARNA',69,69,NULL,74,44,432,3,22,0),(77,'PALETIZADO',77,77,NULL,72,37,230,4,15,1),(80,'EQUIPO J VALLES',80,80,NULL,72,42,693,3,4,0),(86,'LIMPIEZA',86,86,NULL,72,44,599,0,0,0),(88,'CONTROL',88,88,NULL,0,NULL,NULL,NULL,NULL,0),(89,'COORDINACION',89,89,NULL,0,NULL,NULL,NULL,NULL,0); +INSERT INTO `department` VALUES (1,'VERDNATURA',1,52,1,0,NULL,NULL,NULL,NULL,0),(22,'COMPRAS',29,30,NULL,72,49,596,2,5,0),(23,'CAMARA',23,23,NULL,72,49,604,2,6,0),(31,'INFORMATICA',40,41,NULL,72,44,127,3,9,0),(34,'CONTABILIDAD',35,36,NULL,0,NULL,NULL,NULL,NULL,0),(35,'FINANZAS',33,34,NULL,0,NULL,NULL,NULL,NULL,0),(36,'LABORAL',37,38,NULL,0,NULL,NULL,NULL,NULL,0),(37,'PRODUCCION',42,49,NULL,72,44,230,3,11,0),(38,'SACADO',47,48,NULL,72,37,230,4,14,1),(39,'ENCAJADO',45,46,NULL,72,37,230,4,12,1),(40,'CONTROLADORES',43,44,NULL,72,37,619,4,13,0),(41,'ADMINISTRACION',32,39,NULL,72,44,599,3,8,0),(42,'COMERCIAL',26,31,NULL,72,49,1002,2,3,0),(43,'VENTAS',27,28,NULL,0,NULL,NULL,NULL,NULL,0),(44,'GERENCIA',24,25,NULL,72,49,300,2,7,0),(45,'LOGISTICA',18,45,NULL,72,44,596,3,19,0),(46,'REPARTO',21,22,NULL,72,44,659,3,10,0),(47,'CARGA',15,16,NULL,0,NULL,NULL,NULL,NULL,0),(48,'ALMACENAJE',12,17,NULL,0,NULL,NULL,NULL,NULL,0),(49,'PROPIEDAD',10,11,NULL,72,NULL,1008,1,1,0),(51,'DESCARGA',13,14,NULL,0,NULL,NULL,NULL,NULL,0),(52,'CARGA AEREA',19,20,NULL,72,66,163,4,28,0),(53,'MARKETING Y COMUNICACIÓN',50,51,NULL,72,44,1238,0,0,0),(54,'ORNAMENTALES',54,54,NULL,72,44,433,3,21,0),(55,'TALLER Y CONFECCION',4,9,NULL,72,49,695,2,23,0),(56,'TALLER ARTIFICIAL',7,8,NULL,72,49,1780,2,24,0),(57,'SECO',5,6,NULL,0,NULL,NULL,NULL,NULL,0),(58,'CAMPOS',2,3,NULL,72,49,225,2,2,0),(59,'MANTENIMIENTO',52,53,NULL,72,37,230,4,16,0),(60,'RECLAMACIONES',60,60,NULL,72,42,563,3,20,0),(61,'VNH',61,61,NULL,73,44,1297,3,17,0),(63,'VENTAS FRANCIA',63,63,NULL,72,49,277,2,27,0),(64,'PLANTAS',64,64,NULL,72,49,617,2,25,0),(66,'VERDNAMADRID',66,66,NULL,72,44,163,3,18,0),(68,'COMPLEMENTOS',68,68,NULL,72,64,617,3,26,0),(69,'VERDNABARNA',69,69,NULL,74,44,432,3,22,0),(77,'PALETIZADO',77,77,NULL,72,37,230,4,15,1),(80,'EQUIPO J VALLES',80,80,NULL,72,42,693,3,4,0),(86,'LIMPIEZA',86,86,NULL,72,44,599,0,0,0),(88,'CONTROL',88,88,NULL,0,NULL,NULL,NULL,NULL,0),(89,'COORDINACION',89,89,NULL,0,NULL,NULL,NULL,NULL,1); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; @@ -399,7 +399,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:36 +-- Dump completed on 2019-01-31 8:14:32 USE `bi`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -447,7 +447,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:36 +-- Dump completed on 2019-01-31 8:14:33 USE `cache`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -485,7 +485,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:36 +-- Dump completed on 2019-01-31 8:14:33 USE `hedera`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -543,7 +543,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:36 +-- Dump completed on 2019-01-31 8:14:33 USE `postgresql`; -- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64) -- @@ -608,7 +608,7 @@ UNLOCK TABLES; LOCK TABLES `calendar_labour_type` WRITE; /*!40000 ALTER TABLE `calendar_labour_type` DISABLE KEYS */; -INSERT INTO `calendar_labour_type` VALUES (1,'Horario general','00:20:00',40),(2,'Horario 35h/semana','00:20:00',35),(3,'Horario 20h/semana','00:00:00',20),(4,'Festivo y Fin de semana','00:00:00',0),(5,'Horario 30h/semana','00:20:00',30),(6,'Horario 25h/semana','00:20:00',25),(7,'Vacaciones trabajadas','00:00:00',0),(8,'Vacaciones','00:00:00',0),(9,'Horario 26h/semana','00:20:00',26),(10,'Horario 28h/semana','00:20:00',28),(11,'Horario 8h/semana','00:00:00',8),(12,'Horario 16h/semana','00:00:00',16),(13,'Horario 32h/semana','00:20:00',32),(14,'Horario 24h/semana','00:20:00',24),(15,'Horario 10h/semana','00:00:00',10),(16,'Horario 27,5h/semana','00:20:00',28),(17,'Horario 13,5h/semana','00:20:00',14),(18,'Horario 31h/semana',NULL,31),(19,'Horario 21,5h/semana',NULL,22),(20,'Horario 34h/semana',NULL,34),(21,'Horario 17h/semana',NULL,17),(22,'Horario 18h/semana',NULL,18),(23,'Horario 37,5 h/semana',NULL,38),(24,'Horario 29 h/semana',NULL,29),(25,'Horario 12h/semana',NULL,12),(26,'Horario 10h/semana',NULL,10),(27,'Horario 15h/semana',NULL,15); +INSERT INTO `calendar_labour_type` VALUES (1,'Horario general','00:20:00',40),(2,'Horario 35h/semana','00:20:00',35),(3,'Horario 20h/semana','00:00:00',20),(4,'Festivo y Fin de semana','00:00:00',0),(5,'Horario 30h/semana','00:20:00',30),(6,'Horario 25h/semana','00:20:00',25),(7,'Vacaciones trabajadas','00:00:00',0),(8,'Vacaciones','00:00:00',0),(9,'Horario 26h/semana','00:20:00',26),(10,'Horario 28h/semana','00:20:00',28),(11,'Horario 8h/semana','00:00:00',8),(12,'Horario 16h/semana','00:00:00',16),(13,'Horario 32h/semana','00:20:00',32),(14,'Horario 24h/semana','00:20:00',24),(15,'Horario 10h/semana','00:00:00',10),(16,'Horario 27,5h/semana','00:20:00',28),(17,'Horario 13,5h/semana','00:20:00',14),(18,'Horario 31h/semana',NULL,31),(19,'Horario 21,5h/semana',NULL,22),(20,'Horario 34h/semana',NULL,34),(21,'Horario 17h/semana',NULL,17),(22,'Horario 18h/semana',NULL,18),(23,'Horario 37,5 h/semana',NULL,38),(24,'Horario 29 h/semana',NULL,29),(25,'Horario 12h/semana',NULL,12),(26,'Horario 10h/semana',NULL,10),(27,'Horario 15h/semana',NULL,15),(28,'Horario 9h/semana',NULL,9); /*!40000 ALTER TABLE `calendar_labour_type` ENABLE KEYS */; UNLOCK TABLES; @@ -631,4 +631,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-01-24 13:49:36 +-- Dump completed on 2019-01-31 8:14:33 From 19cfa1ab7583d2c577bedc655026d5be9bd9cc7e Mon Sep 17 00:00:00 2001 From: Bernat Date: Thu, 31 Jan 2019 09:12:29 +0100 Subject: [PATCH 11/15] upadte structure db and models --- modules/worker/back/models/worker-department.json | 2 +- modules/worker/back/models/worker-media.json | 2 +- services/db/install/changes/1.2-CHECK/15-personMedia.sql | 2 +- .../{19-personDepartment.sql => 19-workerDepartment.sql} | 6 ++---- 4 files changed, 5 insertions(+), 7 deletions(-) rename services/db/install/changes/1.2-CHECK/{19-personDepartment.sql => 19-workerDepartment.sql} (82%) diff --git a/modules/worker/back/models/worker-department.json b/modules/worker/back/models/worker-department.json index 461009c96..188c308cc 100644 --- a/modules/worker/back/models/worker-department.json +++ b/modules/worker/back/models/worker-department.json @@ -3,7 +3,7 @@ "base": "VnModel", "options": { "mysql": { - "table": "personDepartment" + "table": "workerDepartment" } }, "properties": { diff --git a/modules/worker/back/models/worker-media.json b/modules/worker/back/models/worker-media.json index e86f9e1ac..805ff383b 100644 --- a/modules/worker/back/models/worker-media.json +++ b/modules/worker/back/models/worker-media.json @@ -3,7 +3,7 @@ "base": "VnModel", "options": { "mysql": { - "table": "personMedia" + "table": "workerMedia" } }, "properties": { diff --git a/services/db/install/changes/1.2-CHECK/15-personMedia.sql b/services/db/install/changes/1.2-CHECK/15-personMedia.sql index 2d517f478..d678a3805 100644 --- a/services/db/install/changes/1.2-CHECK/15-personMedia.sql +++ b/services/db/install/changes/1.2-CHECK/15-personMedia.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER -VIEW `personMedia` AS +VIEW `workerMedia` AS SELECT `p`.`id_trabajador` AS `workerFk`, `m`.`value` AS `mediaValue` diff --git a/services/db/install/changes/1.2-CHECK/19-personDepartment.sql b/services/db/install/changes/1.2-CHECK/19-workerDepartment.sql similarity index 82% rename from services/db/install/changes/1.2-CHECK/19-personDepartment.sql rename to services/db/install/changes/1.2-CHECK/19-workerDepartment.sql index 523743326..5f5d6f8f0 100644 --- a/services/db/install/changes/1.2-CHECK/19-personDepartment.sql +++ b/services/db/install/changes/1.2-CHECK/19-workerDepartment.sql @@ -3,12 +3,10 @@ CREATE OR REPLACE ALGORITHM = UNDEFINED DEFINER = `root`@`%` SQL SECURITY DEFINER -VIEW `vn`.`personDepartment` AS +VIEW `vn`.`workerDepartment` AS SELECT `p`.`id_trabajador` AS `workerFk`, - `p`.`name` AS `name`, - `p`.`firstname` AS `firstname`, - `d`.`name` AS `department` + `d`.`name` AS `departmentFk` FROM (((`postgresql`.`person` `p` JOIN `postgresql`.`profile` `pr` ON ((`pr`.`person_id` = `p`.`person_id`))) From 0ca4881fdd771c9874c9b54d1e71cbe588202dbd Mon Sep 17 00:00:00 2001 From: Bernat Date: Thu, 31 Jan 2019 09:12:45 +0100 Subject: [PATCH 12/15] fix test --- .../item/back/methods/item/specs/getLastEntries.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/item/back/methods/item/specs/getLastEntries.spec.js b/modules/item/back/methods/item/specs/getLastEntries.spec.js index 26d82a253..5c28d16bd 100644 --- a/modules/item/back/methods/item/specs/getLastEntries.spec.js +++ b/modules/item/back/methods/item/specs/getLastEntries.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); describe('item getLastEntries()', () => { - it('should return one entry for a given item', async () => { + it('should return one entry for a given item', async() => { let date = new Date(); let filter = {where: {itemFk: 1, date: date}}; let result = await app.models.Item.getLastEntries(filter); @@ -9,9 +9,10 @@ describe('item getLastEntries()', () => { expect(result.length).toEqual(1); }); - it('should return three entries for a given item', async () => { + it('should return three entries for a given item', async() => { let date = new Date(); - date.setMonth(date.getMonth() - 2); + + date.setMonth(date.getMonth() - 2, 15); let filter = {where: {itemFk: 1, date: date}}; let result = await app.models.Item.getLastEntries(filter); From a49d937fd9d2cb502e14c062b2652bf38fd609e3 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 31 Jan 2019 09:47:52 +0100 Subject: [PATCH 13/15] ita-tag validation error + home shortcuts --- front/salix/components/home/home.html | 4 ++-- front/salix/components/home/style.scss | 4 ++-- loopback/locale/es.json | 5 +++-- modules/item/back/models/item-tag.js | 2 ++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/front/salix/components/home/home.html b/front/salix/components/home/home.html index 8187cf18b..cfc59bdc4 100644 --- a/front/salix/components/home/home.html +++ b/front/salix/components/home/home.html @@ -9,14 +9,14 @@

- +
diff --git a/front/salix/components/home/style.scss b/front/salix/components/home/style.scss index 63aabe639..a41cdac0c 100644 --- a/front/salix/components/home/style.scss +++ b/front/salix/components/home/style.scss @@ -57,9 +57,9 @@ vn-home { color: white; margin: 0; - & > .bind-letter { + /* & > .bind-letter { color: #FD0; - } + } */ } } } diff --git a/loopback/locale/es.json b/loopback/locale/es.json index cc08b120e..648989cb6 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -58,11 +58,12 @@ "You can't create an order for a inactive client": "You can't create an order for a inactive client", "You can't create an order for a client that doesn't has tax data verified": "You can't create an order for a client that doesn't has tax data verified", "You must delete the claim id %d first": "Antes debes borrar la reclamacion %d", - "You don't have enough privileges": "You don't have enough privileges", + "You don't have enough privileges": "No tienes suficientes permisos", "Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo", "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos", "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ", "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado", - "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo" + "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo", + "Tag value cannot be blank": "El valor del tag no puede quedar en blanco" } \ No newline at end of file diff --git a/modules/item/back/models/item-tag.js b/modules/item/back/models/item-tag.js index 23a0748f7..cfc2e883b 100644 --- a/modules/item/back/models/item-tag.js +++ b/modules/item/back/models/item-tag.js @@ -3,6 +3,8 @@ let UserError = require('vn-loopback/util/user-error'); module.exports = Self => { require('../methods/item-tag/filterItemTags')(Self); + Self.validatesPresenceOf('value', {message: 'Tag value cannot be blank'}); + Self.rewriteDbError(function(err) { if (err.code === 'ER_DUP_ENTRY') return new UserError(`The tag can't be repeated`); From aac96f4b87131d56e683cdd5c3236d2cf13eb66a Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 31 Jan 2019 11:26:03 +0100 Subject: [PATCH 14/15] #1080 fallos de estilos en order prices-popover --- modules/item/front/locale/es.yml | 5 ++- modules/order/front/locale/es.yml | 7 ++++ modules/order/front/prices-popover/index.html | 40 ++++++++++++++----- modules/order/front/prices-popover/index.js | 7 ++++ modules/order/front/prices-popover/style.scss | 8 +++- 5 files changed, 55 insertions(+), 12 deletions(-) diff --git a/modules/item/front/locale/es.yml b/modules/item/front/locale/es.yml index 5e52960c2..065ba3316 100644 --- a/modules/item/front/locale/es.yml +++ b/modules/item/front/locale/es.yml @@ -34,6 +34,7 @@ Add barcode: Añadir código de barras Remove barcode: Quitar código de barras Buyer: Comprador No results: Sin resultados +Enter a new search: Introduce una nueva búsqueda Tag: Etiqueta Worker: Trabajador Available: Disponible @@ -46,14 +47,16 @@ Density: Densidad # Sections Items: Artículos +List: Listado New item: Nuevo artículo +Summary: Vista previa Basic data: Datos básicos Tax: IVA History: Historial Niches: Nichos Botanical: Botánico Barcodes: Códigos de barras -Diary: Registro +Diary: Histórico Item diary: Registro de compra-venta Last entries: Últimas entradas Tags: Etiquetas \ No newline at end of file diff --git a/modules/order/front/locale/es.yml b/modules/order/front/locale/es.yml index 1bc58c367..0b134783f 100644 --- a/modules/order/front/locale/es.yml +++ b/modules/order/front/locale/es.yml @@ -3,12 +3,19 @@ Catalog: Catálogo from: desde results: resultados More than: Más de +No results: Sin resultados +Enter a new search: Introduce una nueva búsqueda Plant: Planta Flower: Flor Handmade: Confección Green: Verde +Lines: Lineas Accessories: Complemento Category: Reino Search tag: Buscar etiqueta +Order by: Ordenar por +Order: Orden Price: Precio +Ascendant: Ascendente +Descendant: Descendente Created from: Creado desde \ No newline at end of file diff --git a/modules/order/front/prices-popover/index.html b/modules/order/front/prices-popover/index.html index 6a6957edd..5f3f3632e 100644 --- a/modules/order/front/prices-popover/index.html +++ b/modules/order/front/prices-popover/index.html @@ -1,6 +1,6 @@ - - +
+
@@ -8,7 +8,7 @@ - +
{{$ctrl.item.id}}
@@ -59,12 +59,32 @@
- - - - +
- +
diff --git a/modules/order/front/prices-popover/index.js b/modules/order/front/prices-popover/index.js index e1f8e3775..c44ff7109 100644 --- a/modules/order/front/prices-popover/index.js +++ b/modules/order/front/prices-popover/index.js @@ -26,6 +26,13 @@ class Controller { order: 'priority ASC', include: {relation: 'tag'} }; + this.quicklinks = { + btnOne: { + icon: 'icon-transaction', + state: `item.card.diary({id: ${this.item.id}})`, + tooltip: 'Diary' + } + }; this.$http.get(`/item/api/ItemTags?filter=${JSON.stringify(filter)}`).then(response => { this.tags = response.data; }); diff --git a/modules/order/front/prices-popover/style.scss b/modules/order/front/prices-popover/style.scss index 80bc98b57..729158c91 100644 --- a/modules/order/front/prices-popover/style.scss +++ b/modules/order/front/prices-popover/style.scss @@ -44,11 +44,17 @@ vn-order-prices-popover { vn-one.text{ padding-top:10px!important; } - vn-horizontal.buttons-bar{ padding-top: 16px; text-align: center; } + .quicklinks vn-icon { + font-size: 1.8em !important; + padding: 0 !important; + & > i { + line-height: 36px + } + } vn-one.error{ display: none; } From 1bcaf2756362dc629eeba30f17a164b35adeae92 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 31 Jan 2019 11:44:03 +0100 Subject: [PATCH 15/15] changed currency filter, fixed tag value errors --- e2e/paths/claim-module/03_detail.spec.js | 2 +- e2e/paths/client-module/14_risk.spec.js | 6 +- .../06_edit_basic_data_steps.spec.js | 2 +- front/core/filters/currency.js | 30 +- front/core/filters/specs/currency.spec.js | 14 +- gulpfile.js | 1 + loopback/locale/en.json | 3 +- modules/agency/front/descriptor/index.html | 4 +- modules/agency/front/index/index.html | 2 +- modules/agency/front/summary/index.html | 4 +- modules/claim/front/action/index.html | 10 +- modules/claim/front/detail/index.html | 12 +- modules/claim/front/summary/index.html | 6 +- .../insurance/index/index.html | 2 +- modules/client/front/descriptor/index.html | 4 +- modules/client/front/greuge/index/index.html | 4 +- .../client/front/recovery/index/index.html | 2 +- modules/client/front/risk/index/index.html | 8 +- modules/client/front/summary/index.html | 16 +- modules/client/front/web-payment/index.html | 2 +- modules/item/back/models/item-tag.js | 6 +- modules/order/front/catalog/index.html | 2 +- modules/order/front/descriptor/index.html | 2 +- modules/order/front/line/index.html | 8 +- modules/order/front/prices-popover/index.html | 2 +- modules/order/front/summary/index.html | 10 +- modules/ticket/front/component/index.html | 10 +- modules/ticket/front/data/step-two/index.html | 12 +- modules/ticket/front/index/index.html | 2 +- modules/ticket/front/picture/index.html | 2 +- modules/ticket/front/request/index/index.html | 2 +- modules/ticket/front/sale/editDiscount.html | 4 +- modules/ticket/front/sale/index.html | 16 +- modules/ticket/front/summary/index.html | 10 +- print/common/css/layout.css | 109 ++++--- print/config/routes.json | 2 + print/lib/reportEngine.js | 3 +- print/lib/router.js | 4 +- print/report/client-welcome/index.js | 6 +- .../letter-debtor-nd/assets/css/index.js | 6 + print/report/letter-debtor-nd/index.js | 36 ++- print/report/letter-debtor-nd/locale.js | 12 +- .../letter-debtor-st/assets/css/index.js | 6 + print/report/letter-debtor-st/index.js | 15 +- print/report/letter-debtor-st/locale.js | 6 +- .../report/report-footer/assets/css/style.css | 1 - .../assets/css/style.css | 13 + .../report/rpt-claim-pickup-order/index.html | 69 +++-- print/report/rpt-claim-pickup-order/locale.js | 2 +- .../rpt-letter-debtor/assets/css/index.js | 7 + .../rpt-letter-debtor/assets/css/style.css | 14 + print/report/rpt-letter-debtor/index.html | 77 +++++ print/report/rpt-letter-debtor/index.js | 98 +++++++ print/report/rpt-letter-debtor/locale.js | 16 ++ .../report/rpt-sepa-core/assets/css/index.js | 7 + .../report/rpt-sepa-core/assets/css/style.css | 14 + print/report/rpt-sepa-core/index.html | 270 ++++++++++++++++++ print/report/rpt-sepa-core/index.js | 67 +++++ print/report/rpt-sepa-core/locale.js | 19 ++ 59 files changed, 882 insertions(+), 219 deletions(-) create mode 100644 print/report/letter-debtor-nd/assets/css/index.js create mode 100644 print/report/letter-debtor-st/assets/css/index.js create mode 100644 print/report/rpt-letter-debtor/assets/css/index.js create mode 100644 print/report/rpt-letter-debtor/assets/css/style.css create mode 100644 print/report/rpt-letter-debtor/index.html create mode 100755 print/report/rpt-letter-debtor/index.js create mode 100644 print/report/rpt-letter-debtor/locale.js create mode 100644 print/report/rpt-sepa-core/assets/css/index.js create mode 100644 print/report/rpt-sepa-core/assets/css/style.css create mode 100644 print/report/rpt-sepa-core/index.html create mode 100755 print/report/rpt-sepa-core/index.js create mode 100644 print/report/rpt-sepa-core/locale.js diff --git a/e2e/paths/claim-module/03_detail.spec.js b/e2e/paths/claim-module/03_detail.spec.js index 1a7112ff8..55e12fc52 100644 --- a/e2e/paths/claim-module/03_detail.spec.js +++ b/e2e/paths/claim-module/03_detail.spec.js @@ -44,7 +44,7 @@ describe('Claim detail', () => { .waitToGetProperty(selectors.claimDetail.totalClaimed, 'innerText'); expect(claimedQuantity).toEqual('10'); - expect(totalClaimed).toEqual('29.50 €'); + expect(totalClaimed).toContain('29.50'); }); it('should delete the second item from the claim', async() => { diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index 9faea512c..964c0d9b1 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -65,7 +65,7 @@ describe('Client risk path', () => { expect(company).toEqual('VNL'); - expect(firstRiskLineBalance).toEqual('0.00 €'); + expect(firstRiskLineBalance).toContain('0.00'); }); it('should now click the new payment button', async() => { @@ -91,7 +91,7 @@ describe('Client risk path', () => { let result = await nightmare .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); - expect(result).toEqual('100.00 €'); + expect(result).toContain('100.00'); }); it('should again click the new payment button', async() => { @@ -117,7 +117,7 @@ describe('Client risk path', () => { let result = await nightmare .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); - expect(result).toEqual('-50.00 €'); + expect(result).toContain('-€50.00'); }); it('should now click on the Clients button of the top bar menu', async() => { diff --git a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js index a23363675..d48b67c81 100644 --- a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js +++ b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js @@ -73,7 +73,7 @@ describe('Ticket Edit basic data path', () => { .wait(1900) .waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText'); - expect(result).toContain('-187.75 €'); + expect(result).toContain('-€187.75'); }); it(`should then click next to move on to step three`, async() => { diff --git a/front/core/filters/currency.js b/front/core/filters/currency.js index 874305f08..d44457813 100644 --- a/front/core/filters/currency.js +++ b/front/core/filters/currency.js @@ -5,15 +5,29 @@ import ngModule from '../module'; * * @return {String} The formated number */ -export default function currency() { - return function(input, symbol, fractionSize) { - if (!fractionSize) - fractionSize = 2; - if (typeof input == 'number' && fractionSize) { - input = input.toFixed(fractionSize); - return `${input} ${symbol}`; + +export default function currency($translate) { + function currency(input, symbol = 'EUR', fractionSize = 2) { + let options = { + style: 'currency', + currency: symbol, + minimumFractionDigits: fractionSize, + maximumFractionDigits: fractionSize + }; + + if (typeof input == 'number') { + return new Intl.NumberFormat($translate.use(), options) + .format(input); } + return undefined; - }; + } + + currency.$stateful = true; + + return currency; } + +currency.$inject = ['$translate']; + ngModule.filter('currency', currency); diff --git a/front/core/filters/specs/currency.spec.js b/front/core/filters/specs/currency.spec.js index db5a0c163..28a4a3640 100644 --- a/front/core/filters/specs/currency.spec.js +++ b/front/core/filters/specs/currency.spec.js @@ -12,28 +12,28 @@ describe('Currency filter', () => { }; it('should return a ONE decimal number as per the argument', () => { - let html = `
{{200 | currency: '€': 1}}
`; + let html = `
{{200 | currency: 'EUR': 1}}
`; compile(html); - expect($element[0].innerHTML).toEqual('200.0 €'); + expect($element[0].innerHTML).toContain('200.0'); }); it('should return a TWO decimals number as per the argument', () => { - let html = `
{{200 | currency: '€': 2}}
`; + let html = `
{{200 | currency: 'EUR': 2}}
`; compile(html); - expect($element[0].innerHTML).toEqual('200.00 €'); + expect($element[0].innerHTML).toContain('200.00'); }); it('should return a TEN decimals number as per the argument', () => { - let html = `
{{200 | currency: '€': 10}}
`; + let html = `
{{200 | currency: 'EUR': 10}}
`; compile(html); - expect($element[0].innerHTML).toEqual('200.0000000000 €'); + expect($element[0].innerHTML).toContain('200.0000000000'); }); it('sould return nothing when the value is not set', () => { - let html = `
{{null | currency: '€': 2}}
`; + let html = `
{{null | currency: 'EUR': 2}}
`; compile(html); expect($element[0].innerHTML).toEqual(''); diff --git a/gulpfile.js b/gulpfile.js index fce5555ce..831ae6dde 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -50,6 +50,7 @@ function backWatch(done) { nodemon({ exec: commands.join(' && '), + ext: 'js html css', args: ['backOnly'], watch: backSources, done: done diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 06060fe67..b94e67a0c 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -30,5 +30,6 @@ "You can't create a ticket for a inactive client": "You can't create a ticket for a inactive client", "Worker cannot be blank": "Worker cannot be blank", "You must delete the claim id %d first": "You must delete the claim id %d first", - "You don't have enough privileges": "You don't have enough privileges" + "You don't have enough privileges": "You don't have enough privileges", + "Tag value cannot be blank": "Tag value cannot be blank" } \ No newline at end of file diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html index 27042bdfc..e3a42f346 100644 --- a/modules/agency/front/descriptor/index.html +++ b/modules/agency/front/descriptor/index.html @@ -35,10 +35,10 @@ value="{{$ctrl.zone.travelingDays}}"> + value="{{$ctrl.zone.price | currency: 'EUR': 2}}"> + value="{{$ctrl.zone.price | currency: 'EUR': 2}}">
diff --git a/modules/agency/front/index/index.html b/modules/agency/front/index/index.html index 17b978b70..9ee708672 100644 --- a/modules/agency/front/index/index.html +++ b/modules/agency/front/index/index.html @@ -37,7 +37,7 @@ {{::zone.agencyMode.name}} {{::zone.warehouse.name}} {{::zone.hour | date: 'HH:mm'}} - {{::zone.price | currency:'€':2}} + {{::zone.price | currency: 'EUR':2}} + value="{{::$ctrl.summary.price | currency: 'EUR': 2}}"> + value="{{::$ctrl.summary.price | currency: 'EUR': 2}}">
diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html index ff979c4be..f86b9650b 100644 --- a/modules/claim/front/action/index.html +++ b/modules/claim/front/action/index.html @@ -10,7 +10,7 @@
+ value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
@@ -75,12 +75,12 @@ {{saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}} {{saleClaimed.sale.quantity}} {{saleClaimed.sale.concept}} - {{saleClaimed.sale.price | currency:'€':2}} + {{saleClaimed.sale.price | currency: 'EUR':2}} {{saleClaimed.sale.discount}} % {{(saleClaimed.sale.quantity * saleClaimed.sale.price) - ((saleClaimed.sale.discount * - (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency:'€':2 + (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency: 'EUR':2 }} @@ -138,10 +138,10 @@ {{sale.landed | dateTime: 'dd/MM/yyyy'}} {{sale.quantity}} {{sale.concept}} - {{sale.price | currency:'€':2}} + {{sale.price | currency: 'EUR':2}} {{sale.discount}} % - {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2}} + {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}} diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html index c9f6a0f38..0c0fe1140 100644 --- a/modules/claim/front/detail/index.html +++ b/modules/claim/front/detail/index.html @@ -12,10 +12,10 @@
+ value="{{$ctrl.paidTotal | currency: 'EUR':2}}"> + value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
@@ -52,10 +52,10 @@
{{::saleClaimed.sale.concept}} - {{::saleClaimed.sale.price | currency:'€':2}} + {{::saleClaimed.sale.price | currency: 'EUR':2}} {{::saleClaimed.sale.discount}} % - {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency:'€':2}} + {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}} {{sale.landed | dateTime: 'dd/MM/yyyy'}} {{sale.quantity}} {{sale.concept}} - {{sale.price | currency:'€':2}} + {{sale.price | currency: 'EUR':2}} {{sale.discount}} % - {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2}} + {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}} diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html index 3966c6d5e..e624d7434 100644 --- a/modules/claim/front/summary/index.html +++ b/modules/claim/front/summary/index.html @@ -63,12 +63,12 @@ {{saleClaimed.sale.quantity}} {{saleClaimed.quantity}} {{saleClaimed.sale.concept}} - {{saleClaimed.sale.price | currency:'€':2}} + {{saleClaimed.sale.price | currency: 'EUR':2}} {{saleClaimed.sale.discount}} % {{(saleClaimed.sale.quantity * saleClaimed.sale.price) - ((saleClaimed.sale.discount * - (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency:'€':2 + (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency: 'EUR':2 }} @@ -138,7 +138,7 @@ {{(action.sale.quantity * action.sale.price) - ((action.sale.discount * - (action.sale.quantity * action.sale.price))/100) | currency:'€':2 + (action.sale.quantity * action.sale.price))/100) | currency: 'EUR':2 }} diff --git a/modules/client/front/credit-insurance/insurance/index/index.html b/modules/client/front/credit-insurance/insurance/index/index.html index fc58eaa29..6d74d01ea 100644 --- a/modules/client/front/credit-insurance/insurance/index/index.html +++ b/modules/client/front/credit-insurance/insurance/index/index.html @@ -18,7 +18,7 @@ - {{::insurance.credit | currency: ' €': 2}} + {{::insurance.credit | currency: 'EUR': 2}} {{::insurance.grade}} {{::insurance.created | date: 'dd/MM/yyyy'}} diff --git a/modules/client/front/descriptor/index.html b/modules/client/front/descriptor/index.html index 3c088add6..35df1f929 100644 --- a/modules/client/front/descriptor/index.html +++ b/modules/client/front/descriptor/index.html @@ -27,10 +27,10 @@ value="{{$ctrl.client.phone | phone}}"> + value="{{$ctrl.client.credit | currency: 'EUR': 2}}"> + value="{{$ctrl.client.creditInsurance | currency: 'EUR': 2}}"> diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index 213ccab53..3e3866b8f 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -15,7 +15,7 @@
+ value="{{edit.model.sumAmount | currency: 'EUR': 2}}">
@@ -33,7 +33,7 @@ {{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }} {{::greuge.description}} - {{::greuge.amount | currency: ' €': 2}} + {{::greuge.amount | currency: 'EUR': 2}} {{::greuge.greugeType.name}}
diff --git a/modules/client/front/recovery/index/index.html b/modules/client/front/recovery/index/index.html index 35bf0ea25..b130d73c2 100644 --- a/modules/client/front/recovery/index/index.html +++ b/modules/client/front/recovery/index/index.html @@ -32,7 +32,7 @@ {{::recovery.started | date:'dd/MM/yyyy' }} {{recovery.finished | date:'dd/MM/yyyy' }} - {{::recovery.amount | currency:' €': 0}} + {{::recovery.amount | currency: 'EUR': 0}} {{::recovery.period}} diff --git a/modules/client/front/risk/index/index.html b/modules/client/front/risk/index/index.html index a11e01724..8313a12f2 100644 --- a/modules/client/front/risk/index/index.html +++ b/modules/client/front/risk/index/index.html @@ -34,7 +34,7 @@ + value="{{riskByCompany.amount | currency: 'EUR':2}}">
@@ -65,9 +65,9 @@ BILL {{::risk.ref}} {{::risk.bankFk}} - {{::risk.debit | currency:'€':2}} - {{::risk.credit | currency:'€':2}} - {{risk.balance | currency:'€':2}} + {{::risk.debit | currency: 'EUR':2}} + {{::risk.credit | currency: 'EUR':2}} + {{risk.balance | currency: 'EUR':2}}

Business data

+ value="{{$ctrl.summary.totalGreuge | currency: 'EUR':2}}"> + value="{{$ctrl.summary.mana.mana | currency: 'EUR':2}}"> + value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}"> @@ -167,26 +167,26 @@

Financial information

diff --git a/modules/client/front/web-payment/index.html b/modules/client/front/web-payment/index.html index c148a2b52..94da3f9a5 100644 --- a/modules/client/front/web-payment/index.html +++ b/modules/client/front/web-payment/index.html @@ -33,7 +33,7 @@
{{::transaction.id}} - {{::transaction.amount | currency: '€':2}} + {{::transaction.amount | currency: 'EUR':2}} {{::transaction.created | dateTime:'dd/MM/yyyy'}} { require('../methods/item-tag/filterItemTags')(Self); - Self.validatesPresenceOf('value', {message: 'Tag value cannot be blank'}); + Self.rewriteDbError(function(err) { + if (err.code === 'ER_BAD_NULL_ERROR') + return new UserError(`Tag value cannot be blank`); + return err; + }); Self.rewriteDbError(function(err) { if (err.code === 'ER_DUP_ENTRY') diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index c4ba3e49a..26389c7b6 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -74,7 +74,7 @@ {{::item.available}} from - {{::item.price | currency: ' €': 2}} + {{::item.price | currency: 'EUR': 2}} diff --git a/modules/order/front/descriptor/index.html b/modules/order/front/descriptor/index.html index 51776be31..03b5f1f3f 100644 --- a/modules/order/front/descriptor/index.html +++ b/modules/order/front/descriptor/index.html @@ -35,7 +35,7 @@ value="{{$ctrl.order.rows.length || 0}}"> + value="{{$ctrl.order.total | currency: 'EUR': 2}}">
\ No newline at end of file diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index 32dcc9afe..0d8f21e1f 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -116,10 +116,10 @@ ng-click="$ctrl.showEditPricePopover($event, sale)" pointer vn-tooltip="Edit price"> - {{sale.price | currency:'€':2}} + {{sale.price | currency: 'EUR':2}} - {{sale.price | currency:'€':2}} + {{sale.price | currency: 'EUR':2}} - {{$ctrl.getSaleTotal(sale) | currency:'€':2}} + {{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}} @@ -146,15 +146,15 @@ ng-if="$ctrl.sales.length > 0">

Subtotal - {{$ctrl.subTotal | currency:'€':2}} + {{$ctrl.subTotal | currency: 'EUR':2}}

VAT - {{$ctrl.VAT | currency:'€':2}} + {{$ctrl.VAT | currency: 'EUR':2}}

Total - {{$ctrl.total | currency:'€':2}} + {{$ctrl.total | currency: 'EUR':2}}

@@ -169,7 +169,7 @@ vn-id="editPricePopover" on-open="$ctrl.getManaSalespersonMana()"> -
MANÁ: {{$ctrl.mana | currency:'€':0}}
+
MANÁ: {{$ctrl.mana | currency: 'EUR':0}}
New price

{{($ctrl.sale.quantity * $ctrl.editedPrice) - (($ctrl.sale.discount * ($ctrl.sale.quantity * $ctrl.editedPrice))/100) - | currency:'€':2}}

+ | currency: 'EUR':2}}

diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 508cb8928..c8535d5ec 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -46,9 +46,9 @@ -

Subtotal {{$ctrl.summary.subTotal | currency:' €':2}}

-

VAT {{$ctrl.summary.VAT | currency:' €':2}}

-

Total {{$ctrl.summary.total | currency:' €':2}}

+

Subtotal {{$ctrl.summary.subTotal | currency: 'EUR':2}}

+

VAT {{$ctrl.summary.VAT | currency: 'EUR':2}}

+

Total {{$ctrl.summary.total | currency: 'EUR':2}}

Sale

@@ -92,9 +92,9 @@ {{::sale.quantity}} - {{::sale.price | currency:'€':2}} + {{::sale.price | currency: 'EUR':2}} {{::sale.discount}} % - {{::sale.quantity * sale.price | currency:'€':2}} + {{::sale.quantity * sale.price | currency: 'EUR':2}} No results diff --git a/print/common/css/layout.css b/print/common/css/layout.css index 294593142..2f2a4f7c9 100644 --- a/print/common/css/layout.css +++ b/print/common/css/layout.css @@ -34,8 +34,8 @@ } .row { - margin-bottom: 15px; - overflow: hidden + white-space: nowrap; + margin-bottom: 15px } .row.small { @@ -52,10 +52,6 @@ box-sizing: border-box } -.row .text, .row .control { - overflow: hidden -} - .row .description { position: relative; padding-top: 2px; @@ -87,17 +83,18 @@ } .row.inline .text { + display: inline-block; margin-bottom: 0; width: 40%; - float: left + } .row.inline .control { + display: inline-block; font-weight: bold; padding-left: 20px; color: #000; - width: 60%; - float: left + width: 60% } .row.inline .description { @@ -105,36 +102,29 @@ overflow: visible } -.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; - font-weight: bold -} - -.grid .row.inline > section { - float: left; -} - .panel { - border: 1px solid #DDD; - margin-bottom: 10px; - position: relative; - padding:20px + position: relative } .panel .header { background-color: #FFF; + position:absolute; + left: 17.5px; + top: -12px; + padding: 2.5px 5px; + font-weight: bold; - margin-top: -20px +} + +.panel .body { + border: 1px solid #CCC; + margin-top: 10px; + overflow: hidden; + padding: 20px +} + +.panel .body h3 { + margin-top: 0 } .box { @@ -161,4 +151,55 @@ .pull-right { float: right -} \ No newline at end of file +} + +.verticalText { + -moz-transform: rotate(90deg); + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + position: absolute; + text-align: center; + font-size: .65em; + width: 200px; + border: 2px solid #000; + right: -110px; + top: 50% +} + +vn-table { + border-collapse: collapse; + margin: 20px 0; + display: table; + width: 100%; +} + +vn-thead { + border-bottom: 1px solid #808080; + border-top: 1px solid #808080; + display: table-header-group +} + +vn-tbody { + border-top: 3px solid #888888; + display: table-row-group +} + +vn-tfoot { + border-top: 1px solid #808080; + display: table-footer-group +} + +vn-tr { + display: table-row +} + +vn-th { + font-weight: bold +} + +vn-td, vn-th { + vertical-align: middle; + display: table-cell; + text-align: left; + padding: 5px 0 +} diff --git a/print/config/routes.json b/print/config/routes.json index added704e..242557e51 100644 --- a/print/config/routes.json +++ b/print/config/routes.json @@ -8,6 +8,8 @@ {"type": "report", "name": "delivery-note"}, {"type": "report", "name": "invoice"}, {"type": "report", "name": "rpt-claim-pickup-order"}, + {"type": "report", "name": "rpt-letter-debtor"}, + {"type": "report", "name": "rpt-sepa-core"}, {"type": "static", "name": "email-header"}, {"type": "static", "name": "email-footer"}, {"type": "static", "name": "report-header"}, diff --git a/print/lib/reportEngine.js b/print/lib/reportEngine.js index b77d88267..899893b7f 100644 --- a/print/lib/reportEngine.js +++ b/print/lib/reportEngine.js @@ -95,9 +95,10 @@ module.exports = { const template = await fs.readFile(templatePath, 'utf8'); const css = require(stylePath); + const cssOptions = {inlinePseudoElements: true}; component.i18n = require(localePath); - component.template = juice.inlineContent(template, css); + component.template = juice.inlineContent(template, css, cssOptions); }, async toPdf(name, ctx) { diff --git a/print/lib/router.js b/print/lib/router.js index 69b02b702..21aeabe6f 100644 --- a/print/lib/router.js +++ b/print/lib/router.js @@ -16,8 +16,8 @@ module.exports = app => { app.get(`/api/report/${name}`, (request, response, next) => { reportEngine.toPdf(name, request).then(stream => { - response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); - response.setHeader('Content-type', 'application/pdf'); + // response.setHeader('Content-Disposition', `attachment; filename="${name}.pdf"`); + // response.setHeader('Content-type', 'application/pdf'); stream.pipe(response); }).catch(e => { next(e); diff --git a/print/report/client-welcome/index.js b/print/report/client-welcome/index.js index d3ac31205..aeca24a06 100755 --- a/print/report/client-welcome/index.js +++ b/print/report/client-welcome/index.js @@ -1,6 +1,4 @@ const database = require(`${appPath}/lib/database`); -const emailHeader = require('../email-header'); -const emailFooter = require('../email-footer'); const UserException = require(`${appPath}/lib/exceptions/userException`); module.exports = { @@ -42,7 +40,7 @@ module.exports = { }, }, components: { - 'email-header': emailHeader, - 'email-footer': emailFooter, + 'email-header': require('../email-header'), + 'email-footer': require('../email-footer'), }, }; diff --git a/print/report/letter-debtor-nd/assets/css/index.js b/print/report/letter-debtor-nd/assets/css/index.js new file mode 100644 index 000000000..c1943eee1 --- /dev/null +++ b/print/report/letter-debtor-nd/assets/css/index.js @@ -0,0 +1,6 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/letter-debtor-nd/index.js b/print/report/letter-debtor-nd/index.js index 77eec9351..49aa46bbf 100755 --- a/print/report/letter-debtor-nd/index.js +++ b/print/report/letter-debtor-nd/index.js @@ -1,11 +1,11 @@ const database = require(`${appPath}/lib/database`); -const emailHeader = require('../email-header'); -const emailFooter = require('../email-footer'); +const reportEngine = require(`${appPath}/lib/reportEngine.js`); const UserException = require(`${appPath}/lib/exceptions/userException`); module.exports = { name: 'letter-debtor-nd', async asyncData(ctx, params) { + const promises = []; const data = { isPreview: ctx.method === 'GET', }; @@ -16,21 +16,24 @@ module.exports = { if (!params.companyFk) throw new UserException('No company id specified'); - return this.methods.fetchClientData(params.clientFk, params.companyFk) - .then(([result]) => { - return Object.assign(data, result[0]); - }); + promises.push(reportEngine.toPdf('rpt-letter-debtor', ctx)); + promises.push(this.methods.fetchClient(params.clientFk, params.companyFk)); + + return Promise.all(promises).then(result => { + const stream = result[0]; + const [[client]] = result[1]; + + Object.assign(data, client); + Object.assign(data, {attachments: [{filename: 'rpt-letter-debtor.pdf', content: stream}]}); + + return data; + }); }, created() { this.$i18n.locale = this.locale; }, - data() { - return { - attachments: ['http://localhost:8080/report/delivery-note'], - }; - }, methods: { - fetchClientData(clientFk, companyFk) { + fetchClient(clientFk, companyFk) { return database.pool.query(` SELECT u.lang locale, @@ -47,13 +50,8 @@ module.exports = { WHERE c.id = ? AND cny.id = ?`, [clientFk, companyFk]); }, }, - computed: { - accountAddress: function() { - return this.iban.slice(-4); - }, - }, components: { - 'email-header': emailHeader, - 'email-footer': emailFooter, + 'email-header': require('../email-header'), + 'email-footer': require('../email-footer'), }, }; diff --git a/print/report/letter-debtor-nd/locale.js b/print/report/letter-debtor-nd/locale.js index 07b81099f..f15437a72 100644 --- a/print/report/letter-debtor-nd/locale.js +++ b/print/report/letter-debtor-nd/locale.js @@ -6,12 +6,12 @@ module.exports = { sections: { introduction: { title: 'Estimado cliente', - description: `Nos dirigimos a Vd. nuevamente para informarle que sigue - pendiente su deuda con nuestra empresa, tal y como puede comprobar en el extracto adjunto.`, + description: `Nos dirigimos a ti nuevamente para informarte que sigue + pendiente tu deuda con nuestra empresa, tal y como puedes comprobar en el extracto adjunto.`, terms: `Dado que los plazos de pago acordados están ampliamente superados, no procede mayor dilación en la liquidación del importe adeudado.`, }, payMethod: { - description: 'Para ello dispone de las siguientes formas de pago', + description: 'Para ello dispones de las siguientes formas de pago', options: [ 'Pago online desde nuestra web.', 'Ingreso o transferencia al número de cuenta que detallamos al pie de esta carta, indicando el número de cliente.', @@ -27,11 +27,9 @@ module.exports = { ], }, }, - contactPhone: 'Para consultas, puede ponerse en contacto con nosotros en el 96 324 21 00.', - conclusion: 'En espera de sus noticias.
Gracias por su atención.', + contactPhone: 'Para consultas, puedes ponerte en contacto con nosotros en el 96 324 21 00.', + conclusion: 'En espera de tus noticias.
Gracias por tu atención.', transferAccount: 'Datos para transferencia bancaria', }, }, }; - - diff --git a/print/report/letter-debtor-st/assets/css/index.js b/print/report/letter-debtor-st/assets/css/index.js new file mode 100644 index 000000000..c1943eee1 --- /dev/null +++ b/print/report/letter-debtor-st/assets/css/index.js @@ -0,0 +1,6 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/letter-debtor-st/index.js b/print/report/letter-debtor-st/index.js index 8fb51e408..a1a4d8833 100755 --- a/print/report/letter-debtor-st/index.js +++ b/print/report/letter-debtor-st/index.js @@ -1,7 +1,5 @@ const database = require(`${appPath}/lib/database`); const reportEngine = require(`${appPath}/lib/reportEngine.js`); -const emailHeader = require('../email-header'); -const emailFooter = require('../email-footer'); const UserException = require(`${appPath}/lib/exceptions/userException`); @@ -19,7 +17,7 @@ module.exports = { if (!params.companyFk) throw new UserException('No company id specified'); - promises.push(reportEngine.toPdf('delivery-note', ctx)); + promises.push(reportEngine.toPdf('rpt-letter-debtor', ctx)); promises.push(this.methods.fetchClient(params.clientFk, params.companyFk)); return Promise.all(promises).then(result => { @@ -27,7 +25,7 @@ module.exports = { const [[client]] = result[1]; Object.assign(data, client); - Object.assign(data, {attachments: [{filename: 'delivery-note.pdf', content: stream}]}); + Object.assign(data, {attachments: [{filename: 'rpt-letter-debtor.pdf', content: stream}]}); return data; }); @@ -53,13 +51,8 @@ module.exports = { WHERE c.id = ? AND cny.id = ?`, [clientFk, companyFk]); } }, - computed: { - accountAddress: function() { - return this.iban.slice(-4); - }, - }, components: { - 'email-header': emailHeader, - 'email-footer': emailFooter, + 'email-header': require('../email-header'), + 'email-footer': require('../email-footer'), }, }; diff --git a/print/report/letter-debtor-st/locale.js b/print/report/letter-debtor-st/locale.js index 60387e13b..afee35288 100644 --- a/print/report/letter-debtor-st/locale.js +++ b/print/report/letter-debtor-st/locale.js @@ -10,9 +10,9 @@ module.exports = { datos contables, tu cuenta tiene un saldo pendiente de liquidar.`, }, }, - checkExtract: `Te solicitamos compruebes 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.`, + checkExtract: `Te solicitamos compruebes que el extracto adjunto corresponde con los datos de que dispones. + Nuestro departamento de administración te aclarará gustosamente cualquier duda que puedas tener, + e igualmente te facilitará cualquier documento que solicites.`, checkValidData: `Si al comprobar los datos aportados resultaran correctos, te rogamos procedas a regularizar tu situación.`, payMethod: `Si no deseas desplazarte personalmente hasta nuestras oficinas, diff --git a/print/report/report-footer/assets/css/style.css b/print/report/report-footer/assets/css/style.css index cd0f75570..5c44d3a6d 100644 --- a/print/report/report-footer/assets/css/style.css +++ b/print/report/report-footer/assets/css/style.css @@ -1,6 +1,5 @@ footer { font-family: verdana, sans-serif; - margin-top: 30px; font-size: 12px; color: #555; zoom: 0.55 diff --git a/print/report/rpt-claim-pickup-order/assets/css/style.css b/print/report/rpt-claim-pickup-order/assets/css/style.css index 53965a625..dcf1a56ae 100644 --- a/print/report/rpt-claim-pickup-order/assets/css/style.css +++ b/print/report/rpt-claim-pickup-order/assets/css/style.css @@ -7,4 +7,17 @@ margin-top: 0; margin-bottom: 20px; font-size: 2em +} + +vn-table { + margin-top: 50px !important +} + +.sign { + margin: 150px auto; + width: 300px +} + +.sign .body { + height: 150px } \ No newline at end of file diff --git a/print/report/rpt-claim-pickup-order/index.html b/print/report/rpt-claim-pickup-order/index.html index 8d607f537..9862260f2 100644 --- a/print/report/rpt-claim-pickup-order/index.html +++ b/print/report/rpt-claim-pickup-order/index.html @@ -7,7 +7,7 @@
-

{{$t('title')}}

+

{{$t('title')}}

{{$t('claimId')}}:
{{claimId}}
@@ -25,48 +25,47 @@
{{$t('clientData')}}
-

- {{clientName}} -

-
- {{street}} -
-
- {{postcode}}, {{city}} ({{province}}) -
-
- {{country}} +
+

{{clientName}}

+
+ {{street}} +
+
+ {{postcode}}, {{city}} ({{province}}) +
+
+ {{country}} +
-
-
-
{{$t('quantity')}}
-
{{$t('claims')}}
-
{{$t('reference')}}
-
{{$t('concept')}}
-
-
-
{{sale.quantity}} 
-
{{sale.claimQuantity}} 
-
{{sale.id}} 
-
{{sale.concept}} 
+ + + + {{$t('reference')}} + {{$t('quantity')}} + {{$t('claims')}} + {{$t('concept')}} + + + + + {{sale.id}} + {{sale.quantity}} + {{sale.claimQuantity}} + {{sale.concept}} + + + + +
+
+

{{clientName}}

-
-
 
-
-
-
-

{{clientName}}

-
-
-
-
 
-

diff --git a/print/report/rpt-claim-pickup-order/locale.js b/print/report/rpt-claim-pickup-order/locale.js index 9ba80b456..6aefd199e 100644 --- a/print/report/rpt-claim-pickup-order/locale.js +++ b/print/report/rpt-claim-pickup-order/locale.js @@ -1,7 +1,7 @@ module.exports = { messages: { es: { - title: 'ORD. RECOGIDA', + title: 'Ord. recogida', claimId: 'Reclamación', clientId: 'Cliente', date: 'Fecha', diff --git a/print/report/rpt-letter-debtor/assets/css/index.js b/print/report/rpt-letter-debtor/assets/css/index.js new file mode 100644 index 000000000..d40ab4984 --- /dev/null +++ b/print/report/rpt-letter-debtor/assets/css/index.js @@ -0,0 +1,7 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/misc.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/rpt-letter-debtor/assets/css/style.css b/print/report/rpt-letter-debtor/assets/css/style.css new file mode 100644 index 000000000..ae9b314c0 --- /dev/null +++ b/print/report/rpt-letter-debtor/assets/css/style.css @@ -0,0 +1,14 @@ +.container { + color: #000 +} + +.title { + font-weight: 100; + margin-top: 0; + margin-bottom: 20px; + font-size: 2em +} + +vn-table { + margin-top: 50px !important +} \ No newline at end of file diff --git a/print/report/rpt-letter-debtor/index.html b/print/report/rpt-letter-debtor/index.html new file mode 100644 index 000000000..e2458f223 --- /dev/null +++ b/print/report/rpt-letter-debtor/index.html @@ -0,0 +1,77 @@ + + + +
+ +
+
+
+
+

{{$t('title')}}

+
+
{{$t('clientId')}}:
+
{{clientId}}
+
+
+
{{$t('date')}}:
+
{{dated()}}
+
+
+
+
+
+
{{$t('clientData')}}
+
+

{{clientName}}

+
+ {{street}} +
+
+ {{postcode}}, {{city}} ({{province}}) +
+
+ {{country}} +
+
+
+
+
+ + + + + {{$t('date')}} + {{$t('concept')}} + {{$t('invoiced')}} + {{$t('payed')}} + {{$t('balance')}} + + + + + {{toISOString(sale.issued)}} + {{sale.ref}} + {{sale.debtOut}} + {{sale.debtIn}} + {{getBalance(sale)}} + + + + + + Total + {{getTotalDebtOut()}} + {{getTotalDebtIn()}} + {{totalBalance}} + + + +
+ + + +
+ + \ No newline at end of file diff --git a/print/report/rpt-letter-debtor/index.js b/print/report/rpt-letter-debtor/index.js new file mode 100755 index 000000000..2b72b6242 --- /dev/null +++ b/print/report/rpt-letter-debtor/index.js @@ -0,0 +1,98 @@ +const strftime = require('strftime'); +const database = require(`${appPath}/lib/database`); +const UserException = require(`${appPath}/lib/exceptions/userException`); + +module.exports = { + name: 'rpt-letter-debtor', + async asyncData(ctx, params) { + const promises = []; + const data = {}; + + if (!params.clientFk) + throw new UserException('No client id specified'); + + if (!params.companyFk) + throw new UserException('No company id specified'); + + promises.push(this.methods.fetchClient(params.clientFk)); + promises.push(this.methods.fetchSales(params.clientFk, params.companyFk)); + + return Promise.all(promises).then(result => { + const [[client]] = result[0]; + const [[sales]] = result[1]; + + if (!client) + throw new UserException('No client data found'); + + Object.assign(data, client, {sales}); + + return data; + }); + }, + created() { + this.$i18n.locale = this.locale; + }, + data() { + return {totalBalance: 0.00}; + }, + methods: { + fetchClient(clientFk) { + return database.pool.query( + `SELECT + c.id clientId, + u.lang locale, + 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 account.user u ON u.id = c.id + JOIN country ct ON ct.id = c.countryFk + LEFT JOIN province p ON p.id = c.provinceFk + WHERE c.id = ?`, [clientFk]); + }, + fetchSales(clientFk, companyFk) { + return database.pool.query( + `CALL vn.clientGetDebtDiary(?, ?)`, [clientFk, companyFk]); + }, + dated: () => { + return strftime('%d-%m-%Y', new Date()); + }, + toISOString: date => { + return strftime('%d-%m-%Y', date); + }, + getBalance(sale) { + if (sale.debtOut) + this.totalBalance += parseFloat(sale.debtOut); + + if (sale.debtIn) + this.totalBalance -= parseFloat(sale.debtIn); + + return parseFloat(this.totalBalance.toFixed(2)); + }, + getTotalDebtOut() { + let debtOut = 0.00; + this.sales.forEach(sale => { + debtOut += sale.debtOut ? parseFloat(sale.debtOut) : 0; + }); + + return debtOut.toFixed(2); + }, + getTotalDebtIn() { + let debtIn = 0.00; + this.sales.forEach(sale => { + debtIn += sale.debtIn ? parseFloat(sale.debtIn) : 0; + }); + + return debtIn.toFixed(2); + }, + }, + components: { + 'report-header': require('../report-header'), + 'report-footer': require('../report-footer'), + }, +}; diff --git a/print/report/rpt-letter-debtor/locale.js b/print/report/rpt-letter-debtor/locale.js new file mode 100644 index 000000000..8ace81596 --- /dev/null +++ b/print/report/rpt-letter-debtor/locale.js @@ -0,0 +1,16 @@ +module.exports = { + messages: { + es: { + title: 'Extracto', + claimId: 'Reclamación', + clientId: 'Cliente', + clientData: 'Datos del cliente', + date: 'Fecha', + concept: 'Concepto', + invoiced: 'Facturado', + payed: 'Pagado', + balance: 'Saldo', + client: 'Cliente {0}' + }, + }, +}; diff --git a/print/report/rpt-sepa-core/assets/css/index.js b/print/report/rpt-sepa-core/assets/css/index.js new file mode 100644 index 000000000..d40ab4984 --- /dev/null +++ b/print/report/rpt-sepa-core/assets/css/index.js @@ -0,0 +1,7 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/misc.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/rpt-sepa-core/assets/css/style.css b/print/report/rpt-sepa-core/assets/css/style.css new file mode 100644 index 000000000..ae9b314c0 --- /dev/null +++ b/print/report/rpt-sepa-core/assets/css/style.css @@ -0,0 +1,14 @@ +.container { + color: #000 +} + +.title { + font-weight: 100; + margin-top: 0; + margin-bottom: 20px; + font-size: 2em +} + +vn-table { + margin-top: 50px !important +} \ No newline at end of file diff --git a/print/report/rpt-sepa-core/index.html b/print/report/rpt-sepa-core/index.html new file mode 100644 index 000000000..3ae44673f --- /dev/null +++ b/print/report/rpt-sepa-core/index.html @@ -0,0 +1,270 @@ + + + +
+ +
+
+
+
{{$t('supplier.toCompleteBySupplier')}}
+
+
{{$t('supplier.orderReference')}}
+
{{mandateCode}}
+
+
+
{{$t('supplier.identifier')}}
+
ES89000B97367486
+
+
+
{{$t('supplier.name')}}
+
{{supplierName}}
+
+
+
{{$t('supplier.street')}}
+
{{supplierStreet}}
+
+
+
{{$t('supplier.location')}}
+
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
+
+
+
{{$t('supplier.country')}}
+
{{supplierCountry}}
+
+
+
+ +
+
+
{{$t('supplier.toCompleteBySupplier')}}
+
+
{{$t('supplier.orderReference')}}
+
{{mandateCode}}
+
+
+
{{$t('supplier.identifier')}}
+
ES89000B97367486
+
+
+
{{$t('supplier.name')}}
+
{{supplierName}}
+
+
+
{{$t('supplier.street')}}
+
{{supplierStreet}}
+
+
+
{{$t('supplier.location')}}
+
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
+
+
+
{{$t('supplier.country')}}
+
{{supplierCountry}}
+
+
+
+ +
+
+
{{$t('supplier.toCompleteBySupplier')}}
+
+
{{$t('supplier.orderReference')}}
+
{{mandateCode}}
+
+
+
{{$t('supplier.identifier')}}
+
ES89000B97367486
+
+
+
{{$t('supplier.name')}}
+
{{supplierName}}
+
+
+
{{$t('supplier.street')}}
+
{{supplierStreet}}
+
+
+
{{$t('supplier.location')}}
+
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
+
+
+
{{$t('supplier.country')}}
+
{{supplierCountry}}
+
+
+
+ + +
+
+
{{$t('supplier.toCompleteBySupplier')}}
+
+
{{$t('supplier.orderReference')}}
+
{{mandateCode}}
+
+
+
{{$t('supplier.identifier')}}
+
ES89000B97367486
+
+
+
{{$t('supplier.name')}}
+
{{supplierName}}
+
+
+
{{$t('supplier.street')}}
+
{{supplierStreet}}
+
+
+
{{$t('supplier.location')}}
+
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
+
+
+
{{$t('supplier.country')}}
+
{{supplierCountry}}
+
+
+
+ +
+
+
{{$t('supplier.toCompleteBySupplier')}}
+
+
{{$t('supplier.orderReference')}}
+
{{mandateCode}}
+
+
+
{{$t('supplier.identifier')}}
+
ES89000B97367486
+
+
+
{{$t('supplier.name')}}
+
{{supplierName}}
+
+
+
{{$t('supplier.street')}}
+
{{supplierStreet}}
+
+
+
{{$t('supplier.location')}}
+
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
+
+
+
{{$t('supplier.country')}}
+
{{supplierCountry}}
+
+
+
+ + +
+
+
{{$t('supplier.toCompleteBySupplier')}}
+
+
{{$t('supplier.orderReference')}}
+
{{mandateCode}}
+
+
+
{{$t('supplier.identifier')}}
+
ES89000B97367486
+
+
+
{{$t('supplier.name')}}
+
{{supplierName}}
+
+
+
{{$t('supplier.street')}}
+
{{supplierStreet}}
+
+
+
{{$t('supplier.location')}}
+
{{supplierPostCode}}, {{supplierCity}} ({{supplierProvince}})
+
+
+
{{$t('supplier.country')}}
+
{{supplierCountry}}
+
+
+
+ + +
+ + + +
+ + \ No newline at end of file diff --git a/print/report/rpt-sepa-core/index.js b/print/report/rpt-sepa-core/index.js new file mode 100755 index 000000000..9c4ee6ac6 --- /dev/null +++ b/print/report/rpt-sepa-core/index.js @@ -0,0 +1,67 @@ +const strftime = require('strftime'); +const database = require(`${appPath}/lib/database`); +const UserException = require(`${appPath}/lib/exceptions/userException`); + +module.exports = { + name: 'rpt-sepa-core', + async asyncData(ctx, params) { + if (!params.clientFk) + throw new UserException('No client id specified'); + + if (!params.companyFk) + throw new UserException('No company id specified'); + + return this.methods.fetchClient(params.clientFk) + .then(([[client]]) => { + if (!client) + throw new UserException('No client data found'); + + return client; + }); + }, + created() { + if (this.locale) + this.$i18n.locale = this.locale; + }, + methods: { + fetchClient(clientFk) { + return database.pool.query( + `SELECT + c.id clientId, + u.lang locale, + m.code mandateCode, + 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 account.user u ON u.id = c.id + 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 = ?`, [clientFk]); + }, + dated: () => { + return strftime('%d-%m-%Y', new Date()); + }, + toISOString: date => { + return strftime('%d-%m-%Y', date); + }, + }, + components: { + 'report-header': require('../report-header'), + 'report-footer': require('../report-footer'), + }, +}; diff --git a/print/report/rpt-sepa-core/locale.js b/print/report/rpt-sepa-core/locale.js new file mode 100644 index 000000000..e95265a26 --- /dev/null +++ b/print/report/rpt-sepa-core/locale.js @@ -0,0 +1,19 @@ +module.exports = { + messages: { + es: { + title: 'Orden de domiciliación de adeudo SEPA CORE', + supplier: { + toCompleteBySupplier: 'A cumplimentar por el acreedor', + orderReference: 'Referencia de la orden de domiciliación', + identifier: 'Identificador del acreedor', + name: 'Nombre del acreedor', + street: 'Dirección', + location: 'CP - Población - Provincia', + country: 'País', + }, + client: { + toCompleteByClient: 'A cumplimentar por el deudor', + }, + }, + }, +};