Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2141-print_reply_to
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-05-25 07:25:21 +02:00
commit 4878c0dc46
36 changed files with 129 additions and 79 deletions

View File

@ -15,3 +15,14 @@ UPDATE `vn`.`claimState` SET `code` = 'resolved' WHERE (`id` = '3');
UPDATE `vn`.`claimState` SET `code` = 'disputed' WHERE (`id` = '5');
UPDATE `vn`.`claimState` SET `code` = 'mana' WHERE (`id` = '6');
UPDATE `vn`.`claimState` SET `code` = 'managed' WHERE (`id` = '2');
ALTER TABLE `vn`.`claimState`
ADD COLUMN `priority` INT NOT NULL DEFAULT 1 AFTER `roleFk`;
UPDATE `vn`.`claimState` SET `priority` = '1' WHERE (`id` = '1');
UPDATE `vn`.`claimState` SET `priority` = '5' WHERE (`id` = '2');
UPDATE `vn`.`claimState` SET `priority` = '7' WHERE (`id` = '3');
UPDATE `vn`.`claimState` SET `priority` = '6' WHERE (`id` = '4');
UPDATE `vn`.`claimState` SET `priority` = '3' WHERE (`id` = '5');
UPDATE `vn`.`claimState` SET `priority` = '4' WHERE (`id` = '6');
UPDATE `vn`.`claimState` SET `priority` = '2' WHERE (`id` = '7');

View File

@ -1,10 +0,0 @@
ALTER TABLE `vn`.`claimState`
ADD COLUMN `priority` INT NOT NULL DEFAULT 1 AFTER `roleFk`;
UPDATE `vn`.`claimState` SET `priority` = '1' WHERE (`id` = '1');
UPDATE `vn`.`claimState` SET `priority` = '5' WHERE (`id` = '2');
UPDATE `vn`.`claimState` SET `priority` = '7' WHERE (`id` = '3');
UPDATE `vn`.`claimState` SET `priority` = '6' WHERE (`id` = '4');
UPDATE `vn`.`claimState` SET `priority` = '3' WHERE (`id` = '5');
UPDATE `vn`.`claimState` SET `priority` = '4' WHERE (`id` = '6');
UPDATE `vn`.`claimState` SET `priority` = '2' WHERE (`id` = '7');

View File

@ -1185,16 +1185,16 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'seventh travel', 1),
(8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'eight travel', 1);
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`, `ref`,`isInventory`, `isRaid`, `notes`, `evaNotes`)
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `ref`,`isInventory`, `isRaid`, `notes`, `evaNotes`)
VALUES
(1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 442, 'Movement 1', 0, 0, '', ''),
(2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
(3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
(4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
(5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
(6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
(7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
(8, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 8', 1, 1, '', '');
(1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'Movement 1', 0, 0, '', ''),
(2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
(3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
(4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
(5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
(6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
(7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
(8, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 8', 1, 1, '', '');
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
VALUES

View File

@ -1,7 +1,8 @@
const app = require('vn-loopback/server/server');
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
describe('worker workerTimeControl_check()', () => {
// #2257 xdescribe dbtest workerTimeControl_check()
xdescribe('worker workerTimeControl_check()', () => {
it(`should throw an error if the worker can't sign on that tablet`, async() => {
let stmts = [];
let stmt;

View File

@ -32,10 +32,11 @@ describe('Order lines', () => {
});
it('should confirm the order subtotal has changed', async() => {
await page.waitForTextInElement(selectors.orderLine.orderSubtotal, '90.10');
const result = await page
.waitToGetProperty(selectors.orderLine.orderSubtotal, 'innerText');
expect(result).toContain('80.54');
expect(result).toContain('90.10');
});
it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => {

View File

@ -33,9 +33,6 @@ export default class Datalist extends Textfield {
if (this.validSelection(value)) return;
if (!oldValue)
return this.fetchSelection();
this.$timeout.cancel(this.searchTimeout);
if (this.model) {

View File

@ -0,0 +1 @@
Search by: Search by {{module | translate}}

View File

@ -0,0 +1 @@
Search by: Buscar por {{module | translate}}

View File

@ -1,7 +1,7 @@
<form ng-submit="$ctrl.onSubmit()">
<vn-textfield
class="dense standout"
placeholder="{{::'Search' | translate}}"
placeholder="{{::'Search by' | translate: {module: $ctrl.baseState} }}"
ng-model="$ctrl.searchString">
<prepend>
<vn-icon

View File

@ -136,7 +136,6 @@ export default class Searchbar extends Component {
fromBar() {
let filter = {};
if (this.searchString)
filter.search = this.searchString;

View File

@ -3,8 +3,9 @@ describe('Percentage filter', () => {
beforeEach(ngModule('vnCore'));
beforeEach(inject(_percentageFilter_ => {
beforeEach(inject((_percentageFilter_, $translate) => {
percentageFilter = _percentageFilter_;
jest.spyOn($translate, 'use').mockReturnValue('en-US');
}));
it('should return null for input null', () => {

View File

@ -11,7 +11,7 @@ export function factory($http, $window, $ocLazyLoad, $translatePartialLoader, $t
this.loaded = {};
this.imports = {};
this.moduleImport = moduleImport;
this.modelInfo = $http.get(`modelInfo`)
this.modelInfo = $http.get(`Schemas/modelInfo`)
.then(json => {
this.onModelInfoReady(json);
this.modelInfo = true;

View File

@ -23,7 +23,7 @@ describe('factory vnModuleLoader', () => {
}
];
$httpBackend.whenGET('modelInfo')
$httpBackend.whenGET('Schemas/modelInfo')
.respond({
FooModel: {
properties: {

View File

@ -3,11 +3,10 @@
"base": "PersistedModel",
"acls": [
{
"property": "validations",
"accessType": "EXECUTE",
"property": "modelInfo",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}
}

View File

@ -1,9 +0,0 @@
module.exports = function(app) {
// FIXME: Fix until the original can be used
app.get('/api/modelInfo', function(req, res) {
app.models.Schema.modelInfo({req}).then(json => {
res.set('Content-Type', 'application/json');
res.send(JSON.stringify(json));
});
});
};

View File

@ -21,7 +21,7 @@
"required": true
},
"priority": {
"type": "number",
"type": "Number",
"required": true
}
},

View File

@ -14,4 +14,5 @@ Send Pickup order: Enviar orden de recogida
Show Pickup order: Ver orden de recogida
Search claim by id or client name: Buscar reclamaciones por identificador o nombre de cliente
Claim deleted!: Reclamación eliminada!
claim: reclamacióm

View File

@ -45,7 +45,8 @@ export default class Controller extends Section {
const province = selection.province;
const postcodes = selection.postcodes;
this.address.provinceId = province.id;
if (!this.address.provinceI)
this.address.provinceId = province.id;
if (postcodes.length === 1)
this.address.postalCode = postcodes[0].code;
@ -64,8 +65,11 @@ export default class Controller extends Section {
const town = selection.town;
const province = town.province;
this.address.city = town.name;
this.address.provinceId = province.id;
if (!this.address.city)
this.address.city = town.name;
if (!this.address.provinceId)
this.address.provinceId = province.id;
}
onResponse(response) {

View File

@ -42,15 +42,15 @@ export default class Controller extends Section {
// Town auto complete
set town(selection) {
const oldValue = this._town;
this._town = selection;
if (!oldValue) return;
if (!selection) return;
const province = selection.province;
const postcodes = selection.postcodes;
this.address.provinceFk = province.id;
if (!this.address.provinceFk)
this.address.provinceFk = province.id;
if (postcodes.length === 1)
this.address.postalCode = postcodes[0].code;
@ -62,16 +62,18 @@ export default class Controller extends Section {
// Postcode auto complete
set postcode(selection) {
const oldValue = this._postcode;
this._postcode = selection;
if (!oldValue) return;
if (!selection) return;
const town = selection.town;
const province = town.province;
this.address.city = town.name;
this.address.provinceFk = province.id;
if (!this.address.city)
this.address.city = town.name;
if (!this.address.provinceFk)
this.address.provinceFk = province.id;
}
onResponse(response) {

View File

@ -0,0 +1 @@
BILL: N/INV {{ref}}

View File

@ -27,7 +27,8 @@ export default class Controller extends Section {
const country = selection.country;
this.client.countryFk = country.id;
if (!this.client.countryFk)
this.client.countryFk = country.id;
}
get town() {
@ -44,8 +45,11 @@ export default class Controller extends Section {
const country = province.country;
const postcodes = selection.postcodes;
this.client.provinceFk = province.id;
this.client.countryFk = country.id;
if (!this.client.provinceFk)
this.client.provinceFk = province.id;
if (!this.client.countryFk)
this.client.countryFk = country.id;
if (postcodes.length === 1)
this.client.postcode = postcodes[0].code;
@ -65,9 +69,14 @@ export default class Controller extends Section {
const province = town.province;
const country = province.country;
this.client.city = town.name;
this.client.provinceFk = province.id;
this.client.countryFk = country.id;
if (!this.client.city)
this.client.city = town.name;
if (!this.client.provinceFk)
this.client.provinceFk = province.id;
if (!this.client.countryFk)
this.client.countryFk = country.id;
}
onResponse(response) {

View File

@ -41,6 +41,7 @@ describe('Client', () => {
describe('province() setter', () => {
it(`should set countryFk property`, () => {
controller.client.countryFk = null;
controller.province = {
id: 1,
name: 'New york',

View File

@ -98,14 +98,14 @@ export default class Controller extends Section {
// Province auto complete
set province(selection) {
const oldValue = this._province;
this._province = selection;
if (!selection || !oldValue) return;
if (!selection) return;
const country = selection.country;
this.client.countryFk = country.id;
if (!this.client.countryFk)
this.client.countryFk = country.id;
}
get town() {
@ -114,17 +114,19 @@ export default class Controller extends Section {
// Town auto complete
set town(selection) {
const oldValue = this._town;
this._town = selection;
if (!selection || !oldValue) return;
if (!selection) return;
const province = selection.province;
const country = province.country;
const postcodes = selection.postcodes;
this.client.provinceFk = province.id;
this.client.countryFk = country.id;
if (!this.client.provinceFk)
this.client.provinceFk = province.id;
if (!this.client.countryFk)
this.client.countryFk = country.id;
if (postcodes.length === 1)
this.client.postcode = postcodes[0].code;
@ -145,9 +147,14 @@ export default class Controller extends Section {
const province = town.province;
const country = province.country;
this.client.city = town.name;
this.client.provinceFk = province.id;
this.client.countryFk = country.id;
if (!this.client.city)
this.client.city = town.name;
if (!this.client.provinceFk)
this.client.provinceFk = province.id;
if (!this.client.countryFk)
this.client.countryFk = country.id;
}
onResponse(response) {

View File

@ -26,9 +26,9 @@ describe('Client', () => {
isTaxDataChecked: false
};
controller.province = {};
controller.town = {};
controller.postcode = {};
controller._province = {};
controller._town = {};
controller._postcode = {};
}));
describe('onSubmit()', () => {
@ -135,6 +135,7 @@ describe('Client', () => {
describe('province() setter', () => {
it(`should set countryFk property`, () => {
controller.client.countryFk = null;
controller.province = {
id: 1,
name: 'New york',

View File

@ -1,6 +1,7 @@
Active: Activo
Amount: Importe
Client: Cliente
client: cliente
Comercial Name: Comercial
Has to invoice: Factura
Invoice by mail: Factura via e-mail

View File

@ -1,3 +1,5 @@
#Ordenar alfabeticamente
entry: entrada
# Sections

View File

@ -1,2 +1,3 @@
Invoice out: Facturas
invoiceOut: factura
Search invoices by reference: Buscar facturas por referencia

View File

@ -40,6 +40,26 @@ describe('Item', () => {
expect(controller.item.id).toEqual(1);
});
});
describe('scrollToLine ()', () => {
it('should assign $location then call anchorScroll using controller value', () => {
jest.spyOn(controller, '$anchorScroll');
controller.lineFk = 1;
controller.scrollToLine('invalidValue');
expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`);
expect(controller.$anchorScroll).toHaveBeenCalledWith();
});
it('should assign $location then call anchorScroll using received value', () => {
jest.spyOn(controller, '$anchorScroll');
controller.lineFk = undefined;
controller.scrollToLine(1);
expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`);
expect(controller.$anchorScroll).toHaveBeenCalledWith();
});
});
});
});

View File

@ -1,4 +1,5 @@
Item: Artículo
item: artículo
View item: Ver artículo
Category: Reino
Description: Descripción

View File

@ -20,4 +20,5 @@ Color and price: Color y precio
Ascendant: Ascendente
Descendant: Descendente
Created from: Creado desde
Search orders by id: Buscar en la cesta por identificador
Search order by id: Buscar el pedido por identificador
order: pedido

View File

@ -1,3 +1,4 @@
Routes: Rutas
Search routes by id: Buscar rutas por identificador
New route: Nueva ruta
New route: Nueva ruta
route: ruta

View File

@ -61,6 +61,7 @@ Invoice: Factura
You are going to delete this ticket: Vas a eliminar este ticket
Ticket deleted: Ticket borrado
Search ticket by id or alias: Buscar tickets por identificador o alias
ticket: ticket
#sections
List: Listado

View File

@ -13,6 +13,8 @@ Received: Recibido
Travel id: Id envío
Search travels by id: Buscar envíos por identificador
New travel: Nuevo envío
travel: envio
# Sections
Travels: Envíos
Log: Historial

View File

@ -71,7 +71,7 @@
<vn-tr ng-repeat="entry in $ctrl.entries">
<vn-td shrink>
<vn-check
value="{{entry.isConfirmed}}"
ng-model="entry.isConfirmed"
disabled="true">
</vn-check>
</vn-td>
@ -109,15 +109,15 @@
<vn-td shrink><strong>{{$ctrl.total('hb')}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('freightValue') | currency: 'EUR': 2}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('packageValue') | currency: 'EUR': 2}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('cc')}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('pallet')}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('m3')}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('cc') | number:2}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('pallet') | number:2}}</strong></vn-td>
<vn-td shrink><strong>{{$ctrl.total('m3') | number:2}}</strong></vn-td>
<vn-td></vn-td>
</vn-tr>
</vn-tfoot>
</vn-table>
</vn-auto>
<vn-auto>
<vn-auto ng-if="$ctrl.travelThermographs.length != 0">
<h4 translate>Thermographs</h4>
<vn-table>
<vn-thead>

View File

@ -18,3 +18,4 @@ User id: Id de usuario
View worker: Ver trabajador
Worker id: Id trabajador
Workers: Trabajadores
worker: trabajador

View File

@ -29,4 +29,5 @@ Volumetric: Volumétrico
Warehouse: Almacén
Warehouses: Almacenes
Week days: Días de la semana
Zones: Zonas
Zones: Zonas
zone: zona