Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Dani Herrero 2017-10-19 07:16:51 +02:00
commit 070cd764b6
7 changed files with 69136 additions and 25 deletions

View File

@ -2,6 +2,8 @@ import {module} from '../module';
/**
* Sets the focus and selects the text on the input.
*
* @return {Object} The directive
*/
export function directive() {
return {

View File

@ -1,16 +0,0 @@
import {module} from '../module';
directive.$inject = ['$compile'];
function directive($compile) {
return {
restrict: 'A',
priority: 9999,
link: function(scope, element, attrs) {
element.removeAttr('vn-repeat');
element.attr('ng-repeat', attrs.vnRepeat);
$compile(element)(scope);
}
};
}
module.directive('vnRepeat', directive);

View File

@ -6,6 +6,7 @@ var merge = require('merge-stream');
var extend = require('gulp-extend');
var install = require('gulp-install');
var print = require('gulp-print');
var runSequence = require('run-sequence');
var del = require('del');
var fs = require('fs');
var webpack = require('webpack');
@ -151,23 +152,25 @@ gulp.task('watch', function() {
gulp.watch(localeFiles, ['locales']);
});
gulp.task('test', ['deleteDockerDb', 'buildDockerDb'], (callback) => {
exec('docker run -d --name dbLocal -p 3306:3306 dblocal:latest', (err, stdout, stderr) => {
if (err) {
throw new Error(err);
}
gulp.task('test', () => {
process.env.NODE_ENV = gutil.env.env || 'test';
console.log(process.env.NODE_ENV);
runSequence('deleteDockerDb', 'buildDockerDb', 'runDockerDb');
});
gulp.task('runDockerDb', (callback) => {
exec('docker run -d --name dblocal -p 3306:3306 dblocal:latest', (err, stdout, stderr) => {
callback(err);
});
});
gulp.task('buildDockerDb', (callback) => {
exec('docker build -t dblocal:latest ./services/db', (err, stdout, stderr) => {
if (err)
throw new Error(err);
callback(err);
});
});
gulp.task('deleteDockerDb', (callback) => {
exec('docker rm -f dbLocal', () => {
exec('docker rm -f dblocal', (err, stdout, stderr) => {
callback();
});
});

View File

@ -60,6 +60,7 @@
"node-sass": "^3.11.0",
"nodemon": "^1.12.0",
"raw-loader": "*",
"run-sequence": "^2.2.0",
"sass-loader": "^4.0.2",
"style-loader": "^0.13.1",
"webpack": "^2.2.0",

View File

@ -1 +0,0 @@
*.sql

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,245 @@
INSERT INTO `salix`.`Role`(`id`, `name`, `description`, `created`, `modified`)
VALUES
(1, 'employee', 'Privilegios básicos de un empleado', CURDATE(), CURDATE()),
(2, 'customer', 'Privilegios básicos de un cliente', CURDATE(), CURDATE()),
(3, 'administrative', 'Tareas relacionadas con la contabilidad', CURDATE(), CURDATE()),
(4, 'salesPerson', 'Departamento de ventas', CURDATE(), CURDATE());
INSERT INTO `salix`.`Account`(`id`,`name`,`password`,`roleFk`,`active`,`email`)
VALUES
(1, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'nightmare@verdnatura.es'),
(2, 'PetterParker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'nightmare@verdnatura.es'),
(3, 'ClarkKent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'nightmare@verdnatura.es'),
(4, 'TonyStark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'nightmare@verdnatura.es'),
(5, 'MaxEisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'nightmare@verdnatura.es'),
(6, 'DavidCharlesHaller', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'nightmare@verdnatura.es'),
(7, 'HankPym', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'nightmare@verdnatura.es'),
(8, 'CharlesXavier', 'ac754a330530832ba1bf7687f577da91', 4, 1, 'nightmare@verdnatura.es'),
(9, 'BruceBanner', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'nightmare@verdnatura.es'),
(10, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 3, 1, 'nightmare@verdnatura.es');
INSERT INTO `salix`.`Country`(`id`, `name`, `inCee`, `code`, `currencyFk`, `realCountryFk`)
VALUES
(1, 'España', 0, 'ES', 1, 1),
(2, 'Italia', 1, 'IT', 1, 2),
(3, 'Alemania', 1, 'DE', 1, 3),
(4, 'Rumania', 1, 'RO', 1, 4),
(5, 'Holanda', 1, 'NL', 1, 5);
INSERT INTO `salix`.`Warehouse`(`id`, `name`, `tpv`, `inventory`, `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);
INSERT INTO `salix`.`WarehouseAlias`(`id`, `name`)
VALUES
(1, 'Main Warehouse');
INSERT INTO `vn`.`accountingType`(`id`, `description`)
VALUES
(1, 'Digital money'),
(2, 'Cash'),
(3, 'Card'),
(4, 'Stolen Money'),
(5, 'Miscellaneous');
INSERT INTO `salix`.`Bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`)
VALUES
(8, 'Pay on receipt', '0000000000', 4, 0, 1);
INSERT INTO `salix`.`Agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankFk`, `warehouseAliasFk`)
VALUES
(1, 'inhouse pickup', 1, 0, 8, 1),
(2, 'Super-Man delivery', 1, 0, 8, 1),
(3, 'Teleportation device', 1, 0, 8, 1),
(4, 'Entanglement', 1, 0, 8, 1),
(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';
INSERT INTO `salix`.`PayMethod`(`id`, `name`, `graceDays`, `outstandingDebt`, `ibanRequired`)
VALUES
(1, 'PayMethod one', 0, 001, 0),
(2, 'PayMethod two', 10, 001, 0),
(3, 'PayMethod three', 0, 001, 0),
(4, 'PayMethod four', 0, 001, 1),
(5, 'PayMethod five', 10, 001, 0);
INSERT INTO `salix`.`Zone`(`id`, `name`, `printingOrder`)
VALUES
(1, 'zone one', 1),
(2, 'zone two', 2),
(3, 'zone three', 3);
INSERT INTO `salix`.`Province`(`id`, `name`, `countryFk`, `warehouseFk`, `zoneFk`)
VALUES
(1, 'Provicen one', 1, NULL, 1),
(2, 'Provicen two', 1, NULL, 2),
(3, 'Provicen three', 1, NULL, 3),
(4, 'Provicen four', 1, NULL, 2),
(5, 'Provicen five', 1, NULL, 1);
INSERT INTO `salix`.`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`)
VALUES
(1, 'Gotham', 1);
INSERT INTO `vn`.`cplusTerIdNif`(`id`, `description`)
VALUES
(1, 'NIF');
INSERT INTO `vn2008`.`Trabajadores`(`CodigoTrabajador`, `Id_Trabajador`, `Nombre`, `Apellidos`, `user`)
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);
INSERT INTO `salix`.`ContactChannel`(`id`, `name`)
VALUES
(1, 'Rumors on the streets'),
(2, 'Metropolis newspaper'),
(3, 'Daily Bugle'),
(4, 'GCN Channel'),
(5, 'The Newspaper');
INSERT INTO `salix`.`Client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `provinceFk`, `countryFk`, `email`, `phone`, `mobile`, `fax`, `active`, `discount`, `credit`, `creditInsurance`, `iban`, `dueDay`, `equalizationTax`, `hasToInvoice`, `invoiceByEmail`, `payMethodFk`, `salesPersonFk`, `contactChannelFk`, `sepaVnl`, `coreVnl`, `coreVnh`, `eypbc`, `quality`, `vies`, `isRelevant`, `typeFk`, `accountingAccount`, `created`)
VALUES
(1, 'Bruce Wayne', '11111111B', 'Batman', 'Alfred', '1007 Mountain Drive, Gotham', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(2, 'Petter Parker', '22222222P', 'Spider-Man', 'Aunt May', '20 Ingram Street', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(3, 'Clark Kent', '33333333C', 'Super-Man', 'lois lane', '344 Clinton Street', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(4, 'Tony Stark', '44444444T', 'Iron-Man', 'Pepper Potts', '10880 Malibu Point', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(5, 'Max Eisenhardt', '55555555M', 'Magneto', 'Rogue', 'Unknown Whereabouts', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(6, 'DavidCharlesHaller', '66666666D', 'Legion', 'Charles Xavier', 'Evil hideout', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(7, 'Hank Pym', '77777777H', 'Ant-Man', 'Hawk', 'Anthill', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(8, 'Charles Xavier', '88888888C', 'Professor X', 'Beast', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(9, 'Bruce Banner', '99999999B', 'Hulk', 'Black widow', 'Somewhere in New York', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE()),
(10, 'Jessica Jones', '10101010J', 'Jessica Jones', 'Luke Cage', 'NYCC 2015 Poster', 'Silla', 46460, 1, 1, 'nightmare@verdnatura.es', 1111111111, 222222222, 333333333, 1, 1, 300, NULL, NULL, 0, 1, 1, 1, 5, 4, 5, 1, 1, 1, 1, 10, 0, 1, 1, 1234567890, CURDATE());
INSERT INTO `salix`.`Address`(`id`, `consignee`, `street`, `city`, `postcode`, `provinceFk`, `phone`, `mobile`, `isEnabled`, `isDefaultAddress`, `clientFk`, `defaultAgencyFk`, `longitude`, `latitude`, `isEqualizated`)
VALUES
(1, 'Bruce Wayne', 'The Bat cave', 'Silla', 46460, 1, NULL, NULL, 1, 1, 1, 2, NULL, NULL, 1),
(2, 'Petter Parker', 'NY roofs', 'Silla', 46460, 1, NULL, NULL, 1, 1, 2, 2, NULL, NULL, 1),
(3, 'Clark Kenn', 'The phone box', 'Silla', 46460, 1, NULL, NULL, 1, 1, 3, 2, NULL, NULL, 1),
(4, 'Tony Stark', 'Stark tower', 'Silla', 46460, 1, NULL, NULL, 1, 1, 4, 2, NULL, NULL, 1),
(5, 'Max Eisenhardt', 'The plastic cell', 'Silla', 46460, 1, NULL, NULL, 1, 1, 5, 2, NULL, NULL, 1),
(6, 'David Charles Haller', 'Many places', 'Silla', 46460, 1, NULL, NULL, 1, 1, 6, 2, NULL, NULL, 1),
(7, 'Hank Pym', 'Your pocket', 'Silla', 46460, 1, NULL, NULL, 1, 1, 7, 2, NULL, NULL, 1),
(8, 'Charles Xavier', 'Cerebro', 'Silla', 46460, 1, NULL, NULL, 1, 1, 8, 2, NULL, NULL, 1),
(9, 'Bruce Banner', 'Somewhere in Thailand', 'Silla', 46460, 1, NULL, NULL, 1, 1, 9, 2, NULL, NULL, 1),
(10,'Jessica Jones', 'Luke Cages Bar', 'Silla', 46460, 1, NULL, NULL, 1, 1, 10, 2, NULL, NULL, 1);
INSERT INTO `salix`.`ClientCredit`(`id`, `clientFk`, `employeeFk`, `amount`, `created`)
VALUES
(1, 1, 1, 1200, CURDATE()),
(2, 2, 2, 800, CURDATE()),
(3, 3, 3, 200, CURDATE()),
(4, 4, 4, 90, CURDATE()),
(5, 5, 5, 90, CURDATE());
INSERT INTO `salix`.`ClientCreditLimit`(`id`, `maxAmount`, `roleFk`)
VALUES
(1, 10000, 20),
(2, 600, 19),
(3, 0, 13);
INSERT INTO `salix`.`ClientObservation`(`id`, `clientFk`, `employeeFk`, `text`, `created`)
VALUES
(1, 1, 1, 'Madness, as you know, is like gravity, all it takes is a little push', CURDATE()),
(2, 2, 1, 'With great power, comes great responsibility', CURDATE()),
(3, 3, 2, 'this is a job for Super-Man!', CURDATE()),
(4, 4, 2, 'yes... I am Iron-Man', CURDATE()),
(5, 5, 3, 'They do understand. Our mutant powers make us superior', CURDATE()),
(6, 6, 3, 'My name is Legion, for we are many!', CURDATE()),
(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());
INSERT INTO `vn`.`creditClassification`(`id`, `client`, `dateStart`, `dateEnd`)
VALUES
(1, 1, CURDATE(), CURDATE()),
(2, 2, CURDATE(), CURDATE()),
(3, 3, CURDATE(), CURDATE()),
(4, 4, CURDATE(), CURDATE()),
(5, 5, CURDATE(), CURDATE());
INSERT INTO `salix`.`Route`(`id`, `date`)
VALUES
(1, CURDATE()),
(2, CURDATE()),
(3, CURDATE()),
(4, CURDATE()),
(5, CURDATE()),
(6, CURDATE()),
(7, CURDATE());
INSERT INTO `salix`.`State`(`id`, `name`, `order`, `alertLevel`, `code`)
VALUES
(1, 'To check', 2, 0, 'FIXING'),
(2, 'Owes', 1, 0, 'FREE'),
(3, 'Ok', 3, 0, 'OK');
INSERT INTO `vn2008`.`empresa_grupo`(`empresa_grupo_id`, `grupo`)
VALUES
(1, 'Wayne Industries');
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', 'VNL', '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', 'nightmare@verdnatura.es', NULL, '1989-08-11 12:31:22', '10', '1', NULL, '1', '1');
INSERT INTO `salix`.`Ticket`(`id`, `agencyFk`, `employeeFk`, `date`, `hour`, `clientFk`, `addressFk`)
VALUES
(1, 1, 1, CURDATE(), 0, 1, 1),
(2, 1, 1, CURDATE(), 0, 1, 2),
(3, 2, 2, CURDATE(), 0, 2, 3),
(4, 2, 2, CURDATE(), 0, 2, 4),
(5, 3, 3, CURDATE(), 0, 3, 5),
(6, 3, 3, CURDATE(), 0, 3, 6),
(7, 4, 4, CURDATE(), 0, 4, 7),
(8, 4, 4, CURDATE(), 0, 4, 8),
(9, 5, 5, CURDATE(), 0, 5, 9),
(10, 6, 5, CURDATE(), 0, 5, 10);
INSERT INTO `salix`.`TicketState`(`id`, `ticketFk`, `stateFk`, `employeeFk`, `updated`)
VALUES
(1, 1, 1, 1, CURDATE()),
(2, 2, 2, 1, CURDATE()),
(3, 3, 3, 2, CURDATE()),
(4, 4, 1, 2, CURDATE()),
(5, 5, 2, 3, CURDATE()),
(6, 6, 3, 3, CURDATE()),
(7, 7, 1, 4, CURDATE()),
(8, 8, 2, 4, CURDATE()),
(9, 9, 3, 5, CURDATE()),
(10, 10, 1, 5, CURDATE());
INSERT INTO `salix`.`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),
(3, '2222-IMK', 'STARK INDUSTRIES', 'MARK-VI', 442, 1, 'Iron-Man Heavy Armor MARK-VI', 16, 1),
(4, '3333-IMK', 'STARK INDUSTRIES', 'MARK-VII', 442, 1, 'Iron-Man Heavy Armor MARK-VII', 14, 1),
(5, '4444-IMK', 'STARK INDUSTRIES', 'MARK-XLII', 442, 1, 'Iron-Man Heavy Armor MARK-XLII', 13, 1),
(6, '5555-IMK', 'STARK INDUSTRIES', 'MARK-XLV', 442, 1, 'Iron-Man Heavy Armor MARK-XLV', 12, 1);
INSERT INTO `vn`.`config`(`id`, `mdbServer`, `fakeEmail`, `defaultersMaxAmount`)
VALUES
(1, 'beta-server', 'nightmare@verdnatura.es', '200');