Merge branch 'dev' of https://git.verdnatura.es/salix into dev
This commit is contained in:
commit
c461f16ce7
|
@ -4,7 +4,6 @@ describe('Client', () => {
|
||||||
describe('Component vnClientAddressEdit', () => {
|
describe('Component vnClientAddressEdit', () => {
|
||||||
let $componentController;
|
let $componentController;
|
||||||
let $state;
|
let $state;
|
||||||
let controller;
|
|
||||||
let $httpBackend;
|
let $httpBackend;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
|
@ -36,6 +36,17 @@ describe('Client', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('onSubmit()', () => {
|
||||||
|
it(`should call notifyChanges() if there are changes on payMethod data`, () => {
|
||||||
|
spyOn(controller, 'notifyChanges');
|
||||||
|
controller.client.payMethodFk = 5;
|
||||||
|
controller.onSubmit();
|
||||||
|
|
||||||
|
expect(controller.hasPaymethodChanged()).toBeTruthy();
|
||||||
|
expect(controller.notifyChanges).toHaveBeenCalledWith();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('hasPaymethodChanged()', () => {
|
describe('hasPaymethodChanged()', () => {
|
||||||
it(`should call hasPaymethodChanged() and return true if there are changes on payMethod data`, () => {
|
it(`should call hasPaymethodChanged() and return true if there are changes on payMethod data`, () => {
|
||||||
controller.client.payMethodFk = 5;
|
controller.client.payMethodFk = 5;
|
||||||
|
@ -49,16 +60,5 @@ describe('Client', () => {
|
||||||
expect(controller.hasPaymethodChanged()).toBeFalsy();
|
expect(controller.hasPaymethodChanged()).toBeFalsy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('onSubmit()', () => {
|
|
||||||
it(`should call notifyChanges() if there are changes on payMethod data`, () => {
|
|
||||||
spyOn(controller, 'notifyChanges');
|
|
||||||
controller.client.payMethodFk = 5;
|
|
||||||
controller.onSubmit();
|
|
||||||
|
|
||||||
expect(controller.hasPaymethodChanged()).toBeTruthy();
|
|
||||||
expect(controller.notifyChanges).toHaveBeenCalledWith();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -18,6 +18,7 @@ describe('Client', () => {
|
||||||
controller = $componentController('vnClientCreditInsuranceInsuranceIndex', {$stateParams: $stateParams});
|
controller = $componentController('vnClientCreditInsuranceInsuranceIndex', {$stateParams: $stateParams});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
describe('$onInit()', () => {
|
||||||
it('should perform a query to GET credit the credit classification', () => {
|
it('should perform a query to GET credit the credit classification', () => {
|
||||||
let res = [{finished: 'some value'}];
|
let res = [{finished: 'some value'}];
|
||||||
let query = '/client/api/CreditClassifications?filter=%7B%22fields%22%3A%5B%22finished%22%5D%2C%22where%22%3A%7B%22id%22%3A1%7D%7D';
|
let query = '/client/api/CreditClassifications?filter=%7B%22fields%22%3A%5B%22finished%22%5D%2C%22where%22%3A%7B%22id%22%3A1%7D%7D';
|
||||||
|
@ -30,4 +31,5 @@ describe('Client', () => {
|
||||||
expect(controller.isClosed).toBe(true);
|
expect(controller.isClosed).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
|
@ -37,6 +37,7 @@ describe('Client', () => {
|
||||||
$httpBackend.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({});
|
$httpBackend.when('GET', /\/locale\/\w+\/[a-z]{2}\.json/).respond({});
|
||||||
controller = $componentController('vnClientCreditCreate', {$scope: $scope}, {$state: $state});
|
controller = $componentController('vnClientCreditCreate', {$scope: $scope}, {$state: $state});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('onSubmit()', () => {
|
describe('onSubmit()', () => {
|
||||||
it('should perform a query to check (GET) if the client has an active recovery', () => {
|
it('should perform a query to check (GET) if the client has an active recovery', () => {
|
||||||
$httpBackend.whenGET(`/client/api/Recoveries/101/hasActiveRecovery`).respond(true);
|
$httpBackend.whenGET(`/client/api/Recoveries/101/hasActiveRecovery`).respond(true);
|
||||||
|
@ -65,6 +66,7 @@ describe('Client', () => {
|
||||||
expect(controller.addCredit).toHaveBeenCalledWith();
|
expect(controller.addCredit).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('returnDialog()', () => {
|
describe('returnDialog()', () => {
|
||||||
it('should call addCredit() when is called with ACCEPT', () => {
|
it('should call addCredit() when is called with ACCEPT', () => {
|
||||||
spyOn(controller, 'addCredit');
|
spyOn(controller, 'addCredit');
|
||||||
|
@ -73,6 +75,7 @@ describe('Client', () => {
|
||||||
expect(controller.addCredit).toHaveBeenCalledWith();
|
expect(controller.addCredit).toHaveBeenCalledWith();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('addCredit()', () => {
|
describe('addCredit()', () => {
|
||||||
it('should call the function go() on $state to go to the credit list', () => {
|
it('should call the function go() on $state to go to the credit list', () => {
|
||||||
spyOn($state, 'go');
|
spyOn($state, 'go');
|
|
@ -1,4 +1,7 @@
|
||||||
<vn-popover vn-id="popover">
|
<vn-popover vn-id="popover">
|
||||||
<vn-client-descriptor client="$ctrl.client" clientFk="$ctrl.clientFk">
|
<vn-client-descriptor
|
||||||
|
client="$ctrl.client"
|
||||||
|
clientFk="$ctrl.clientFk"
|
||||||
|
quicklinks="$ctrl.quicklinks">
|
||||||
</vn-client-descriptor>
|
</vn-client-descriptor>
|
||||||
</vn-popover>
|
</vn-popover>
|
||||||
|
|
|
@ -9,6 +9,22 @@ class Controller extends Component {
|
||||||
this.$timeout = $timeout;
|
this.$timeout = $timeout;
|
||||||
this.isTooltip = true;
|
this.isTooltip = true;
|
||||||
this.client = {};
|
this.client = {};
|
||||||
|
this.links = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
set clientFk(value) {
|
||||||
|
if (value) {
|
||||||
|
this._getClient(value);
|
||||||
|
this._getClientDebt(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set quicklinks(value = {}) {
|
||||||
|
this._quicklinks = Object.assign(value, this.links);
|
||||||
|
}
|
||||||
|
|
||||||
|
get quicklinks() {
|
||||||
|
return this._quicklinks;
|
||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
|
@ -34,13 +50,6 @@ class Controller extends Component {
|
||||||
this.$state.go('ticket.index', {q: `{"clientFk": ${this.client.id}}`});
|
this.$state.go('ticket.index', {q: `{"clientFk": ${this.client.id}}`});
|
||||||
}
|
}
|
||||||
|
|
||||||
set clientFk(value) {
|
|
||||||
if (value) {
|
|
||||||
this._getClient(value);
|
|
||||||
this._getClientDebt(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.$.popover.parent = this.parent;
|
this.$.popover.parent = this.parent;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -56,6 +65,7 @@ ngModule.component('vnClientDescriptorPopover', {
|
||||||
controller: Controller,
|
controller: Controller,
|
||||||
bindings: {
|
bindings: {
|
||||||
client: '<',
|
client: '<',
|
||||||
clientFk: '<'
|
clientFk: '<',
|
||||||
|
quicklinks: '<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -53,11 +53,23 @@
|
||||||
ng-class="{bright: $ctrl.client.isTaxDataChecked == false}">
|
ng-class="{bright: $ctrl.client.isTaxDataChecked == false}">
|
||||||
</vn-icon>
|
</vn-icon>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-horizontal pad-small class="buttons">
|
<vn-horizontal pad-small class="quicklinks">
|
||||||
<vn-button
|
<vn-button ng-if="$ctrl.quicklinks.btnOne" pad-small-right
|
||||||
vn-tooltip="Client ticket list"
|
vn-tooltip="{{::$ctrl.quicklinks.btnOne.tooltip}}"
|
||||||
icon="icon-ticket"
|
icon="{{::$ctrl.quicklinks.btnOne.icon}}"
|
||||||
ng-click="$ctrl.goToClientTickets()">
|
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnOne.state, $ctrl.quicklinks.btnOne.params)">
|
||||||
|
</vn-button>
|
||||||
|
|
||||||
|
<vn-button ng-if="$ctrl.quicklinks.btnTwo" pad-small-right
|
||||||
|
vn-tooltip="{{::$ctrl.quicklinks.btnTwo.tooltip}}"
|
||||||
|
icon="{{::$ctrl.quicklinks.btnTwo.icon}}"
|
||||||
|
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnTwo.state, $ctrl.quicklinks.btnTwo.params)">
|
||||||
|
</vn-button>
|
||||||
|
|
||||||
|
<vn-button ng-if="$ctrl.quicklinks.btnThree" pad-small-right
|
||||||
|
vn-tooltip="{{::$ctrl.quicklinks.btnThree.tooltip}}"
|
||||||
|
icon="{{::$ctrl.quicklinks.btnThree.icon}}"
|
||||||
|
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnThree.state, $ctrl.quicklinks.btnThree.params)">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
|
@ -4,7 +4,31 @@ class Controller {
|
||||||
constructor($http, $state) {
|
constructor($http, $state) {
|
||||||
this.$state = $state;
|
this.$state = $state;
|
||||||
this.$http = $http;
|
this.$http = $http;
|
||||||
|
this.links = {
|
||||||
|
btnOne: {
|
||||||
|
icon: 'icon-ticket',
|
||||||
|
state: 'ticket.index',
|
||||||
|
params: {q: `{"clientFk": ${$state.params.id}}`},
|
||||||
|
tooltip: 'Client ticket list'
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
set clientFk(value) {
|
||||||
|
if (value) {
|
||||||
|
this._getClient(value);
|
||||||
|
this._getClientDebt(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set quicklinks(value = {}) {
|
||||||
|
this._quicklinks = Object.assign(value, this.links);
|
||||||
|
}
|
||||||
|
|
||||||
|
get quicklinks() {
|
||||||
|
return this._quicklinks;
|
||||||
|
}
|
||||||
|
|
||||||
_getClientDebt(clientFk) {
|
_getClientDebt(clientFk) {
|
||||||
this.$http.get(`/client/api/Clients/${clientFk}/getDebt`)
|
this.$http.get(`/client/api/Clients/${clientFk}/getDebt`)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
@ -23,11 +47,8 @@ class Controller {
|
||||||
this.$state.go('ticket.index', {q: `{"clientFk": ${this.client.id}}`});
|
this.$state.go('ticket.index', {q: `{"clientFk": ${this.client.id}}`});
|
||||||
}
|
}
|
||||||
|
|
||||||
set clientFk(value) {
|
quicklinkGo(state, params) {
|
||||||
if (value) {
|
this.$state.go(state, params);
|
||||||
this._getClient(value);
|
|
||||||
this._getClientDebt(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +58,8 @@ ngModule.component('vnClientDescriptor', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
bindings: {
|
bindings: {
|
||||||
client: '<',
|
client: '<',
|
||||||
clientFk: '<?'
|
clientFk: '<?',
|
||||||
|
quicklinks: '<'
|
||||||
},
|
},
|
||||||
controller: Controller
|
controller: Controller
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
import './index';
|
|
||||||
|
|
||||||
describe('Client', () => {
|
|
||||||
describe('Component vnClientIndex', () => {
|
|
||||||
let $componentController;
|
|
||||||
let controller;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
angular.mock.module('client');
|
|
||||||
});
|
|
||||||
|
|
||||||
beforeEach(angular.mock.inject(_$componentController_ => {
|
|
||||||
$componentController = _$componentController_;
|
|
||||||
controller = $componentController('vnClientIndex');
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should define and set clientSelected property as null', () => {
|
|
||||||
expect(controller.clientSelected).toEqual(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
// describe('search()', () => {
|
|
||||||
// it(`should set model's search to the search input`, () => {
|
|
||||||
// controller.model.search = 'batman';
|
|
||||||
// let index = {
|
|
||||||
// filter: {},
|
|
||||||
// accept: () => {
|
|
||||||
// return 'accepted';
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// controller.search(index);
|
|
||||||
|
|
||||||
// expect(index.filter.search).toBe('batman');
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,6 +1,6 @@
|
||||||
import './index';
|
import './index';
|
||||||
|
|
||||||
fdescribe('Client', () => {
|
describe('Client', () => {
|
||||||
describe('Component vnClientSampleCreate', () => {
|
describe('Component vnClientSampleCreate', () => {
|
||||||
let $componentController;
|
let $componentController;
|
||||||
let $scope;
|
let $scope;
|
|
@ -43,6 +43,7 @@ describe('Component vnStepControl', () => {
|
||||||
controller.steps = [{state: 'iam_not_current_state'}, {state: 'iam_a_current_state'}];
|
controller.steps = [{state: 'iam_not_current_state'}, {state: 'iam_a_current_state'}];
|
||||||
|
|
||||||
let result = controller.currentStepIndex;
|
let result = controller.currentStepIndex;
|
||||||
|
|
||||||
expect(result).toEqual(1);
|
expect(result).toEqual(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,9 +4,15 @@
|
||||||
.icon-barcode:before { content: '\e802'; } /* '' */
|
.icon-barcode:before { content: '\e802'; } /* '' */
|
||||||
.icon-bucket:before { content: '\e803'; } /* '' */
|
.icon-bucket:before { content: '\e803'; } /* '' */
|
||||||
.icon-complementos:before { content: '\e804'; } /* '' */
|
.icon-complementos:before { content: '\e804'; } /* '' */
|
||||||
|
.icon-dfiscales:before { content: '\e805'; } /* '' */
|
||||||
.icon-doc:before { content: '\e806'; } /* '' */
|
.icon-doc:before { content: '\e806'; } /* '' */
|
||||||
|
.icon-eye:before { content: '\e807'; } /* '' */
|
||||||
|
.icon-frozen:before { content: '\e808'; } /* '' */
|
||||||
|
.icon-greuge:before { content: '\e809'; } /* '' */
|
||||||
|
.icon-grid:before { content: '\e80a'; } /* '' */
|
||||||
.icon-disabled:before { content: '\e80b'; } /* '' */
|
.icon-disabled:before { content: '\e80b'; } /* '' */
|
||||||
.icon-invoices:before { content: '\e80c'; } /* '' */
|
.icon-invoices:before { content: '\e80c'; } /* '' */
|
||||||
|
.icon-frozen-1:before { content: '\e80d'; } /* '' */
|
||||||
.icon-noweb:before { content: '\e812'; } /* '' */
|
.icon-noweb:before { content: '\e812'; } /* '' */
|
||||||
.icon-payment:before { content: '\e813'; } /* '' */
|
.icon-payment:before { content: '\e813'; } /* '' */
|
||||||
.icon-recovery:before { content: '\e815'; } /* '' */
|
.icon-recovery:before { content: '\e815'; } /* '' */
|
||||||
|
@ -23,6 +29,7 @@
|
||||||
.icon-no036:before { content: '\e823'; } /* '' */
|
.icon-no036:before { content: '\e823'; } /* '' */
|
||||||
.icon-mana:before { content: '\e824'; } /* '' */
|
.icon-mana:before { content: '\e824'; } /* '' */
|
||||||
.icon-claims:before { content: '\e825'; } /* '' */
|
.icon-claims:before { content: '\e825'; } /* '' */
|
||||||
|
.icon-tags:before { content: '\e826'; } /* '' */
|
||||||
.icon-solunion:before { content: '\e827'; } /* '' */
|
.icon-solunion:before { content: '\e827'; } /* '' */
|
||||||
.icon-reserva:before { content: '\e828'; } /* '' */
|
.icon-reserva:before { content: '\e828'; } /* '' */
|
||||||
.icon-entry:before { content: '\e829'; } /* '' */
|
.icon-entry:before { content: '\e829'; } /* '' */
|
||||||
|
|
Binary file not shown.
|
@ -2,6 +2,7 @@
|
||||||
<vn-item-descriptor
|
<vn-item-descriptor
|
||||||
item="$ctrl.item"
|
item="$ctrl.item"
|
||||||
item-tags="$ctrl.itemTags"
|
item-tags="$ctrl.itemTags"
|
||||||
tags="$ctrl.tags">
|
tags="$ctrl.tags"
|
||||||
|
quicklinks="$ctrl.quicklinks">
|
||||||
</vn-item-descriptor>
|
</vn-item-descriptor>
|
||||||
</vn-popover>
|
</vn-popover>
|
||||||
|
|
|
@ -7,11 +7,19 @@ class Controller extends Component {
|
||||||
super($element, $scope);
|
super($element, $scope);
|
||||||
this.$http = $http;
|
this.$http = $http;
|
||||||
this.$timeout = $timeout;
|
this.$timeout = $timeout;
|
||||||
|
this.links = {};
|
||||||
this.isTooltip = true;
|
this.isTooltip = true;
|
||||||
this.clear();
|
this.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set quicklinks(value = {}) {
|
||||||
|
this._quicklinks = Object.assign(value, this.links);
|
||||||
|
}
|
||||||
|
|
||||||
|
get quicklinks() {
|
||||||
|
return this._quicklinks;
|
||||||
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
this.item = null;
|
this.item = null;
|
||||||
this.tags = {};
|
this.tags = {};
|
||||||
|
@ -90,7 +98,8 @@ Controller.$inject = ['$element', '$scope', '$http', '$timeout'];
|
||||||
ngModule.component('vnItemDescriptorPopover', {
|
ngModule.component('vnItemDescriptorPopover', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
bindings: {
|
bindings: {
|
||||||
itemFk: '<'
|
itemFk: '<',
|
||||||
|
quicklinks: '<'
|
||||||
},
|
},
|
||||||
controller: Controller
|
controller: Controller
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,4 +37,23 @@
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
</vn-auto>
|
</vn-auto>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
|
<vn-horizontal pad-small class="quicklinks">
|
||||||
|
<vn-button ng-if="$ctrl.quicklinks.btnOne" pad-small-right
|
||||||
|
vn-tooltip="{{::$ctrl.quicklinks.btnOne.tooltip}}"
|
||||||
|
icon="{{::$ctrl.quicklinks.btnOne.icon}}"
|
||||||
|
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnOne.state, $ctrl.quicklinks.btnOne.params)">
|
||||||
|
</vn-button>
|
||||||
|
|
||||||
|
<vn-button ng-if="$ctrl.quicklinks.btnTwo" pad-small-right
|
||||||
|
vn-tooltip="{{::$ctrl.quicklinks.btnTwo.tooltip}}"
|
||||||
|
icon="{{::$ctrl.quicklinks.btnTwo.icon}}"
|
||||||
|
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnTwo.state, $ctrl.quicklinks.btnTwo.params)">
|
||||||
|
</vn-button>
|
||||||
|
|
||||||
|
<vn-button ng-if="$ctrl.quicklinks.btnThree" pad-small-right
|
||||||
|
vn-tooltip="{{::$ctrl.quicklinks.btnThree.tooltip}}"
|
||||||
|
icon="{{::$ctrl.quicklinks.btnThree.icon}}"
|
||||||
|
ng-click="$ctrl.quicklinkGo($ctrl.quicklinks.btnThree.state, $ctrl.quicklinks.btnThree.params)">
|
||||||
|
</vn-button>
|
||||||
|
</vn-horizontal>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
|
|
|
@ -1,11 +1,34 @@
|
||||||
import ngModule from '../module';
|
import ngModule from '../module';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
|
class Controller {
|
||||||
|
constructor($state) {
|
||||||
|
this.$state = $state;
|
||||||
|
this.links = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
set quicklinks(value = {}) {
|
||||||
|
this._quicklinks = Object.assign(value, this.links);
|
||||||
|
}
|
||||||
|
|
||||||
|
get quicklinks() {
|
||||||
|
return this._quicklinks;
|
||||||
|
}
|
||||||
|
|
||||||
|
quicklinkGo(state, params) {
|
||||||
|
this.$state.go(state, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controller.$inject = ['$state'];
|
||||||
|
|
||||||
ngModule.component('vnItemDescriptor', {
|
ngModule.component('vnItemDescriptor', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
|
controller: Controller,
|
||||||
bindings: {
|
bindings: {
|
||||||
item: '<',
|
item: '<',
|
||||||
itemTags: '<',
|
itemTags: '<',
|
||||||
tags: '<'
|
tags: '<',
|
||||||
|
quicklinks: '<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import './index.js';
|
import './index.js';
|
||||||
|
|
||||||
fdescribe('Item', () => {
|
describe('Item', () => {
|
||||||
describe('Component vnItemDiary', () => {
|
describe('Component vnItemDiary', () => {
|
||||||
let $componentController;
|
let $componentController;
|
||||||
let $scope;
|
let $scope;
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
import ngModule from '../module';
|
import ngModule from '../module';
|
||||||
|
|
||||||
class Controller {
|
class Controller {
|
||||||
constructor() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
setFilter() {
|
setFilter() {
|
||||||
this.catalogue.applyFilter();
|
this.catalogue.applyFilter();
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ vn-main-block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons {
|
.quicklinks {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* import './step-three.js';
|
/* import './index.js';
|
||||||
|
|
||||||
describe('ticket', () => {
|
describe('ticket', () => {
|
||||||
describe('Component vnTicketDataStepThree', () => {
|
describe('Component vnTicketDataStepThree', () => {
|
|
@ -164,7 +164,8 @@
|
||||||
</vn-table>
|
</vn-table>
|
||||||
</vn-vertical>
|
</vn-vertical>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
<vn-item-descriptor-popover vn-id="descriptor">
|
<vn-item-descriptor-popover vn-id="descriptor"
|
||||||
|
quicklinks="$ctrl.quicklinks">
|
||||||
</vn-item-descriptor-popover>
|
</vn-item-descriptor-popover>
|
||||||
|
|
||||||
<!-- Add Turn Dialog -->
|
<!-- Add Turn Dialog -->
|
||||||
|
|
|
@ -20,6 +20,25 @@ class Controller {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set ticket(value) {
|
||||||
|
this._ticket = value;
|
||||||
|
|
||||||
|
if (!value) return;
|
||||||
|
|
||||||
|
this.quicklinks = {
|
||||||
|
btnThree: {
|
||||||
|
icon: 'icon-transaction',
|
||||||
|
state: 'item.card.diary',
|
||||||
|
params: {id: value.id, q: `{"warehouseFk": ${value.warehouseFk}}`},
|
||||||
|
tooltip: 'Item diary'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
get ticket() {
|
||||||
|
return this._ticket;
|
||||||
|
}
|
||||||
|
|
||||||
onDataChange() {
|
onDataChange() {
|
||||||
this.sales = this.$scope.model.data;
|
this.sales = this.$scope.model.data;
|
||||||
this.getTaxes();
|
this.getTaxes();
|
||||||
|
|
|
@ -159,8 +159,8 @@ describe('Ticket', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('onStateChange()', () => {
|
describe('onStateChange()', () => {
|
||||||
it('should perform a post and then call a function', () => {
|
it('should perform a POST', () => {
|
||||||
$httpBackend.expectPOST(`/ticket/api/TicketTrackings/changeState`).respond();
|
$httpBackend.expectPOST(`/ticket/api/TicketTrackings`).respond();
|
||||||
controller.card = {reload: () => {}};
|
controller.card = {reload: () => {}};
|
||||||
controller.onStateChange(3);
|
controller.onStateChange(3);
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
|
@ -88,6 +88,7 @@ describe('Client', () => {
|
||||||
.wait(selectors.clientFiscalData.socialNameInput)
|
.wait(selectors.clientFiscalData.socialNameInput)
|
||||||
.clearInput(selectors.clientFiscalData.socialNameInput)
|
.clearInput(selectors.clientFiscalData.socialNameInput)
|
||||||
.type(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
.type(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
||||||
|
.waitForTextInInput(selectors.clientFiscalData.socialNameInput, 'SMASH!')
|
||||||
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
||||||
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
||||||
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
||||||
|
|
|
@ -441,7 +441,7 @@ gulp.task('docker', async () => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rebuilds the docker image, if already exists, destroys and
|
* Rebuilds the docker image, if already exists, destroys and
|
||||||
* rebuild it.
|
* rebuild it. calls upon docker task afterwards.
|
||||||
*/
|
*/
|
||||||
gulp.task('docker-build', async () => {
|
gulp.task('docker-build', async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -456,6 +456,8 @@ gulp.task('docker-build', async () => {
|
||||||
|
|
||||||
log('Building image...');
|
log('Building image...');
|
||||||
await execP('docker build -t dblocal:latest ./services/db');
|
await execP('docker build -t dblocal:latest ./services/db');
|
||||||
|
|
||||||
|
await runSequenceP('docker');
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,24 +13,24 @@ DELETE FROM `vn`.`worker` where name ='customer';
|
||||||
|
|
||||||
INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`)
|
INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`)
|
||||||
VALUES
|
VALUES
|
||||||
(101, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@verdnatura.es'),
|
(101, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'BruceWayne@verdnatura.es'),
|
||||||
(102, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@verdnatura.es'),
|
(102, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'PetterParker@verdnatura.es'),
|
||||||
(103, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@verdnatura.es'),
|
(103, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'ClarkKent@verdnatura.es'),
|
||||||
(104, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@verdnatura.es'),
|
(104, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'TonyStark@verdnatura.es'),
|
||||||
(105, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@verdnatura.es'),
|
(105, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'MaxEisenhardt@verdnatura.es'),
|
||||||
(106, 'DavidCharlesHaller', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'DavidCharlesHaller@verdnatura.es'),
|
(106, 'DavidCharlesHaller', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'DavidCharlesHaller@verdnatura.es'),
|
||||||
(107, 'HankPym', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'HankPym@verdnatura.es'),
|
(107, 'HankPym', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'HankPym@verdnatura.es'),
|
||||||
(108, 'CharlesXavier', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'CharlesXavier@verdnatura.es'),
|
(108, 'CharlesXavier', 'ac754a330530832ba1bf7687f577da91', 20, 1, 'CharlesXavier@verdnatura.es'),
|
||||||
(109, 'BruceBanner', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceBanner@verdnatura.es'),
|
(109, 'BruceBanner', 'ac754a330530832ba1bf7687f577da91', 2 , 1, 'BruceBanner@verdnatura.es'),
|
||||||
(110, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91' , 2, 1, 'JessicaJones@verdnatura.es');
|
(110, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 1 , 1, 'JessicaJones@verdnatura.es');
|
||||||
|
|
||||||
INSERT INTO `vn`.`worker`(`workerCode`, `id`, `firstName`, `name`, `userFk`)
|
INSERT INTO `vn`.`worker`(`workerCode`, `id`, `firstName`, `name`, `userFk`)
|
||||||
VALUES
|
VALUES
|
||||||
('LGN', 106, 'David Charles', 'Haller', 106),
|
('LGN', 106, 'David Charles', 'Haller', 106),
|
||||||
('ANT', 107, 'Hank' , 'Pym' , 107),
|
('ANT', 107, 'Hank' , 'Pym' , 107),
|
||||||
('DCX', 108, 'Charles' , 'Xavier', 108),
|
('DCX', 110, 'Charles' , 'Xavier', 108),
|
||||||
('HLK', 109, 'Bruce' , 'Banner', 109),
|
('HLK', 109, 'Bruce' , 'Banner', 109),
|
||||||
('JJJ', 110, 'Jessica' , 'Jones' , 110);
|
('JJJ', 108, 'Jessica' , 'Jones' , 110);
|
||||||
|
|
||||||
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`)
|
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -227,21 +227,21 @@ INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `pr
|
||||||
|
|
||||||
INSERT INTO `vn`.`clientCredit`(`id`, `clientFk`, `workerFk`, `amount`, `created`)
|
INSERT INTO `vn`.`clientCredit`(`id`, `clientFk`, `workerFk`, `amount`, `created`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 101, 5, 300, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)),
|
(1 , 101, 5, 300, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)),
|
||||||
(2, 101, 5, 900, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)),
|
(2 , 101, 5, 900, DATE_ADD(CURDATE(), INTERVAL -2 MONTH)),
|
||||||
(3, 101, 5, 800, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)),
|
(3 , 101, 5, 800, DATE_ADD(CURDATE(), INTERVAL -3 MONTH)),
|
||||||
(4, 101, 5, 700, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)),
|
(4 , 101, 5, 700, DATE_ADD(CURDATE(), INTERVAL -4 MONTH)),
|
||||||
(5, 101, 5, 600, DATE_ADD(CURDATE(), INTERVAL -5 MONTH)),
|
(5 , 101, 5, 600, DATE_ADD(CURDATE(), INTERVAL -5 MONTH)),
|
||||||
(6, 101, 5, 500, DATE_ADD(CURDATE(), INTERVAL -6 MONTH)),
|
(6 , 101, 5, 500, DATE_ADD(CURDATE(), INTERVAL -6 MONTH)),
|
||||||
(7, 101, 5, 400, DATE_ADD(CURDATE(), INTERVAL -7 MONTH)),
|
(7 , 101, 5, 400, DATE_ADD(CURDATE(), INTERVAL -7 MONTH)),
|
||||||
(8, 101, 9, 300, DATE_ADD(CURDATE(), INTERVAL -8 MONTH)),
|
(8 , 101, 9, 300, DATE_ADD(CURDATE(), INTERVAL -8 MONTH)),
|
||||||
(9, 101, 9, 200, DATE_ADD(CURDATE(), INTERVAL -9 MONTH)),
|
(9 , 101, 9, 200, DATE_ADD(CURDATE(), INTERVAL -9 MONTH)),
|
||||||
(10, 101, 9, 100, DATE_ADD(CURDATE(), INTERVAL -10 MONTH)),
|
(10, 101, 9, 100, DATE_ADD(CURDATE(), INTERVAL -10 MONTH)),
|
||||||
(11, 101, 9, 50, DATE_ADD(CURDATE(), INTERVAL -11 MONTH)),
|
(11, 101, 9, 50 , DATE_ADD(CURDATE(), INTERVAL -11 MONTH)),
|
||||||
(12, 102, 9, 800, CURDATE()),
|
(12, 102, 9, 800, CURDATE()),
|
||||||
(13, 103, 9, 200, CURDATE()),
|
(13, 103, 9, 200, CURDATE()),
|
||||||
(14, 104, 9, 90, CURDATE()),
|
(14, 104, 9, 90 , CURDATE()),
|
||||||
(15, 105, 9, 90, CURDATE());
|
(15, 105, 9, 90 , CURDATE());
|
||||||
|
|
||||||
INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`)
|
INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -312,11 +312,11 @@ INSERT INTO `vn`.`bankEntity`(`id`, `countryFk`, `name`, `bic`)
|
||||||
|
|
||||||
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`)
|
INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`, `companyCode`, `sage200Company`)
|
||||||
VALUES
|
VALUES
|
||||||
( 69, 'CCs', NULL, 30, NULL, 1),
|
( 69 , 'CCs', NULL, 30, NULL, 1),
|
||||||
(442, 'VNL', 241, 30, 2, 2),
|
( 442 , 'VNL', 241, 30, 2 , 2),
|
||||||
( 567, 'VNH', NULL, 30, NULL, 3),
|
( 567 , 'VNH', NULL, 30, NULL, 3),
|
||||||
( 791, 'FTH', NULL, 30, NULL, 4),
|
( 791 , 'FTH', NULL, 30, NULL, 4),
|
||||||
( 1381, 'ORN', NULL, 30, NULL,5);
|
( 1381, 'ORN', NULL, 30, NULL, 5);
|
||||||
|
|
||||||
INSERT INTO `vn`.`invoiceOut`(`id`, `ref`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `pdf`)
|
INSERT INTO `vn`.`invoiceOut`(`id`, `ref`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `pdf`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -428,14 +428,14 @@ INSERT INTO `vn`.`mandate`(`id`, `clientFk`, `companyFk`, `code`, `created`, `ma
|
||||||
|
|
||||||
INSERT INTO `vn`.`itemCategory`(`id`, `name`, `display`, `color`)
|
INSERT INTO `vn`.`itemCategory`(`id`, `name`, `display`, `color`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Plant', 1, 'B92A26'),
|
(1, 'Plant' , 1, 'B92A26'),
|
||||||
(2, 'Flower', 2, 'dcf711');
|
(2, 'Flower', 2, 'dcf711');
|
||||||
|
|
||||||
INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `life`,`workerFk`)
|
INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `life`,`workerFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'CRI', 'Crisantemo', 2, 15, 5),
|
(1, 'CRI', 'Crisantemo' , 2, 15, 5),
|
||||||
(2, 'ITG', 'Anthurium', 1, 30, 5),
|
(2, 'ITG', 'Anthurium' , 1, 30, 5),
|
||||||
(3, 'WPN', 'Paniculata', 2, 30, 5),
|
(3, 'WPN', 'Paniculata' , 2, 30, 5),
|
||||||
(4, 'PRT', 'Delivery ports', 2, 30, 5);
|
(4, 'PRT', 'Delivery ports', 2, 30, 5);
|
||||||
|
|
||||||
INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`)
|
INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`)
|
||||||
|
@ -457,14 +457,14 @@ INSERT INTO `vn`.`producer`(`id`, `name`)
|
||||||
|
|
||||||
INSERT INTO `vn`.`taxType`(`id`, `nickname`, `isAccrued`, `serial`, `TIPOOPE`, `description`, `countryFk`)
|
INSERT INTO `vn`.`taxType`(`id`, `nickname`, `isAccrued`, `serial`, `TIPOOPE`, `description`, `countryFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'National', 1, 'R', 'I', 'national VAT',1),
|
(1, 'National', 1, 'R', 'I', 'national VAT', 1),
|
||||||
(2, 'European', 0, 'E', 'I', 'europe VAT', 1);
|
(2, 'European', 0, 'E', 'I', 'europe VAT' , 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`taxCode`(`id`, `dated`, `code`, `taxTypeFk`, `rate`, `equalizationTax`, `type`, `link`, `isActive`, `updated`, `transactionCode`)
|
INSERT INTO `vn`.`taxCode`(`id`, `dated`, `code`, `taxTypeFk`, `rate`, `equalizationTax`, `type`, `link`, `isActive`, `updated`, `transactionCode`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, CURDATE() , '1111111111', 1, 7.0 , 0.0, 'R', 1, 1, CURDATE(), 1),
|
(1 , CURDATE(), '1111111111', 1, 7.0 , 0.0, 'R', 1, 1, CURDATE(), 1),
|
||||||
(2, CURDATE() , '2222222222', 2, 16.0, 0.0, 'G', 2, 1, CURDATE(), 1),
|
(2 , CURDATE(), '2222222222', 2, 16.0, 0.0, 'G', 2, 1, CURDATE(), 1),
|
||||||
(21, CURDATE() , '3333333333', 1, 18.0, 0.0, 'R', 3, 1, CURDATE(), 1),
|
(21 , CURDATE(), '3333333333', 1, 18.0, 0.0, 'R', 3, 1, CURDATE(), 1),
|
||||||
(108, CURDATE(), '4444444444', 2, 8.0 , 0.0, 'R', 4, 1, CURDATE(), 1);
|
(108, CURDATE(), '4444444444', 2, 8.0 , 0.0, 'R', 4, 1, CURDATE(), 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`taxClass`(`id`, `description`, `code`)
|
INSERT INTO `vn`.`taxClass`(`id`, `description`, `code`)
|
||||||
|
@ -484,7 +484,7 @@ INSERT INTO `vn`.`item`(`id`, `name`,`typeFk`,`size`,`inkFk`,`category`,`stems`,
|
||||||
(3, 'Iron Patriot', 1, 60, 'AMR', 'EXT', 1 , 3, 'Rhodeys armor' , 1 , 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, 'Iron Patriot', NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
|
(3, 'Iron Patriot', 1, 60, 'AMR', 'EXT', 1 , 3, 'Rhodeys armor' , 1 , 05080000, 0, 4751000000, 0, NULL, 0, 61692, 1, 'Iron Patriot', NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
|
||||||
(4, 'Mark I', 1, 60, 'AMR', 'EXT', 1 , 1, 'Iron Mans first armor' , 1 , 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, 'Mark I' , NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
|
(4, 'Mark I', 1, 60, 'AMR', 'EXT', 1 , 1, 'Iron Mans first armor' , 1 , 05080000, 1, 4751000000, 0, NULL, 0, 66090, 2, 'Mark I' , NULL, 'Medida', '60', 'Color', 'Rosa/Amarillo', 'Categoria', 'EXT', 'Tallos', '1'),
|
||||||
(5, 'Mjolnir', 3, 30, 'AZL', 'EXT', 1 , 2, 'Thors hammer!' , 2 , 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, 'Mjolnir' , NULL, 'Medida', '30', 'Color', 'Azul' , 'Categoria', 'EXT', 'Tallos', '1'),
|
(5, 'Mjolnir', 3, 30, 'AZL', 'EXT', 1 , 2, 'Thors hammer!' , 2 , 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, 'Mjolnir' , NULL, 'Medida', '30', 'Color', 'Azul' , 'Categoria', 'EXT', 'Tallos', '1'),
|
||||||
(6, 'ShippingCost', 4, NULL, NULL, NULL, NULL, 2, NULL , NULL, 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, 'ShippingCost', NULL, 'Medida', NULL, 'Color', NULL , 'Categoria', NULL, 'Tallos', NULL);
|
(6, 'ShippingCost', 4, NULL, NULL, NULL, NULL, 2, NULL , NULL, 06021010, 1, 4751000000, 0, NULL, 0, 67350, 2, 'ShippingCost', NULL, 'Medida', NULL, 'Color', NULL , 'Categoria', NULL , 'Tallos', NULL);
|
||||||
|
|
||||||
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`)
|
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -614,7 +614,30 @@ INSERT INTO `vn`.`tag`(`id`,`name`,`isFree`,`isQuantitatif`,`sourceTable`,`unit`
|
||||||
(3, 'Shape', 0, 0, null, null),
|
(3, 'Shape', 0, 0, null, null),
|
||||||
(4, 'Location', 1, 0, null, null),
|
(4, 'Location', 1, 0, null, null),
|
||||||
(5, 'Owner', 1, 1, null, null);
|
(5, 'Owner', 1, 1, null, null);
|
||||||
|
/*
|
||||||
|
INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
||||||
|
VALUES
|
||||||
|
(1, 1, 1, 'Yellow', 5),
|
||||||
|
(2, 1, 2, 'Manipulates time', 4),
|
||||||
|
(3, 1, 3, 'round', 3),
|
||||||
|
(4, 1, 4, 'Gamoras hideout', 2),
|
||||||
|
(5, 1, 5, 'Gamora', 1),
|
||||||
|
(6, 2, 1, 'Red', 5),
|
||||||
|
(7, 2, 2, 'Manipulates mind', 4),
|
||||||
|
(8, 2, 3, 'square', 3),
|
||||||
|
(9, 2, 4, 'unknown location', 2),
|
||||||
|
(10, 2, 5, 'Thanos', 1),
|
||||||
|
(11, 3, 1, 'Green', 5),
|
||||||
|
(12, 3, 2, 'Save the children', 4),
|
||||||
|
(13, 3, 3, 'human shape', 3),
|
||||||
|
(14, 3, 4, 'Stark tower', 2),
|
||||||
|
(15, 3, 5, 'Tony Stark', 1),
|
||||||
|
(16, 4, 1, 'Blue', 5),
|
||||||
|
(17, 4, 2, 'Protect the citizen', 4),
|
||||||
|
(18, 4, 3, 'human shape', 3),
|
||||||
|
(19, 4, 4, 'Manhattan', 2),
|
||||||
|
(20, 4, 5, 'Tony Stark', 1);
|
||||||
|
*/
|
||||||
INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 'Yellow', 5),
|
(1, 1, 1, 'Yellow', 5),
|
||||||
|
@ -706,23 +729,25 @@ INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`)
|
||||||
( 3, 1, CURDATE(), 3, 442),
|
( 3, 1, CURDATE(), 3, 442),
|
||||||
( 4, 2, CURDATE(), 4, 69);
|
( 4, 2, CURDATE(), 4, 69);
|
||||||
|
|
||||||
INSERT INTO `vn`.`agencyProvince`(`provinceFk`, `agencyFk`, `zone`, `warehouseFk`, `route`)
|
INSERT INTO `vn`.`agencyProvince`(`provinceFk`, `agencyFk`, `zone`, `warehouseFk`)
|
||||||
VALUES
|
VALUES
|
||||||
( 1, 1, 1, 1, 1),
|
( 1, 1, 1, 1),
|
||||||
( 1, 1, 1, 2, 1),
|
( 1, 1, 1, 2),
|
||||||
( 1, 1, 1, 3, 1),
|
( 1, 1, 1, 3),
|
||||||
( 1, 2, 2, 2, 2),
|
( 1, 2, 2, 2),
|
||||||
( 1, 2, 2, 3, 2);
|
( 1, 2, 2, 3),
|
||||||
|
( 1, 7, 2, 1),
|
||||||
|
( 1, 8, 2, 1);
|
||||||
|
|
||||||
INSERT INTO `vn`.`agencyModeZone`(`agencyModeFk`, `zone`, `price`, `itemFk`, `warehouseFk`, `minimCost`, `inflation`)
|
INSERT INTO `vn`.`agencyModeZone`(`agencyModeFk`, `zone`, `price`, `itemFk`, `warehouseFk`, `minimCost`, `inflation`)
|
||||||
VALUES
|
VALUES
|
||||||
( 1, 1, 10, 1, 1, 1, 1.00),
|
( 1, 1, 10, 6, 1, 1, 1.00),
|
||||||
( 1, 1, 20, 2, 1, 1, 1.00),
|
( 1, 1, 20, 6, 1, 1, 1.00),
|
||||||
( 2, 1, 10, 1, 1, 1, 1.00),
|
( 2, 1, 10, 6, 1, 1, 1.00),
|
||||||
( 2, 1, 20, 2, 1, 1, 2.00),
|
( 2, 1, 20, 6, 1, 1, 2.00),
|
||||||
( 2, 2, 10, 1, 1, 0, 2.00),
|
( 2, 2, 10, 6, 1, 0, 2.00),
|
||||||
( 7, 2, 10, 1, 1, 0, 2.00),
|
( 7, 2, 50, 6, 1, 0, 1.00),
|
||||||
( 8, 2, 10, 1, 1, 0, 2.00);
|
( 8, 2, 100, 6, 1, 0, 2.00);
|
||||||
|
|
||||||
INSERT INTO `vn`.`agencyWeekDayBonus`(`id`, `warehouseFk`, `agencyFk`, `weekDay`, `zone`, `bonus`)
|
INSERT INTO `vn`.`agencyWeekDayBonus`(`id`, `warehouseFk`, `agencyFk`, `weekDay`, `zone`, `bonus`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -741,10 +766,10 @@ INSERT INTO `bi`.`claims_ratio`(`id_Cliente`, `Consumo`, `Reclamaciones`, `Ratio
|
||||||
|
|
||||||
INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`,`minPrice`,`producer`,`printedStickers`,`isChecked`,`isIgnored`)
|
INSERT INTO `vn`.`buy`(`id`,`entryFk`,`itemFk`,`buyingValue`,`quantity`,`packageFk`,`stickers`,`freightValue`,`packageValue`,`comissionValue`,`packing`,`grouping`,`groupingMode`,`location`,`price1`,`price2`,`price3`,`minPrice`,`producer`,`printedStickers`,`isChecked`,`isIgnored`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 1, 1, 2.5, 4, 1, 1, 0.350, 0.050, 0.000, 1, 1, 1, NULL, 1.50, 1.25, 1.30, 2.00, NULL, 0, 1, 0),
|
(1, 1, 1, 2.5, 10 , 1, 1, 0.350, 0.050, 0.000, 1, 1, 1, NULL, 1.50, 1.25, 1.30, 2.00, NULL, 0, 1, 0),
|
||||||
(2, 2, 2, 5 , 2, 1, 1, 0.000, 0.000, 0.000, 1, 1, 1, NULL, 2, 1.00, 1.30, 2.00, NULL, 0, 1, 0),
|
(2, 2, 2, 5 , 450, 1, 1, 0.000, 0.000, 0.000, 1, 1, 1, NULL, 2, 1.00, 1.30, 2.00, NULL, 0, 1, 0),
|
||||||
(3, 3, 3, 10 , 1, 1, 1, 0.000, 0.000, 0.000, 1, 1, 1, NULL, 2.50, 1.00, 2.50, 2.00, NULL, 0, 1, 0),
|
(3, 3, 3, 10 , 500, 1, 1, 0.000, 0.000, 0.000, 1, 1, 1, NULL, 2.50, 1.00, 2.50, 2.00, NULL, 0, 1, 0),
|
||||||
(4, 4, 4, 20 , 1, 1, 1, 0.000, 0.000, 0.000, 1, 1, 1, NULL, 2.50, 1.00, 2.50, 2.00, NULL, 0, 1, 0);
|
(4, 4, 4, 20 , 100, 1, 1, 0.000, 0.000, 0.000, 1, 1, 1, NULL, 2.50, 1.00, 2.50, 2.00, NULL, 0, 1, 0);
|
||||||
|
|
||||||
INSERT INTO `vn2008`.`tblContadores`(`id`,`FechaInventario`)
|
INSERT INTO `vn2008`.`tblContadores`(`id`,`FechaInventario`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe('Client listWorkers', () => {
|
||||||
.then(result => {
|
.then(result => {
|
||||||
let amountOfEmployees = Object.keys(result).length;
|
let amountOfEmployees = Object.keys(result).length;
|
||||||
|
|
||||||
expect(amountOfEmployees).toEqual(39);
|
expect(amountOfEmployees).toEqual(41);
|
||||||
done();
|
done();
|
||||||
})
|
})
|
||||||
.catch(catchErrors(done));
|
.catch(catchErrors(done));
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
const app = require(`${servicesDir}/client/server/server`);
|
const app = require(`${servicesDir}/client/server/server`);
|
||||||
|
|
||||||
describe('message send()', () => {
|
describe('message send()', () => {
|
||||||
it('should call the send method and return the response', done => {
|
it('should call the send method and return the response', async() => {
|
||||||
let ctx = {req: {accessToken: {userId: 1}}};
|
let ctx = {req: {accessToken: {userId: 1}}};
|
||||||
app.models.Message.send('salesPerson', {message: 'I changed something'}, ctx)
|
await app.models.Message.send('salesPerson', {message: 'I changed something'}, ctx)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response.sent).toEqual(1);
|
expect(response.sent).toEqual(1);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module.exports = State => {
|
module.exports = State => {
|
||||||
var serverFilter = {where: {order: {gt: 0}}, order: "order, name"};
|
var serverFilter = {where: {order: {gt: 0}}, order: 'order, name'};
|
||||||
State.defineScope(serverFilter);
|
State.defineScope(serverFilter);
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,7 +23,7 @@ module.exports = function(Self) {
|
||||||
Self.changeState = function(ctx, state, cb) {
|
Self.changeState = function(ctx, state, cb) {
|
||||||
var tickets = ctx.req.body.tickets;
|
var tickets = ctx.req.body.tickets;
|
||||||
|
|
||||||
Self.connectToService(ctx, "client");
|
Self.connectToService(ctx, 'client');
|
||||||
|
|
||||||
Self.app.models.Worker.findOne({where: {userFk: ctx.req.accessToken.userId}}, function(err, emp) {
|
Self.app.models.Worker.findOne({where: {userFk: ctx.req.accessToken.userId}}, function(err, emp) {
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -32,7 +32,7 @@ module.exports = function(Self) {
|
||||||
changeState(emp.id, tickets, state, cb);
|
changeState(emp.id, tickets, state, cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.disconnectFromService("client");
|
Self.disconnectFromService('client');
|
||||||
};
|
};
|
||||||
|
|
||||||
function changeState(emp, tickets, state, cb) {
|
function changeState(emp, tickets, state, cb) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket componentUpdate()', () => {
|
describe('ticket componentUpdate()', () => {
|
||||||
it('should call the componentUpdate method', done => {
|
it('should call the componentUpdate method and receive an error', async() => {
|
||||||
let data = {
|
let data = {
|
||||||
agencyModeFk: 1,
|
agencyModeFk: 1,
|
||||||
addressFk: 121,
|
addressFk: 121,
|
||||||
|
@ -12,10 +12,9 @@ describe('ticket componentUpdate()', () => {
|
||||||
option: 1
|
option: 1
|
||||||
};
|
};
|
||||||
let ctx = {req: {accessToken: {userId: 101}}};
|
let ctx = {req: {accessToken: {userId: 101}}};
|
||||||
app.models.Ticket.componentUpdate(1, data, ctx)
|
await app.models.Ticket.componentUpdate(1, data, ctx)
|
||||||
.catch(response => {
|
.catch(response => {
|
||||||
expect(response).toEqual(new Error('ER_SIGNAL_EXCEPTION: NO_AGENCY_AVAILABLE'));
|
expect(response).toEqual(new Error('ER_SIGNAL_EXCEPTION: NO_AGENCY_AVAILABLE'));
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket getShipped()', () => {
|
describe('ticket getShipped()', () => {
|
||||||
it('should call the getShipped method', done => {
|
it('should call the getShipped method', async() => {
|
||||||
let data = {
|
let data = {
|
||||||
landed: new Date(),
|
landed: new Date(),
|
||||||
addressFk: 121,
|
addressFk: 121,
|
||||||
agencyModeFk: 7
|
agencyModeFk: 7
|
||||||
};
|
};
|
||||||
app.models.Ticket.getShipped(data)
|
await app.models.Ticket.getShipped(data)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response.warehouseFk).toEqual(1);
|
expect(response.warehouseFk).toEqual(1);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -1,11 +1,10 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket getTaxes()', () => {
|
describe('ticket getTaxes()', () => {
|
||||||
it('should call the getTaxes method', done => {
|
it('should call the getTaxes method', async() => {
|
||||||
app.models.Ticket.getTaxes(1)
|
await app.models.Ticket.getTaxes(1)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response[0].tax).toEqual(20.95);
|
expect(response[0].tax).toEqual(20.95);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -1,19 +1,17 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket getTotal()', () => {
|
describe('ticket getTotal()', () => {
|
||||||
it('should call the getTotal method and return the response', done => {
|
it('should call the getTotal method and return the response', async() => {
|
||||||
app.models.Ticket.getTotal(1)
|
await app.models.Ticket.getTotal(1)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response).toEqual(448.25);
|
expect(response).toEqual(448.25);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should call the getTotal method and return zero if doesn't have lines`, done => {
|
it(`should call the getTotal method and return zero if doesn't have lines`, async() => {
|
||||||
app.models.Ticket.getTotal(13)
|
await app.models.Ticket.getTotal(13)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response).toEqual(0);
|
expect(response).toEqual(0);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -1,19 +1,17 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket getVAT()', () => {
|
describe('ticket getVAT()', () => {
|
||||||
it('should call the getVAT method and return the response', done => {
|
it('should call the getVAT method and return the response', async() => {
|
||||||
app.models.Ticket.getVAT(1)
|
await app.models.Ticket.getVAT(1)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response).toEqual(58.75);
|
expect(response).toEqual(58.75);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should call the getVAT method and return zero if doesn't have lines`, done => {
|
it(`should call the getVAT method and return zero if doesn't have lines`, async() => {
|
||||||
app.models.Ticket.getVAT(13)
|
await app.models.Ticket.getVAT(13)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response).toEqual(0);
|
expect(response).toEqual(0);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -1,12 +1,11 @@
|
||||||
const app = require(`${servicesDir}/ticket/server/server`);
|
const app = require(`${servicesDir}/ticket/server/server`);
|
||||||
|
|
||||||
describe('ticket getVolume()', () => {
|
describe('ticket getVolume()', () => {
|
||||||
it('should call the getVolume method', done => {
|
it('should call the getVolume method', async() => {
|
||||||
let ticketFk = 1;
|
let ticketFk = 1;
|
||||||
app.models.Ticket.getVolume(ticketFk)
|
await app.models.Ticket.getVolume(ticketFk)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
expect(response[0].m3).toEqual(0.04);
|
expect(response[0].m3).toEqual(0.04);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -1,3 +1,3 @@
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
require('../methods/message/send')(Self);
|
require('../methods/message/send')(Self);
|
||||||
}
|
};
|
||||||
|
|
Loading…
Reference in New Issue