diff --git a/Jenkinsfile b/Jenkinsfile index 06eb855612..8f87ffe610 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,9 +25,11 @@ pipeline { switch (env.BRANCH_NAME) { case 'master': env.NODE_ENV = 'production' + env.BACK_REPLICAS = 4 break case 'test': env.NODE_ENV = 'test' + env.BACK_REPLICAS = 2 break } } diff --git a/back/methods/image/upload.js b/back/methods/image/upload.js index 649d13c680..a93ead6510 100644 --- a/back/methods/image/upload.js +++ b/back/methods/image/upload.js @@ -48,7 +48,7 @@ module.exports = Self => { throw new UserError(`You don't have enough privileges`); if (process.env.NODE_ENV == 'test') - throw new UserError(`You can't upload images on the test instance`); + throw new UserError(`You can't upload images on the test environment`); // Upload file to temporary path const tempContainer = await TempContainer.container(args.collection); diff --git a/db/changes/12270-wisemen/00-itemTag.sql b/db/changes/12270-wisemen/00-itemTag.sql new file mode 100644 index 0000000000..f1e9370d5f --- /dev/null +++ b/db/changes/12270-wisemen/00-itemTag.sql @@ -0,0 +1,19 @@ +DROP TRIGGER IF EXISTS `vn`.`itemTag_afterUpdate`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` TRIGGER `vn`.`itemTag_afterUpdate` + AFTER UPDATE ON `itemTag` FOR EACH ROW +trig: BEGIN + IF @isTriggerDisabled THEN + LEAVE trig; + END IF; + + DROP TEMPORARY TABLE IF EXISTS tmp.item; + CREATE TEMPORARY TABLE tmp.item + SELECT NEW.itemFk id; + + CALL item_refreshTags(); + DROP TEMPORARY TABLE tmp.item; +END$$ +DELIMITER ; \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c04f7e3887..24e1446e91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: ports: - 80 deploy: - replicas: 3 + replicas: 2 back: image: registry.verdnatura.es/salix-back:${BRANCH_NAME:?} build: . @@ -30,7 +30,7 @@ services: - /mnt/storage/dms:/var/lib/salix/dms - /mnt/storage/image:/var/lib/salix/image deploy: - replicas: 6 + replicas: ${BACK_REPLICAS:?} configs: datasources: external: true diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index b629984000..b8309a2624 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -722,9 +722,9 @@ export default { }, workerSummary: { header: 'vn-worker-summary h5', - id: 'vn-worker-summary vn-one:nth-child(1) > vn-label-value:nth-child(2) > section > span', - email: 'vn-worker-summary vn-one:nth-child(1) > vn-label-value:nth-child(3) > section > span', - department: 'vn-worker-summary vn-one:nth-child(1) > vn-label-value:nth-child(4) > section > span', + id: 'vn-worker-summary vn-one:nth-child(1) > vn-label-value:nth-child(3) > section > span', + email: 'vn-worker-summary vn-one:nth-child(1) > vn-label-value:nth-child(4) > section > span', + department: 'vn-worker-summary vn-one:nth-child(1) > vn-label-value:nth-child(5) > section > span', userId: 'vn-worker-summary vn-one:nth-child(2) > vn-label-value:nth-child(2) > section > span', userName: 'vn-worker-summary vn-one:nth-child(2) > vn-label-value:nth-child(3) > section > span', role: 'vn-worker-summary vn-one:nth-child(2) > vn-label-value:nth-child(4) > section > span', diff --git a/front/core/components/field/index.js b/front/core/components/field/index.js index 8d619e4a3d..d18973bbe6 100644 --- a/front/core/components/field/index.js +++ b/front/core/components/field/index.js @@ -187,7 +187,10 @@ export default class Field extends FormInput { } onChange() { - this.emit('change', {value: this.field}); + // Changes doesn't reflect until appling async + this.$.$applyAsync(() => { + this.emit('change', {value: this.field}); + }); } } Field.$inject = ['$element', '$scope']; diff --git a/front/core/components/searchbar/search-panel.js b/front/core/components/searchbar/search-panel.js index f473c2b049..67fd3fae27 100644 --- a/front/core/components/searchbar/search-panel.js +++ b/front/core/components/searchbar/search-panel.js @@ -1,4 +1,5 @@ import Component from '../../lib/component'; +import './style.scss'; export default class SearchPanel extends Component { set filter(value) { diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index c1d4be21c3..eab9c126b1 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -1,4 +1,4 @@ -@import "variables"; +@import "./variables"; vn-searchbar { display: block; @@ -44,4 +44,27 @@ vn-searchbar { & > form { padding: $spacing-lg; } + + & > form#manifold-form { + padding: 0; + + .manifold-panel { + border: $border-thin-light; + border-radius: 5px; + position: relative; + text-align: right; + + .or { + font-weight: bold; + font-size: 26px; + color: $color-font-secondary + } + + vn-icon[icon="info"] { + position: absolute; + top: 2px; + right: 2px + } + } + } } \ No newline at end of file diff --git a/front/core/components/th/index.js b/front/core/components/th/index.js index f815056f6e..b9ea8fde8a 100644 --- a/front/core/components/th/index.js +++ b/front/core/components/th/index.js @@ -1,4 +1,5 @@ import ngModule from '../../module'; +import './style.scss'; export default class Th { constructor($element) { diff --git a/front/salix/components/summary/style.scss b/front/salix/components/summary/style.scss index 85da5aa03c..99854fa9d6 100644 --- a/front/salix/components/summary/style.scss +++ b/front/salix/components/summary/style.scss @@ -73,6 +73,21 @@ ui-view > .vn-summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + position: relative; + span { + display: block; + } + a { + color: $color-font; + } + } + h4 span:after { + font-family: 'Material Icons'; + content: 'open_in_new'; + position: absolute; + right: 5px; + text-transform: none; + color: $color-spacer } & > * { margin: $spacing-sm; diff --git a/front/salix/locale/es.yml b/front/salix/locale/es.yml index f2a23a7a74..98384df835 100644 --- a/front/salix/locale/es.yml +++ b/front/salix/locale/es.yml @@ -52,6 +52,7 @@ Suppliers: Proveedores Summary: Vista previa Basic data: Datos básicos List: Listado +Go to: Ir a # Misc diff --git a/modules/account/back/models/ldap-config.js b/modules/account/back/models/ldap-config.js index 9f0e84c666..819659066d 100644 --- a/modules/account/back/models/ldap-config.js +++ b/modules/account/back/models/ldap-config.js @@ -35,14 +35,13 @@ module.exports = Self => { accountConfig } = this; - let newEntry; + let dn = `uid=${userName},${this.userDn}`; if (info.hasAccount) { let {user} = info; let oldUser = await client.searchOne(this.userDn, { scope: 'sub', - attributes: ['userPassword', 'sambaNTPassword'], filter: `&(uid=${userName})` }); @@ -52,7 +51,7 @@ module.exports = Self => { ? nameArgs.splice(1).join(' ') : '-'; - newEntry = { + let newEntry = { uid: userName, objectClass: [ 'inetOrgPerson', @@ -101,62 +100,115 @@ module.exports = Self => { if (newEntry[prop] == null) delete newEntry[prop]; } + + if (oldUser) { + let changes = []; + let skipProps = new Set([ + 'dn', + 'controls' + ]); + + for (let prop in oldUser) { + let deleteProp = !skipProps.has(prop) + && !newEntry.hasOwnProperty(prop); + if (!deleteProp) continue; + changes.push(new ldap.Change({ + operation: 'delete', + modification: { + [prop]: oldUser[prop] + } + })); + } + for (let prop in newEntry) { + if (this.isEqual(oldUser[prop], newEntry[prop])) + continue; + changes.push(new ldap.Change({ + operation: 'replace', + modification: { + [prop]: newEntry[prop] + } + })); + } + + if (changes.length) + await client.modify(dn, changes); + } else + await client.add(dn, newEntry); + } else { + try { + await client.del(dn); + console.log(` -> User '${userName}' removed from LDAP`); + } catch (e) { + if (e.name !== 'NoSuchObjectError') throw e; + } } + }, - // Remove and recreate (if applicable) user - - let dn = `uid=${userName},${this.userDn}`; - let operation; - - try { - await client.del(dn); - operation = 'delete'; - } catch (e) { - if (e.name !== 'NoSuchObjectError') throw e; - } - - if (info.hasAccount) { - await client.add(dn, newEntry); - operation = 'add'; - } - - if (operation === 'delete') - console.log(` -> User '${userName}' removed from LDAP`); + isEqual(a, b) { + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) + return false; + for (let element of a) { + if (b.indexOf(element) === -1) + return false; + } + return true; + } else + return a == b; }, async syncUserGroups(userName, info) { let {client} = this; + let {user} = info; + let groupDn = this.groupDn; let opts = { scope: 'sub', - attributes: ['dn'], + attributes: ['dn', 'cn'], filter: `&(memberUid=${userName})(objectClass=posixGroup)` }; - let oldGroups = await client.searchAll(this.groupDn, opts); + let oldGroups = await client.searchAll(groupDn, opts); - let reqs = []; - for (let oldGroup of oldGroups) { - let change = new ldap.Change({ - operation: 'delete', - modification: {memberUid: userName} - }); - reqs.push(client.modify(oldGroup.dn, change)); + let deleteGroups = []; + let addGroups = []; + + if (info.hasAccount) { + let oldSet = new Set(); + oldGroups.forEach(e => oldSet.add(e.cn)); + + let newSet = new Set(); + user.roles().forEach(e => newSet.add(e.inherits().name)); + + for (let group of oldGroups) { + if (!newSet.has(group.cn)) + deleteGroups.push(group.cn); + } + for (let role of user.roles()) { + if (!oldSet.has(role.inherits().name)) + addGroups.push(role.inherits().name); + } + } else { + for (let group of oldGroups) + deleteGroups.push(group.cn); } - await Promise.all(reqs); - if (!info.hasAccount) return; - - reqs = []; - for (let role of info.user.roles()) { - let change = new ldap.Change({ - operation: 'add', - modification: {memberUid: userName} - }); - let roleName = role.inherits().name; - let dn = `cn=${roleName},${this.groupDn}`; - reqs.push(client.modify(dn, change)); + async function applyOperations(groups, operation) { + for (let group of groups) { + try { + let dn = `cn=${group},${groupDn}`; + await client.modify(dn, new ldap.Change({ + operation, + modification: {memberUid: userName} + })); + } catch (err) { + if (err.name !== 'NoSuchObjectError') + throw err; + } + } } - await Promise.all(reqs); + + await applyOperations(deleteGroups, 'delete'); + await applyOperations(addGroups, 'add'); }, async getUsers(usersToSync) { diff --git a/modules/account/front/summary/index.html b/modules/account/front/summary/index.html index 9c96a97036..41632aef69 100644 --- a/modules/account/front/summary/index.html +++ b/modules/account/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -10,7 +11,18 @@
-

Basic data

+

+ + Basic Data + +

+

+ Basic Data +

diff --git a/modules/account/front/summary/index.js b/modules/account/front/summary/index.js index 21be84660f..8ed025b613 100644 --- a/modules/account/front/summary/index.js +++ b/modules/account/front/summary/index.js @@ -18,6 +18,9 @@ class Controller extends Summary { this.$http.get(`Accounts/${value.id}`, {filter}) .then(res => this.$.summary = res.data); } + get isHr() { + return this.aclService.hasAny(['hr']); + } get user() { return this._user; diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html index f4e9c1471a..e9ec1e765f 100644 --- a/modules/claim/front/summary/index.html +++ b/modules/claim/front/summary/index.html @@ -4,7 +4,8 @@
- @@ -54,7 +55,18 @@ -

Detail

+

+ + Detail + +

+

+ Detail +

@@ -105,7 +117,18 @@ -

Development

+

+ + Development + +

+

+ Development +

@@ -136,7 +159,18 @@
-

Action

+

+ + Action + +

+

+ Action +

diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js index 89848ecc6e..bda830d6a6 100644 --- a/modules/claim/front/summary/index.js +++ b/modules/claim/front/summary/index.js @@ -13,6 +13,14 @@ class Controller extends Summary { this.getSummary(); } + get isSalesPerson() { + return this.aclService.hasAny(['salesPerson']); + } + + get isClaimManager() { + return this.aclService.hasAny(['claimManager']); + } + get claim() { return this._claim; } diff --git a/modules/client/front/consumption/index.js b/modules/client/front/consumption/index.js index af08a88719..7017fed411 100644 --- a/modules/client/front/consumption/index.js +++ b/modules/client/front/consumption/index.js @@ -33,7 +33,7 @@ class Controller extends Section { get reportParams() { const userParams = this.$.model.userParams; return Object.assign({ - authorization: this.vnToken.token, + recipient: this.client.email, recipientId: this.client.id }, userParams); } diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 50bdd226cd..3e8f4f7056 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -12,7 +12,18 @@ -

Basic data

+

+ + Basic data + +

+

+ Basic data +

@@ -43,7 +54,18 @@
-

Fiscal address

+

+ + Fiscal address + +

+

+ Fiscal address +

@@ -67,7 +89,18 @@
-

Fiscal data

+

+ + Fiscal data + +

+

+ Fiscal data +

-

Billing data

+

+ + Billing data + +

+

+ Billing data +

@@ -136,7 +180,18 @@
-

Default address

+

+ + Address + +

+

+ Address +

@@ -148,7 +203,17 @@
-

Web access

+

+ + Web access + +

+

Web access +

diff --git a/modules/client/front/summary/index.js b/modules/client/front/summary/index.js index cf59912476..8ef724061a 100644 --- a/modules/client/front/summary/index.js +++ b/modules/client/front/summary/index.js @@ -18,6 +18,9 @@ class Controller extends Summary { } }); } + get isEmployee() { + return this.aclService.hasAny(['employee']); + } sumRisk() { let total = 0; diff --git a/modules/client/front/summary/locale/es.yml b/modules/client/front/summary/locale/es.yml index 0a101f6ef6..6d1c3b4f6d 100644 --- a/modules/client/front/summary/locale/es.yml +++ b/modules/client/front/summary/locale/es.yml @@ -7,6 +7,7 @@ Secured credit: Crédito asegurado Average invoiced: Consumo medio Sales person: Comercial Recovery: Recobro +Basic data: Datos básicos Balance due: Saldo vencido Rate: Tarifa Business data: Datos comerciales diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index daee3aa05e..42dbe3078d 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -93,7 +93,12 @@ module.exports = Self => { let where = buildFilter(ctx.args, (param, value) => { switch (param) { case 'search': - return {'e.id': value}; + return /^\d+$/.test(value) + ? {'e.id': value} + : {or: [ + {'s.name': {like: `%${value}%`}}, + {'s.nickname': {like: `%${value}%`}} + ]}; case 'ref': param = `e.${param}`; return {[param]: {like: `%${value}%`}}; @@ -141,6 +146,7 @@ module.exports = Self => { e.invoiceInFk, t.landed, s.name AS supplierName, + s.nickname AS supplierAlias, co.code AS companyCode, cu.code AS currencyCode FROM vn.entry e diff --git a/modules/entry/front/main/index.html b/modules/entry/front/main/index.html index f19db21519..6c08cd0c42 100644 --- a/modules/entry/front/main/index.html +++ b/modules/entry/front/main/index.html @@ -8,11 +8,14 @@ - \ No newline at end of file + + + + diff --git a/modules/entry/front/search-panel/index.html b/modules/entry/front/search-panel/index.html index cff555e91e..38acdf77d6 100644 --- a/modules/entry/front/search-panel/index.html +++ b/modules/entry/front/search-panel/index.html @@ -5,7 +5,7 @@ vn-one label="General search" ng-model="filter.search" - info="Search entries by id" + info="Search entry by id or a suppliers by name or alias" vn-focus> @@ -45,8 +45,11 @@ label="Supplier" ng-model="filter.supplierFk" url="Suppliers" + fields="['name','nickname']" + search-function="{or: [{nickname: {like: '%'+ $search +'%'}}, {name: {like: '%'+ $search +'%'}}]}" show-field="name" value-field="id"> + {{name}}: {{nickname}} { ori.code AS origin, ic.name AS category, i.density, + i.stemMultiplier, b.grouping, b.packing, itn.code AS niche, @visibleCalc diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 66c32933ed..96fec51611 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -65,7 +65,10 @@ "type": "Number", "description": "Density" }, - "image": { + "stemMultiplier": { + "type": "Number", + "description": "Multiplier" + },"image": { "type": "String", "description": "Image" }, diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 8b03bc0d6b..71bff05eef 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -25,6 +25,7 @@ Origin Buyer Density + Multiplier Active @@ -78,6 +79,7 @@ {{::item.density}} + {{::item.stemMultiplier}}
-

Basic data

+

+ + Basic data + +

+

+ Basic data +

@@ -53,7 +64,18 @@
-

Other data

+

+ + Other data + +

+

+ Other data +

@@ -77,7 +99,18 @@
-

Tags

+

+ + Tags + +

+

+ Tags +

-

Tax

+

+ + Tax + +

+

+ Tax +

-

Niche

+

+ + Niche + +

+

+ Niche +

-

Botanical

+

+ + Botanical + +

+

+ Botanical +

@@ -111,7 +177,18 @@
-

Barcode

+

+ + Barcode + +

+

+ Barcode +

{{barcode.code}}

diff --git a/modules/item/front/summary/index.js b/modules/item/front/summary/index.js index dc4e638b82..52753ff650 100644 --- a/modules/item/front/summary/index.js +++ b/modules/item/front/summary/index.js @@ -13,6 +13,22 @@ class Controller extends Summary { if (this.item && this.item.id) this.getSummary(); } + + get isBuyer() { + return this.aclService.hasAny(['buyer']); + } + + get isReplenisher() { + return this.aclService.hasAny(['replenisher']); + } + + get isAdministrative() { + return this.aclService.hasAny(['administrative']); + } + + get isEmployee() { + return this.aclService.hasAny(['employee']); + } } ngModule.vnComponent('vnItemSummary', { diff --git a/modules/route/front/summary/index.html b/modules/route/front/summary/index.html index 6dd01c8b0d..b284851a07 100644 --- a/modules/route/front/summary/index.html +++ b/modules/route/front/summary/index.html @@ -61,7 +61,18 @@
-

Ticket

+

+ + Ticket + +

+

+ Ticket +

diff --git a/modules/route/front/summary/index.js b/modules/route/front/summary/index.js index 762cd8a41d..543c54afcf 100644 --- a/modules/route/front/summary/index.js +++ b/modules/route/front/summary/index.js @@ -16,6 +16,10 @@ class Controller extends Summary { }); } + get isDelivery() { + return this.aclService.hasAny(['delivery']); + } + get route() { return this._route; } diff --git a/modules/supplier/front/summary/index.html b/modules/supplier/front/summary/index.html index 14168f253f..b089f25e93 100644 --- a/modules/supplier/front/summary/index.html +++ b/modules/supplier/front/summary/index.html @@ -10,7 +10,18 @@ -

Basic data

+

+ + Basic data + +

+

+ Basic data +

-

Billing data

+

+ + Billing data + +

+

+ Billing data +

@@ -63,7 +85,18 @@
-

Fiscal data

+

+ + Fiscal data + +

+

+ Fiscal data +

@@ -82,7 +115,18 @@
-

Fiscal address

+

+ + Fiscal address + +

+

+ Fiscal address +

diff --git a/modules/supplier/front/summary/index.js b/modules/supplier/front/summary/index.js index 0992578489..a828379bc9 100644 --- a/modules/supplier/front/summary/index.js +++ b/modules/supplier/front/summary/index.js @@ -10,6 +10,10 @@ class Controller extends Summary { this.getSummary(); } + get isAdministrative() { + return this.aclService.hasAny(['administrative']); + } + getSummary() { return this.$http.get(`Suppliers/${this.supplier.id}/getSummary`).then(response => { this.summary = response.data; diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 8570036c01..d9ab2ee910 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -1,6 +1,6 @@
-
- + + - + - - - - - - - - - +
+ + + + + + O + + + + + +
+ - + - + - + - + diff --git a/modules/ticket/front/search-panel/index.js b/modules/ticket/front/search-panel/index.js index 08b0fb2447..6ef47757a8 100644 --- a/modules/ticket/front/search-panel/index.js +++ b/modules/ticket/front/search-panel/index.js @@ -1,8 +1,11 @@ import ngModule from '../module'; import SearchPanel from 'core/components/searchbar/search-panel'; + class Controller extends SearchPanel { constructor($, $element) { super($, $element); + this.filter = this.$.filter; + this.getGroupedStates(); } @@ -19,6 +22,35 @@ class Controller extends SearchPanel { this.groupedStates = groupedStates; }); } + + get from() { + return this._from; + } + + set from(value) { + this._from = value; + this.filter.scopeDays = null; + } + + get to() { + return this._to; + } + + set to(value) { + this._to = value; + this.filter.scopeDays = null; + } + + get scopeDays() { + return this._scopeDays; + } + + set scopeDays(value) { + this._scopeDays = value; + + this.filter.from = null; + this.filter.to = null; + } } ngModule.vnComponent('vnTicketSearchPanel', { diff --git a/modules/ticket/front/search-panel/index.spec.js b/modules/ticket/front/search-panel/index.spec.js index 55d341d2ac..f3a2f39edd 100644 --- a/modules/ticket/front/search-panel/index.spec.js +++ b/modules/ticket/front/search-panel/index.spec.js @@ -10,10 +10,11 @@ describe('Ticket Component vnTicketSearchPanel', () => { $httpBackend = _$httpBackend_; controller = $componentController('vnTicketSearchPanel', {$element: null}); controller.$t = () => {}; + controller.filter = {}; })); describe('getGroupedStates()', () => { - it('should set an array of groupedStates with the aditionof a name translation', () => { + it('should set an array of groupedStates with the adition of a name translation', () => { jest.spyOn(controller, '$t').mockReturnValue('miCodigo'); const data = [ { @@ -32,4 +33,39 @@ describe('Ticket Component vnTicketSearchPanel', () => { }]); }); }); + + describe('from() setter', () => { + it('should clear the scope days when setting the from property', () => { + controller.filter.scopeDays = 1; + + controller.from = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.from).toBeDefined(); + }); + }); + + describe('to() setter', () => { + it('should clear the scope days when setting the to property', () => { + controller.filter.scopeDays = 1; + + controller.to = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.to).toBeDefined(); + }); + }); + + describe('scopeDays() setter', () => { + it('should clear the date range when setting the scopeDays property', () => { + controller.filter.from = new Date(); + controller.filter.to = new Date(); + + controller.scopeDays = 1; + + expect(controller.filter.from).toBeNull(); + expect(controller.filter.to).toBeNull(); + expect(controller.scopeDays).toBeDefined(); + }); + }); }); diff --git a/modules/ticket/front/search-panel/locale/es.yml b/modules/ticket/front/search-panel/locale/es.yml index 5fa75ac099..54a01c82f8 100644 --- a/modules/ticket/front/search-panel/locale/es.yml +++ b/modules/ticket/front/search-panel/locale/es.yml @@ -16,4 +16,5 @@ Pending: Pendiente FREE: Libre DELIVERED: Servido ON_PREPARATION: En preparacion -PACKED: Encajado \ No newline at end of file +PACKED: Encajado +Cannot choose a range of dates and days onward at the same time: No se puede selecionar un rango de fechas y días en adelante a la vez \ No newline at end of file diff --git a/modules/ticket/front/services/index.html b/modules/ticket/front/services/index.html index 9fc9e5a311..13fd84b003 100644 --- a/modules/ticket/front/services/index.html +++ b/modules/ticket/front/services/index.html @@ -6,6 +6,7 @@ auto-load="true"> { + this.$.typesModel.refresh(); + return res; + }) .then(res => service.ticketServiceTypeFk = res.data.id); } diff --git a/modules/ticket/front/services/index.spec.js b/modules/ticket/front/services/index.spec.js index 5d8d58505f..affe8a6e7f 100644 --- a/modules/ticket/front/services/index.spec.js +++ b/modules/ticket/front/services/index.spec.js @@ -1,4 +1,5 @@ import './index.js'; +import crudModel from 'core/mocks/crud-model'; describe('Ticket component vnTicketService', () => { let controller; @@ -11,7 +12,7 @@ describe('Ticket component vnTicketService', () => { beforeEach(inject(($componentController, _$httpBackend_, $rootScope) => { $httpBackend = _$httpBackend_; $scope = $rootScope.$new(); - + $scope.typesModel = crudModel; $element = angular.element(`
`); controller = $componentController('vnTicketService', {$scope, $element}); })); diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 803734c740..dcd4470e4e 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -103,7 +104,13 @@

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

-

Sale

+

+ + Sale + +

@@ -158,7 +165,13 @@ -

Packages

+

+ + Packages + +

@@ -177,7 +190,13 @@
-

Service

+

+ + Service + +

@@ -202,7 +221,13 @@ -

Purchase request

+

+ + Purchase request + +

diff --git a/modules/ticket/front/weekly/locale/es.yml b/modules/ticket/front/weekly/locale/es.yml index 804467dae2..62f0f5b53d 100644 --- a/modules/ticket/front/weekly/locale/es.yml +++ b/modules/ticket/front/weekly/locale/es.yml @@ -4,4 +4,4 @@ You are going to delete this weekly ticket: Vas a eliminar este ticket programad This ticket will be removed from weekly tickets! Continue anyway?: Este ticket se eliminará de tickets programados! ¿Continuar de todas formas? Search weekly ticket by id or client id: Busca tickets programados por el identificador o el identificador del cliente Search by weekly ticket: Buscar por tickets programados -weekDay: Dia \ No newline at end of file +Weekday: Llegada \ No newline at end of file diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html index de6f6e979e..90a2ea27f6 100644 --- a/modules/travel/front/summary/index.html +++ b/modules/travel/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -132,7 +133,18 @@ -

Thermographs

+

+ + Thermograph + +

+

+ Thermograph +

diff --git a/modules/travel/front/summary/index.js b/modules/travel/front/summary/index.js index 876d1ec6c2..5144a0bb5e 100644 --- a/modules/travel/front/summary/index.js +++ b/modules/travel/front/summary/index.js @@ -56,6 +56,10 @@ class Controller extends Summary { return total; } + + get isBuyer() { + return this.aclService.hasAny(['buyer']); + } } ngModule.vnComponent('vnTravelSummary', { diff --git a/modules/worker/back/models/calendar.json b/modules/worker/back/models/calendar.json index 199d81e6c7..1da7179c4e 100644 --- a/modules/worker/back/models/calendar.json +++ b/modules/worker/back/models/calendar.json @@ -1,6 +1,6 @@ { "name": "Calendar", - "base": "Loggable", + "base": "VnModel", "log": { "model": "WorkerLog", "relation": "labour" diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index e816f6cf2a..0a99959e4f 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -10,7 +10,17 @@
-

Basic data

+

+ + Basic data + +

+

+ Basic data +

diff --git a/modules/worker/front/summary/index.js b/modules/worker/front/summary/index.js index 178df81a90..6a4d870074 100644 --- a/modules/worker/front/summary/index.js +++ b/modules/worker/front/summary/index.js @@ -52,6 +52,10 @@ class Controller extends Summary { this.$.worker = res.data; }); } + + get isHr() { + return this.aclService.hasAny(['hr']); + } } ngModule.vnComponent('vnWorkerSummary', { diff --git a/modules/zone/front/summary/index.html b/modules/zone/front/summary/index.html index 9247087e60..2fe94388f1 100644 --- a/modules/zone/front/summary/index.html +++ b/modules/zone/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -36,7 +37,11 @@ -

Warehouses

+

+ + Warehouse + +

diff --git a/print/templates/email/letter-debtor-nd/sql/client.sql b/print/templates/email/letter-debtor-nd/sql/client.sql index 1f672879b6..aad907a4b1 100644 --- a/print/templates/email/letter-debtor-nd/sql/client.sql +++ b/print/templates/email/letter-debtor-nd/sql/client.sql @@ -7,4 +7,4 @@ FROM client c JOIN company AS cny JOIN supplierAccount AS sa ON sa.id = cny.supplierAccountFk JOIN bankEntity be ON be.id = sa.bankEntityFk -WHERE c.id = ? AND cny.id = ?` \ No newline at end of file +WHERE c.id = ? AND cny.id = ? \ No newline at end of file