Merge branch 'dev' of https://git.verdnatura.es/salix into dev
This commit is contained in:
commit
f4a790f87c
|
@ -1,5 +1,4 @@
|
|||
import ngModule from '../module';
|
||||
import './style.scss';
|
||||
|
||||
export default class Controller {
|
||||
constructor($translate) {
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
vn-descriptor {
|
||||
.descriptor-header{
|
||||
background: rgb(255,171,64);
|
||||
color: white;
|
||||
text-align: center;
|
||||
i {
|
||||
font-size: 51px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -64,7 +64,7 @@
|
|||
</vn-vertical>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save"></vn-submit>
|
||||
<vn-submit label="Save" vn-acl="administrative"></vn-submit>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
<vn-dialog
|
||||
|
|
|
@ -12,7 +12,7 @@ function vnAcl(aclService, $timeout) {
|
|||
function udateMaterial(input) {
|
||||
if (input && input.className) {
|
||||
let find = input.className.match(/mdl-[\w]+input/g);
|
||||
if (find.length && find[0]) {
|
||||
if (find && find.length && find[0]) {
|
||||
let type = getMaterialType(find[0]);
|
||||
if (type && input.parentNode[`Material${type}`] && input.parentNode[`Material${type}`].updateClasses_) {
|
||||
input.parentNode[`Material${type}`].updateClasses_();
|
||||
|
|
|
@ -3,3 +3,4 @@ import './focus';
|
|||
import './dialog';
|
||||
import './validation';
|
||||
import './acl';
|
||||
import './onErrorSrc';
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import {module} from '../module';
|
||||
|
||||
function onErrorSrc() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: (scope, element, attrs) => {
|
||||
let imgError = '/static/images/no-image200x200.png';
|
||||
element.bind('error', function() {
|
||||
if (attrs.src != imgError) {
|
||||
attrs.$set('src', imgError);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.directive('onErrorSrc', onErrorSrc);
|
|
@ -12,7 +12,8 @@ export default class App {
|
|||
this.$rootScope = $rootScope;
|
||||
}
|
||||
show(message) {
|
||||
if (this.snackbar) this.snackbar.show({message: message});
|
||||
this.timeout = window.snackbarTimeout || 2000;
|
||||
if (this.snackbar) this.snackbar.show({message: message, timeout: this.timeout});
|
||||
}
|
||||
showMessage(message) {
|
||||
this.show(message);
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
{
|
||||
"url": "/list",
|
||||
"state": "item.index",
|
||||
"component": "vn-item-list"
|
||||
"component": "vn-item-list",
|
||||
"acl": ["developer"]
|
||||
}, {
|
||||
"url": "/create",
|
||||
"state": "item.create",
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
<vn-main-block>
|
||||
<vn-horizontal>
|
||||
<vn-auto class="left-block">
|
||||
<vn-card margin-medium-v>
|
||||
<a class="item-product-link pad-large text-center" ui-sref="item.index">
|
||||
<b>{{$ctrl.item.name}}</b>
|
||||
<img ng-src="http://verdnatura.es/vn-image-data/catalog/200x200/{{$ctrl.item.image}}" />
|
||||
</a>
|
||||
</vn-card>
|
||||
<vn-item-descriptor item="$ctrl.item"></vn-item-descriptor>
|
||||
<vn-left-menu></vn-left-menu>
|
||||
</vn-auto>
|
||||
<vn-one>
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<vn-card margin-medium-v>
|
||||
<vn-vertical>
|
||||
<vn-auto class="descriptor-header pointer" ui-sref="item.index">
|
||||
<img ng-src="/static/images/icon_item.png"/>
|
||||
</vn-auto>
|
||||
<vn-auto pad-medium text-center>
|
||||
<img ng-src="http://verdnatura.es/vn-image-data/catalog/200x200/{{$ctrl.item.image}}" on-error-src/>
|
||||
</vn-auto>
|
||||
<vn-auto pad-medium>
|
||||
<div><span translate>Id</span>: <b>{{$ctrl.item.id}}</b></div>
|
||||
<div><span translate>Name</span>: <b>{{$ctrl.item.name}}</b></div>
|
||||
<div><span translate>Description</span>: <b>{{$ctrl.item.description}}</b></div>
|
||||
<div><span translate>Size</span>: <b>{{$ctrl.item.size}}</b></div>
|
||||
<div><span translate>Type</span>: <b>{{$ctrl.item.itemType.name}}</b></div>
|
||||
</vn-auto>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
|
@ -0,0 +1,8 @@
|
|||
import ngModule from '../module';
|
||||
|
||||
ngModule.component('vnItemDescriptor', {
|
||||
template: require('./item-descriptor.html'),
|
||||
bindings: {
|
||||
item: '<'
|
||||
}
|
||||
});
|
|
@ -4,6 +4,7 @@ import './list/list';
|
|||
import './filter-panel/filter-panel';
|
||||
import './create/item-create';
|
||||
import './card/item-card';
|
||||
import './descriptor/item-descriptor';
|
||||
import './data/item-data';
|
||||
import './tags/item-tags';
|
||||
import './history/item-history';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
<vn-horizontal pad-medium border-solid-bottom>
|
||||
<vn-auto margin-medium-right ng-if="$ctrl.item.image">
|
||||
<img ng-src="http://verdnatura.es/vn-image-data/catalog/200x200/{{$ctrl.item.image}}" />
|
||||
<vn-auto margin-medium-right>
|
||||
<img ng-src="http://verdnatura.es/vn-image-data/catalog/200x200/{{$ctrl.item.image}}" on-error-src/>
|
||||
</vn-auto>
|
||||
<vn-one>
|
||||
<div><span translate>Id</span>: <b>{{$ctrl.item.id}}</b></div>
|
||||
|
|
|
@ -113,3 +113,23 @@ vn-main-block {
|
|||
padding-bottom: 1em;
|
||||
}
|
||||
}
|
||||
.descriptor-header{
|
||||
background: rgb(255,171,64);
|
||||
color: white;
|
||||
text-align: center;
|
||||
i {
|
||||
font-size: 51px;
|
||||
}
|
||||
img {
|
||||
width: 51px;
|
||||
height: 51px;
|
||||
}
|
||||
}
|
||||
fieldset[disabled] .mdl-textfield .mdl-textfield__input, .mdl-textfield.is-disabled .mdl-textfield__input,
|
||||
fieldset[disabled] .mdl-checkbox .mdl-checkbox__label, .mdl-checkbox.is-disabled .mdl-checkbox__label{
|
||||
border: none !important;
|
||||
color: inherit !important;
|
||||
}
|
||||
fieldset[disabled] .mdl-textfield .mdl-textfield__label, .mdl-textfield.is-disabled.is-disabled .mdl-textfield__label {
|
||||
color: rgb(255,171,64) !important;
|
||||
}
|
|
@ -8,6 +8,10 @@ export default function createNightmare(width = 1280, height = 720) {
|
|||
fail(error);
|
||||
});
|
||||
|
||||
nightmare.on('dom-ready', function() {
|
||||
nightmare.inject('js', `${__dirname}/nightmareModifiers.js`);
|
||||
});
|
||||
|
||||
nightmare.on('console', (type, message) => {
|
||||
if (type === 'error') {
|
||||
fail(message);
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
// snackbar default 2500 and jasmine timeout should be 10000
|
||||
window.snackbarTimeout = 400;
|
|
@ -98,6 +98,7 @@ describe('Add credit path', () => {
|
|||
|
||||
it(`should edit the credit`, done => {
|
||||
nightmare
|
||||
.clearInput(selectors.credit.creditInput)
|
||||
.type(selectors.credit.creditInput, 999)
|
||||
.click(selectors.credit.saveButton)
|
||||
.wait(selectors.globalItems.snackbarIsActive)
|
||||
|
|
|
@ -152,6 +152,7 @@ describe('Add greuge path', () => {
|
|||
|
||||
it(`should create a new greuge with all its data`, done => {
|
||||
nightmare
|
||||
.clearInput(selectors.greuge.amountInput)
|
||||
.type(selectors.greuge.amountInput, 999)
|
||||
.type(selectors.greuge.descriptionInput, 'new armor for Batman!')
|
||||
.click(selectors.greuge.saveButton)
|
||||
|
|
|
@ -61,7 +61,20 @@ module.exports = function(config) {
|
|||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['Chrome', 'Firefox'],
|
||||
browsers: ['ChromeNoSandboxHeadless'],
|
||||
customLaunchers: {
|
||||
ChromeNoSandboxHeadless: {
|
||||
base: 'Chrome',
|
||||
flags: [
|
||||
'--no-sandbox',
|
||||
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
|
||||
'--headless',
|
||||
'--disable-gpu',
|
||||
// Without a remote debugging port, Google Chrome exits immediately.
|
||||
' --remote-debugging-port=9222'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
|
|
|
@ -2,19 +2,17 @@ import app from '../../../../server/server';
|
|||
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
|
||||
|
||||
describe('Client addresses', () => {
|
||||
it('should call the addressesList method and receive total results and results of 2 as it has only 2 addresses', done => {
|
||||
it('should call the addressesList method and receive total results and items', done => {
|
||||
let id = 1;
|
||||
let params = {
|
||||
page: 10,
|
||||
size: 30
|
||||
page: 1,
|
||||
size: 1
|
||||
};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result).toEqual(jasmine.objectContaining({
|
||||
total: 2
|
||||
}));
|
||||
expect(Object.keys(result)).toEqual(['total', 'items']);
|
||||
done();
|
||||
};
|
||||
app.models.Client.addressesList(id, params, callback);
|
||||
|
|
|
@ -2,7 +2,7 @@ import app from '../../../../server/server';
|
|||
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
|
||||
|
||||
describe('Client card', () => {
|
||||
it('should call the card() method to receive a formatd card of Bruce Wayne', done => {
|
||||
it('should call the card() method to receive a formated card of Bruce Wayne', done => {
|
||||
let id = 1;
|
||||
|
||||
let callback = (error, result) => {
|
||||
|
|
|
@ -5,33 +5,9 @@ describe('Client employeeList', () => {
|
|||
it('should call the employeeList()', done => {
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
let amountOfEmployees = Object.keys(result).length;
|
||||
|
||||
expect(result).toEqual(jasmine.objectContaining([
|
||||
{
|
||||
id: 4,
|
||||
name: 'Bruce Banner'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'Charles Xavier'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: 'David Charles Haller'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Hank Pym'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'Jessica Jones'
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
name: 'Victor Stone'
|
||||
}
|
||||
]));
|
||||
expect(amountOfEmployees).toEqual(6);
|
||||
done();
|
||||
};
|
||||
app.models.Client.employeeList(callback);
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
import app from '../../../../server/server';
|
||||
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
|
||||
|
||||
describe('Client getRoleCustomer', () => {
|
||||
it('should call the getRoleCustomer() method with a customer id', done => {
|
||||
let id = 1;
|
||||
let params = {};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result).toEqual(jasmine.objectContaining({isCustomer: 1}));
|
||||
done();
|
||||
};
|
||||
|
||||
app.models.Client.getRoleCustomer(id, params, callback);
|
||||
});
|
||||
|
||||
it('should call the getRoleCustomer() method with a non customer id', done => {
|
||||
let id = 8;
|
||||
let params = {};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result).toEqual(jasmine.objectContaining({isCustomer: 0}));
|
||||
done();
|
||||
};
|
||||
|
||||
app.models.Client.getRoleCustomer(id, params, callback);
|
||||
});
|
||||
|
||||
it('should call the getRoleCustomer() method with an unreal id', done => {
|
||||
let id = 999;
|
||||
let params = {};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result).toEqual(jasmine.objectContaining({isCustomer: 0}));
|
||||
done();
|
||||
};
|
||||
|
||||
app.models.Client.getRoleCustomer(id, params, callback);
|
||||
});
|
||||
|
||||
it('should call the getRoleCustomer() method with an invalid id', done => {
|
||||
let id = 'WRONG!';
|
||||
let params = {};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result).toEqual(jasmine.objectContaining({isCustomer: 0}));
|
||||
done();
|
||||
};
|
||||
|
||||
app.models.Client.getRoleCustomer(id, params, callback);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
import app from '../../../../server/server';
|
||||
import {catchErrors} from '../../../../../../services/utils/jasmineHelpers';
|
||||
|
||||
describe('Client activeSalesPerson', () => {
|
||||
it('should call the activeSalesPerson() method with limit of 1', done => {
|
||||
let filter = {
|
||||
limit: 1
|
||||
};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result.length).toEqual(1);
|
||||
done();
|
||||
};
|
||||
|
||||
app.models.Client.activeSalesPerson(filter, callback);
|
||||
});
|
||||
|
||||
it('should call the activeSalesPerson() method with no limit and receive all 3 salesPersons', done => {
|
||||
let filter = {
|
||||
};
|
||||
|
||||
let callback = (error, result) => {
|
||||
if (error) return catchErrors(done)(error);
|
||||
|
||||
expect(result.length).toEqual(3);
|
||||
done();
|
||||
};
|
||||
|
||||
app.models.Client.activeSalesPerson(filter, callback);
|
||||
});
|
||||
});
|
|
@ -1,23 +0,0 @@
|
|||
import filter from '../filter';
|
||||
|
||||
describe('Greuge filterParams()', () => {
|
||||
it('should call the filterParams method', () => {
|
||||
let params = {
|
||||
clientFk: 1,
|
||||
page: 1,
|
||||
size: 1,
|
||||
order: 'DESC'
|
||||
};
|
||||
let self = jasmine.createSpyObj('self', ['installMethod']);
|
||||
filter(self);
|
||||
let filterParams = self.installMethod.calls.allArgs()[0][1];
|
||||
|
||||
expect(filterParams(params)).toEqual({
|
||||
where: Object({clientFk: 1}),
|
||||
skip: 0,
|
||||
limit: 1,
|
||||
order: 'DESC',
|
||||
include: Object({relation: 'greugeType', scope: Object({fields: ['id', 'name']})})
|
||||
});
|
||||
});
|
||||
});
|
|
@ -791,14 +791,6 @@ BEGIN
|
|||
Id_Trabajador = vn.getWorker();
|
||||
END IF;
|
||||
|
||||
IF !(NEW.Credito <=> OLD.Credito) AND IFNULL(NEW.Credito, 0) >= 0
|
||||
THEN
|
||||
INSERT INTO credit SET
|
||||
Id_Cliente = NEW.Id_Cliente,
|
||||
amount = NEW.Credito,
|
||||
Id_Trabajador = vEmployee;
|
||||
END IF;
|
||||
|
||||
-- Avisar al comercial si ha llegado la documentación sepa/core
|
||||
|
||||
IF NEW.sepavnl AND !OLD.sepavnl THEN
|
||||
|
|
|
@ -361,8 +361,7 @@ SET character_set_client = utf8;
|
|||
/*!50001 CREATE VIEW `clientCredit` AS SELECT
|
||||
1 AS `id`,
|
||||
1 AS `clientFk`,
|
||||
1 AS `workerFk`,
|
||||
1 AS `__employeeFk`,
|
||||
1 AS `employeeFk`,
|
||||
1 AS `amount`,
|
||||
1 AS `created`*/;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
@ -1068,6 +1067,7 @@ SET @saved_cs_client = @@character_set_client;
|
|||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE VIEW `itemType` AS SELECT
|
||||
1 AS `id`,
|
||||
1 AS `code`,
|
||||
1 AS `name`,
|
||||
1 AS `categoryFk`,
|
||||
1 AS `life`,
|
||||
|
@ -2310,7 +2310,7 @@ SET character_set_client = @saved_cs_client;
|
|||
/*!50001 SET collation_connection = utf8_general_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `clientCredit` AS select `c`.`id` AS `id`,`c`.`Id_Cliente` AS `clientFk`,`c`.`Id_Trabajador` AS `workerFk`,`c`.`Id_Trabajador` AS `__employeeFk`,`c`.`amount` AS `amount`,`c`.`odbc_date` AS `created` from `vn2008`.`credit` `c` */;
|
||||
/*!50001 VIEW `clientCredit` AS select `c`.`id` AS `id`,`c`.`Id_Cliente` AS `clientFk`,`c`.`Id_Trabajador` AS `employeeFk`,`c`.`amount` AS `amount`,`c`.`odbc_date` AS `created` from `vn2008`.`credit` `c` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
|
@ -3084,7 +3084,7 @@ SET character_set_client = @saved_cs_client;
|
|||
/*!50001 SET collation_connection = utf8_general_ci */;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `itemType` AS select `t`.`tipo_id` AS `id`,`t`.`Tipo` AS `name`,`t`.`reino_id` AS `categoryFk`,`t`.`life` AS `life`,`t`.`Id_Trabajador` AS `workerFk` from `vn2008`.`Tipos` `t` */;
|
||||
/*!50001 VIEW `itemType` AS select `t`.`tipo_id` AS `id`,`t`.`Id_Tipo` AS `code`,`t`.`Tipo` AS `name`,`t`.`reino_id` AS `categoryFk`,`t`.`life` AS `life`,`t`.`Id_Trabajador` AS `workerFk` from `vn2008`.`Tipos` `t` */;
|
||||
/*!50001 SET character_set_client = @saved_cs_client */;
|
||||
/*!50001 SET character_set_results = @saved_cs_results */;
|
||||
/*!50001 SET collation_connection = @saved_col_connection */;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -233,32 +233,32 @@ INSERT INTO `account`.`roleInherit`(`role`, `inheritsFrom`)
|
|||
|
||||
INSERT INTO `salix`.`ACL`(`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
||||
VALUES
|
||||
(1, 'Account', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(2, 'Account', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(3, 'Address', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(4, 'Address', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(5, 'AgencyService', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(6, 'AgencyService', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(7, 'Client', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(8, 'Client', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(9, 'ClientObservation', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(10, 'ClientObservation', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(11, 'ContactChannel', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(12, 'ContactChannel', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(13, 'Employee', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(14, 'PayMethod', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(15, 'PayMethod', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(16, 'FakeProduction', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(17, 'Warehouse', '* ', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(18, 'State', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(19, 'FakeProduction', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(20, 'TicketState', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(22, 'TicketState', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(23, 'TicketState', '*', 'EXECUTE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(24, 'Delivery', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(25, 'Zone', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
||||
(1, 'Account', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(2, 'Account', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(3, 'Address', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(4, 'Address', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(5, 'AgencyService', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(6, 'AgencyService', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(7, 'Client', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(8, 'Client', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(9, 'ClientObservation', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(10, 'ClientObservation', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(11, 'ContactChannel', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(12, 'ContactChannel', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(13, 'Employee', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(14, 'PayMethod', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(15, 'PayMethod', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(16, 'FakeProduction', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(17, 'Warehouse', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(18, 'State', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(19, 'FakeProduction', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(20, 'TicketState', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(22, 'TicketState', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(23, 'TicketState', '*', 'EXECUTE', 'ALLOW', 'ROLE', 'employee'),
|
||||
(24, 'Delivery', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
|
||||
(25, 'Zone', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
||||
|
||||
INSERT INTO `salix`.`Account`(`id`,`name`,`password`,`roleFk`,`active`,`email`)
|
||||
INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`)
|
||||
VALUES
|
||||
(1, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@verdnatura.es'),
|
||||
(2, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@verdnatura.es'),
|
||||
|
@ -281,15 +281,15 @@ INSERT INTO `salix`.`Country`(`id`, `name`, `inCee`, `code`, `currencyFk`, `real
|
|||
(5, 'Holanda', 1, 'NL', 1, 5),
|
||||
(30,'Francia', 1, 'FR', 1, 6);
|
||||
|
||||
INSERT INTO `salix`.`Warehouse`(`id`, `name`, `tpv`, `inventory`, `isManaged`)
|
||||
INSERT INTO `vn`.`warehouse`(`id`, `name`, `isComparative`, `isInventory`, `isManaged`)
|
||||
VALUES
|
||||
(1, 'Warehouse One', 01, 1, 1),
|
||||
(2, 'Warehouse Two', 01, 1, 1),
|
||||
(3, 'Warehouse Three', 01, 1, 1),
|
||||
(4, 'Warehouse Four', 01, 1, 1),
|
||||
(5, 'Warehouse Five', 01, 1, 0);
|
||||
(1, 'Warehouse One', 0, 1, 1),
|
||||
(2, 'Warehouse Two', 0, 1, 1),
|
||||
(3, 'Warehouse Three', 1, 1, 1),
|
||||
(4, 'Warehouse Four', 1, 1, 1),
|
||||
(5, 'Warehouse Five', 1, 1, 0);
|
||||
|
||||
INSERT INTO `salix`.`WarehouseAlias`(`id`, `name`)
|
||||
INSERT INTO `vn`.`warehouseAlias`(`id`, `name`)
|
||||
VALUES
|
||||
(1, 'Main Warehouse');
|
||||
|
||||
|
@ -301,7 +301,7 @@ INSERT INTO `vn`.`accountingType`(`id`, `description`)
|
|||
(4, 'Stolen Money'),
|
||||
(5, 'Miscellaneous');
|
||||
|
||||
INSERT INTO `salix`.`Bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`)
|
||||
INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`)
|
||||
VALUES
|
||||
(8, 'Pay on receipt', '0000000000', 4, 0, 1);
|
||||
|
||||
|
@ -314,14 +314,14 @@ INSERT INTO `salix`.`Agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankF
|
|||
(5, 'Quantum break device', 1, 0, 8, 1),
|
||||
(6, 'Walking', 1, 0, 8, 1);
|
||||
|
||||
UPDATE `salix`.`AgencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
|
||||
UPDATE `salix`.`AgencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
|
||||
UPDATE `salix`.`AgencyMode` SET `id` = 3 WHERE `name` = 'Teleportation device';
|
||||
UPDATE `salix`.`AgencyMode` SET `id` = 4 WHERE `name` = 'Entanglement';
|
||||
UPDATE `salix`.`AgencyMode` SET `id` = 5 WHERE `name` = 'Quantum break device';
|
||||
UPDATE `salix`.`AgencyMode` SET `id` = 6 WHERE `name` = 'Walking';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 3 WHERE `name` = 'Teleportation device';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 4 WHERE `name` = 'Entanglement';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 5 WHERE `name` = 'Quantum break device';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 6 WHERE `name` = 'Walking';
|
||||
|
||||
INSERT INTO `salix`.`PayMethod`(`id`, `name`, `graceDays`, `outstandingDebt`, `ibanRequired`)
|
||||
INSERT INTO `vn`.`payMethod`(`id`, `name`, `graceDays`, `outstandingDebt`, `ibanRequired`)
|
||||
VALUES
|
||||
(1, 'PayMethod one', 0, 001, 0),
|
||||
(2, 'PayMethod two', 10, 001, 0),
|
||||
|
@ -335,7 +335,7 @@ INSERT INTO `salix`.`Zone`(`id`, `name`, `printingOrder`)
|
|||
(2, 'zone two', 2),
|
||||
(3, 'zone three', 3);
|
||||
|
||||
INSERT INTO `salix`.`Province`(`id`, `name`, `countryFk`, `warehouseFk`, `zoneFk`)
|
||||
INSERT INTO `vn`.`province`(`id`, `name`, `countryFk`, `warehouseFk`, `zoneFk`)
|
||||
VALUES
|
||||
(1, 'Province one', 1, NULL, 1),
|
||||
(2, 'Province two', 1, NULL, 2),
|
||||
|
@ -343,14 +343,14 @@ INSERT INTO `salix`.`Province`(`id`, `name`, `countryFk`, `warehouseFk`, `zoneFk
|
|||
(4, 'Province four', 1, NULL, 2),
|
||||
(5, 'Province five', 1, NULL, 1);
|
||||
|
||||
INSERT INTO `salix`.`ClientType`(`id`, `code`, `type`)
|
||||
INSERT INTO `vn`.`clientType`(`id`, `code`, `type`)
|
||||
VALUES
|
||||
(1, 'normal', 'Normal'),
|
||||
(2, 'internalUse', 'Autoconsumo'),
|
||||
(3, 'handMaking', 'Confección'),
|
||||
(4, 'loses', 'Mermas');
|
||||
|
||||
INSERT INTO `salix`.`City`(`id`, `name`, `provinceFk`)
|
||||
INSERT INTO `vn`.`city`(`id`, `name`, `provinceFk`)
|
||||
VALUES
|
||||
(1, 'Gotham', 1);
|
||||
|
||||
|
@ -359,16 +359,16 @@ INSERT INTO `vn`.`cplusTerIdNif`(`id`, `description`)
|
|||
VALUES
|
||||
(1, 'NIF');
|
||||
|
||||
INSERT INTO `vn2008`.`Trabajadores`(`CodigoTrabajador`, `Id_Trabajador`, `Nombre`, `Apellidos`, `user_id`)
|
||||
INSERT INTO `vn`.`worker`(`workerCode`, `id`, `firstName`, `name`, `userFk`)
|
||||
VALUES
|
||||
('LGN', 1, 'David Charles', 'Haller', 6),
|
||||
('ANT', 2, 'Hank', 'Pym', 7),
|
||||
('DCX', 3, 'Charles', 'Xavier', 8),
|
||||
('HLK', 4, 'Bruce', 'Banner', 9),
|
||||
('JJJ', 5, 'Jessica', 'Jones', 10),
|
||||
('VSC', 20, 'Victor ', 'Stone', 11);
|
||||
('VSC', 20, 'Victor', 'Stone', 11);
|
||||
|
||||
INSERT INTO `salix`.`ContactChannel`(`id`, `name`)
|
||||
INSERT INTO `vn`.`contactChannel`(`id`, `name`)
|
||||
VALUES
|
||||
(1, 'Rumors on the streets'),
|
||||
(2, 'Metropolis newspaper'),
|
||||
|
@ -428,7 +428,7 @@ INSERT INTO `salix`.`ClientObservation`(`id`, `clientFk`, `employeeFk`, `text`,
|
|||
(7, 7, 4, 'I think our first move should be calling the Avengers..', CURDATE()),
|
||||
(8, 8, 4, 'Just because someone stumbles and loses their path, does not mean they are lost forever.', CURDATE()),
|
||||
(9, 9, 5, 'HULK SMASH! ...', CURDATE()),
|
||||
(10, 10, 5, 'They say everyone is born a hero. But if you let it, life will push you over the line until you are the villain. Problem is, you dont always know that you have crossed that line.', CURDATE());
|
||||
(10, 10, 5, 'They say everyone is born a hero. But if you let it, life will push you over the line until you are the villain.', CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`creditClassification`(`id`, `client`, `dateStart`, `dateEnd`)
|
||||
VALUES
|
||||
|
@ -460,7 +460,7 @@ INSERT INTO `vn2008`.`empresa_grupo`(`empresa_grupo_id`, `grupo`)
|
|||
|
||||
INSERT INTO `vn2008`.`empresa`(`id`, `abbreviation`, `registro`, `gerente_id`, `alta`, `baja`, `logo`, `oficial`, `cyc`, `rgb`, `mail`, `cuno`, `ODBC_DATE`, `Id_Cliente`, `digito_factura`, `Id_Proveedores_account`, `morosidad`, `empresa_grupo`)
|
||||
VALUES
|
||||
(442, 'WAY', 'Wayne Industries, Inc. operates as a warehouse for steel products. Wayne Industries, Inc. was founded in 1989 and is based in Wayne, Michigan.', '2', '1989-11-19', NULL, NULL, '1', '1', '00FF00', 'BruceWayne@verdnatura.es', NULL, '1989-08-11 12:31:22', '10', '1', NULL, '1', '1');
|
||||
(442, 'WAY', 'Wayne Industries, Inc. operates as a warehouse for steel products.', '2', '1989-11-19', NULL, NULL, '1', '1', '00FF00', 'BruceWayne@verdnatura.es', NULL, '1989-08-11 12:31:22', '10', '1', NULL, '1', '1');
|
||||
|
||||
|
||||
INSERT INTO `vn`.`ticket`(`id`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `clientFk`,`nickname`, `addressFk`)
|
||||
|
@ -476,7 +476,7 @@ INSERT INTO `vn2008`.`empresa`(`id`, `abbreviation`, `registro`, `gerente_id`, `
|
|||
(9, 5, 5, NULL, CURDATE(), 5, 'Hulk', 9),
|
||||
(10, 6, 5, NULL, CURDATE(), 5, 'Jessica Jones', 10);
|
||||
|
||||
INSERT INTO `salix`.`TicketState`(`id`, `ticketFk`, `stateFk`, `employeeFk`, `updated`)
|
||||
INSERT INTO `vn`.`ticketTracking`(`id`, `ticketFk`, `stateFk`, `workerFk`, `created`)
|
||||
VALUES
|
||||
(1, 1, 1, 5, CURDATE()),
|
||||
(2, 2, 2, 5, CURDATE()),
|
||||
|
@ -489,7 +489,7 @@ INSERT INTO `salix`.`TicketState`(`id`, `ticketFk`, `stateFk`, `employeeFk`, `up
|
|||
(9, 9, 3, 5, CURDATE()),
|
||||
(10, 10, 1, 5, CURDATE());
|
||||
|
||||
INSERT INTO `salix`.`Vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk`, `warehouseFk`, `description`, `m3`, `isActive`)
|
||||
INSERT INTO `vn`.`vehicle`(`id`, `numberPlate`, `tradeMark`, `model`, `companyFk`, `warehouseFk`, `description`, `m3`, `isActive`)
|
||||
VALUES
|
||||
(1, '3333-BAT', 'WAYNE INDUSTRIES', 'BATMOBILE', 442, 1, 'The ultimate war machine', 50, 1),
|
||||
(2, '1111-IMK', 'STARK INDUSTRIES', 'MARK-III', 442, 1, 'Iron-Man Heavy Armor MARK-III', 18, 1),
|
||||
|
@ -585,11 +585,11 @@ INSERT INTO `vn`.`expence`(`id`, `taxTypeFk`, `name`, `isWithheld`)
|
|||
|
||||
INSERT INTO `vn`.`item`(`id`, `name`,`typeFk`,`size`,`inkFk`,`category`,`stems`,`originFk`,`description`,`producerFk`,`intrastatFk`,`isOnOffer`,`expenceFk`,`isBargain`,`comment`,`relevancy`,`image`,`taxClassFk`)
|
||||
VALUES
|
||||
(1, 'Gema del Tiempo', 2, 70, 'AMA', 'EXT', 1, 1, 'Una de las gemas del infinito', 1, 2, 0, 1, 0, NULL, 0, NULL, 1),
|
||||
(2, 'Gema de la Mente', 2, 70, 'AZL', 'EXT', 1, 2, 'Una de las gemas del infinito', 1, 2, 0, 1, 0, NULL, 0, NULL, 1),
|
||||
(3, 'Iron Patriot', 1, 60, 'AMR', 'EXT', 1, 3, 'La armadura de Rhodey', 1, 1, 0, 1, 0, NULL, 0, NULL, 1),
|
||||
(4, 'Mark I', 1, 60, 'AMR', 'EXT', 1, 1, 'La primera armadura de Iron Man', 1, 1, 1, 2, 0, NULL, 0, NULL, 2),
|
||||
(5, 'Mjolnir', 3, 30, 'AZR', 'EXT', 1, 2, 'El martillo de Thor', 2, 2, 1, 2, 0, NULL, 0, NULL, 2);
|
||||
(1, 'Gema del Tiempo', 2, 70, 'AMA', 'EXT', 1, 1, 'Una de las gemas del infinito', 1, 2, 0, 1, 0, NULL, 0, 66540, 1),
|
||||
(2, 'Gema de la Mente', 2, 70, 'AZL', 'EXT', 1, 2, 'Una de las gemas del infinito', 1, 2, 0, 1, 0, NULL, 0, 65540, 1),
|
||||
(3, 'Iron Patriot', 1, 60, 'AMR', 'EXT', 1, 3, 'La armadura de Rhodey', 1, 1, 0, 1, 0, NULL, 0, 61692, 1),
|
||||
(4, 'Mark I', 1, 60, 'AMR', 'EXT', 1, 1, 'La primera armadura de Iron Man', 1, 1, 1, 2, 0, NULL, 0, 66090, 2),
|
||||
(5, 'Mjolnir', 3, 30, 'AZR', 'EXT', 1, 2, 'El martillo de Thor', 2, 2, 1, 2, 0, NULL, 0, 67350, 2);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ module.exports = function(Client) {
|
|||
delete params.size;
|
||||
|
||||
if (params.search) {
|
||||
hasAnd = true;
|
||||
filters.where.and = [
|
||||
{
|
||||
or: [
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Loading…
Reference in New Issue