This commit is contained in:
Juan Ferrer 2019-02-11 22:57:59 +01:00
commit 476ce3318f
63 changed files with 2894 additions and 2367 deletions

View File

@ -7,7 +7,7 @@ RUN apt-get update \
ca-certificates \
gnupg2 \
libfontconfig \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
&& apt-get purge -y --auto-remove \

View File

@ -3,18 +3,21 @@
"description": "Companies",
"base": "VnModel",
"options": {
"mysql": {
"table": "company"
}
"mysql": {
"table": "company"
}
},
"properties": {
"id": {
"id": true,
"type": "Number",
"description": "Identifier"
},
"code": {
"type": "String"
}
"id": {
"id": true,
"type": "Number",
"description": "Identifier"
},
"code": {
"type": "String"
},
"expired": {
"type": "date"
}
}
}
}

View File

@ -493,4 +493,10 @@ export default {
observationInput: `vn-textarea[label="Observation"] textarea`,
saveButton: `${components.vnSubmit}`
},
orderLine: {
orderSubtotal: 'vn-order-line > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > div > span',
firstLineDeleteButton: 'vn-order-line vn-tbody > vn-tr:nth-child(1) vn-icon[icon="delete"]',
confirmOrder: 'vn-order-line > vn-vertical > vn-button-bar > vn-button > button',
confirmButton: 'vn-order-line > vn-confirm button[response="ACCEPT"]',
},
};

View File

@ -0,0 +1,45 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('Order lines', () => {
const nightmare = createNightmare();
beforeAll(() => {
nightmare
.loginAndModule('employee', 'order')
.accessToSearchResult('16')
.accessToSection('order.card.line');
});
it('should check the order subtotal', async() => {
const result = await nightmare
.waitToGetProperty(selectors.orderLine.orderSubtotal, 'innerText');
expect(result).toContain('135.60');
});
it('should delete the first line in the order', async() => {
const result = await nightmare
.waitToClick(selectors.orderLine.firstLineDeleteButton)
.waitToClick(selectors.orderLine.confirmButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should confirm the order subtotal has changed', async() => {
const result = await nightmare
.waitToGetProperty(selectors.orderLine.orderSubtotal, 'innerText');
expect(result).toContain('90.10');
});
it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => {
const url = await nightmare
.waitToClick(selectors.orderLine.confirmOrder)
.waitForURL('ticket/index')
.parsedUrl();
expect(url.hash).toContain('ticket/index');
expect(url.hash).toContain('clientFk');
});
});

View File

@ -296,7 +296,7 @@ describe('Ticket Edit sale path', () => {
expect(result).toEqual(`The sales of this ticket can't be modified`);
});
it('should transfer the sale to a valid ticket', async() => {
it('should transfer the third sale to a valid ticket', async() => {
const result = await nightmare
.waitToClick(selectors.ticketSales.moveToTicketInputClearButton)
.write(selectors.ticketSales.moveToTicketInput, 12)
@ -357,7 +357,7 @@ describe('Ticket Edit sale path', () => {
const result = await nightmare
.waitToClick(selectors.ticketSales.firstSaleCheckbox)
.waitToClick(selectors.ticketSales.transferSaleButton)
.write(selectors.ticketSales.moveToTicketInput, 16)
.write(selectors.ticketSales.moveToTicketInput, '16')
.waitToClick(selectors.ticketSales.moveToTicketButton)
.waitForURL('ticket/16/sale')
.parsedUrl();
@ -367,7 +367,7 @@ describe('Ticket Edit sale path', () => {
it('should confirm the original ticket received the line', async() => {
const result = await nightmare
.wait(selectors.ticketSales.saleLine)
// .waitForNumberOfElements(selectors.ticketSales.saleLine, 3)
.countElement(selectors.ticketSales.saleLine);
expect(result).toEqual(3);

View File

@ -1,7 +1,6 @@
import './module-loader';
import './crud';
import './acl-service';
import './storage-services';
import './template';
import './interpolate';
import './copy';

View File

@ -1,66 +0,0 @@
import ngModule from '../module';
class VnStorage {
constructor() {
this._type = '';
this.prefix = 'vn';
}
set type(value) {
this._type = value;
this.checkSupport();
}
get type() {
return this._type;
}
get webStorage() {
return window[this.type];
}
checkSupport() {
try {
let supported = (this.type in window && window[this.type] !== null);
if (supported) {
let key = '__' + Math.round(Math.random() * 1e7);
let webStorage = window[this.type];
webStorage.setItem(key, '');
webStorage.removeItem(key);
}
} catch (e) {
console.error('VnStorage.notification.error', e.message);
return false;
}
}
get(param) {
let toRead = this.webStorage.getItem(`${this.prefix}.${param}`);
if (toRead && toRead.startsWith('jsonObject:')) {
toRead = JSON.parse(toRead.replace('jsonObject:', ''));
}
return toRead;
}
set(param, data) {
let toStorage = typeof data === 'object' ? `jsonObject:${JSON.stringify(data)}` : data;
this.webStorage.setItem(`${this.prefix}.${param}`, toStorage);
}
remove(param) {
this.webStorage.removeItem(`${this.prefix}.${param}`);
}
clear() {
this.webStorage.clear();
}
}
class SessionStorage extends VnStorage {
constructor() {
super();
this.type = 'sessionStorage';
}
}
class LocalStorage extends VnStorage {
constructor() {
super();
this.type = 'localStorage';
}
}
ngModule.service('sessionStorage', SessionStorage);
ngModule.service('localStorage', LocalStorage);

View File

@ -58,6 +58,7 @@ function backWatch(done) {
nodemon({
exec: commands.join(' && '),
ext: 'js html css',
args: ['backOnly'],
watch: backSources,
done: done

View File

@ -3,7 +3,9 @@
<a translate-attr="{title: 'Return to module index'}" ui-sref="zone.index">
<vn-icon icon="chevron_left"></vn-icon>
</a>
<vn-icon icon="my_location"></vn-icon>
<a translate-attr="{title: 'Preview'}" ui-sref="zone.card.summary({id: $ctrl.zone.id})">
<vn-icon icon="desktop_windows"></vn-icon>
</a>
<vn-icon-menu
vn-id="more-button"
icon="more_vert"
@ -15,7 +17,7 @@
</vn-icon-menu>
</vn-horizontal>
<div class="body">
<vn-one>
<div class="attributes">
<vn-label-value label="Id"
value="{{$ctrl.zone.id}}">
</vn-label-value>
@ -40,7 +42,7 @@
<vn-label-value label="Bonus"
value="{{$ctrl.zone.price | currency: 'EUR': 2}}">
</vn-label-value>
</vn-one>
</div>
</div>
</div>
<vn-confirm

View File

@ -38,7 +38,8 @@
"params": {
"zone": "$ctrl.zone"
}
}, {
},
{
"url": "/basic-data",
"state": "zone.card.basicData",
"component": "vn-zone-basic-data",
@ -46,6 +47,15 @@
"params": {
"zone": "$ctrl.zone"
}
},
{
"url": "/summary",
"state": "zone.card.summary",
"component": "vn-zone-summary",
"description": "Summary",
"params": {
"zone": "$ctrl.zone"
}
}
]
}

View File

@ -154,4 +154,11 @@
message="Continue anyway?">
</vn-confirm>
<vn-add-stowaway vn-id="addStowaway" card-reload="$ctrl.cardReload()" ticket="$ctrl.ticket"></vn-add-stowaway>
<vn-remove-stowaway vn-id="removeStowaway" card-reload="$ctrl.cardReload()" ticket="$ctrl.ticket"></vn-remove-stowaway>
<vn-remove-stowaway vn-id="removeStowaway" card-reload="$ctrl.cardReload()" ticket="$ctrl.ticket"></vn-remove-stowaway>
<vn-confirm
vn-id="confirm-dialog"
on-response="$ctrl.returnDialog(response)"
question="Pickup order"
message="Do you want to send it directly?">
<tpl-buttons>asd</tpl-buttons>
</vn-confirm>

View File

@ -9,9 +9,10 @@ class Controller {
this.$translate = $translate;
this.moreOptions = [
{callback: this.showAddTurnDialog, name: 'Add turn', show: true},
{callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true},
{callback: this.showAddStowaway, name: 'Add stowaway', show: () => this.isTicketModule()},
{callback: this.showRemoveStowaway, name: 'Remove stowaway', show: () => this.shouldShowRemoveStowaway()},
{callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true},
{callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true},
/* callback: this.showChangeShipped, name: 'Change shipped hour', show: true} */
];
}
@ -157,6 +158,11 @@ class Controller {
get quicklinks() {
return this._quicklinks;
}
showDeliveryNote() {
let url = `/api/report/rpt-delivery-note?ticketFk=${this.ticket.id}`;
window.open(url);
}
}
Controller.$inject = ['$state', '$scope', '$http', 'vnApp', '$translate'];

View File

@ -1,6 +1,6 @@
import './index.js';
xdescribe('Item Component vnTicketDescriptor', () => {
describe('Item Component vnTicketDescriptor', () => {
let $httpBackend;
let controller;
@ -69,5 +69,15 @@ xdescribe('Item Component vnTicketDescriptor', () => {
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Ticket deleted');
});
});
describe('showDeliveryNote()', () => {
it('should open a new window showing a delivery note PDF document', () => {
let expectedPath = '/api/report/rpt-delivery-note?ticketFk=2';
spyOn(window, 'open');
controller.showDeliveryNote();
expect(window.open).toHaveBeenCalledWith(expectedPath);
});
});
});

View File

@ -6,4 +6,5 @@ Stowaways to add: Polizones a añadir
Stowaways of the ticket: Polizones del ticket
Add stowaway: Añadir polizón
Remove stowaway: Borrar polizón
Are you sure you want to delete this stowaway?: ¿Estas seguro de que quieres borrar este polizón?
Are you sure you want to delete this stowaway?: ¿Estas seguro de que quieres borrar este polizón?
Show Delivery Note: Ver albarán

View File

@ -70,6 +70,7 @@ class Controller {
this.$http.post(query, params).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
});
this.$scope.watcher.updateOriginalData();
this.getVAT();
this.card.reload();
}
@ -92,7 +93,7 @@ class Controller {
this.$http.post(query).then(() => {
this.vnApp.showSuccess(this.$translate.instant('Order confirmed'));
this.$state.go(`ticket.index`, {clientFk: this.order.clientFk});
this.$state.go(`ticket.index`, {q: JSON.stringify({clientFk: this.order.clientFk})});
});
}
}

View File

@ -32,6 +32,9 @@
"atenderFk": {
"type": "Number",
"required": true
},
"response": {
"type": "String"
}
},
"relations": {
@ -54,6 +57,11 @@
"type": "belongsTo",
"model": "Worker",
"foreignKey": "requesterFk"
},
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk"
}
}
}

View File

@ -51,7 +51,7 @@
</vn-horizontal>
</vn-one>
<vn-one>
<vn-icon-butto
<vn-icon-button
vn-tooltip="Add service"
vn-bind="+"
icon="add_circle"

144
package-lock.json generated
View File

@ -1274,7 +1274,7 @@
},
"ansi-escapes": {
"version": "3.1.0",
"resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
"integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==",
"dev": true
},
@ -1567,7 +1567,7 @@
},
"util": {
"version": "0.10.3",
"resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
"integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
"dev": true,
"requires": {
@ -1795,7 +1795,7 @@
"base": {
"version": "0.11.2",
"resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
"integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
"integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=",
"dev": true,
"requires": {
"cache-base": "^1.0.1",
@ -2167,7 +2167,7 @@
},
"browserify-rsa": {
"version": "4.0.1",
"resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
"resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
"integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
"dev": true,
"requires": {
@ -2217,7 +2217,7 @@
},
"buffer": {
"version": "4.9.1",
"resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
"integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
"dev": true,
"requires": {
@ -2392,7 +2392,7 @@
"cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
"integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
"integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=",
"dev": true,
"requires": {
"collection-visit": "^1.0.0",
@ -2436,7 +2436,7 @@
},
"camelcase-keys": {
"version": "2.1.0",
"resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
"dev": true,
"requires": {
@ -2573,7 +2573,7 @@
"class-utils": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
"integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
"integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=",
"dev": true,
"requires": {
"arr-union": "^3.1.0",
@ -2733,7 +2733,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@ -2807,7 +2807,7 @@
},
"colors": {
"version": "1.1.2",
"resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
"integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
"dev": true
},
@ -3000,7 +3000,7 @@
},
"content-disposition": {
"version": "0.5.2",
"resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
},
"content-security-policy-builder": {
@ -3269,13 +3269,13 @@
"dependencies": {
"jsesc": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true
},
"regexpu-core": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz",
"resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz",
"integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=",
"dev": true,
"requires": {
@ -3286,13 +3286,13 @@
},
"regjsgen": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
"resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
"integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
"dev": true
},
"regjsparser": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
"resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
"integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
"dev": true,
"requires": {
@ -3762,7 +3762,7 @@
"dot-prop": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
"integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=",
"integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
"is-obj": "^1.0.0"
@ -3795,7 +3795,7 @@
},
"readable-stream": {
"version": "1.1.14",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
"integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
"dev": true,
"requires": {
@ -3922,7 +3922,7 @@
"dependencies": {
"fs-extra": {
"version": "0.30.0",
"resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
"integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
"dev": true,
"requires": {
@ -3935,7 +3935,7 @@
},
"jsonfile": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"dev": true,
"requires": {
@ -4464,7 +4464,7 @@
},
"events": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=",
"dev": true
},
@ -4967,7 +4967,7 @@
},
"file-loader": {
"version": "1.1.11",
"resolved": "http://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz",
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz",
"integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==",
"dev": true,
"requires": {
@ -5181,7 +5181,7 @@
},
"fs-access": {
"version": "1.0.1",
"resolved": "http://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz",
"resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz",
"integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=",
"dev": true,
"requires": {
@ -5961,7 +5961,7 @@
"global-modules": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
"integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
"integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=",
"dev": true,
"requires": {
"global-prefix": "^1.0.1",
@ -6004,7 +6004,7 @@
},
"globby": {
"version": "5.0.0",
"resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
"resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
"integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
"dev": true,
"requires": {
@ -6049,7 +6049,7 @@
},
"got": {
"version": "6.7.1",
"resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz",
"resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz",
"integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=",
"dev": true,
"requires": {
@ -6226,7 +6226,7 @@
},
"kind-of": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
"dev": true
},
@ -6410,7 +6410,7 @@
"dependencies": {
"es6-promise": {
"version": "3.3.1",
"resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz",
"integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=",
"dev": true
},
@ -7160,7 +7160,7 @@
"is-absolute": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
"integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
"integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=",
"dev": true,
"requires": {
"is-relative": "^1.0.0",
@ -7209,7 +7209,7 @@
},
"is-builtin-module": {
"version": "1.0.0",
"resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true,
"requires": {
@ -7356,7 +7356,7 @@
},
"is-obj": {
"version": "1.0.1",
"resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true
},
@ -7387,7 +7387,7 @@
"is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
"integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
"integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=",
"dev": true,
"requires": {
"isobject": "^3.0.1"
@ -7423,7 +7423,7 @@
"is-relative": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
"integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
"integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=",
"dev": true,
"requires": {
"is-unc-path": "^1.0.0"
@ -7457,7 +7457,7 @@
"is-unc-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
"integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
"integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=",
"dev": true,
"requires": {
"unc-path-regex": "^0.1.2"
@ -7558,7 +7558,7 @@
},
"jasmine-core": {
"version": "2.99.1",
"resolved": "http://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz",
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz",
"integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=",
"dev": true
},
@ -7575,7 +7575,7 @@
"jasmine-spec-reporter": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz",
"integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==",
"integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=",
"dev": true,
"requires": {
"colors": "1.1.2"
@ -7863,7 +7863,7 @@
"karma-chrome-launcher": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz",
"integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=",
"integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==",
"dev": true,
"requires": {
"fs-access": "^1.0.0",
@ -8059,7 +8059,7 @@
},
"load-json-file": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"dev": true,
"requires": {
@ -9511,7 +9511,7 @@
},
"media-typer": {
"version": "0.3.0",
"resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"mem": {
@ -9534,7 +9534,7 @@
},
"meow": {
"version": "3.7.0",
"resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"dev": true,
"requires": {
@ -9657,7 +9657,7 @@
},
"minimist": {
"version": "1.2.0",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"minstache": {
@ -9750,7 +9750,7 @@
},
"mkdirp": {
"version": "0.5.1",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"requires": {
"minimist": "0.0.8"
@ -9758,7 +9758,7 @@
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
}
}
@ -9910,7 +9910,7 @@
},
"multipipe": {
"version": "0.1.2",
"resolved": "http://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz",
"resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz",
"integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=",
"dev": true,
"requires": {
@ -10039,7 +10039,7 @@
},
"named-placeholders": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz",
"integrity": "sha1-O3oNJiA910s6nfTJz7gnsvuQfmQ=",
"dev": true,
"requires": {
@ -10048,7 +10048,7 @@
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"resolved": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz",
"integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=",
"dev": true
}
@ -10136,7 +10136,7 @@
"dependencies": {
"jsesc": {
"version": "0.5.0",
"resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true
}
@ -11006,7 +11006,7 @@
"dependencies": {
"minimist": {
"version": "0.0.10",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
"integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
"dev": true
},
@ -11068,7 +11068,7 @@
},
"os-homedir": {
"version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true
},
@ -11084,7 +11084,7 @@
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
@ -11272,7 +11272,7 @@
},
"path-browserify": {
"version": "0.0.0",
"resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz",
"integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=",
"dev": true
},
@ -11567,7 +11567,7 @@
},
"pretty-bytes": {
"version": "1.0.4",
"resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz",
"resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz",
"integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=",
"dev": true,
"requires": {
@ -11656,7 +11656,7 @@
},
"through2": {
"version": "0.2.3",
"resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
"resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
"integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=",
"dev": true,
"requires": {
@ -12119,7 +12119,7 @@
"dependencies": {
"jsesc": {
"version": "0.5.0",
"resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
"integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=",
"dev": true
}
@ -12525,7 +12525,7 @@
},
"safe-regex": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
"dev": true,
"requires": {
@ -12650,7 +12650,7 @@
"dependencies": {
"source-map": {
"version": "0.4.4",
"resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"dev": true,
"requires": {
@ -12790,7 +12790,7 @@
"set-value": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
"integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=",
"dev": true,
"requires": {
"extend-shallow": "^2.0.1",
@ -12977,7 +12977,7 @@
"snapdragon-node": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
"integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
"integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=",
"dev": true,
"requires": {
"define-property": "^1.0.0",
@ -13028,7 +13028,7 @@
"snapdragon-util": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
"integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
"integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=",
"dev": true,
"requires": {
"kind-of": "^3.2.0"
@ -13358,7 +13358,7 @@
"split-string": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
"integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
"integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=",
"dev": true,
"requires": {
"extend-shallow": "^3.0.0"
@ -13367,7 +13367,7 @@
"split2": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz",
"integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=",
"integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==",
"dev": true,
"requires": {
"through2": "^2.0.2"
@ -13469,7 +13469,7 @@
},
"stream-browserify": {
"version": "2.0.1",
"resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
"resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
"integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=",
"dev": true,
"requires": {
@ -13548,7 +13548,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@ -13634,7 +13634,7 @@
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
@ -14015,7 +14015,7 @@
},
"tar": {
"version": "2.2.1",
"resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
"dev": true,
"requires": {
@ -14185,7 +14185,7 @@
},
"through": {
"version": "2.3.8",
"resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"through2": {
@ -14368,7 +14368,7 @@
"touch": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
"integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=",
"integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==",
"dev": true,
"requires": {
"nopt": "~1.0.10"
@ -14457,7 +14457,7 @@
},
"tty-browserify": {
"version": "0.0.0",
"resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
"resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
"integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=",
"dev": true
},
@ -14855,7 +14855,7 @@
"useragent": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz",
"integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==",
"integrity": "sha1-IX+UOtVAyyEoZYqyP8lg9qiMmXI=",
"dev": true,
"requires": {
"lru-cache": "4.1.x",
@ -15083,7 +15083,7 @@
},
"vm-browserify": {
"version": "0.0.4",
"resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
"resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz",
"integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=",
"dev": true,
"requires": {
@ -15571,7 +15571,7 @@
},
"globby": {
"version": "6.1.0",
"resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
"resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
"integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"dev": true,
"requires": {
@ -15584,7 +15584,7 @@
"dependencies": {
"pify": {
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
}
@ -15966,7 +15966,7 @@
"write-file-atomic": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz",
"integrity": "sha1-H/YVdcLipOjlENb6TiQ8zhg5mas=",
"integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.11",

View File

@ -38,93 +38,26 @@
clear: both
}
.row {
margin-bottom: 15px;
overflow: hidden;
display: block;
clear: both;
width: 100%
}
.row.small {
margin-bottom: 5px
}
.row .text {
margin-bottom: 5px
}
.row .control {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box
}
.row:last-child {
margin-bottom: 0
}
.row.inline .text {
display: table-cell;
margin-bottom: 0;
width: 30%
}
.row.inline .control {
display: table-cell;
padding-left: 20px;
font-weight: bold;
color: #000;
width: 70%
}
.row.inline .description {
position: static;
overflow: visible
}
.row .description {
position: relative;
padding-top: 2px;
font-size: 9px;
overflow: hidden;
display: block;
clear: both
}
.row .line {
border-bottom: 1px solid #DDD;
border-right: 1px solid #DDD;
border-left: 1px solid #DDD;
margin-top: 10px;
color: #999;
padding: 5px
}
.row .description span {
background-color: #FFF;
margin: -5px 0 0 50px;
display: block;
padding: 5px;
float: left
}
.panel {
position: relative
position: relative;
margin-bottom: 15px;
padding-top: 10px;
break-inside: avoid;
break-before: always;
break-after: always;
}
.panel .header {
background-color: #FFF;
padding: 2.5px 5px;
padding: 2.5px 10px;
position: absolute;
font-weight: bold;
top: 0px;
left: 17.5px;
top: -12px
}
.panel .body {
border: 1px solid #CCC;
margin-top: 10px;
overflow: hidden;
padding: 20px
}
@ -133,7 +66,17 @@
margin-top: 0
}
.field {
.panel.dark .header {
border: 1px solid #808080;
background-color: #FFF;
}
.panel.dark .body {
border: 1px solid #808080;
background-color: #c0c0c0
}
.field {
border-bottom: 1px solid #CCC;
border-left: 1px solid #CCC;
border-top: 1px solid #CCC;
@ -157,20 +100,20 @@
}
.pull-left {
float: left
float: left !important
}
.pull-right {
float: right
float: right !important
}
.vertical-text {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
position: absolute;
text-align: center;
font-size: .65em;
text-align: center;
font-size: .65em;
right: -108px;
width: 200px;
top: 50%
@ -186,58 +129,38 @@ table {
width: 100%
}
.row-oriented .description,
.column-oriented .description {
font-size: 0.6em;
color: #888;
padding: 0 !important
}
.row-oriented .description .line,
.column-oriented .description .line {
border-bottom: 1px solid #DDD;
border-right: 1px solid #DDD;
border-left: 1px solid #DDD;
margin-top: 10px;
color: #999;
padding: 5px
}
.row-oriented .description span,
.column-oriented .description span {
background-color: #FFF;
margin: -5px 0 0 50px;
display: block;
padding: 5px;
float: left
}
.column-oriented {
margin: 20px 0
margin-bottom: 15px
}
.column-oriented tfoot {
border-top: 1px solid #808080;
}
.column-oriented td, .column-oriented th {
.column-oriented td,
.column-oriented th {
padding: 5px 10px
}
.column-oriented thead {
background-color: #c0c0c0
background-color: #e5e5e5
}
.column-oriented thead tr {
border-bottom: 1px solid #808080;
border-top: 1px solid #808080;
background-color: #c0c0c0
background-color: #e5e5e5
}
.column-oriented tfoot {
border-top: 2px solid #808080;
}
.column-oriented tfoot tr:first-child td {
padding-top: 20px !important;
}
.column-oriented .description {
border-bottom: 1px solid #DDD;
font-size: 0.8em
}
.panel .row-oriented td, .panel .row-oriented th {
padding: 10px 0
}
@ -249,4 +172,28 @@ table {
.row-oriented > tbody > tr > th {
padding-left: 30px;
width: 70%
}
}
.row-oriented .description {
padding: 0 !important;
font-size: 0.6em;
color: #888
}
.line {
border-bottom: 1px solid #DDD;
border-right: 1px solid #DDD;
border-left: 1px solid #DDD;
margin-top: 10px;
color: #999;
padding: 5px
}
.line span {
background-color: #FFF;
margin: -5px 0 0 50px;
display: block;
padding: 5px;
float: left
}

View File

@ -24,4 +24,8 @@
.font.small {
font-size: 0.65em
}
.font.bold {
font-weight: bold
}

View File

View File

@ -26,7 +26,7 @@ module.exports = {
const result = await this.preFetch(component, ctx);
const i18n = new VueI18n({
locale: 'es',
fallbackLocale: 'en'
fallbackLocale: 'es'
});
const app = new Vue({i18n,
render: h => h(result.component)});
@ -106,9 +106,6 @@ module.exports = {
const options = {
format: 'A4',
border: '1.5cm',
header: {
height: '80px',
},
footer: {
height: '60px',
}

View File

@ -1,5 +1,5 @@
footer {
font-family: verdana, sans-serif;
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
font-size: 0.55em;
color: #555;
zoom: 0.65
@ -9,6 +9,10 @@ footer, footer p {
text-align: center
}
p.privacy {
font-size: 0.8em
}
footer .page {
border-bottom: 2px solid #CCC;
padding-bottom: 2px

View File

@ -5,5 +5,5 @@
<section class="number">{{$t('numPages')}}</section>
</section>
<p class="phytosanitary">{{$t('law.phytosanitary')}}</p>
<p v-html="$t('law.privacy')"></p>
<p class="privacy" v-html="$t('law.privacy')"></p>
</footer>

View File

@ -7,8 +7,7 @@ module.exports = {
privacy: `En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal,
le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L.,
pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo
por escrito al domicilio social de la entidad. <br/>
La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.`,
por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.`,
}
},
},

View File

@ -2,10 +2,10 @@ header {
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
border-bottom: 1px solid #DDD;
padding-bottom: 10px;
margin-bottom: 20px;
text-align: center;
font-size: 0.60em;
color: #555;
zoom: 0.65
font-size: 0.55em;
color: #555
}
header img {

View File

@ -1,5 +1,5 @@
<header>
<img :src="embeded['/assets/images/report-logo.svg']" alt="Verdnatura"/>
<section>{{$t('company.registry')}}</section>
<section>{{$t('company.fiscalAddress')}}</section>
<section>{{$t('company.registry')}}</section>
</header>

View File

@ -3,9 +3,7 @@
<body>
<section class="container">
<!-- Header component -->
<report-header id="pageHeader-first"
:locale="locale">
</report-header>
<report-header :locale="locale"></report-header>
<!-- End header component -->
<section class="main">
<section class="columns">
@ -53,22 +51,23 @@
<thead>
<tr>
<th>{{$t('reference')}}</th>
<th>{{$t('quantity')}}</th>
<th>{{$t('claims')}}</th>
<th class="number">{{$t('quantity')}}</th>
<th class="number">{{$t('claims')}}</th>
<th>{{$t('concept')}}</th>
</tr>
</thead>
<tbody>
<tr v-for="sale in sales" :key="sale.id">
<td class="font gray">{{sale.id}}</td>
<td>{{sale.quantity}}</td>
<td>{{sale.claimQuantity}}</td>
<td class="number">{{sale.quantity}}</td>
<td class="number">{{sale.claimQuantity}}</td>
<td>{{sale.concept}}</td>
</tr>
</tbody>
</table>
<section class="panel sign">
<section class="header">{{$t('clientSignature')}}</section>
<section class="body centered">
<h3>{{clientName}}</h3>
</section>

View File

@ -10,6 +10,7 @@ module.exports = {
claims: 'Reclama',
reference: 'Referencia',
concept: 'Concepto',
clientSignature: 'Firma del cliente',
claim: 'Reclamación {0}',
sections: {
agency: {

View File

@ -1,3 +1,24 @@
table.column-oriented {
margin-top: 50px !important
#signature {
padding-right: 10px
}
#signature img {
-webkit-filter: brightness(0%);
filter: brightness(0%);
margin-bottom: 10px;
max-width: 150px
}
#packagings {
box-sizing: border-box;
padding-right: 10px
}
#taxes {
box-sizing: border-box;
padding-left: 10px
}
.description.phytosanitary {
background-color: #e5e5e5
}

View File

@ -1,13 +1,11 @@
<!DOCTYPE html>
<html lang="es">
<body>
<section class="container" id="report">
<section class="container">
<!-- Header component -->
<report-header id="pageHeader-first"
:locale="locale">
</report-header>
<report-header :locale="ticket.locale"></report-header>
<!-- End header component -->
<section class="main">
<section class="main" style="margin-bottom:100px">
<section class="columns">
<section class="size50">
<section class="size75">
@ -16,15 +14,15 @@
<tbody>
<tr>
<td class="font gray uppercase">{{$t('clientId')}}</td>
<th>{{clientId}}</th>
<th>{{client.id}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('ticketId')}}</td>
<th>{{ticketId}}</th>
<th>{{ticket.id}}</th>
</tr>
<tr>
<td class="font gray uppercase">{{$t('date')}}</td>
<th>{{dated()}}</th>
<th>{{shipped}}</th>
</tr>
</tbody>
</table>
@ -32,70 +30,168 @@
</section>
<section class="size50">
<section class="panel">
<section class="header">{{$t('clientData')}}</section>
<section class="header">{{$t('deliveryAddress')}}</section>
<section class="body">
<h3 class="uppercase">{{clientName}}</h3>
<h3 class="uppercase">{{address.nickname}}</h3>
<section>
{{street}}
{{address.street}}
</section>
<section>
{{postcode}}, {{city}} ({{province}})
{{address.postalCode}}, {{address.city}} ({{address.province}})
</section>
</section>
</section>
<section class="panel">
<section class="header">{{$t('fiscalData')}}</section>
<section class="body">
<section>
{{client.socialName}}
</section>
<section>
{{country}}
{{client.street}}
</section>
<section>
{{client.fi}}
</section>
</section>
</section>
</section>
</section>
<table class="column-oriented">
<thead>
<tr>
<th>{{$t('reference')}}</th>
<th>{{$t('quantity')}}</th>
<th>{{$t('concept')}}</th>
<th class="number">{{$t('size')}}</th>
<th>{{$t('cat')}}</th>
<th>{{$t('col')}}</th>
<th>{{$t('VAT')}}</th>
<th>{{$t('price')}}</th>
<th>{{$t('%')}}</th>
<th>{{$t('amount')}}</th>
<td>{{$t('reference')}}</td>
<td class="number">{{$t('quantity')}}</td>
<td>{{$t('concept')}}</td>
<td class="number">{{$t('price')}}</td>
<td class="centered">{{$t('discount')}}</td>
<td class="centered">{{$t('vat')}}</td>
<td class="number">{{$t('amount')}}</td>
</tr>
</thead>
<tbody>
<tr v-for="sale in sales" :key="sale.id">
<td>{{sale.ref</td>
<td>{{sale}}</td>
<td class="number">{{sale}}</td>
<td class="number">{{sale}}</td>
<td class="number">{{a}}</td>
<template v-for="sale in sales">
<tr class="font bold" :key="sale.id">
<td>{{sale.itemFk}}</td>
<td class="number">{{sale.quantity}}</td>
<td>{{sale.concept}}</td>
<td class="number">{{sale.price | currency('EUR')}}</td>
<td class="centered">{{sale.discount | percent}}</td>
<td class="centered">{{sale.vatType}}</td>
<td class="number">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR')}}</td>
</tr>
<tr class="description">
<td colspan="2" class="centered">
<strong class="font gray" v-if="sale.val1">{{sale.tag1}}</strong>
<span>{{sale.val1}}</span>
</td>
<td colspan="3" class="centered">
<strong class="font gray" v-if="sale.val2">{{sale.tag2}}</strong>
<span>{{sale.val2}}</span>
</td>
<td colspan="2" class="centered">
<strong class="font gray" v-if="sale.val3">{{sale.tag3}}</strong>
<span>{{sale.val3}}</span>
</td>
</tr>
<tr class="description phytosanitary" v-if="sale.passportNumber">
<td colspan="7">
{{sale.ediBotanic}} {{sale.denomination}} {{sale.countryCode}}-{{sale.passportNumber}}
<span v-if="sale.isProtectedZone">ZP</span>
</td>
</tr>
</template>
<!-- FIXME - APPLY CSS POST-RENDER -->
<tr >
<td colspan="7"></td>
</tr>
</tbody>
<tfoot>
<!-- <tr>
<td></td>
<td></td>
<td class="number"><strong class="pull-left">Total</strong> {{getTotalDebtOut()}}</td>
<td class="number">{{getTotalDebtIn()}}</td>
<td class="number">{{totalBalance}}</td>
</tr> -->
<tr>
<td colspan="6">
<span class="pull-right">{{$t('subtotal')}}</span>
</td>
<td class="number">{{getSubTotal() | currency('EUR')}}</td>
</tr>
</tfoot>
</table>
<section class="columns">
<section id="packagings" class="size50 pull-left" v-if="packagings.length > 0">
<h3>{{$t('packaging')}}</h3>
<table class="column-oriented">
<thead>
<tr>
<td>Id</td>
<td>{{$t('concept')}}</td>
<td class="number">{{$t('quantity')}}</td>
</tr>
</thead>
<tbody>
<tr v-for="packaging in packagings">
<td>{{packaging.itemFk}}</td>
<td>{{packaging.name}}</td>
<td class="number">{{packaging.quantity}}</td>
</tr>
</tbody>
<tfoot>
<tr class="font bold">
<td colspan="2">{{$t('total')}}</td>
<td class="number">0</td>
</tr>
</tfoot>
</table>
</section>
<section id="taxes" class="size50 pull-right" v-if="taxes">
<h3>{{$t('taxBreakdown')}}</h3>
<table class="column-oriented">
<thead>
<tr>
<td>{{$t('type')}}</td>
<td class="number">{{$t('taxBase')}}</td>
<td>{{$t('tax')}}</td>
<td class="number">{{$t('fee')}}</td>
</tr>
</thead>
<tbody>
<tr v-for="tax in taxes">
<td>{{tax.name}}</td>
<td class="number">{{tax.Base | currency('EUR')}}</td>
<td>{{tax.vatPercent | percent}}</td>
<td class="number">{{tax.tax | currency('EUR')}}</td>
</tr>
</tbody>
<tfoot>
<tr class="font bold">
<td>{{$t('subtotal')}}</td>
<td class="number">{{getTotalBase() | currency('EUR')}}</td>
<td></td>
<td class="number">{{getTotalTax()| currency('EUR')}}</td>
</tr>
<tr class="font bold">
<td colspan="2">{{$t('total')}}</td>
<td colspan="2" class="number">{{getTotal() | currency('EUR')}}</td>
</tr>
</tfoot>
</table>
</section>
<section class="size50 pull-left">
<section id="signature" class="panel" v-if="signature && signature.id">
<section class="header">Firma digital</section>
<section class="body centered">
<img v-bind:src="dmsPath"/>
<section>{{signature.created | date}}</section>
</section>
</section>
</section>
</section>
<div class="panel" style="text-align:center;background-color:red">
<div class="header">Firma digital</div>
<img width="200" src="http://windows.verdnatura.es/signatures/tickets/1161229.png"/>
<section>{{dmsCreated}}</section>
</div>
</div>
</section>
<!-- Footer component -->
<report-footer id="pageFooter"
:left-text="$t('ticket', [ticketId])"
:center-text="clientName"
:locale="locale">
:left-text="$t('ticket', [ticket.id])"
:center-text="client.socialName"
:locale="client.locale">
</report-footer>
<!-- End footer component -->
</section>

View File

@ -5,65 +5,94 @@ const UserException = require(`${appPath}/lib/exceptions/userException`);
module.exports = {
name: 'rpt-delivery-note',
async asyncData(ctx, params) {
const promises = [];
const data = {};
Object.assign(this, this.methods);
if (!params.ticketFk)
throw new UserException('No ticket id specified');
const [[client]] = await this.fetchClient(params.ticketFk);
const [[ticket]] = await this.fetchTicket(params.ticketFk);
const [[address]] = await this.fetchAddress(params.ticketFk);
const [[signature]] = await this.fetchSignature(params.ticketFk);
const [[taxes]] = await this.fetchTaxes(params.ticketFk);
const [sales] = await this.fetchSales(params.ticketFk);
const [packagings] = await this.fetchPackagings(params.ticketFk);
promises.push(this.methods.fetchClient(params.ticketFk));
promises.push(this.methods.fetchSales(params.ticketFk));
if (!ticket)
throw new UserException('No ticket data found');
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;
});
return {client, ticket, address, sales, taxes, packagings, signature};
},
created() {
if (this.locale)
this.$i18n.locale = this.locale;
if (this.client.locale)
this.$i18n.locale = this.client.locale;
},
data() {
return {totalBalance: 0.00};
},
computed: {
dmsPath() {
return `http://windows.verdnatura.es/signatures/tickets/1161229.png`;
const hostPath = 'http://windows.verdnatura.es/signatures/tickets';
if (this.signature && this.signature.id)
return `${hostPath}/${this.signature.id}.png`;
},
shipped() {
return strftime('%d-%m-%Y', this.ticket.shipped);
}
},
filters: {
currency(input, currency = 'EUR') {
return new Intl.NumberFormat('es', {
style: 'currency', currency
}).format(parseFloat(input));
},
percent(input) {
return new Intl.NumberFormat('es', {
style: 'percent',
minimumFractionDigits: 0,
maximumFractionDigits: 0
}).format(parseFloat(input));
},
date(input) {
return strftime('%d-%m-%Y %H:%I:%S', input);
}
},
methods: {
fetchClient(ticketFk) {
return database.pool.query(
`SELECT
c.id clientId,
t.id ticketId,
u.lang locale,
c.id,
c.email AS recipient,
c.socialName AS clientName,
c.socialName,
c.street,
c.postcode,
c.city,
c.fi,
p.name AS province,
ct.country,
dt.dmsFk,
d.created AS dmsCreated
u.lang locale
FROM ticket t
JOIN client c ON c.id = t.clientFk
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 dmsTicket dt ON dt.ticketFk = t.id
LEFT JOIN dms d ON d.id = dt.dmsFk
WHERE t.id = ?`, [ticketFk]);
},
fetchTicket(ticketFk) {
return database.pool.query(
`SELECT
t.id,
t.shipped
FROM ticket t
JOIN client c ON c.id = t.clientFk
JOIN account.user u ON u.id = c.id
WHERE t.id = ?`, [ticketFk]);
},
fetchAddress(ticketFk) {
return database.pool.query(
`SELECT
a.nickname,
a.street,
a.postalCode,
a.city,
p.name province
FROM ticket t
JOIN address a ON a.clientFk = t.clientFk
LEFT JOIN province p ON p.id = a.provinceFk
WHERE t.id = ?`, [ticketFk]);
},
fetchSales(ticketFk) {
return database.pool.query(
`SELECT
@ -78,45 +107,105 @@ module.exports = {
s.discount,
i.size,
i.stems,
ic.type taxType,
i.category,
it.id itemTypeId,
o.code AS origin,
i.inkFk,
s.ticketFk,
tcl.code vatType,
ibwg.ediBotanic,
ppa.denomination,
pp.number passportNumber,
be.isProtectedZone,
c.code AS countryCode,
ita.tag1,
ita.val1,
ita.tag2,
ita.val2,
ita.tag3,
ita.val3
FROM sale s
FROM vn.sale s
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
LEFT JOIN componentRate cr ON cr.id = sc.componentFk
LEFT JOIN componentTypeRate ctr ON ctr.id = cr.componentTypeRate
LEFT JOIN item i ON i.id = s.itemFk
LEFT JOIN ticket t ON t.id = s.ticketFk
LEFT JOIN origin o ON o.id = i.originFk
INNER JOIN supplier sp ON sp.id = t.companyFk
INNER JOIN itemType it ON it.id = i.typeFk
LEFT JOIN
(SELECT *
FROM
(SELECT tt.countryFk, tcc.taxClassFk, tc.type
FROM taxClassCode tcc
JOIN taxCode tc ON tc.id = tcc.taxCodeFk
JOIN taxType tt ON tt.id = tc.taxTypeFk
WHERE tcc.effectived <= '2019-01-29 13:00:00'
ORDER BY tcc.effectived DESC) tx
GROUP BY tx.countryFk, tx.taxClassFk) ic ON ic.countryFk = sp.countryFk
AND ic.taxClassFk = i.taxClassFk
JOIN vn.itemTagArranged ita ON ita.itemFk = s.itemFk
LEFT JOIN country c ON c.id = o.countryFk
LEFT JOIN supplier sp ON sp.id = t.companyFk
LEFT JOIN itemType it ON it.id = i.typeFk
LEFT JOIN itemTaxCountry itc ON itc.itemFk = i.id
AND itc.countryFk = sp.countryFk
LEFT JOIN taxClass tcl ON tcl.id = itc.taxClassFk
LEFT JOIN itemTagArranged ita ON ita.itemFk = s.itemFk
LEFT JOIN plantpassport pp ON pp.producerFk = i.producerFk
LEFT JOIN plantpassportAuthority ppa ON ppa.id = pp.plantpassportAuthorityFk
LEFT JOIN itemBotanicalWithGenus ibwg ON ibwg.itemFk = i.id
LEFT JOIN botanicExport be ON be.restriction = 'pasaporte fitosanitario'
LEFT JOIN ediGenus eg ON eg.id = be.ediGenusFk
LEFT JOIN ediSpecie es ON es.id = be.ediSpecieFk
AND ibwg.ediBotanic LIKE CONCAT(
IFNULL(eg.latinGenusName, ''),
IF(es.latinSpeciesName > '',
CONCAT(' ', es.latinSpeciesName), ''),
'%')
WHERE s.ticketFk = ?
GROUP BY s.id
ORDER BY (it.isPackaging), s.concept, s.itemFk`, [ticketFk]);
},
dated: () => {
return strftime('%d-%m-%Y', new Date());
fetchTaxes(ticketFk) {
return database.pool.query(
`CALL vn.ticketGetTaxAdd(?)`, [ticketFk]);
},
fetchPackagings(ticketFk) {
return database.pool.query(
`SELECT
tp.quantity,
i.name,
p.itemFk
FROM ticketPackaging tp
JOIN packaging p ON p.id = tp.packagingFk
JOIN item i ON i.id = p.itemFk
WHERE tp.ticketFk = ?
ORDER BY itemFk`, [ticketFk]);
},
fetchSignature(ticketFk) {
return database.pool.query(
`SELECT
d.id,
d.created
FROM ticket t
JOIN dmsTicket dt ON dt.ticketFk = t.id
JOIN dms d ON d.id = dt.dmsFk
AND d.file LIKE '%.png'
WHERE t.id = ?`, [ticketFk]);
},
getSubTotal() {
let subTotal = 0.00;
this.sales.forEach(sale => {
subTotal += sale.quantity * sale.price * (1 - sale.discount / 100);
});
return subTotal;
},
getTotalBase() {
let totalBase = 0.00;
this.taxes.forEach(tax => {
totalBase += parseFloat(tax.Base);
});
return totalBase;
},
getTotalTax() {
let totalTax = 0.00;
this.taxes.forEach(tax => {
totalTax += parseFloat(tax.tax);
});
return totalTax;
},
getTotal() {
return this.getTotalBase() + this.getTotalTax();
},
},
components: {

View File

@ -4,12 +4,24 @@ module.exports = {
title: 'Albarán',
ticketId: 'Albarán',
clientId: 'Cliente',
clientData: 'Datos del cliente',
deliveryAddress: 'Dirección de entrega',
fiscalData: 'Datos fiscales',
date: 'Fecha',
reference: 'Ref.',
quantity: 'Cant.',
concept: 'Concepto',
invoiced: 'Facturado',
payed: 'Pagado',
balance: 'Saldo',
price: 'PVP/u',
discount: 'Dto.',
vat: 'IVA',
amount: 'Importe',
type: 'Tipo',
taxBase: 'Base imp.',
tax: 'Tasa',
fee: 'Cuota',
packaging: 'Cubos y embalajes',
taxBreakdown: 'Desglose impositivo',
total: 'Total',
subtotal: 'Subtotal',
ticket: 'Albarán {0}'
},
},

View File

@ -3,9 +3,7 @@
<body>
<section class="container" id="report">
<!-- Header component -->
<report-header id="pageHeader-first"
:locale="locale">
</report-header>
<report-header :locale="locale"></report-header>
<!-- End header component -->
<section class="main">
<!-- Report start -->

View File

@ -3,9 +3,7 @@
<body>
<section class="container">
<!-- Header component -->
<report-header id="pageHeader-first"
:locale="locale">
</report-header>
<report-header :locale="locale"></report-header>
<!-- End header component -->
<section class="main">
<section class="columns">
@ -77,7 +75,7 @@
</section>
<!-- Footer component -->
<report-footer id="pageFooter"
:left-text="$t('claim', [claimId])"
:left-text="$t('client', [clientId])"
:center-text="clientName"
:locale="locale">
</report-footer>

View File

@ -3,9 +3,7 @@
<body>
<section class="container">
<!-- Header component -->
<report-header id="pageHeader-first"
:locale="locale">
</report-header>
<report-header :locale="locale"></report-header>
<!-- End header component -->
<section class="main">
<h1 class="title centered">{{$t('title')}}</h1>
@ -145,7 +143,7 @@
</section>
<!-- Footer component -->
<report-footer id="pageFooter"
:left-text="$t('claim', [claimId])"
:left-text="$t('order', [mandateCode])"
:center-text="clientName"
:locale="locale">
</report-footer>

View File

@ -3,9 +3,7 @@
<body>
<section class="container" id="report">
<!-- Header component -->
<report-header id="pageHeader-first"
:locale="locale">
</report-header>
<report-header :locale="locale"></report-header>
<!-- End header component -->
<section class="main">
<!-- Report start -->

View File

@ -1,89 +0,0 @@
USE `vn`;
DROP procedure IF EXISTS `ticketCalculateClon`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `ticketCalculateClon`(IN vTicketNew INT, vTicketOld INT)
BEGIN
/*
* @vTicketNew id del nuevo ticket clonado
* @vTicketOld id ticket original, a partir del qual se clonara el nuevo
* Este procedimiento "rebioniza" una linea, eliminando los componentes existentes e insertandolos de nuevo
*/
DECLARE vShipped DATE;
DECLARE vClient INT;
DECLARE vWarehouse SMALLINT;
DECLARE vAgencyMode INT;
DECLARE vAddress INT;
DECLARE vLanded DATE;
DECLARE vAgency INT;
REPLACE INTO orderTicket(orderFk,ticketFk)
SELECT orderFk, vTicketNew
FROM orderTicket
WHERE ticketFk = vTicketOld;
SELECT t.clientFk , t.warehouseFk, date(t.shipped), t.addressFk, t.agencyModeFk, t.landed, a.agencyFk
INTO vClient, vWarehouse, vShipped, vAddress, vAgencyMode, vLanded, vAgency
FROM vn.agencyMode a
JOIN vn.ticket t ON t.agencyModeFk = a.id
WHERE t.id = vTicketNew;
DROP TEMPORARY TABLE IF EXISTS tmp.agencyHourGetShipped;
CREATE TEMPORARY TABLE tmp.agencyHourGetShipped ENGINE = MEMORY
SELECT vWarehouse warehouseFk, vShipped shipped, vLanded landed;
CALL buyUltimate(vWarehouse, vShipped); -- rellena la tabla tmp.buyUltimate con la ultima compra
DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot;
CREATE TEMPORARY TABLE tmp.ticketLot
SELECT vWarehouse warehouseFk,NULL available,s.itemFk, bu.buyFk
FROM sale s
LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
WHERE s.ticketFk = vTicketOld GROUP BY s.itemFk;
CALL ticketComponentCalculate(vAddress,vAgencyMode);
-- Bionizamos lineas con Preu = 0
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
CREATE TEMPORARY TABLE tmp.sale
(PRIMARY KEY (saleFk)) ENGINE = MEMORY
SELECT s.id saleFk, vWarehouse warehouseFk
FROM sale s
JOIN ticket t on t.id = s.ticketFk WHERE s.ticketFk = vTicketNew AND s.price = 0;
CALL ticketComponentUpdateSale(1);
-- Bionizamos lineas con Preu > 0
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
CREATE TEMPORARY TABLE tmp.sale
(PRIMARY KEY (saleFk)) ENGINE = MEMORY
SELECT s.id saleFk, vWarehouse warehouseFk
FROM sale s
JOIN ticket t on t.id = s.ticketFk WHERE s.ticketFk = vTicketNew
AND s.price > 0;
CALL ticketComponentUpdateSale(6);
IF vLanded IS NULL THEN
CALL agencyHourGetLanded(vShipped, vAddress, vAgency,vWarehouse);
UPDATE ticket t
JOIN tmp.agencyHourGetLanded ah ON t.warehouseFk = ah.warehouseFk
SET t.landed = ah.landed
WHERE t.id = vTicketNew;
END IF;
-- Log
CALL `logAdd`(vTicketNew, 'update', ' ticket' , 'Bioniza Ticket');
-- Limpieza
DROP TEMPORARY TABLE IF EXISTS tmp.buyUltimate;
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot;
DROP TEMPORARY TABLE IF EXISTS tmp.agencyHourGetShipped;
END$$
DELIMITER ;

View File

@ -1,29 +0,0 @@
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `vn2008`.`department`;
CREATE TABLE `vn2008`.`department` (
`department_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`lft` int(11) NOT NULL,
`rgt` int(11) NOT NULL,
`Id_Trabajador` int(11) DEFAULT NULL COMMENT 'Id_Trabajador es el jefe del departamento',
`company_id` int(11) NOT NULL,
`father_id` int(11) DEFAULT NULL,
`boss_id` int(11) DEFAULT NULL,
`x` int(11) DEFAULT NULL,
`y` int(11) DEFAULT NULL,
`production` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`department_id`),
UNIQUE KEY `lft_UNIQUE` (`lft`),
UNIQUE KEY `rgt_UNIQUE` (`rgt`),
UNIQUE KEY `name_UNIQUE` (`name`),
KEY `fk_department_Trabajadores1_idx` (`Id_Trabajador`),
KEY `dep_org_ibfk_3_idx` (`company_id`),
KEY `fk_department_department1_idx` (`father_id`),
KEY `fk_department_department1_idx_idx` (`father_id`),
CONSTRAINT `fk_department_Trabajadores1` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE,
CONSTRAINT `fk_department_department1_idx` FOREIGN KEY (`father_id`) REFERENCES `department` (`department_id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=90 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET FOREIGN_KEY_CHECKS=1;

View File

@ -1,6 +0,0 @@
CREATE OR REPLACE VIEW vn.labourHolidayType
AS SELECT
`cf`.`calendar_free_id` AS `id`,
`cf`.`type` AS `name`,
`cf`.`rgb` AS `rgb`
FROM `postgresql`.`calendar_free` `cf`;

View File

@ -1,5 +0,0 @@
CREATE OR REPLACE VIEW vn.labourHolidayLegend
AS SELECT
`cll`.`calendar_labour_legend_id` AS `id`,
`cll`.`descripcion` AS `description`
FROM `postgresql`.`calendar_labour_legend` `cll`;

View File

@ -1,8 +0,0 @@
CREATE OR REPLACE VIEW vn.labourHoliday
AS SELECT
`cl`.`calendar_labour_legend_id` AS `labourHolidayLegendFk`,
`cl`.`calendar_free_id` AS `labourHolidayTypeFk`,
`cl`.`workcenter_id` AS `workCenterFk`,
`cl`.`day` AS `dated`
FROM
`postgresql`.`calendar_labour` `cl`;

View File

@ -1,34 +0,0 @@
USE `vn`;
DROP procedure IF EXISTS `logAddWithUser`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `logAddWithUser`(vOriginFk INT, vUserId INT, vActionCode VARCHAR(45), vEntity VARCHAR(45), vDescription TEXT)
BEGIN
/**
* Guarda las acciones realizadas por el usuario
*
* @param vOriginFk Id del registro de origen
* @param vActionCode Código de la acción {insert | delete | update}
* @param vEntity Nombre que hace referencia a la tabla.
* @param descripcion Descripción de la acción realizada por el usuario
*/
DECLARE vTableName VARCHAR(255) DEFAULT CONCAT(IFNULL(vEntity, ''), 'Log');
SET @sqlQuery = CONCAT(
'INSERT INTO vn.', vTableName, ' SET originFk = ?, userFk = ?, action = ?, description = ?'
);
SET @originFk = vOriginFk;
SET @userFk = vUserId;
SET @action = vActionCode;
SET @description = vDescription;
PREPARE stmt FROM @sqlQuery;
EXECUTE stmt USING @originFk, @userFk, @action, @description;
DEALLOCATE PREPARE stmt;
SET @sqlQuery = NULL;
END$$
DELIMITER ;

View File

@ -1,21 +0,0 @@
USE `vn`;
DROP procedure IF EXISTS `logAdd`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `logAdd`(vOriginFk INT, vActionCode VARCHAR(45), vEntity VARCHAR(45), vDescription TEXT)
BEGIN
/**
* Guarda las acciones realizadas por el usuario
*
* @param vOriginFk Id del registro de origen
* @param vActionCode Código de la acción {insert | delete | update}
* @param vEntity Nombre que hace referencia a la tabla.
* @param descripcion Descripción de la acción realizada por el usuario
*/
CALL logAddWithUser(vOriginFk, account.userGetId(), vActionCode, vEntity, vDescription);
END$$
DELIMITER ;

View File

@ -1,21 +0,0 @@
USE `vn`;
DROP procedure IF EXISTS `ticketCreate`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `ticketCreate`(
vClientId INT
,vShipped DATE
,vWarehouseId INT
,vCompanyFk INT
,vAddressFk INT
,vAgencyType INT
,vRouteFk INT
,vlanded DATE
,OUT vNewTicket INT)
BEGIN
CALL `ticketCreateWithUser`(vClientId, vShipped, vWarehouseId, vCompanyFk, vAddressFk, vAgencyType, vRouteFk, vlanded, account.userGetId(), vNewTicket);
END$$
DELIMITER ;

View File

@ -1,82 +0,0 @@
USE `vn`;
DROP procedure IF EXISTS `ticketCreateWithUser`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `ticketCreateWithUser`(
vClientId INT
,vShipped DATE
,vWarehouseId INT
,vCompanyFk INT
,vAddressFk INT
,vAgencyType INT
,vRouteFk INT
,vlanded DATE
,vUserId INT
,OUT vNewTicket INT)
BEGIN
DECLARE vClientOrnamentales INT DEFAULT 5270;
DECLARE vCompanyOrn INT DEFAULT 1381;
DECLARE vProvinceName VARCHAR(255);
SELECT p.name INTO vProvinceName
FROM vn.client c
JOIN province p ON p.id = c.provinceFk
WHERE c.id = vClientId;
IF vProvinceName IN ('SANTA CRUZ DE TENERIFE', 'LAS PALMAS DE GRAN CANARIA') AND vClientId <> vClientOrnamentales THEN
SET vCompanyFk = vCompanyOrn;
END IF;
IF NOT vAddressFk OR vAddressFk IS NULL THEN
SELECT id INTO vAddressFk
FROM address
WHERE clientFk = vClientId AND isDefaultAddress;
END IF;
INSERT INTO vn2008.Tickets (
Id_Cliente,
Fecha,
Id_Consigna,
Id_Agencia,
Alias,
warehouse_id,
Id_Ruta,
empresa_id,
landing
)
SELECT
vClientId,
vShipped,
a.id,
IF(vAgencyType, vAgencyType, a.agencyModeFk),
a.nickname,
vWarehouseId,
IF(vRouteFk,vRouteFk,NULL),
vCompanyFk,
vlanded
FROM address a
JOIN agencyMode am ON am.id = a.agencyModeFk
WHERE a.id = vAddressFk;
SET vNewTicket = LAST_INSERT_ID();
INSERT INTO ticketObservation(ticketFk, observationTypeFk, description)
SELECT vNewTicket, ao.observationTypeFk, ao.description
FROM addressObservation ao
JOIN address a ON a.id = ao.addressFk
WHERE a.id = vAddressFk;
CALL logAddWithUser(vNewTicket, vUserId, 'insert', 'ticket', CONCAT('Ha creado el ticket', ' ', vNewTicket));
IF (SELECT isCreatedAsServed FROM vn.client WHERE id = vClientId ) <> FALSE THEN
INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador)
SELECT id, vNewTicket, getWorker()
FROM state
WHERE `code` = 'DELIVERED';
END IF;
END$$
DELIMITER ;

View File

@ -1,18 +0,0 @@
USE `hedera`;
DROP procedure IF EXISTS `orderConfirm`;
DELIMITER $$
USE `hedera`$$
CREATE DEFINER=`root`@`%` PROCEDURE `orderConfirm`(vOrder INT)
BEGIN
/**
* Confirms an order, creating each of its tickets on
* the corresponding date and store.
*
* @param vOrder The order identifier
*/
CALL orderConfirmWithUser(vOrder, account.userGetId());
END$$
DELIMITER ;

View File

@ -1,233 +0,0 @@
USE `hedera`;
DROP procedure IF EXISTS `orderConfirmWithUser`;
DELIMITER $$
USE `hedera`$$
CREATE DEFINER=`root`@`%` PROCEDURE `orderConfirmWithUser`(vOrder INT, vUserId INT)
BEGIN
/**
* Confirms an order, creating each of its tickets on
* the corresponding date, store and user
*
* @param vOrder The order identifier
*@param vUser The user identifier
*/
DECLARE vOk BOOL;
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vWarehouse INT;
DECLARE vShipment DATETIME;
DECLARE vTicket INT;
DECLARE vNotes VARCHAR(255);
DECLARE vItem INT;
DECLARE vConcept VARCHAR(30);
DECLARE vAmount INT;
DECLARE vPrice DECIMAL(10,2);
DECLARE vSale INT;
DECLARE vRate INT;
DECLARE vRowId INT;
DECLARE vDelivery DATE;
DECLARE vAddress INT;
DECLARE vAgency INT;
DECLARE vIsConfirmed BOOL;
DECLARE vClientId INT;
DECLARE vCompanyId INT;
DECLARE vAgencyModeId INT;
DECLARE TICKET_FREE INT DEFAULT 2;
DECLARE SYSTEM_WORKER INT DEFAULT 20;
DECLARE cDates CURSOR FOR
SELECT ah.shipped, r.warehouse_id
FROM `order` o
JOIN order_row r ON r.order_id = o.id
LEFT JOIN tmp.agencyHourGetShipped ah ON ah.warehouseFk = r.warehouse_id
WHERE o.id = vOrder AND r.amount != 0
GROUP BY warehouse_id;
DECLARE cRows CURSOR FOR
SELECT r.id, r.item_id, a.Article, r.amount, r.price, r.rate
FROM order_row r
JOIN vn2008.Articles a ON a.Id_Article = r.item_id
WHERE r.amount != 0
AND r.warehouse_id = vWarehouse
AND r.order_id = vOrder
ORDER BY r.rate DESC;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET vDone = TRUE;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
RESIGNAL;
END;
-- Carga los datos del pedido
SELECT o.date_send, o.address_id, o.note, a.agency_id,
o.confirmed, cs.Id_Cliente, o.company_id, o.agency_id
INTO vDelivery, vAddress, vNotes, vAgency,
vIsConfirmed, vClientId, vCompanyId, vAgencyModeId
FROM hedera.`order` o
JOIN vn2008.Agencias a ON a.Id_Agencia = o.agency_id
JOIN vn2008.Consignatarios cs ON cs.Id_Consigna = o.address_id
WHERE id = vOrder;
-- Comprueba que el pedido no está confirmado
IF vIsConfirmed THEN
CALL util.throw ('ORDER_ALREADY_CONFIRMED');
END IF;
-- Comprueba que el pedido no está vacío
SELECT COUNT(*) > 0 INTO vOk
FROM order_row WHERE order_id = vOrder AND amount > 0;
IF !vOk THEN
CALL util.throw ('ORDER_EMPTY');
END IF;
-- Carga las fechas de salida de cada almacén
CALL vn.agencyHourGetShipped (vDelivery, vAddress, vAgency);
-- Trabajador que realiza la acción
IF vUserId IS NULL THEN
SELECT employeeFk INTO vUserId FROM orderConfig;
END IF;
-- Crea los tickets del pedido
START TRANSACTION;
OPEN cDates;
lDates:
LOOP
SET vTicket = NULL;
SET vDone = FALSE;
FETCH cDates INTO vShipment, vWarehouse;
IF vDone THEN
LEAVE lDates;
END IF;
-- Busca un ticket existente que coincida con los parametros del nuevo pedido
SELECT Id_Ticket INTO vTicket
FROM vn2008.Tickets t
LEFT JOIN vn.ticketState tls on tls.ticket = t.Id_Ticket
JOIN `order` o
ON o.address_id = t.Id_Consigna
AND vWarehouse = t.warehouse_id
AND o.agency_id = t.Id_Agencia
AND t.landing = o.date_send
AND vShipment = DATE(t.Fecha)
WHERE o.id = vOrder
AND t.Factura IS NULL
AND IFNULL(tls.alertLevel,0) = 0
AND t.Id_Cliente <> 1118
LIMIT 1;
-- Crea el ticket en el caso de no existir uno adecuado
IF vTicket IS NULL
THEN
CALL vn.ticketCreateWithUser(
vClientId,
IFNULL(vShipment, CURDATE()),
vWarehouse,
vCompanyId,
vAddress,
vAgencyModeId,
NULL,
vDelivery,
vUserId,
vTicket
);
ELSE
INSERT INTO vncontrol.inter
SET Id_Ticket = vTicket,
Id_Trabajador = SYSTEM_WORKER,
state_id = TICKET_FREE;
END IF;
INSERT IGNORE INTO vn2008.order_Tickets
SET order_id = vOrder,
Id_Ticket = vTicket;
-- Añade las notas
IF vNotes IS NOT NULL AND vNotes != ''
THEN
INSERT INTO vn2008.ticket_observation (Id_Ticket, observation_type_id, text)
VALUES (vTicket, 4/*comercial*/ , vNotes)
ON DUPLICATE KEY UPDATE text = CONCAT(VALUES(text),'. ', text);
END IF;
-- Añade los movimientos y sus componentes
OPEN cRows;
lRows:
LOOP
SET vDone = FALSE;
FETCH cRows INTO vRowId, vItem, vConcept, vAmount, vPrice, vRate;
IF vDone THEN
LEAVE lRows;
END IF;
INSERT INTO vn2008.Movimientos
SET
Id_Article = vItem,
Id_Ticket = vTicket,
Concepte = vConcept,
Cantidad = vAmount,
Preu = vPrice,
CostFixat = 0,
PrecioFijado = TRUE;
SET vSale = LAST_INSERT_ID();
INSERT INTO vn2008.Movimientos_componentes (Id_Movimiento, Id_Componente, Valor)
SELECT vSale, cm.component_id, cm.price
FROM order_component cm
JOIN bi.tarifa_componentes tc ON tc.Id_Componente = cm.component_id
WHERE cm.order_row_id = vRowId
GROUP BY vSale, cm.component_id;
UPDATE order_row SET Id_Movimiento = vSale
WHERE id = vRowId;
END LOOP;
CLOSE cRows;
-- Fija el Costfixat
UPDATE vn2008.Movimientos m
JOIN (SELECT SUM(mc.Valor) sum_valor,mc.Id_Movimiento
FROM vn2008.Movimientos_componentes mc
JOIN bi.tarifa_componentes tc USING(Id_Componente)
JOIN bi.tarifa_componentes_series tcs on tcs.tarifa_componentes_series_id = tc.tarifa_componentes_series_id AND tcs.base
JOIN vn2008.Movimientos m ON m.Id_Movimiento = mc.Id_Movimiento
WHERE m.Id_Ticket = vTicket
GROUP BY mc.Id_Movimiento) mc ON mc.Id_Movimiento = m.Id_Movimiento
SET m.CostFixat = sum_valor;
END LOOP;
CLOSE cDates;
DELETE FROM basketOrder WHERE orderFk = vOrder;
UPDATE `order` SET confirmed = TRUE, confirm_date = NOW()
WHERE id = vOrder;
COMMIT;
END$$
DELIMITER ;

View File

@ -1,13 +0,0 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `department` AS
SELECT
`b`.`department_id` AS `id`,
`b`.`name` AS `name`,
`b`.`father_id` AS `fatherFk`,
`b`.`production` AS `isProduction`
FROM
`vn2008`.`department` `b`;

View File

@ -1,17 +0,0 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `workerMedia` AS
SELECT
`p`.`id_trabajador` AS `workerFk`,
`m`.`value` AS `mediaValue`
FROM
((((`postgresql`.`person` `p`
JOIN `postgresql`.`profile` `po` ON ((`po`.`person_id` = `p`.`person_id`)))
JOIN `postgresql`.`profile_media` `pom` ON ((`pom`.`profile_id` = `po`.`profile_id`)))
JOIN `postgresql`.`media` `m` ON ((`m`.`media_id` = `pom`.`media_id`)))
JOIN `postgresql`.`media_type` `mt` ON ((`mt`.`media_type_id` = `m`.`media_type_id`)))
WHERE
(`mt`.`name` = 'movil empresa');

View File

@ -1,30 +0,0 @@
DROP TRIGGER IF EXISTS `vn2008`.`expeditionsBeforeInsert`;
DELIMITER $$
USE `vn2008`$$
CREATE DEFINER=`root`@`%` TRIGGER `expeditionsBeforeInsert`
BEFORE INSERT ON `expeditions` FOR EACH ROW
-- Edit trigger body code below this line. Do not edit lines above this one
BEGIN
DECLARE intcounter INT;
DECLARE vShipFk INT;
IF NEW.EsBulto > 0 THEN
UPDATE Tickets SET Bultos = nz(Bultos) + 1 WHERE Id_Ticket = NEW.ticket_id;
SELECT IFNULL(MAX(counter),0) +1 INTO intcounter FROM expeditions e
INNER JOIN Tickets t1 ON e.ticket_id = t1.Id_Ticket
LEFT JOIN vn.ticketState ts ON ts.ticket = t1.Id_Ticket
INNER JOIN Tickets t2 ON t2.Id_Consigna = t1.Id_Consigna AND DATE(t2.Fecha) = DATE(t1.Fecha) AND t1.warehouse_id = t2.warehouse_id
WHERE t2.Id_Ticket = NEW.ticket_id AND ts.alertLevel < 3 AND t1.empresa_id = t2.empresa_id AND t1.Id_Agencia = t2.Id_Agencia;
SET NEW.`counter` = intcounter;
END IF;
SET NEW.workerFk=get_Trabajador();
-- JGF 14/01/19 si existe un polizon queda anulado
SELECT shipFk INTO vShipFk FROM vn.stowaway WHERE id = NEW.ticket_id;
IF vShipFk THEN
CALL vn.stowawayUnBoarding(vShipFk, NEW.ticket_id);
END IF;
END$$
DELIMITER ;

View File

@ -1,19 +0,0 @@
DROP TRIGGER IF EXISTS `vn2008`.`expeditionsBeforeUpdate`;
DELIMITER $$
USE `vn2008`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`expeditionsBeforeUpdate`
BEFORE UPDATE ON `vn2008`.`expeditions`
FOR EACH ROW
-- Edit trigger body code below this line. Do not edit lines above this one
BEGIN
IF NEW.counter <> OLD.counter THEN
IF (SELECT COUNT(*) FROM expeditions e
INNER JOIN Tickets t1 ON e.ticket_id = t1.Id_Ticket
INNER JOIN Tickets t2 ON t2.Id_Consigna = t1.Id_Consigna AND DATE(t2.Fecha) = DATE(t1.Fecha)
WHERE t1.Id_Ticket = NEW.ticket_id AND counter = NEW.counter) > 0 THEN
SET NEW.expeditions_id = NULL;
END IF;
END IF;
END$$
DELIMITER ;

View File

@ -1,72 +0,0 @@
USE `vn`;
DROP procedure IF EXISTS `clientGetDebt`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` PROCEDURE `clientGetDebt`(vDate DATE)
BEGIN
/**
* Calcula el riesgo para los clientes activos
*
* @table tmp.clientGetDebt(clientFk)
* @param vDate Fecha maxima de los registros
* @return tmp.risk
*/
DECLARE vStarted DATETIME DEFAULT TIMESTAMPADD(DAY, - DAYOFMONTH(CURDATE()) - 5, CURDATE());
DECLARE vEnded DATETIME;
SET vEnded = TIMESTAMP(IFNULL(vDate, CURDATE()), '23:59:59');
DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
CREATE TEMPORARY TABLE tmp.ticket
(INDEX (ticketFk))
ENGINE = MEMORY
SELECT id ticketFk, c.clientFk
FROM ticket t
JOIN tmp.clientGetDebt c ON c.clientFk = t.clientFk
WHERE refFk IS NULL
AND shipped BETWEEN vStarted AND vEnded;
CALL ticketGetTotal();
DROP TEMPORARY TABLE IF EXISTS tClientRisk;
CREATE TEMPORARY TABLE tClientRisk
ENGINE = MEMORY
SELECT cr.customer_id clientFk, SUM(cr.amount) amount
FROM bi.customer_risk cr
JOIN tmp.clientGetDebt c ON c.clientFk = cr.customer_id
GROUP BY cr.customer_id;
INSERT INTO tClientRisk
SELECT c.clientFk, SUM(r.amountPaid)
FROM receipt r
JOIN tmp.clientGetDebt c ON c.clientFk = r.clientFk
WHERE r.payed > vEnded
GROUP BY c.clientFk;
INSERT INTO tClientRisk
SELECT t.clientFk, CAST(-SUM(t.amount) / 100 AS DECIMAL(10,2))
FROM hedera.tpvTransaction t
JOIN tmp.clientGetDebt c ON c.clientFk = t.clientFk
WHERE t.receiptFk IS NULL
AND t.status = 'ok'
GROUP BY t.clientFk;
INSERT INTO tClientRisk
SELECT t.clientFk, total
FROM tmp.ticketTotal tt
JOIN tmp.ticket t ON t.ticketFk = tt.ticketFk;
DROP TEMPORARY TABLE IF EXISTS tmp.risk;
CREATE TEMPORARY TABLE tmp.risk
(PRIMARY KEY (clientFk))
ENGINE = MEMORY
SELECT clientFk, SUM(amount) risk
FROM client c
JOIN tClientRisk cr ON cr.clientFk = c.id
WHERE c.isActive
GROUP BY c.id;
END$$
DELIMITER ;

View File

@ -1,18 +0,0 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`workerDepartment` AS
SELECT
`p`.`id_trabajador` AS `workerFk`,
`d`.`name` AS `departmentFk`
FROM
(((`postgresql`.`person` `p`
JOIN `postgresql`.`profile` `pr` ON ((`pr`.`person_id` = `p`.`person_id`)))
LEFT JOIN (`postgresql`.`business` `b`
LEFT JOIN `postgresql`.`business_labour` `bl` ON ((`b`.`business_id` = `bl`.`business_id`))) ON ((`pr`.`profile_id` = `b`.`client_id`)))
JOIN `vn`.`department` `d` ON ((`d`.`id` = `bl`.`department_id`)))
WHERE
(ISNULL(`b`.`date_end`)
OR (`b`.`date_end` > CURDATE()));

View File

@ -1,11 +0,0 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`businessReasonEnd` AS
SELECT
`b`.`id` AS `id`,
`b`.`reason` AS `reason`
FROM
`vn2008`.`businessReasonEnd` `b`;

View File

@ -1,13 +0,0 @@
ALTER TABLE `postgresql`.`business_labour`
DROP FOREIGN KEY `business_labour_department`;
ALTER TABLE `postgresql`.`business_labour`
ADD INDEX `business_labour_department_idx` (`department_id` ASC);
ALTER TABLE `postgresql`.`business_labour`
ADD CONSTRAINT `business_labour_department`
FOREIGN KEY (`department_id`)
REFERENCES `vn2008`.`department` (`department_id`)
ON DELETE SET NULL
ON UPDATE CASCADE;

View File

@ -1,13 +0,0 @@
DROP TRIGGER IF EXISTS `vn2008`.`expeditionsBeforeDelete`;
DELIMITER $$
USE `vn2008`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`expeditionsBeforeDelete`
BEFORE DELETE ON `expeditions` FOR EACH ROW
BEGIN
UPDATE Tickets SET Bultos = (SELECT COUNT(counter)-1
FROM expeditions WHERE ticket_id = OLD.ticket_id and EsBulto)
WHERE Id_Ticket = OLD.ticket_id;
END$$
DELIMITER ;

View File

@ -1,9 +0,0 @@
CREATE TABLE `salix`.`userConfigView` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`userFk` int(10) unsigned NOT NULL,
`tableCode` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`configuration` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `uniqueUser_TableCode` (`userFk`,`tableCode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

View File

@ -1,2 +0,0 @@
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (144, 'Stowaway', '*', '*', 'ALLOW', 'ROLE', 'employee');
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (145, 'Ticket', 'getPossibleStowaways', 'READ', 'ALLOW', 'ROLE', 'employee');

View File

@ -1,23 +0,0 @@
ALTER TABLE `vn2008`.`expeditions`
ADD COLUMN `externalId` BIGINT(25) NULL DEFAULT NULL AFTER `workerFk`;
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`expedition` AS
SELECT
`e`.`expeditions_id` AS `id`,
`e`.`agency_id` AS `agencyModeFk`,
`e`.`ticket_id` AS `ticketFk`,
`e`.`EsBulto` AS `isBox`,
`e`.`odbc_date` AS `created`,
`e`.`Id_Article` AS `itemFk`,
`e`.`counter` AS `counter`,
`e`.`checked` AS `checked`,
`e`.`workerFk` AS `workerFk`,
`e`.`externalId` AS `externalId`
FROM
`vn2008`.`expeditions` `e`;

File diff suppressed because one or more lines are too long

View File

@ -328,13 +328,13 @@ INSERT INTO `vn`.`bankEntity`(`id`, `countryFk`, `name`, `bic`)
VALUES
( 241, 442, 'ES111122333344111122221111', 128);
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`)
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`, `expired`)
VALUES
( 69 , 'CCs', NULL, 30, NULL, 0),
( 442 , 'VNL', 241, 30, 2 , 1),
( 567 , 'VNH', NULL, 30, NULL, 4),
( 791 , 'FTH', NULL, 30, NULL, 3),
( 1381, 'ORN', NULL, 30, NULL, 7);
( 69 , 'CCs', NULL, 30, NULL, 0, NULL),
( 442 , 'VNL', 241, 30, 2 , 1, NULL),
( 567 , 'VNH', NULL, 30, NULL, 4, NULL),
( 791 , 'FTH', NULL, 30, NULL, 3, '2015-11-30'),
( 1381, 'ORN', NULL, 30, NULL, 7, NULL);
INSERT INTO `vn`.`invoiceOut`(`id`,`ref`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `pdf`)
VALUES
@ -875,7 +875,7 @@ INSERT INTO `hedera`.`order`(`id`, `date_send`, `customer_id`, `delivery_method_
(13, DATE_ADD(CURDATE(), INTERVAL +2 MONTH), 101, 1, 2, 121, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL +2 MONTH), DATE_ADD(CURDATE(), INTERVAL +2 MONTH), DATE_ADD(CURDATE(), INTERVAL +2 MONTH)),
(14, DATE_ADD(CURDATE(), INTERVAL +3 MONTH), 101, 2, 2, 121, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL +3 MONTH), DATE_ADD(CURDATE(), INTERVAL +3 MONTH), DATE_ADD(CURDATE(), INTERVAL +3 MONTH)),
(15, DATE_ADD(CURDATE(), INTERVAL +4 MONTH), 101, 3, 3, 121, 442, NULL, 'SALIX', 1, DATE_ADD(CURDATE(), INTERVAL +4 MONTH), DATE_ADD(CURDATE(), INTERVAL +4 MONTH), DATE_ADD(CURDATE(), INTERVAL +4 MONTH)),
(16, CURDATE() , 101, 1, 1, 121, 442, NULL, 'SALIX', 0, CURDATE() , CURDATE() , CURDATE() ),
(16, DATE_ADD(CURDATE(), INTERVAL +4 DAY) , 101, 1, 1, 121, 442, NULL, 'SALIX', 0, CURDATE() , CURDATE() , CURDATE() ),
(17, CURDATE() , 106, 2, 4, 126, 442, NULL, 'SALIX', 0, CURDATE() , CURDATE() , CURDATE() ),
(18, CURDATE() , 107, 3, 4, 127, 442, NULL, 'SALIX', 0, CURDATE() , CURDATE() , CURDATE() ),
(19, CURDATE() , 108, 1, 5, 128, 442, NULL, 'SALIX', 0, CURDATE() , CURDATE() , CURDATE() ),
@ -1073,12 +1073,12 @@ INSERT INTO `vn2008`.`workerTeam`(`id`, `team`, `user`)
(5, 3, 103),
(6, 3, 104);
INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `atenderFk`, `quantity`, `price`, `isOk`, `saleFk`, `ticketFk`, `created`)
INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `atenderFk`, `quantity`, `itemFk`, `price`, `isOk`, `saleFk`, `ticketFk`, `created`)
VALUES
(1, 'Object1 Gem1 5', 18, 35, 5, 9.10, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(2, 'Object2 Gem2 3', 18, 35, 10, 1.07, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(3, 'Object4 Armor2 2', 18, 35, 20, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(4, 'Object2 Gem2 3', 18, 35, 15, 1.30, NULL, NULL, 11, CURDATE());
(1, 'Object1 Gem1 5', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(2, 'Object2 Gem2 3', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(3, 'Object4 Armor2 2', 18, 35, 20, 4, 3.06, 0, NULL, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(4, 'Object2 Gem2 3', 18, 35, 15, 2, 1.30, NULL, NULL, 11, CURDATE());
INSERT INTO `vn`.`ticketService`(`id`, `description`, `quantity`, `price`, `taxClassFk`, `ticketFk`)
VALUES

File diff suppressed because it is too large Load Diff