Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-05-22 19:06:20 +02:00
commit da0aa57539
104 changed files with 589 additions and 401 deletions

View File

@ -8,11 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [2322.01] - 2023-06-08
### Added
-
- (Tickets -> Crear Factura) Al facturar se envia automáticamente el pdf al cliente
### Changed
-
- (Trabajadores -> Nuevo trabajador) Los clientes se crean sin 'TR' pero se añade tipo de negocio 'Trabajador'
### Fixed
-

View File

@ -4,25 +4,25 @@ module.exports = Self => {
Self.remoteMethodCtx('deliveryNoteEmail', {
description: 'Sends the delivery note email with an docuware attached PDF',
accessType: 'WRITE',
accessScopes: ['docuwareDeliveryNoteEmail'],
accepts: [
{
arg: 'id',
type: 'string',
type: 'number',
required: true,
description: 'The ticket id',
http: {source: 'path'}
},
{
arg: 'recipient',
type: 'string',
description: 'The recipient email',
required: true,
},
{
arg: 'recipientId',
type: 'number',
description: 'The client id',
required: false
required: true
},
{
arg: 'recipient',
type: 'string',
description: 'The recipient email',
required: false,
}
],
returns: [
@ -41,12 +41,13 @@ module.exports = Self => {
}
],
http: {
path: '/:id/delivery-note-email',
path: '/delivery-note-email',
verb: 'POST'
}
});
Self.deliveryNoteEmail = async(ctx, id) => {
Self.deliveryNoteEmail = async(ctx, id, recipientId, recipient) => {
const models = Self.app.models;
const args = Object.assign({}, ctx.args);
const params = {
recipient: args.recipient,
@ -57,9 +58,11 @@ module.exports = Self => {
for (const param in args)
params[param] = args[param];
if (!recipient) params.recipient = models.Client.findById(recipientId, {fields: ['email']});
const email = new Email('delivery-note', params);
const docuwareFile = await Self.app.models.Docuware.download(ctx, id, 'deliveryNote');
const docuwareFile = await models.Docuware.download(ctx, id, 'deliveryNote');
return email.send({
overrideAttachments: true,

View File

@ -1,4 +1,4 @@
INSERT INTO `vn`.`businessType` (`code`, `description`)
INSERT INTO `vn`.`businessType` (`code`, `description`)
VALUES ('worker','Trabajador');
ALTER TABLE `vn`.`workerConfig` ADD businessTypeFk varchar(100) NULL

View File

@ -2780,10 +2780,23 @@ UPDATE `account`.`user`
INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldInstance, newInstance, changedModelId, `description`)
VALUES
(7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 1, NULL),
(7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 1, NULL),
(7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL),
(7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'");
(7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 1, NULL),
(7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 1, NULL),
(7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL),
(7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'");
INSERT INTO `vn`.`ticketLog` (originFk, userFk, `action`, creationDate, changedModel, changedModelId, changedModelValue, oldInstance, newInstance, description)
VALUES
(1, NULL, 'delete', '2001-06-09 11:00:04', 'Ticket', 45, 'Spider Man' , NULL, NULL, NULL),
(1, 18, 'select', '2001-06-09 11:00:03', 'Ticket', 45, 'Spider Man' , NULL, NULL, NULL),
(1, NULL, 'update', '2001-05-09 10:00:02', 'Sale', 69854, 'Armor' , '{"isPicked": false}','{"isPicked": true}', NULL),
(1, 18, 'update', '2001-01-01 10:05:01', 'Sale', 69854, 'Armor' , NULL, NULL, 'Armor quantity changed from ''15'' to ''10'''),
(1, NULL, 'delete', '2001-01-01 10:00:10', 'Sale', 5689, 'Shield' , '{"quantity":10,"concept":"Shield"}', NULL, NULL),
(1, 18, 'insert', '2000-12-31 15:00:05', 'Sale', 69854, 'Armor' , NULL,'{"quantity":15,"concept":"Armor", "price": 345.99, "itemFk": 2}', NULL),
(1, 18, 'update', '2000-12-28 08:40:45', 'Ticket', 45, 'Spider Man' , '{"warehouseFk":60,"shipped":"2023-05-16T22:00:00.000Z","nickname":"Super Man","isSigned":true,"isLabeled":true,"isPrinted":true,"packages":0,"hour":0,"isBlocked":false,"hasPriority":false,"companyFk":442,"landed":"2023-05-17T22:00:00.000Z","isBoxed":true,"isDeleted":true,"zoneFk":713,"zonePrice":13,"zoneBonus":0}','{"warehouseFk":61,"shipped":"2023-05-17T22:00:00.000Z","nickname":"Spider Man","isSigned":false,"isLabeled":false,"isPrinted":false,"packages":1,"hour":0,"isBlocked":true,"hasPriority":true,"companyFk":443,"landed":"2023-05-18T22:00:00.000Z","isBoxed":false,"isDeleted":false,"zoneFk":713,"zonePrice":13,"zoneBonus":1}', NULL),
(1, 18, 'select', '2000-12-27 03:40:30', 'Ticket', 45, NULL , NULL, NULL, NULL),
(1, 18, 'insert', '2000-04-10 09:40:15', 'Sale', 5689, 'Shield' , NULL, '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', NULL),
(1, 18, 'insert', '1999-05-09 10:00:00', 'Ticket', 45, 'Super Man' , NULL, '{"id":45,"clientFk":8608,"warehouseFk":60,"shipped":"2023-05-16T22:00:00.000Z","nickname":"Super Man","addressFk":48637,"isSigned":true,"isLabeled":true,"isPrinted":true,"packages":0,"hour":0,"created":"2023-05-16T11:42:56.000Z","isBlocked":false,"hasPriority":false,"companyFk":442,"agencyModeFk":639,"landed":"2023-05-17T22:00:00.000Z","isBoxed":true,"isDeleted":true,"zoneFk":713,"zonePrice":13,"zoneBonus":0}', NULL);
INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`)
VALUES

View File

@ -5,8 +5,8 @@ const $ = {
userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]',
email: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.email"]',
saveButton: 'vn-client-web-access button[type=submit]',
nameValue: 'vn-client-log .change:nth-child(1) .basic-json:nth-child(1) vn-json-value',
activeValue: 'vn-client-log .change:nth-child(2) .basic-json:nth-child(2) vn-json-value'
nameValue: 'vn-client-log .change:nth-child(1) .basic-json:nth-child(2) vn-json-value',
activeValue: 'vn-client-log .change:nth-child(2) .basic-json:nth-child(1) vn-json-value'
};
describe('Client web access path', () => {

View File

@ -1,5 +1,6 @@
import ngModule from '../../module';
import Component from 'core/lib/component';
import {hashToColor} from '../../lib/string';
import './style.scss';
/**
@ -16,13 +17,8 @@ export default class Avatar extends Component {
this._val = value;
const val = value || '';
let hash = 0;
for (let i = 0; i < val.length; i++)
hash += val.charCodeAt(i);
const color = '#' + colors[hash % colors.length];
const el = this.element;
el.style.backgroundColor = color;
el.style.backgroundColor = hashToColor(val);
el.title = val;
}
}
@ -35,29 +31,3 @@ ngModule.vnComponent('vnAvatar', {
},
transclude: true
});
const colors = [
'e2553d', // Coral
'FFA07A', // Salmon
'FFDAB9', // Peach
'a17077', // Pink
'bf0e99', // Pink light
'52a500', // Green chartreuse
'00aeae', // Cian
'b754cf', // Purple middle
'8a69cd', // Blue lavender
'1fa8a1', // Green ocean
'DC143C', // Red crimson
'5681cf', // Blue steel
'FF1493', // Ping intense
'02ba02', // Green lime
'1E90FF', // Blue sky
'8B008B', // Purple dark
'cc7000', // Orange bright
'00b5b8', // Turquoise
'8B0000', // Red dark
'008080', // Green bluish
'2F4F4F', // Gray board
'7e7e7e', // Gray
'5d5d5d', // Gray dark
];

View File

@ -2,7 +2,7 @@ import ngModule from '../../module';
import Component from 'core/lib/component';
import './style.scss';
const maxStrLen = 50;
const maxStrLen = 512;
/**
* Displays pretty JSON value.
@ -28,6 +28,12 @@ export default class Controller extends Component {
} else {
cssClass = type;
switch (type) {
case 'number':
if (Number.isInteger(value))
text = value;
else
text = Math.round((value + Number.EPSILON) * 1000) / 1000;
break;
case 'boolean':
text = value ? '✓' : '✗';
cssClass = value ? 'true' : 'false';

View File

@ -75,5 +75,19 @@ describe('Component vnJsonValue', () => {
expect(el.textContent).toEqual('2050');
expect(el.className).toContain('json-number');
});
it('should display number when value is decimal', () => {
controller.value = 10.1;
expect(el.textContent).toEqual('10.1');
expect(el.className).toContain('json-number');
});
it('should display rounded number when value is decimal with lot of decimals', () => {
controller.value = 10.124323234;
expect(el.textContent).toEqual('10.124');
expect(el.className).toContain('json-number');
});
});
});

View File

@ -1,3 +1,3 @@
SelectAllRows: Seleccionar las {{rows}} fila(s)
All: Se han seleccionado
row(s) have been selected.: fila(s).
Have been selected: Se han seleccionado
row(s) have been selected.: fila(s).

View File

@ -30,3 +30,39 @@ export function camelToKebab(str) {
export function firstUpper(str) {
return str.charAt(0).toUpperCase() + str.substr(1);
}
export function djb2a(string) {
let hash = 5381;
for (let i = 0; i < string.length; i++)
hash = ((hash << 5) + hash) ^ string.charCodeAt(i);
return hash >>> 0;
}
export function hashToColor(value) {
return '#' + colors[djb2a(value || '') % colors.length];
}
const colors = [
'b5b941', // Yellow
'ae9681', // Peach
'd78767', // Salmon
'cc7000', // Orange bright
'e2553d', // Coral
'8B0000', // Red dark
'de4362', // Red crimson
'FF1493', // Ping intense
'be39a2', // Pink light
'b754cf', // Purple middle
'a87ba8', // Pink
'8a69cd', // Blue lavender
'ab20ab', // Purple dark
'00b5b8', // Turquoise
'1fa8a1', // Green ocean
'5681cf', // Blue steel
'3399fe', // Blue sky
'6d9c3e', // Green chartreuse
'51bb51', // Green lime
'518b8b', // Gray board
'7e7e7e', // Gray
'5d5d5d', // Gray dark
];

View File

@ -1,70 +1,73 @@
@import "./variables";
/* Headings */
.text-h1, h1 {
font-size: 2.3rem;
}
.text-h2, h2 {
font-size: 2.25rem;
}
.text-h3, h3 {
font-size: 2rem;
}
.text-h4, h4 {
font-size: 1.6rem;
}
.text-h5, h5 {
font-size: 1.3rem;
}
.text-h6, h6 {
font-size: 1.125rem;
}
.text-subtitle1 {
font-size: 1.06rem;
}
.text-subtitle2 {
font-size: 1rem;
}
.text-body1 {
font-size: .875rem;
}
.text-body2 {
font-size: .875rem;
}
.text-caption {
font-size: .875rem;
}
.text-overline {
font-size: .8rem;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin-top: 0;
margin-bottom: 4px;
}
/* Colors */
.text-primary {
color: $color-main;
}
.text-secondary {
color: $color-font-light;
}
/* Helpers */
.text-uppercase {
text-transform: uppercase;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.text-left {
text-align: left;
}
@import "./variables";
/* Headings */
.text-h1, h1 {
font-size: 2.3rem;
}
.text-h2, h2 {
font-size: 2.25rem;
}
.text-h3, h3 {
font-size: 2rem;
}
.text-h4, h4 {
font-size: 1.6rem;
}
.text-h5, h5 {
font-size: 1.3rem;
}
.text-h6, h6 {
font-size: 1.125rem;
}
.text-subtitle1 {
font-size: 1.06rem;
}
.text-subtitle2 {
font-size: 1rem;
}
.text-body1 {
font-size: .875rem;
}
.text-body2 {
font-size: .875rem;
}
.text-caption {
font-size: .875rem;
}
.text-overline {
font-size: .8rem;
}
.text-capitalize {
text-transform: capitalize;
}
h1, h2, h3, h4, h5, h6 {
padding: 0;
margin-top: 0;
margin-bottom: 4px;
}
/* Colors */
.text-primary {
color: $color-main;
}
.text-secondary {
color: $color-font-light;
}
/* Helpers */
.text-uppercase {
text-transform: uppercase;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.text-left {
text-align: left;
}

View File

@ -10,19 +10,18 @@
</vn-crud-model>
<vn-crud-model
url="{{$ctrl.url}}/{{$ctrl.originId}}/models"
data="models"
data="$ctrl.models"
order="changedModel"
auto-load="true">
</vn-crud-model>
<vn-data-viewer
model="model"
is-loading="model.isLoading"
class="vn-w-md vn-px-sm">
class="vn-w-sm vn-px-sm">
<div class="change vn-mb-sm" ng-repeat="log in $ctrl.logs">
<div class="left">
<vn-avatar class="vn-mt-xs"
ng-class="::{system: !log.user}"
val="{{::log.user ? log.user.nickname : 'System'}}"
val="{{::log.user ? log.user.nickname : $ctrl.$t('System')}}"
ng-click="$ctrl.showWorkerDescriptor($event, log)">
<img
ng-if="::log.user.image"
@ -32,80 +31,67 @@
<div class="arrow bg-panel"></div>
<div class="line"></div>
</div>
<vn-card class="detail vn-pa-sm">
<div class="header vn-mb-sm">
<vn-card class="detail">
<div class="header vn-pa-sm">
<div
class="date text-secondary text-caption"
class="action-date text-secondary text-caption vn-mr-sm"
title="{{::log.creationDate | date:'dd/MM/yyyy HH:mm:ss'}}">
<vn-icon
class="action vn-mr-xs"
ng-class="::$ctrl.actionsClass[log.action]"
icon="{{::$ctrl.actionsIcon[log.action]}}"
translate-attr="::{title: $ctrl.actionsText[log.action]}">
</vn-icon>
{{::$ctrl.relativeDate(log.creationDate)}}
</div>
<span class="chip" ng-class="::$ctrl.actionsClass[log.action]" translate>
{{::$ctrl.actionsText[log.action]}}
</span>
</div>
<div
class="model vn-mb-sm"
title="{{::log.changedModelValue}}"
ng-if="::log.changedModel || log.changedModelValue">
<span class="model-name"
ng-if="::$ctrl.showModelName"
title="{{::log.changedModel}}">
{{::log.changedModelI18n}}
</span>
<span class="model-id"
ng-if="::log.changedModelId">
#{{::log.changedModelId}}
</span>
<span class="model-value">
{{::log.changedModelValue}}
</span>
</div>
<div class="changes"
ng-class="::log.props.length ? 'props' : 'no-props'"
vn-id="changes">
<vn-icon icon="visibility"
class="expand-button"
ng-click="$ctrl.toggleAttributes(log, changes, true)">
</vn-icon>
<vn-icon icon="visibility_off"
class="shrink-button"
ng-click="$ctrl.toggleAttributes(log, changes, false)">
</vn-icon>
<div class="changes-wrapper">
<span ng-if="::log.props.length"
class="attributes">
<span ng-if="!log.expand" ng-repeat="prop in ::log.props"
class="basic-json">
<span class="json-field"
title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value><span ng-if="::!$last">,</span>
</span>
<div ng-if="log.expand"
class="expanded-json">
<div ng-repeat="prop in ::log.props">
<span class="json-field"
title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value>
<span ng-if="::log.action == 'update'">
<vn-json-value value="::prop.old"></vn-json-value>
</span>
</div>
</div>
</span>
<span ng-if="::!log.props.length"
class="description">
{{::log.description}}
</span>
<span ng-if="::!log.description && !log.props.length"
class="no-changes"
translate>
No changes
<div class="action-model">
<span class="model-name"
ng-if="::$ctrl.showModelName && log.changedModel"
ng-style="::{backgroundColor: $ctrl.hashToColor(log.changedModel)}"
title="{{::log.changedModel}}">
{{::log.changedModelI18n}}
</span>
</div>
</div>
<div
class="model vn-pb-sm vn-px-sm"
title="{{::log.changedModelValue}}"
ng-if="::log.changedModelId || log.changedModelValue">
<span class="model-id" ng-if="::log.changedModelId">#{{::log.changedModelId}}</span>
<span class="model-value">{{::log.changedModelValue}}</span>
</div>
<div class="changes vn-pa-sm"
ng-class="{expanded: log.expand}"
ng-if="::log.props.length || log.description">
<vn-icon
icon="expand_more"
translate-attr="{title: 'Details'}"
ng-click="log.expand = !log.expand">
</vn-icon>
<span ng-if="::log.props.length"
class="attributes">
<span ng-if="!log.expand" ng-repeat="prop in ::log.props"
class="basic-json">
<span class="json-field" title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value><span ng-if="::!$last">,</span>
</span>
<div ng-if="log.expand" class="expanded-json">
<div ng-repeat="prop in ::log.props">
<span class="json-field" title="{{::prop.name}}">
{{::prop.nameI18n}}:
</span>
<vn-json-value value="::$ctrl.mainVal(prop, log.action)"></vn-json-value>
<span ng-if="::log.action == 'update'">
<vn-json-value value="::prop.old"></vn-json-value>
</span>
</div>
</div>
</span>
<span ng-if="::!log.props.length" class="description">
{{::log.description}}
</span>
</vn-card>
</div>
</div>
@ -114,10 +100,6 @@
<form vn-vertical
ng-model-options="{updateOn: 'change blur'}"
class="vn-pa-md filter">
<vn-textfield
label="Name"
ng-model="filter.changedModelValue">
</vn-textfield>
<vn-vertical>
<vn-radio
label="All"
@ -134,7 +116,7 @@
val="system"
ng-model="filter.who">
</vn-radio>
</div>
</vn-vertical>
<vn-autocomplete
ng-show="filter.who != 'system'"
label="User"
@ -162,24 +144,38 @@
</div>
</tpl-item>
</vn-autocomplete>
<vn-textfield
label="Search"
ng-model="filter.search">
<append>
<vn-icon
icon="info_outline"
vn-tooltip="Search by id or concept"
pointer>
</vn-icon>
</append>
</vn-textfield>
<vn-autocomplete
label="Model"
label="Entity"
ng-model="filter.changedModel"
value-field="changedModel"
show-field="changedModel"
data="models">
show-field="changedModelI18n"
data="$ctrl.models"
class="changed-model">
</vn-autocomplete>
<!-- FIXME: Cannot use LIKE with JSON columns
<vn-textfield
label="Id"
ng-model="filter.changedModelId">
label="Changes"
ng-model="filter.changes">
</vn-textfield>
-->
<vn-vertical>
<vn-check
label="Creates"
ng-model="filter.actions.insert">
</vn-check>
<vn-check
label="Updates"
label="Edits"
ng-model="filter.actions.update">
</vn-check>
<vn-check
@ -187,10 +183,10 @@
ng-model="filter.actions.delete">
</vn-check>
<vn-check
label="Views"
label="Accesses"
ng-model="filter.actions.select">
</vn-check>
</div>
</vn-vertical>
<vn-date-picker
label="Date"
ng-model="filter.from">
@ -199,7 +195,7 @@
label="To"
ng-model="filter.to">
</vn-date-picker>
<vn-button-bar vn-vertical class="vn-mt-sm">
<vn-button-bar vn-vertical>
<vn-button
label="Filter"
ng-click="$ctrl.applyFilter(filter)">

View File

@ -1,5 +1,6 @@
import ngModule from '../../module';
import Section from '../section';
import {hashToColor} from 'core/lib/string';
import './style.scss';
const validDate = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/;
@ -7,11 +8,12 @@ const validDate = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[
export default class Controller extends Section {
constructor($element, $) {
super($element, $);
this.hashToColor = hashToColor;
this.actionsText = {
insert: 'Creates',
update: 'Updates',
update: 'Edits',
delete: 'Deletes',
select: 'Views'
select: 'Accesses'
};
this.actionsClass = {
insert: 'success',
@ -19,6 +21,12 @@ export default class Controller extends Section {
delete: 'alert',
select: 'notice'
};
this.actionsIcon = {
insert: 'add',
update: 'edit',
delete: 'remove',
select: 'visibility'
};
this.filter = {
include: [{
relation: 'user',
@ -55,14 +63,14 @@ export default class Controller extends Section {
set logs(value) {
this._logs = value;
if (!this.logs) return;
if (!value) return;
const empty = {};
const validations = window.validations;
for (const log of value) {
const oldValues = log.oldInstance || empty;
const newValues = log.newInstance || empty;
const locale = validations[log.changedModel]?.locale || empty;
log.changedModelI18n = locale.name || log.changedModel;
log.changedModelI18n = firstUpper(locale.name) || log.changedModel;
let props = Object.keys(oldValues).concat(Object.keys(newValues));
props = [...new Set(props)];
@ -71,11 +79,27 @@ export default class Controller extends Section {
for (const prop of props) {
log.props.push({
name: prop,
nameI18n: locale.columns?.[prop] || prop,
nameI18n: firstUpper(locale.columns?.[prop]) || prop,
old: this.castJsonValue(oldValues[prop]),
new: this.castJsonValue(newValues[prop])
});
}
log.props.sort(
(a, b) => a.nameI18n.localeCompare(b.nameI18n));
}
}
get models() {
return this._models;
}
set models(value) {
this._models = value;
if (!value) return;
for (const model of value) {
const name = model.changedModel;
model.changedModelI18n =
firstUpper(window.validations[name]?.locale?.name) || name;
}
}
@ -93,11 +117,6 @@ export default class Controller extends Section {
return action == 'delete' ? prop.old : prop.new;
}
toggleAttributes(log, changesEl, force) {
log.expand = force;
changesEl.classList.toggle('expanded', force);
}
relativeDate(dateVal) {
if (dateVal == null) return '';
const date = new Date(dateVal);
@ -130,8 +149,17 @@ export default class Controller extends Section {
function getParam(prop, value) {
if (value == null || value == '') return null;
switch (prop) {
case 'changedModelValue':
return {[prop]: {like: `%${value}%`}};
case 'search':
const or = [{changedModelId: value}];
if (!/^[0-9]+$/.test(value))
or.push({changedModelValue: {like: `%${value}%`}});
return {or};
case 'changes':
return {or: [
{oldInstance: {like: `%${value}%`}},
{newInstance: {like: `%${value}%`}},
{description: {like: `%${value}%`}}
]};
case 'who':
switch (value) {
case 'all':
@ -195,6 +223,10 @@ export default class Controller extends Section {
}
}
function firstUpper(str) {
return str && str.charAt(0).toUpperCase() + str.substr(1);
}
ngModule.vnComponent('vnLog', {
controller: Controller,
template: require('./index.html'),

View File

@ -1,5 +1,8 @@
Date: Fecha
Model: Modelo
Concept: Concepto
Search: Buscar
Search by id or concept: Buscar por identificador o concepto
Entity: Entidad
Action: Acción
Author: Autor
Before: Antes
@ -7,12 +10,12 @@ After: Despues
History: Historial
Name: Nombre
Creates: Crea
Updates: Actualiza
Edits: Modifica
Deletes: Elimina
Views: Visualiza
Accesses: Accede
System: Sistema
Details: Detalles
note: nota
Changes: Cambios
No changes: No hay cambios
today: hoy
yesterday: ayer

View File

@ -1,4 +1,5 @@
@import "variables";
@import "effects";
vn-log {
.change {
@ -45,31 +46,52 @@ vn-log {
overflow: hidden;
& > .header {
display: flex;
justify-content: space-between;
align-items: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
& > .chip {
padding: 2px 4px;
border-radius: 4px;
display: inline-block;
color: $color-font-bg;
& > .action-model {
display: inline-flex;
overflow: hidden;
&.notice {
background-color: $color-notice-medium;
}
&.success {
background-color: $color-success-medium;
}
&.warning {
background-color: $color-main-medium;
}
&.alert {
background-color: lighten($color-alert, 5%);
& > .model-name {
display: inline-block;
padding: 2px 5px;
color: $color-font-dark;
border-radius: 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.date {
float: right;
& > .action-date {
white-space: nowrap;
& > .action {
display: inline-flex;
align-items: center;
justify-content: center;
color: $color-font-bg;
vertical-align: middle;
border-radius: 50%;
width: 24px;
height: 24px;
font-size: 1.4em;
&.notice {
background-color: $color-notice-medium
}
&.success {
background-color: $color-success-medium;
}
&.warning {
background-color: $color-main-medium;
}
&.alert {
background-color: lighten($color-alert, 5%);
}
}
}
}
& > .model {
@ -77,16 +99,12 @@ vn-log {
text-overflow: ellipsis;
white-space: nowrap;
& > .model-name {
text-transform: capitalize;
}
& > .model-value {
font-style: italic;
color: #c7bd2b;
}
& > .model-id {
color: $color-font-secondary;
font-size: .9em;
font-size: .9rem;
}
}
}
@ -94,59 +112,35 @@ vn-log {
.changes {
overflow: hidden;
background-color: rgba(255, 255, 255, .05);
border-radius: 4px;
color: $color-font-secondary;
transition: max-height 150ms ease-in-out;
max-height: 28px;
color: $color-font-light;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-height: 34px;
box-sizing: border-box;
& > .expand-button,
& > .shrink-button {
display: none;
& > vn-icon {
@extend %clickable;
float: right;
position: relative;
transition-property: transform, background-color;
transition-duration: 150ms;
margin: -5px;
margin-left: 4px;
padding: 1px;
border-radius: 50%;
}
&.props {
padding-right: 24px;
&.expanded {
text-overflow: initial;
white-space: initial;
& > .expand-button,
& > .shrink-button {
position: absolute;
top: 6px;
right: 8px;
font-size: inherit;
float: right;
cursor: pointer;
}
& > .expand-button {
display: block;
}
&.expanded {
max-height: 500px;
padding-right: 0;
& > .changes-wrapper {
text-overflow: initial;
white-space: initial;
}
& > .shrink-button {
display: block;
}
& > .expand-button {
display: none;
}
& > vn-icon {
transform: rotate(180deg);
}
}
& > .changes-wrapper {
padding: 4px 6px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
& > .no-changes {
font-style: italic;
}
.json-field {
text-transform: capitalize;
}
& > .no-changes {
font-style: italic;
}
}
}

View File

@ -33,7 +33,7 @@ export default class Controller {
const newPassword = this.newPassword;
this.$http.post('users/reset-password', {newPassword}, {headers})
this.$http.post('VnUsers/reset-password', {newPassword}, {headers})
.then(() => {
this.vnApp.showSuccess(this.$translate.instant('Password changed!'));
this.$state.go('login');

View File

@ -0,0 +1,4 @@
name: mail forward
columns:
account: account
forwardTo: forward to

View File

@ -0,0 +1,4 @@
name: reenvio de correo
columns:
account: cuenta
forwardTo: reenviar a

View File

@ -1,4 +1,4 @@
name: mail
name: correo electrónico
columns:
id: id
receiver: receptor

View File

@ -0,0 +1,4 @@
name: subrole
columns:
role: rol
inheritsFrom: inherits

View File

@ -0,0 +1,4 @@
name: subrol
columns:
role: rol
inheritsFrom: hereda

View File

@ -0,0 +1,5 @@
name: role
columns:
id: id
name: name
description: description

View File

@ -0,0 +1,5 @@
name: rol
columns:
id: id
name: nombre
description: descripción

View File

@ -1,4 +1,4 @@
name: account
name: user
columns:
id: id
name: name
@ -6,7 +6,7 @@ columns:
nickname: nickname
lang: lang
password: password
bcryptPassword: bcrypt password
bcryptPassword: BCRYPT password
active: active
email: email
emailVerified: email verified

View File

@ -1,4 +1,4 @@
name: cuenta
name: usuario
columns:
id: id
name: nombre
@ -6,12 +6,12 @@ columns:
nickname: apodo
lang: idioma
password: contraseña
bcryptPassword: contraseña bcrypt
bcryptPassword: contraseña BCRYPT
active: activo
email: email
emailVerified: email verificado
email: correo electrónico
emailVerified: correo verificado
created: creado
updated: actualizado
image: imagen
hasGrant: tiene permiso
hasGrant: puede delegar
userFk: usuario

View File

@ -1,4 +1,4 @@
name: claim beginning
name: beginning
columns:
id: id
quantity: quantity

View File

@ -1,4 +1,4 @@
name: comienzo reclamación
name: comienzo
columns:
id: id
quantity: cantidad

View File

@ -1,4 +1,4 @@
name: claim development
name: development
columns:
id: id
claimFk: claim

View File

@ -1,4 +1,4 @@
name: desarrollo reclamación
name: desarrollo
columns:
id: id
claimFk: reclamación

View File

@ -1,4 +1,4 @@
name: claim dms
name: document
columns:
dmsFk: dms
claimFk: claim

View File

@ -1,4 +1,4 @@
name: documento reclamación
name: documento
columns:
dmsFk: dms
claimFk: reclamación

View File

@ -1,4 +1,4 @@
name: claim end
name: end
columns:
id: id
claimFk: claim

View File

@ -1,4 +1,4 @@
name: final reclamación
name: finalización
columns:
id: id
claimFk: reclamación

View File

@ -1,4 +1,4 @@
name: claim observation
name: observation
columns:
id: id
claimFk: claim

View File

@ -1,4 +1,4 @@
name: observación reclamación
name: observación
columns:
id: id
claimFk: reclamación

View File

@ -18,3 +18,4 @@ columns:
addressFk: address
incotermsFk: incoterms
customsAgentFk: customs agent
isDefaultAddress: default

View File

@ -18,3 +18,4 @@ columns:
addressFk: dirección
incotermsFk: incoterms
customsAgentFk: agente adunanas
isDefaultAddress: predeterminada

View File

@ -1,4 +1,4 @@
name: client contact
name: contact
columns:
id: id
name: name

View File

@ -1,4 +1,4 @@
name: contacto cliente
name: contacto
columns:
id: id
name: nombre

View File

@ -1,4 +1,4 @@
name: client dms
name: document
columns:
dmsFk: dms
clientFk: client

View File

@ -1,4 +1,4 @@
name: documento cliente
name: documento
columns:
dmsFk: dms
clientFk: client

View File

@ -1,4 +1,4 @@
name: client observation
name: observation
columns:
id: id
clientFk: client

View File

@ -1,4 +1,4 @@
name: observación cliente
name: observación
columns:
id: id
clientFk: cliente

View File

@ -1,4 +1,4 @@
name: client sample
name: sample
columns:
id: id
created: created
@ -6,3 +6,5 @@ columns:
typeFk: type
userFk: user
companyFk: company
workerFk: worker
balance: balance

View File

@ -1,4 +1,4 @@
name: muestra cliente
name: muestra
columns:
id: id
created: creado
@ -6,3 +6,5 @@ columns:
typeFk: tipo
userFk: usuario
companyFk: compañia
workerFk: trabajador
balance: balance

View File

@ -2,7 +2,7 @@ name: client
columns:
id: id
name: name
fi: fi
fi: tax identifier
socialName: socialName
contact: contact
street: street
@ -14,22 +14,22 @@ columns:
isActive: active
credit: credit
creditInsurance: credit insurance
iban: iban
iban: IBAN
dueDay: due day
isEqualizated: equalizated
isFreezed: freezed
hasToInvoiceByAddress: invoice by address
hasToInvoice: has to invoice
isToBeMailed: be mailed
hasSepaVnl: sepa nnl
hasLcr: lcr
hasCoreVnl: core vnl
hasCoreVnh: core vnh
isToBeMailed: mailed
hasSepaVnl: sepa VNL
hasLcr: LCR
hasCoreVnl: core VNL
hasCoreVnh: core VNH
hasIncoterms: incoterms
isTaxDataChecked: tax data checked
eypbc: eypbc
eypbc: EYPBC
quality: quality
isVies: vies
isVies: VIES
isRelevant: relevant
accountingAccount: accounting account
created: created
@ -47,4 +47,9 @@ columns:
defaultAddressFk: default address
bankEntityFk: bank entity
transferorFk: transferor
riskCalculated: risk calculated
isCreatedAsServed: created as served
hasInvoiceSimplified: simplified invoice
typeFk: type
lastSalesPersonFk: last salesperson

View File

@ -2,7 +2,7 @@ name: cliente
columns:
id: id
name: nombre
fi: fi
fi: identificador fiscal
socialName: nombre social
contact: contacto
street: calle
@ -14,27 +14,27 @@ columns:
isActive: activo
credit: crédito
creditInsurance: seguro crédito
iban: iban
iban: IBAN
dueDay: día vencimiento
isEqualizated: igualado
isFreezed: congelado
hasToInvoiceByAddress: factura por dirección
hasToInvoice: tiene que facturar
isToBeMailed: envío por email
hasSepaVnl: sepa nnl
hasLcr: lcr
hasCoreVnl: centro vnl
hasCoreVnh: cenrto vnh
hasSepaVnl: sepa VNL
hasLcr: LCR
hasCoreVnl: centro VNL
hasCoreVnh: centro VNH
hasIncoterms: incoterms
isTaxDataChecked: datos fiscales comprobados
eypbc: eypbc
eypbc: EYPBC
quality: calidad
isVies: vies
isVies: VIES
isRelevant: importante
accountingAccount: cuenta contable
created: creado
sageTaxTypeFk: tipo impuesto sage
sageTransactionTypeFk: tipo transacción sage
sageTransactionTypeFk: tipo transacción Sage
businessTypeFk: tipo negocio
salesPersonFk: comercial
hasElectronicInvoice: factura electrónica
@ -47,4 +47,9 @@ columns:
defaultAddressFk: dirección predeterminada
bankEntityFk: entidad bancaria
transferorFk: cedente
riskCalculated: riesgo calculado
isCreatedAsServed: creado como servido
hasInvoiceSimplified: factura simple
typeFk: tipo
lastSalesPersonFk: último comercial

View File

@ -1,4 +1,4 @@
name: tpv transaction
name: TPV transaction
columns:
id: id
merchantFk: merchant

View File

@ -1,4 +1,4 @@
name: transacción tpv
name: transacción TPV
columns:
id: id
merchantFk: comerciante

View File

@ -1,4 +1,4 @@
name: entry observation
name: observation
columns:
id: id
description: description

View File

@ -1,4 +1,4 @@
name: observación entrada
name: observación
columns:
id: id
description: descripción

View File

@ -1,4 +1,4 @@
name: item barcode
name: barcode
columns:
id: id
code: code

View File

@ -1,4 +1,4 @@
name: código barras artículo
name: código barras
columns:
id: id
code: código

View File

@ -1,4 +1,4 @@
name: item botanical
name: botanical
columns:
itemFk: item
genusFk: genus

View File

@ -1,4 +1,4 @@
name: artículo botánico
name: botánico
columns:
itemFk: artículo
genusFk: género

View File

@ -1,4 +1,4 @@
name: item tag
name: tag
columns:
id: id
value: value

View File

@ -1,4 +1,4 @@
name: etiqueta artículo
name: etiqueta
columns:
id: id
value: valor

View File

@ -1,4 +1,4 @@
name: item tax country
name: country tax
columns:
id: id
effectived: effectived

View File

@ -1,7 +1,7 @@
name: impuesto país del artículo
name: impuesto país
columns:
id: id
effectived: efectivo
itemFk: artículo
countryFk: país
taxClassFk: clase impuestos
taxClassFk: clase impuesto

View File

@ -44,4 +44,6 @@ columns:
intrastatFk: intrastat
genericFk: generic
itemFk: item
density: density
compression: compression

View File

@ -27,8 +27,8 @@ columns:
value9: valor9
tag10: etiqueta10
value10: valor10
itemPackingTypeFk: embalaje del artículo
hasKgPrice: tiene precio kg
itemPackingTypeFk: tipo embalaje
hasKgPrice: precio kg
family: familia
expenseFk: gasto
minPrice: precio mínimo
@ -44,4 +44,6 @@ columns:
intrastatFk: intrastat
genericFk: genérico
itemFk: artículo
density: densidad
compression: compresión

View File

@ -1,14 +1,14 @@
name: ruta
columns:
id: id
created: creado
created: creada
time: tiempo
kmStart: km inicio
kmEnd: km fin
started: comenzado
finished: terminado
started: empezada
finished: terminada
gestdoc: gestdoc
cost: costo
cost: coste
m3: m3
description: descripción
isOk: ok

View File

@ -1,7 +1,7 @@
name: supplier account
name: account
columns:
id: id
iban: iban
iban: IBAN
beneficiary: beneficiary
supplierFk: supplier
bankEntityFk: bank entity

View File

@ -1,7 +1,7 @@
name: cuenta proveedor
name: cuenta
columns:
id: id
iban: iban
iban: IBAN
beneficiary: beneficiario
supplierFk: proveedor
bankEntityFk: entidad bancaria

View File

@ -1,4 +1,4 @@
name: supplier contact
name: contact
columns:
id: id
supplierFk: supplier

View File

@ -1,4 +1,4 @@
name: contacto proveedor
name: contacto
columns:
id: id
supplierFk: proveedor

View File

@ -4,7 +4,7 @@ columns:
name: name
account: account
countryFk: country
nif: nif
nif: NIF
phone: phone
retAccount: ret account
commission: commission

View File

@ -4,7 +4,7 @@ columns:
name: nombre
account: cuenta
countryFk: país
nif: nif
nif: NIF
phone: teléfono
retAccount: cuenta ret
commission: comisión

View File

@ -8,3 +8,7 @@ columns:
agencyModeFk: agency
workerFk: worker
packagingFk: packaging
hasNewRoute: new route
hostFk: PC
isBox: box
itemPackingTypeFk: packing type

View File

@ -8,3 +8,7 @@ columns:
agencyModeFk: agencia
workerFk: trabajador
packagingFk: embalaje
hasNewRoute: nueva ruta
hostFk: PC
isBox: caja
itemPackingTypeFk: tipo empaquetado

View File

@ -1,5 +1,6 @@
name: sale
columns:
id: id
concept: concept
quantity: quantity
price: price
@ -11,3 +12,7 @@ columns:
itemFk: item
ticketFk: ticket
saleFk: sale
priceFixed: price fixed
isPriceFixed: has fixed price
isAdded: added
total: total

View File

@ -1,13 +1,18 @@
name: línea
columns:
id: id
concept: concepto
quantity: cantidad
price: precio
discount: descuento
reserved: reservado
isPicked: esta seleccionado
isPicked: cogida
created: creado
originalQuantity: cantidad original
itemFk: artículo
ticketFk: ticket
saleFk: línea
priceFixed: precio fijado
isPriceFixed: tiene precio fijado
isAdded: añadida
total: total

View File

@ -1,4 +1,4 @@
name: ticket dms
name: document
columns:
dmsFk: dms
ticketFk: ticket

View File

@ -1,4 +1,4 @@
name: documento ticket
name: documento
columns:
dmsFk: dms
ticketFk: ticket

View File

@ -1,4 +1,4 @@
name: ticket observation
name: observation
columns:
id: id
description: description

View File

@ -1,4 +1,4 @@
name: observación ticket
name: observación
columns:
id: id
description: descripción

View File

@ -1,4 +1,4 @@
name: ticket packaging
name: packaging
columns:
id: id
quantity: quantity

View File

@ -1,4 +1,4 @@
name: embalaje ticket
name: embalaje
columns:
id: id
quantity: cantidad

View File

@ -1,4 +1,4 @@
name: ticket refund
name: refund
columns:
id: id
refundTicketFk: refund ticket

View File

@ -1,4 +1,4 @@
name: ticket abono
name: abono
columns:
id: id
refundTicketFk: ticket abono

View File

@ -1,4 +1,4 @@
name: ticket request
name: request
columns:
id: id
description: description

View File

@ -1,4 +1,4 @@
name: peticiones ticket
name: peticion
columns:
id: id
description: descripción

View File

@ -1,4 +1,4 @@
name: ticket service
name: service
columns:
id: id
ticketFk: ticket

View File

@ -1,4 +1,4 @@
name: servicios ticket
name: servicio
columns:
id: id
ticketFk: ticket

View File

@ -1,7 +1,8 @@
name: ticket tracking
name: state
columns:
id: id
created: created
ticketFk: ticket
stateFk: state
workerFk: worker
failFk: fail

View File

@ -1,7 +1,8 @@
name: seguimiento ticket
name: estado
columns:
id: id
created: creado
ticketFk: ticket
stateFk: estado
workerFk: trabajador
failFk: fallo

View File

@ -1,5 +1,6 @@
name: ticket
columns:
id: id
shipped: shipped
landed: landed
nickname: nickname
@ -23,3 +24,14 @@ columns:
agencyModeFk: agency
ticketFk: ticket
mergedTicket: merged ticket
withWarningAccept: negative warning
isWithoutNegatives: without negatives
isSigned: signed
isLabeled: labeled
isPrinted: printed
hour: hour
created: created
isBlocked: bloqued
hasPriority: priority
isBoxed: boxed
clonedFrom: cloned from

View File

@ -1,5 +1,6 @@
name: ticket
columns:
id: id
shipped: salida
landed: entrega
nickname: alias
@ -25,3 +26,12 @@ columns:
mergedTicket: ticket fusionado
withWarningAccept: aviso negativos
isWithoutNegatives: sin negativos
isSigned: firmado
isLabeled: etiquetado
isPrinted: impreso
hour: hora
created: creado
isBlocked: bloqueado
hasPriority: prioritario
isBoxed: encajado
clonedFrom: Clonado de

View File

@ -142,9 +142,10 @@ class Controller extends Section {
sendPdfDeliveryNote($data) {
let query = `tickets/${this.id}/delivery-note-email`;
if (this.hasDocuwareFile) query = `docuwares/${this.id}/delivery-note-email`;
if (this.hasDocuwareFile) query = `docuwares/delivery-note-email`;
return this.vnEmail.send(query, {
id: this.id,
recipientId: this.ticket.client.id,
recipient: $data.email
});

View File

@ -141,6 +141,7 @@ describe('Ticket Component vnTicketDescriptorMenu', () => {
const $data = {email: 'brucebanner@gothamcity.com'};
const params = {
id: 16,
recipient: $data.email,
recipientId: ticket.client.id
};

View File

@ -194,7 +194,10 @@ class Controller extends Section {
}
createClaim() {
const timeDifference = new Date().getTime() - new Date(this.ticket.shipped).getTime();
const today = new Date();
today.setHours(0, 0, 0, 0);
const timeDifference = today.getTime() - new Date(this.ticket.landed).getTime();
const pastDays = Math.floor(timeDifference / 86400000);
if (pastDays >= this.ticketConfig[0].daysForWarningClaim)

View File

@ -1,4 +1,4 @@
name: travel thermograph
name: thermograph
columns:
id: id
created: created
@ -6,5 +6,5 @@ columns:
result: result
warehouseFk: warehouse
travelFk: travel
dmsFk: dms
dmsFk: document
thermographFk: thermograph

View File

@ -1,4 +1,4 @@
name: travel thermograph
name: termógrafo
columns:
id: id
created: creado
@ -6,5 +6,5 @@ columns:
result: resultado
warehouseFk: almacén
travelFk: envío
dmsFk: dms
dmsFk: documento
thermographFk: termógrafo

View File

@ -0,0 +1,12 @@
name: contrato
columns:
id: id
companyCodeFk: company
started: started
ended: ended
payedHolidays: payed holidays
workerFk: worker
calendarTypeFk: calendar type
isHourlyLabor: hourly labor
workcenterFk: workcenter
amount: amount

View File

@ -0,0 +1,12 @@
name: contrato
columns:
id: id
companyCodeFk: empresa
started: iniciado
ended: finalizado
payedHolidays: vacaciones pagadas
workerFk: trabajador
calendarTypeFk: tipo calendario
isHourlyLabor: horario laboral
workcenterFk: centro de trabajo
amount: salario

View File

@ -1,4 +1,4 @@
name: worker dms
name: document
columns:
id: id
dmsFk: dms

View File

@ -1,4 +1,4 @@
name: documento trabajador
name: documento
columns:
id: id
dmsFk: dms

View File

@ -1,4 +1,4 @@
name: worker time control mail
name: time control mail
columns:
id: id
workerFk: worker

Some files were not shown because too many files have changed in this diff Show More