diff --git a/front/salix/components/user-popover/index.js b/front/salix/components/user-popover/index.js
index e4d7b4466..0d35d8995 100644
--- a/front/salix/components/user-popover/index.js
+++ b/front/salix/components/user-popover/index.js
@@ -78,10 +78,6 @@ class Controller {
this.$.companies.refresh();
this.$.popover.show(event.target);
}
-
- getImageUrl(userId) {
- return '/api/Images/user/160x160/' + userId + '/download?access_token=' + this.vnToken.token;
- }
}
Controller.$inject = ['$scope', '$translate', 'vnConfig', 'vnAuth', 'vnToken'];
diff --git a/front/salix/components/user-popover/index.spec.js b/front/salix/components/user-popover/index.spec.js
index 7a088fc51..aaba3c189 100644
--- a/front/salix/components/user-popover/index.spec.js
+++ b/front/salix/components/user-popover/index.spec.js
@@ -2,14 +2,16 @@ import './index.js';
describe('Salix', () => {
describe('Component vnUserPopover', () => {
+ const userId = 9;
let controller;
let $scope;
+ let $root;
beforeEach(ngModule('salix'));
beforeEach(inject(($componentController, $rootScope, $httpBackend) => {
$httpBackend.expectGET('UserConfigs/getUserConfig');
-
+ $root = $rootScope;
$scope = $rootScope.$new();
controller = $componentController('vnUserPopover', {$scope});
}));
@@ -60,9 +62,10 @@ describe('Salix', () => {
describe('getImageUrl()', () => {
it('should return de url image', () => {
- const url = controller.getImageUrl();
+ const url = $root.imagePath('user', '160x160', userId);
expect(url).toBeDefined();
+ expect(url).toEqual(`/api/Images/user/160x160/${userId}/download?access_token=null`);
});
});
});
diff --git a/front/salix/module.js b/front/salix/module.js
index 2c61af4d1..a8de61ae0 100644
--- a/front/salix/module.js
+++ b/front/salix/module.js
@@ -7,9 +7,14 @@ export const appName = 'salix';
const ngModule = ng.module('salix', ['vnCore']);
export default ngModule;
-run.$inject = ['$window', '$rootScope', 'vnAuth', 'vnApp', '$state'];
-export function run($window, $rootScope, vnAuth, vnApp, $state) {
- $rootScope.imagePath = appConfig.imagePath;
+run.$inject = ['$window', '$rootScope', 'vnAuth', 'vnApp', 'vnToken', '$state'];
+export function run($window, $rootScope, vnAuth, vnApp, vnToken, $state) {
+ $rootScope.imagePath = (collection, size, id) => {
+ if (!collection || !size || !id) return;
+
+ const basePath = `/api/Images/${collection}/${size}/${id}`;
+ return `${basePath}/download?access_token=${vnToken.token}`;
+ };
$window.validations = {};
vnApp.name = appName;
diff --git a/loopback/common/models/container.js b/loopback/common/models/container.js
new file mode 100644
index 000000000..f24982021
--- /dev/null
+++ b/loopback/common/models/container.js
@@ -0,0 +1,57 @@
+const md5 = require('md5');
+
+module.exports = function(Self) {
+ Self.setup = function() {
+ Self.super_.setup.call(this);
+
+ this.remoteMethod('allowedContentTypes', {
+ description: 'Returns a list of allowed contentTypes',
+ accessType: 'READ',
+ returns: {
+ type: ['Object'],
+ root: true
+ },
+ http: {
+ path: `/allowedContentTypes`,
+ verb: 'GET'
+ }
+ });
+ };
+
+ /**
+ * Returns a container instance
+ * If doesn't exists creates a new one
+ *
+ * @param {String} name Container name
+ * @return {Object} Container instance
+ */
+ Self.container = async function(name) {
+ const models = Self.app.models;
+ let container;
+ try {
+ container = await models[this.modelName].getContainer(name);
+ } catch (err) {
+ if (err.code === 'ENOENT') {
+ container = await models[this.modelName].createContainer({
+ name: name
+ });
+ } else throw err;
+ }
+
+ return container;
+ };
+
+ Self.getHash = function(id) {
+ return md5(id.toString()).substring(0, 3);
+ };
+
+ Self.getFileExtension = function(fileName) {
+ return fileName.split('.').pop().toLowerCase();
+ };
+
+ Self.allowedContentTypes = async function() {
+ const connector = this.dataSource.connector;
+ const allowedContentTypes = connector.allowedContentTypes;
+ return allowedContentTypes;
+ };
+};
diff --git a/loopback/common/models/container.json b/loopback/common/models/container.json
new file mode 100644
index 000000000..da4811028
--- /dev/null
+++ b/loopback/common/models/container.json
@@ -0,0 +1,12 @@
+{
+ "name": "Container",
+ "base": "VnModel",
+ "acls": [
+ {
+ "property": "status",
+ "principalType": "ROLE",
+ "principalId": "$everyone",
+ "permission": "ALLOW"
+ }
+ ]
+}
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 769ccc1bd..4c7deb8fd 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -162,5 +162,6 @@
"You need to fill sage information before you check verified data": "Debes rellenar la información de sage antes de marcar datos comprobados",
"ASSIGN_ZONE_FIRST": "Asigna una zona primero",
"You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria",
+ "You can't upload images on the test environment": "No puedes subir imágenes en el entorno de pruebas",
"Sorts whole route": "Reordena ruta entera"
}
\ No newline at end of file
diff --git a/loopback/server/boot/storage.js b/loopback/server/boot/storage.js
deleted file mode 100644
index 12662ab73..000000000
--- a/loopback/server/boot/storage.js
+++ /dev/null
@@ -1,18 +0,0 @@
-const uuid = require('uuid/v1');
-const md5 = require('md5');
-
-module.exports = app => {
- const storageConnector = app.dataSources.storage.connector;
-
- storageConnector.getFilename = function(file) {
- return `${uuid()}.${storageConnector.getFileExtension(file.name)}`;
- };
-
- storageConnector.getFileExtension = function(fileName) {
- return fileName.split('.').pop().toLowerCase();
- };
-
- storageConnector.getPathHash = function(id) {
- return md5(id.toString()).substring(0, 3);
- };
-};
diff --git a/loopback/server/datasources.json b/loopback/server/datasources.json
index 0ea634484..8ce442b8e 100644
--- a/loopback/server/datasources.json
+++ b/loopback/server/datasources.json
@@ -17,11 +17,11 @@
"connectTimeout": 40000,
"acquireTimeout": 20000
},
- "storage": {
- "name": "storage",
+ "tempStorage": {
+ "name": "tempStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
- "root": "./e2e/dms",
+ "root": "./storage/tmp",
"maxFileSize": "262144000",
"allowedContentTypes": [
"application/x-7z-compressed",
@@ -36,5 +36,37 @@
"image/jpeg",
"image/jpg"
]
+ },
+ "dmsStorage": {
+ "name": "dmsStorage",
+ "connector": "loopback-component-storage",
+ "provider": "filesystem",
+ "root": "./storage/dms",
+ "maxFileSize": "262144000",
+ "allowedContentTypes": [
+ "application/x-7z-compressed",
+ "application/x-zip-compressed",
+ "application/x-rar-compressed",
+ "application/octet-stream",
+ "application/pdf",
+ "application/zip",
+ "application/rar",
+ "multipart/x-zip",
+ "image/png",
+ "image/jpeg",
+ "image/jpg"
+ ]
+ },
+ "imageStorage": {
+ "name": "imageStorage",
+ "connector": "loopback-component-storage",
+ "provider": "filesystem",
+ "root": "./storage/image",
+ "maxFileSize": "52428800",
+ "allowedContentTypes": [
+ "image/png",
+ "image/jpeg",
+ "image/jpg"
+ ]
}
}
diff --git a/loopback/server/model-config.json b/loopback/server/model-config.json
index 20e22accd..ff1a2daa2 100644
--- a/loopback/server/model-config.json
+++ b/loopback/server/model-config.json
@@ -49,5 +49,8 @@
},
"Application": {
"dataSource": "vn"
+ },
+ "Container": {
+ "dataSource": "vn"
}
}
\ No newline at end of file
diff --git a/modules/claim/back/methods/claim-dms/allowedContentTypes.js b/modules/claim/back/methods/claim-dms/allowedContentTypes.js
index 2f5183f92..3d4b90876 100644
--- a/modules/claim/back/methods/claim-dms/allowedContentTypes.js
+++ b/modules/claim/back/methods/claim-dms/allowedContentTypes.js
@@ -13,7 +13,7 @@ module.exports = Self => {
});
Self.allowedContentTypes = async() => {
- const storageConnector = Self.app.dataSources.storage.connector;
+ const storageConnector = Self.app.dataSources.dmsStorage.connector;
const allowedContentTypes = storageConnector.allowedContentTypes;
const modelAllowedContentTypes = Self.definition.settings.allowedContentTypes;
diff --git a/modules/client/back/methods/client-dms/allowedContentTypes.js b/modules/client/back/methods/client-dms/allowedContentTypes.js
deleted file mode 100644
index 2f5183f92..000000000
--- a/modules/client/back/methods/client-dms/allowedContentTypes.js
+++ /dev/null
@@ -1,23 +0,0 @@
-module.exports = Self => {
- Self.remoteMethodCtx('allowedContentTypes', {
- description: 'Returns a list of allowed contentTypes',
- accessType: 'READ',
- returns: {
- type: ['Object'],
- root: true
- },
- http: {
- path: `/allowedContentTypes`,
- verb: 'GET'
- }
- });
-
- Self.allowedContentTypes = async() => {
- const storageConnector = Self.app.dataSources.storage.connector;
- const allowedContentTypes = storageConnector.allowedContentTypes;
- const modelAllowedContentTypes = Self.definition.settings.allowedContentTypes;
-
- return modelAllowedContentTypes || allowedContentTypes;
- };
-};
-
diff --git a/modules/client/back/models/client-dms.js b/modules/client/back/models/client-dms.js
index 0cffb042c..9e5da9132 100644
--- a/modules/client/back/models/client-dms.js
+++ b/modules/client/back/models/client-dms.js
@@ -1,4 +1,3 @@
module.exports = Self => {
require('../methods/client-dms/removeFile')(Self);
- require('../methods/client-dms/allowedContentTypes')(Self);
};
diff --git a/modules/client/front/dms/create/index.js b/modules/client/front/dms/create/index.js
index 3c3f20100..461d0aa36 100644
--- a/modules/client/front/dms/create/index.js
+++ b/modules/client/front/dms/create/index.js
@@ -26,7 +26,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('clientDms/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/client/front/dms/create/index.spec.js b/modules/client/front/dms/create/index.spec.js
index 0ed3f6671..5fa1a3835 100644
--- a/modules/client/front/dms/create/index.spec.js
+++ b/modules/client/front/dms/create/index.spec.js
@@ -62,7 +62,7 @@ describe('Client', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `clientDms/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/client/front/dms/edit/index.js b/modules/client/front/dms/edit/index.js
index 2b8a7046d..8765eeff2 100644
--- a/modules/client/front/dms/edit/index.js
+++ b/modules/client/front/dms/edit/index.js
@@ -17,7 +17,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('clientDms/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/client/front/dms/edit/index.spec.js b/modules/client/front/dms/edit/index.spec.js
index e52ab7f7b..d063db57d 100644
--- a/modules/client/front/dms/edit/index.spec.js
+++ b/modules/client/front/dms/edit/index.spec.js
@@ -69,7 +69,7 @@ describe('Client', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `clientDms/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html
index 4e0c6ded8..6ab675d76 100644
--- a/modules/entry/front/latest-buys/index.html
+++ b/modules/entry/front/latest-buys/index.html
@@ -70,8 +70,8 @@
diff --git a/modules/item/back/methods/item-image-queue/downloadImages.js b/modules/item/back/methods/item-image-queue/downloadImages.js
index d953d1938..ce52c103b 100644
--- a/modules/item/back/methods/item-image-queue/downloadImages.js
+++ b/modules/item/back/methods/item-image-queue/downloadImages.js
@@ -33,8 +33,10 @@ module.exports = Self => {
// Exit loop
if (!image) return clearInterval(timer);
- const fileName = `${image.itemFk}.png`;
- const filePath = path.join(tempPath, fileName);
+ const srcFile = image.url.split('/').pop();
+ const fileName = srcFile.split('.')[0];
+ const file = `${fileName}.png`;
+ const filePath = path.join(tempPath, file);
const writeStream = fs.createWriteStream(filePath);
writeStream.on('open', () => {
@@ -57,7 +59,7 @@ module.exports = Self => {
writeStream.on('finish', async function() {
try {
- await models.Image.registerImage('catalog', fileName, filePath);
+ await models.Image.registerImage('catalog', filePath, fileName, image.itemFk);
await image.destroy();
} catch (error) {
await errorHandler(image.itemFk, error, filePath);
diff --git a/modules/item/front/card/index.html b/modules/item/front/card/index.html
index f547a9e7a..b7513a42a 100644
--- a/modules/item/front/card/index.html
+++ b/modules/item/front/card/index.html
@@ -1,5 +1,5 @@
-
+
diff --git a/modules/item/front/descriptor/index.html b/modules/item/front/descriptor/index.html
index 917c274d0..f20ddf2ea 100644
--- a/modules/item/front/descriptor/index.html
+++ b/modules/item/front/descriptor/index.html
@@ -16,19 +16,15 @@
-
-
-
-
-
-
+
+
+
+
@@ -102,4 +98,10 @@
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/item/front/descriptor/index.js b/modules/item/front/descriptor/index.js
index 2791e960a..195a97d13 100644
--- a/modules/item/front/descriptor/index.js
+++ b/modules/item/front/descriptor/index.js
@@ -3,6 +3,11 @@ import Descriptor from 'salix/components/descriptor';
import './style.scss';
class Controller extends Descriptor {
+ constructor($element, $, $rootScope) {
+ super($element, $);
+ this.$rootScope = $rootScope;
+ }
+
get item() {
return this.entity;
}
@@ -65,13 +70,27 @@ class Controller extends Descriptor {
this.$http.post(`Items/${this.item.id}/clone`)
.then(res => this.$state.go('item.card.tags', {id: res.data.id}));
}
+
+ onUploadResponse() {
+ const timestamp = new Date().getTime();
+ const src = this.$rootScope.imagePath('catalog', '200x200', this.item.id);
+ const zoomSrc = this.$rootScope.imagePath('catalog', '1600x900', this.item.id);
+ const newSrc = `${src}&t=${timestamp}`;
+ const newZoomSrc = `${zoomSrc}&t=${timestamp}`;
+
+ this.$.photo.setAttribute('src', newSrc);
+ this.$.photo.setAttribute('zoom-image', newZoomSrc);
+ }
}
+Controller.$inject = ['$element', '$scope', '$rootScope'];
+
ngModule.vnComponent('vnItemDescriptor', {
template: require('./index.html'),
controller: Controller,
bindings: {
item: '<',
- dated: '<'
+ dated: '<',
+ cardReload: '&'
}
});
diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html
index 0d4ae61f3..8b03bc0d6 100644
--- a/modules/item/front/index/index.html
+++ b/modules/item/front/index/index.html
@@ -35,8 +35,8 @@
ui-sref="item.card.summary({id: item.id})">
@@ -44,7 +44,7 @@
- {{::item.id | zeroFill:6}}
+ {{::item.id}}
{{::item.grouping | dashIfEmpty}}
diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html
index e9c835dac..5fb556bd4 100644
--- a/modules/item/front/summary/index.html
+++ b/modules/item/front/summary/index.html
@@ -11,8 +11,8 @@
+ ng-src="{{$root.imagePath('catalog', '200x200', $ctrl.item.id)}}"
+ zoom-image="{{$root.imagePath('catalog', '1600x900', $ctrl.item.id)}}" on-error-src/>
Visible
diff --git a/modules/order/front/catalog-view/index.html b/modules/order/front/catalog-view/index.html
index 2d7492d87..25d84db75 100644
--- a/modules/order/front/catalog-view/index.html
+++ b/modules/order/front/catalog-view/index.html
@@ -5,11 +5,11 @@
diff --git a/modules/order/front/line/index.html b/modules/order/front/line/index.html
index 1ba6e3f9c..51702e16e 100644
--- a/modules/order/front/line/index.html
+++ b/modules/order/front/line/index.html
@@ -32,8 +32,8 @@
diff --git a/modules/route/front/create/index.html b/modules/route/front/create/index.html
index 754bed9f4..1a9a4b96d 100644
--- a/modules/route/front/create/index.html
+++ b/modules/route/front/create/index.html
@@ -26,6 +26,7 @@
label="Vehicle"
ng-model="$ctrl.route.vehicleFk"
url="Vehicles"
+ where="{warehouseFk: $ctrl.vnConfig.warehouseFk}"
show-field="numberPlate">
{
+ Self.remoteMethodCtx('consumption', {
+ description: 'Find all instances of the model matched by filter from the data source.',
+ accessType: 'READ',
+ accepts: [
+ {
+ arg: 'filter',
+ type: 'Object',
+ description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string'
+ }, {
+ arg: 'search',
+ type: 'String',
+ description: `If it's and integer searchs by id, otherwise it searchs by name`
+ }, {
+ arg: 'itemId',
+ type: 'Number',
+ description: 'Item id'
+ }, {
+ arg: 'categoryId',
+ type: 'Number',
+ description: 'Category id'
+ }, {
+ arg: 'typeId',
+ type: 'Number',
+ description: 'Item type id',
+ }, {
+ arg: 'buyerId',
+ type: 'Number',
+ description: 'Buyer id'
+ }, {
+ arg: 'from',
+ type: 'Date',
+ description: `The from date filter`
+ }, {
+ arg: 'to',
+ type: 'Date',
+ description: `The to date filter`
+ }
+ ],
+ returns: {
+ type: ['Object'],
+ root: true
+ },
+ http: {
+ path: `/consumption`,
+ verb: 'GET'
+ }
+ });
+
+ Self.consumption = async(ctx, filter) => {
+ const conn = Self.dataSource.connector;
+ const where = buildFilter(ctx.args, (param, value) => {
+ switch (param) {
+ case 'search':
+ return /^\d+$/.test(value)
+ ? {'i.id': value}
+ : {'i.name': {like: `%${value}%`}};
+ case 'itemId':
+ return {'i.id': value};
+ case 'description':
+ return {'i.description': {like: `%${value}%`}};
+ case 'categoryId':
+ return {'it.categoryFk': value};
+ case 'typeId':
+ return {'it.id': value};
+ case 'buyerId':
+ return {'it.workerFk': value};
+ case 'from':
+ return {'t.shipped': {gte: value}};
+ case 'to':
+ return {'t.shipped': {lte: value}};
+ }
+ });
+
+ filter = mergeFilters(filter, {where});
+ let stmts = [];
+ let stmt;
+
+ stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.entry');
+
+ stmt = new ParameterizedSQL(
+ `CREATE TEMPORARY TABLE tmp.entry
+ (INDEX (id))
+ ENGINE = MEMORY
+ SELECT
+ e.id,
+ e.ref,
+ e.supplierFk,
+ t.shipped
+ FROM vn.entry e
+ JOIN vn.travel t ON t.id = e.travelFk
+ JOIN buy b ON b.id = b.entryFk
+ JOIN item i ON i.id = b.itemFk
+ JOIN itemType it ON it.id = i.typeFk`);
+ stmt.merge(conn.makeWhere(filter.where));
+ stmt.merge(conn.makeGroupBy('e.id'));
+ stmt.merge(conn.makeLimit(filter));
+ stmts.push(stmt);
+
+ const entriesIndex = stmts.push('SELECT * FROM tmp.entry') - 1;
+ stmt = new ParameterizedSQL(
+ `SELECT
+ b.id AS buyId,
+ b.itemFk,
+ b.entryFk,
+ b.quantity,
+ CAST(b.buyingValue AS DECIMAL(10,2)) AS price,
+ CAST(SUM(b.buyingValue*b.quantity)AS DECIMAL(10,2)) AS total,
+ i.id,
+ i.description,
+ i.name AS itemName,
+ i.subName,
+ i.size AS itemSize,
+ i.typeFk AS itemTypeFk,
+ i.tag5,
+ i.value5,
+ i.tag6,
+ i.value6,
+ i.tag7,
+ i.value7,
+ i.tag8,
+ i.value8,
+ i.tag9,
+ i.value9,
+ i.tag10,
+ i.value10,
+ it.id,
+ it.workerFk,
+ it.categoryFk,
+ it.code AS itemTypeCode
+ FROM buy b
+ JOIN tmp.entry e ON e.id = b.entryFk
+ JOIN item i ON i.id = b.itemFk
+ JOIN itemType it ON it.id = i.typeFk`
+ );
+ stmt.merge('WHERE b.quantity > 0');
+ stmt.merge(conn.makeGroupBy('b.id'));
+ stmt.merge(conn.makeOrderBy(filter.order));
+ const buysIndex = stmts.push(stmt) - 1;
+ stmts.push(`DROP TEMPORARY TABLE tmp.entry`);
+ const sql = ParameterizedSQL.join(stmts, ';');
+
+ const result = await conn.executeStmt(sql);
+
+ const entries = result[entriesIndex];
+ const buys = result[buysIndex];
+ const entriesMap = new Map();
+
+ for (let entry of entries)
+ entriesMap.set(entry.id, entry);
+
+ for (let buy of buys) {
+ const entry = entriesMap.get(buy.entryFk);
+
+ if (entry) {
+ if (!entry.buys) entry.buys = [];
+
+ entry.buys.push(buy);
+ }
+ }
+ return entries;
+ };
+};
diff --git a/modules/supplier/back/methods/supplier/specs/consumption.spec.js b/modules/supplier/back/methods/supplier/specs/consumption.spec.js
new file mode 100644
index 000000000..0e8f3afcc
--- /dev/null
+++ b/modules/supplier/back/methods/supplier/specs/consumption.spec.js
@@ -0,0 +1,36 @@
+const app = require('vn-loopback/server/server');
+
+describe('supplier consumption() filter', () => {
+ it('should return a list of entries from the supplier 2', async() => {
+ const ctx = {req: {accessToken: {userId: 9}}, args: {}};
+ const filter = {
+ where: {
+ supplierFk: 2
+ },
+ order: 'itemTypeFk, itemName, itemSize'
+ };
+ const result = await app.models.Supplier.consumption(ctx, filter);
+
+ expect(result.length).toEqual(6);
+ });
+
+ it('should return a list of entries from the item id 1 and supplier 1', async() => {
+ const ctx = {req: {accessToken: {userId: 9}},
+ args: {
+ itemId: 1
+ }
+ };
+ const filter = {
+ where: {
+ supplierFk: 1
+ },
+ order: 'itemTypeFk, itemName, itemSize'
+ };
+ const result = await app.models.Supplier.consumption(ctx, filter);
+
+ const expectedItemId = 1;
+ const firstRowBuys = result[0].buys[0];
+
+ expect(firstRowBuys.itemFk).toEqual(expectedItemId);
+ });
+});
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 73fd9d854..a95df9f20 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -5,6 +5,7 @@ module.exports = Self => {
require('../methods/supplier/filter')(Self);
require('../methods/supplier/getSummary')(Self);
require('../methods/supplier/updateFiscalData')(Self);
+ require('../methods/supplier/consumption')(Self);
Self.validatesPresenceOf('name', {
message: 'The social name cannot be empty'
diff --git a/modules/supplier/front/consumption-search-panel/index.html b/modules/supplier/front/consumption-search-panel/index.html
new file mode 100644
index 000000000..e957c891b
--- /dev/null
+++ b/modules/supplier/front/consumption-search-panel/index.html
@@ -0,0 +1,68 @@
+
diff --git a/modules/supplier/front/consumption-search-panel/index.js b/modules/supplier/front/consumption-search-panel/index.js
new file mode 100644
index 000000000..f6c63c55c
--- /dev/null
+++ b/modules/supplier/front/consumption-search-panel/index.js
@@ -0,0 +1,7 @@
+import ngModule from '../module';
+import SearchPanel from 'core/components/searchbar/search-panel';
+
+ngModule.vnComponent('vnSupplierConsumptionSearchPanel', {
+ template: require('./index.html'),
+ controller: SearchPanel
+});
diff --git a/modules/supplier/front/consumption-search-panel/locale/es.yml b/modules/supplier/front/consumption-search-panel/locale/es.yml
new file mode 100644
index 000000000..f136283f8
--- /dev/null
+++ b/modules/supplier/front/consumption-search-panel/locale/es.yml
@@ -0,0 +1,7 @@
+Item id: Id artículo
+From: Desde
+To: Hasta
+Campaign: Campaña
+allSaints: Día de todos los Santos
+valentinesDay: Día de San Valentín
+mothersDay: Día de la madre
\ No newline at end of file
diff --git a/modules/supplier/front/consumption/index.html b/modules/supplier/front/consumption/index.html
new file mode 100644
index 000000000..a0df60ea9
--- /dev/null
+++ b/modules/supplier/front/consumption/index.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Entry
+ {{::entry.id}}
+ Date
+ {{::entry.shipped | date: 'dd/MM/yyyy'}}
+ Reference
+ {{::entry.ref}}
+
+
+
+
+
+
+ {{::buy.itemName}}
+
+
+
+
+
+
+ {{::buy.quantity | dashIfEmpty}}
+ {{::buy.price | dashIfEmpty}}
+ {{::buy.total | dashIfEmpty}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/supplier/front/consumption/index.js b/modules/supplier/front/consumption/index.js
new file mode 100644
index 000000000..9e1357a9f
--- /dev/null
+++ b/modules/supplier/front/consumption/index.js
@@ -0,0 +1,65 @@
+import ngModule from '../module';
+import Section from 'salix/components/section';
+
+class Controller extends Section {
+ constructor($element, $, vnReport, vnEmail) {
+ super($element, $);
+ this.vnReport = vnReport;
+ this.vnEmail = vnEmail;
+
+ this.setDefaultFilter();
+ }
+
+ setDefaultFilter() {
+ const minDate = new Date();
+ minDate.setHours(0, 0, 0, 0);
+ minDate.setMonth(minDate.getMonth() - 2);
+
+ const maxDate = new Date();
+ maxDate.setHours(23, 59, 59, 59);
+
+ this.filterParams = {
+ from: minDate,
+ to: maxDate
+ };
+ }
+
+ get reportParams() {
+ const userParams = this.$.model.userParams;
+ return Object.assign({
+ authorization: this.vnToken.token,
+ recipientId: this.supplier.id
+ }, userParams);
+ }
+
+ showReport() {
+ this.vnReport.show('supplier-campaign-metrics', this.reportParams);
+ }
+
+ sendEmail() {
+ this.vnEmail.send('supplier-campaign-metrics', this.reportParams);
+ }
+
+ getTotal(entry) {
+ if (entry.buys) {
+ let total = 0;
+ for (let buy of entry.buys)
+ total += buy.total;
+
+ return total;
+ }
+ }
+}
+
+Controller.$inject = ['$element', '$scope', 'vnReport', 'vnEmail'];
+
+ngModule.vnComponent('vnSupplierConsumption', {
+ template: require('./index.html'),
+ controller: Controller,
+ bindings: {
+ supplier: '<'
+ },
+ require: {
+ card: '^vnSupplierCard'
+ }
+});
diff --git a/modules/supplier/front/consumption/index.spec.js b/modules/supplier/front/consumption/index.spec.js
new file mode 100644
index 000000000..35eb6935c
--- /dev/null
+++ b/modules/supplier/front/consumption/index.spec.js
@@ -0,0 +1,72 @@
+import './index.js';
+import crudModel from 'core/mocks/crud-model';
+
+describe('Supplier', () => {
+ describe('Component vnSupplierConsumption', () => {
+ let $scope;
+ let controller;
+ let $httpParamSerializer;
+ let $httpBackend;
+
+ beforeEach(ngModule('supplier'));
+
+ beforeEach(inject(($componentController, $rootScope, _$httpParamSerializer_, _$httpBackend_) => {
+ $scope = $rootScope.$new();
+ $httpParamSerializer = _$httpParamSerializer_;
+ $httpBackend = _$httpBackend_;
+ const $element = angular.element(' {
+ it('should call the window.open function', () => {
+ jest.spyOn(window, 'open').mockReturnThis();
+
+ const now = new Date();
+ controller.$.model.userParams = {
+ from: now,
+ to: now
+ };
+
+ controller.showReport();
+
+ const expectedParams = {
+ recipientId: 2,
+ from: now,
+ to: now
+ };
+ const serializedParams = $httpParamSerializer(expectedParams);
+ const path = `api/report/supplier-campaign-metrics?${serializedParams}`;
+
+ expect(window.open).toHaveBeenCalledWith(path);
+ });
+ });
+
+ describe('sendEmail()', () => {
+ it('should make a GET query sending the report', () => {
+ const now = new Date();
+ controller.$.model.userParams = {
+ from: now,
+ to: now
+ };
+ const expectedParams = {
+ recipientId: 2,
+ from: now,
+ to: now
+ };
+
+ const serializedParams = $httpParamSerializer(expectedParams);
+ const path = `email/supplier-campaign-metrics?${serializedParams}`;
+
+ $httpBackend.expect('GET', path).respond({});
+ controller.sendEmail();
+ $httpBackend.flush();
+ });
+ });
+ });
+});
+
diff --git a/modules/supplier/front/consumption/locale/es.yml b/modules/supplier/front/consumption/locale/es.yml
new file mode 100644
index 000000000..dd052696c
--- /dev/null
+++ b/modules/supplier/front/consumption/locale/es.yml
@@ -0,0 +1,2 @@
+
+Total entry: Total entrada
diff --git a/modules/supplier/front/index.js b/modules/supplier/front/index.js
index 22f402a0c..9a9334c41 100644
--- a/modules/supplier/front/index.js
+++ b/modules/supplier/front/index.js
@@ -10,4 +10,6 @@ import './basic-data';
import './fiscal-data';
import './contact';
import './log';
+import './consumption';
+import './consumption-search-panel';
import './billing-data';
diff --git a/modules/supplier/front/routes.json b/modules/supplier/front/routes.json
index 47f742a70..54d203c8c 100644
--- a/modules/supplier/front/routes.json
+++ b/modules/supplier/front/routes.json
@@ -13,7 +13,8 @@
{"state": "supplier.card.fiscalData", "icon": "account_balance"},
{"state": "supplier.card.billingData", "icon": "icon-payment"},
{"state": "supplier.card.contact", "icon": "contact_phone"},
- {"state": "supplier.card.log", "icon": "history"}
+ {"state": "supplier.card.log", "icon": "history"},
+ {"state": "supplier.card.consumption", "icon": "show_chart"}
]
},
"routes": [
@@ -77,6 +78,15 @@
"supplier": "$ctrl.supplier"
}
},
+ {
+ "url": "/consumption?q",
+ "state": "supplier.card.consumption",
+ "component": "vn-supplier-consumption",
+ "description": "Consumption",
+ "params": {
+ "supplier": "$ctrl.supplier"
+ }
+ },
{
"url": "/billing-data",
"state": "supplier.card.billingData",
diff --git a/modules/ticket/back/methods/ticket-dms/allowedContentTypes.js b/modules/ticket/back/methods/ticket-dms/allowedContentTypes.js
deleted file mode 100644
index 2f5183f92..000000000
--- a/modules/ticket/back/methods/ticket-dms/allowedContentTypes.js
+++ /dev/null
@@ -1,23 +0,0 @@
-module.exports = Self => {
- Self.remoteMethodCtx('allowedContentTypes', {
- description: 'Returns a list of allowed contentTypes',
- accessType: 'READ',
- returns: {
- type: ['Object'],
- root: true
- },
- http: {
- path: `/allowedContentTypes`,
- verb: 'GET'
- }
- });
-
- Self.allowedContentTypes = async() => {
- const storageConnector = Self.app.dataSources.storage.connector;
- const allowedContentTypes = storageConnector.allowedContentTypes;
- const modelAllowedContentTypes = Self.definition.settings.allowedContentTypes;
-
- return modelAllowedContentTypes || allowedContentTypes;
- };
-};
-
diff --git a/modules/ticket/back/models/ticket-dms.js b/modules/ticket/back/models/ticket-dms.js
index 8a6d03434..ddb338632 100644
--- a/modules/ticket/back/models/ticket-dms.js
+++ b/modules/ticket/back/models/ticket-dms.js
@@ -1,4 +1,3 @@
module.exports = Self => {
require('../methods/ticket-dms/removeFile')(Self);
- require('../methods/ticket-dms/allowedContentTypes')(Self);
};
diff --git a/modules/ticket/front/dms/create/index.js b/modules/ticket/front/dms/create/index.js
index 142158e46..b25abf17c 100644
--- a/modules/ticket/front/dms/create/index.js
+++ b/modules/ticket/front/dms/create/index.js
@@ -25,7 +25,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('ticketDms/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/ticket/front/dms/create/index.spec.js b/modules/ticket/front/dms/create/index.spec.js
index e3c195799..15017daf9 100644
--- a/modules/ticket/front/dms/create/index.spec.js
+++ b/modules/ticket/front/dms/create/index.spec.js
@@ -67,7 +67,7 @@ describe('Ticket', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `ticketDms/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/ticket/front/dms/edit/index.js b/modules/ticket/front/dms/edit/index.js
index e50092f77..808ca6a6a 100644
--- a/modules/ticket/front/dms/edit/index.js
+++ b/modules/ticket/front/dms/edit/index.js
@@ -16,7 +16,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('ticketDms/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/ticket/front/dms/edit/index.spec.js b/modules/ticket/front/dms/edit/index.spec.js
index 052b08a1b..15ab588f7 100644
--- a/modules/ticket/front/dms/edit/index.spec.js
+++ b/modules/ticket/front/dms/edit/index.spec.js
@@ -69,7 +69,7 @@ describe('Ticket', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `ticketDms/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/ticket/front/picture/index.html b/modules/ticket/front/picture/index.html
index 52cab5b31..c95e604dd 100644
--- a/modules/ticket/front/picture/index.html
+++ b/modules/ticket/front/picture/index.html
@@ -19,8 +19,8 @@
diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html
index 90cfa39d1..ed3cbc02b 100644
--- a/modules/ticket/front/sale/index.html
+++ b/modules/ticket/front/sale/index.html
@@ -93,8 +93,8 @@
diff --git a/modules/travel/back/methods/travel-thermograph/allowedContentTypes.js b/modules/travel/back/methods/travel-thermograph/allowedContentTypes.js
deleted file mode 100644
index 2f5183f92..000000000
--- a/modules/travel/back/methods/travel-thermograph/allowedContentTypes.js
+++ /dev/null
@@ -1,23 +0,0 @@
-module.exports = Self => {
- Self.remoteMethodCtx('allowedContentTypes', {
- description: 'Returns a list of allowed contentTypes',
- accessType: 'READ',
- returns: {
- type: ['Object'],
- root: true
- },
- http: {
- path: `/allowedContentTypes`,
- verb: 'GET'
- }
- });
-
- Self.allowedContentTypes = async() => {
- const storageConnector = Self.app.dataSources.storage.connector;
- const allowedContentTypes = storageConnector.allowedContentTypes;
- const modelAllowedContentTypes = Self.definition.settings.allowedContentTypes;
-
- return modelAllowedContentTypes || allowedContentTypes;
- };
-};
-
diff --git a/modules/travel/back/models/travel-thermograph.js b/modules/travel/back/models/travel-thermograph.js
index a16e68b98..91aa4de69 100644
--- a/modules/travel/back/models/travel-thermograph.js
+++ b/modules/travel/back/models/travel-thermograph.js
@@ -1,5 +1,4 @@
module.exports = Self => {
- require('../methods/travel-thermograph/allowedContentTypes')(Self);
require('../methods/travel-thermograph/getThermographTemperatures')(Self);
};
diff --git a/modules/travel/front/thermograph/create/index.js b/modules/travel/front/thermograph/create/index.js
index 4b4cebb9f..666393350 100644
--- a/modules/travel/front/thermograph/create/index.js
+++ b/modules/travel/front/thermograph/create/index.js
@@ -21,7 +21,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('TravelThermographs/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
@@ -46,7 +46,7 @@ class Controller extends Section {
warehouseId: warehouseId,
companyId: companyId,
dmsTypeId: dmsTypeId,
- description: this.$t('FileDescription', {
+ description: this.$t('TravelFileDescription', {
travelId: this.travel.id
}).toUpperCase()
};
diff --git a/modules/travel/front/thermograph/create/index.spec.js b/modules/travel/front/thermograph/create/index.spec.js
index 36f17a409..c2b94d3e8 100644
--- a/modules/travel/front/thermograph/create/index.spec.js
+++ b/modules/travel/front/thermograph/create/index.spec.js
@@ -53,7 +53,7 @@ describe('Ticket', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['application/pdf', 'image/png', 'image/jpg'];
- $httpBackend.expect('GET', `TravelThermographs/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/travel/front/thermograph/edit/index.js b/modules/travel/front/thermograph/edit/index.js
index daa0f696b..a8df3142d 100644
--- a/modules/travel/front/thermograph/edit/index.js
+++ b/modules/travel/front/thermograph/edit/index.js
@@ -17,7 +17,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('TravelThermographs/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/travel/front/thermograph/edit/index.spec.js b/modules/travel/front/thermograph/edit/index.spec.js
index 68ce763c2..c0b044a8d 100644
--- a/modules/travel/front/thermograph/edit/index.spec.js
+++ b/modules/travel/front/thermograph/edit/index.spec.js
@@ -79,7 +79,7 @@ describe('Worker', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `TravelThermographs/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/travel/front/thermograph/locale/es.yml b/modules/travel/front/thermograph/locale/es.yml
index 0e3bc99fc..1fdb98c8e 100644
--- a/modules/travel/front/thermograph/locale/es.yml
+++ b/modules/travel/front/thermograph/locale/es.yml
@@ -8,7 +8,7 @@ Upload file: Subir fichero
Edit file: Editar fichero
Upload: Subir
File: Fichero
-FileDescription: Travel id {{travelId}}
+TravelFileDescription: Travel id {{travelId}}
ContentTypesInfo: 'Tipos de archivo permitidos: {{allowedContentTypes}}'
Are you sure you want to continue?: ¿Seguro que quieres continuar?
Add thermograph: Añadir termógrafo
diff --git a/modules/worker/back/methods/worker-dms/allowedContentTypes.js b/modules/worker/back/methods/worker-dms/allowedContentTypes.js
deleted file mode 100644
index 2f5183f92..000000000
--- a/modules/worker/back/methods/worker-dms/allowedContentTypes.js
+++ /dev/null
@@ -1,23 +0,0 @@
-module.exports = Self => {
- Self.remoteMethodCtx('allowedContentTypes', {
- description: 'Returns a list of allowed contentTypes',
- accessType: 'READ',
- returns: {
- type: ['Object'],
- root: true
- },
- http: {
- path: `/allowedContentTypes`,
- verb: 'GET'
- }
- });
-
- Self.allowedContentTypes = async() => {
- const storageConnector = Self.app.dataSources.storage.connector;
- const allowedContentTypes = storageConnector.allowedContentTypes;
- const modelAllowedContentTypes = Self.definition.settings.allowedContentTypes;
-
- return modelAllowedContentTypes || allowedContentTypes;
- };
-};
-
diff --git a/modules/worker/back/models/worker-dms.js b/modules/worker/back/models/worker-dms.js
index 4b862a81e..b9d6f9a77 100644
--- a/modules/worker/back/models/worker-dms.js
+++ b/modules/worker/back/models/worker-dms.js
@@ -1,7 +1,6 @@
module.exports = Self => {
require('../methods/worker-dms/downloadFile')(Self);
require('../methods/worker-dms/removeFile')(Self);
- require('../methods/worker-dms/allowedContentTypes')(Self);
require('../methods/worker-dms/filter')(Self);
Self.isMine = async function(ctx, dmsId) {
diff --git a/modules/worker/front/descriptor/index.html b/modules/worker/front/descriptor/index.html
index fb2264494..ad0b9e5c3 100644
--- a/modules/worker/front/descriptor/index.html
+++ b/modules/worker/front/descriptor/index.html
@@ -1,6 +1,18 @@
+
+
+
+
+
+
+
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/worker/front/descriptor/index.js b/modules/worker/front/descriptor/index.js
index 98f8f2f72..c5dc1ea2c 100644
--- a/modules/worker/front/descriptor/index.js
+++ b/modules/worker/front/descriptor/index.js
@@ -2,6 +2,11 @@ import ngModule from '../module';
import Descriptor from 'salix/components/descriptor';
class Controller extends Descriptor {
+ constructor($element, $, $rootScope) {
+ super($element, $);
+ this.$rootScope = $rootScope;
+ }
+
get worker() {
return this.entity;
}
@@ -48,8 +53,21 @@ class Controller extends Descriptor {
return this.getData(`Workers/${this.id}`, {filter})
.then(res => this.entity = res.data);
}
+
+ onUploadResponse() {
+ const timestamp = new Date().getTime();
+ const src = this.$rootScope.imagePath('user', '520x520', this.worker.id);
+ const zoomSrc = this.$rootScope.imagePath('user', '1600x900', this.worker.id);
+ const newSrc = `${src}&t=${timestamp}`;
+ const newZoomSrc = `${zoomSrc}&t=${timestamp}`;
+
+ this.$.photo.setAttribute('src', newSrc);
+ this.$.photo.setAttribute('zoom-image', newZoomSrc);
+ }
}
+Controller.$inject = ['$element', '$scope', '$rootScope'];
+
ngModule.vnComponent('vnWorkerDescriptor', {
template: require('./index.html'),
controller: Controller,
diff --git a/modules/worker/front/dms/create/index.js b/modules/worker/front/dms/create/index.js
index f712edaf3..ff6112211 100644
--- a/modules/worker/front/dms/create/index.js
+++ b/modules/worker/front/dms/create/index.js
@@ -26,7 +26,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('workerDms/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/worker/front/dms/create/index.spec.js b/modules/worker/front/dms/create/index.spec.js
index f0d088715..07a66b9dc 100644
--- a/modules/worker/front/dms/create/index.spec.js
+++ b/modules/worker/front/dms/create/index.spec.js
@@ -64,7 +64,7 @@ describe('Client', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `workerDms/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/worker/front/dms/edit/index.js b/modules/worker/front/dms/edit/index.js
index 68c851ff3..31d4c2853 100644
--- a/modules/worker/front/dms/edit/index.js
+++ b/modules/worker/front/dms/edit/index.js
@@ -17,7 +17,7 @@ class Controller extends Section {
}
getAllowedContentTypes() {
- this.$http.get('WorkerDms/allowedContentTypes').then(res => {
+ this.$http.get('DmsContainers/allowedContentTypes').then(res => {
const contentTypes = res.data.join(', ');
this.allowedContentTypes = contentTypes;
});
diff --git a/modules/worker/front/dms/edit/index.spec.js b/modules/worker/front/dms/edit/index.spec.js
index 3724a6c7c..44abc6d64 100644
--- a/modules/worker/front/dms/edit/index.spec.js
+++ b/modules/worker/front/dms/edit/index.spec.js
@@ -70,7 +70,7 @@ describe('Worker', () => {
describe('getAllowedContentTypes()', () => {
it('should make an HTTP GET request to get the allowed content types', () => {
const expectedResponse = ['image/png', 'image/jpg'];
- $httpBackend.expect('GET', `WorkerDms/allowedContentTypes`).respond(expectedResponse);
+ $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse);
controller.getAllowedContentTypes();
$httpBackend.flush();
diff --git a/modules/worker/front/dms/index/index.html b/modules/worker/front/dms/index/index.html
index ce236932f..d6e1bc25c 100644
--- a/modules/worker/front/dms/index/index.html
+++ b/modules/worker/front/dms/index/index.html
@@ -60,7 +60,7 @@
-
diff --git a/print/config/print.json b/print/config/print.json
index 5f4c0f7b8..bb7468281 100755
--- a/print/config/print.json
+++ b/print/config/print.json
@@ -43,6 +43,6 @@
"pool": true
},
"storage": {
- "root": "./e2e/dms"
+ "root": "./storage/dms"
}
}
\ No newline at end of file
diff --git a/print/templates/email/supplier-campaign-metrics/assets/css/import.js b/print/templates/email/supplier-campaign-metrics/assets/css/import.js
new file mode 100644
index 000000000..b44d6bd37
--- /dev/null
+++ b/print/templates/email/supplier-campaign-metrics/assets/css/import.js
@@ -0,0 +1,8 @@
+const Stylesheet = require(`${appPath}/core/stylesheet`);
+
+module.exports = new Stylesheet([
+ `${appPath}/common/css/spacing.css`,
+ `${appPath}/common/css/misc.css`,
+ `${appPath}/common/css/layout.css`,
+ `${appPath}/common/css/email.css`])
+ .mergeStyles();
diff --git a/print/templates/email/supplier-campaign-metrics/attachments.json b/print/templates/email/supplier-campaign-metrics/attachments.json
new file mode 100644
index 000000000..4eacb54db
--- /dev/null
+++ b/print/templates/email/supplier-campaign-metrics/attachments.json
@@ -0,0 +1,6 @@
+[
+ {
+ "filename": "supplier-campaign-metrics.pdf",
+ "component": "supplier-campaign-metrics"
+ }
+]
\ No newline at end of file
diff --git a/print/templates/email/supplier-campaign-metrics/locale/es.yml b/print/templates/email/supplier-campaign-metrics/locale/es.yml
new file mode 100644
index 000000000..d1c1182a2
--- /dev/null
+++ b/print/templates/email/supplier-campaign-metrics/locale/es.yml
@@ -0,0 +1,8 @@
+subject: Informe de consumo
+title: Informe de consumo
+dear: Estimado cliente
+description: Tal y como nos ha solicitado nos complace
+ relacionarle a continuación el consumo que nos consta en su cuenta para las
+ fechas comprendidas entre {0} y {1}.
+ Espero le sea de utilidad para preparar su pedido.
+ Al mismo tiempo aprovecho la ocasión para saludarle cordialmente.
diff --git a/print/templates/email/supplier-campaign-metrics/supplier-campaign-metrics.html b/print/templates/email/supplier-campaign-metrics/supplier-campaign-metrics.html
new file mode 100644
index 000000000..9d7014f34
--- /dev/null
+++ b/print/templates/email/supplier-campaign-metrics/supplier-campaign-metrics.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+ {{ $t('subject') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('title') }}
+ {{$t('dear')}},
+
+
+
+
+
+
+
+ |
+
+
+
+
+
\ No newline at end of file
diff --git a/print/templates/email/supplier-campaign-metrics/supplier-campaign-metrics.js b/print/templates/email/supplier-campaign-metrics/supplier-campaign-metrics.js
new file mode 100755
index 000000000..20113d8ea
--- /dev/null
+++ b/print/templates/email/supplier-campaign-metrics/supplier-campaign-metrics.js
@@ -0,0 +1,33 @@
+const Component = require(`${appPath}/core/component`);
+const emailHeader = new Component('email-header');
+const emailFooter = new Component('email-footer');
+
+module.exports = {
+ name: 'supplier-campaign-metrics',
+ created() {
+ this.filters = this.$options.filters;
+ },
+ computed: {
+ minDate: function() {
+ return this.filters.date(this.from, '%d-%m-%Y');
+ },
+ maxDate: function() {
+ return this.filters.date(this.to, '%d-%m-%Y');
+ }
+ },
+ components: {
+ 'email-header': emailHeader.build(),
+ 'email-footer': emailFooter.build()
+ },
+ props: {
+ recipientId: {
+ required: true
+ },
+ from: {
+ required: true
+ },
+ to: {
+ required: true
+ }
+ }
+};
diff --git a/print/templates/reports/supplier-campaign-metrics/assets/css/import.js b/print/templates/reports/supplier-campaign-metrics/assets/css/import.js
new file mode 100644
index 000000000..fd8796c2b
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/assets/css/import.js
@@ -0,0 +1,9 @@
+const Stylesheet = require(`${appPath}/core/stylesheet`);
+
+module.exports = new Stylesheet([
+ `${appPath}/common/css/spacing.css`,
+ `${appPath}/common/css/misc.css`,
+ `${appPath}/common/css/layout.css`,
+ `${appPath}/common/css/report.css`,
+ `${__dirname}/style.css`])
+ .mergeStyles();
diff --git a/print/templates/reports/supplier-campaign-metrics/assets/css/style.css b/print/templates/reports/supplier-campaign-metrics/assets/css/style.css
new file mode 100644
index 000000000..32caeb43c
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/assets/css/style.css
@@ -0,0 +1,20 @@
+.column-oriented {
+ margin-top: 0px;
+}
+
+.bottom-line > tr {
+ border-bottom: 1px solid #ccc;
+}
+
+.bottom-line tr:nth-last-child() {
+ border-bottom: none;
+}
+
+h2 {
+ font-weight: 100;
+ color: #555;
+}
+
+.description strong {
+ text-transform: uppercase;
+}
\ No newline at end of file
diff --git a/print/templates/reports/supplier-campaign-metrics/locale/es.yml b/print/templates/reports/supplier-campaign-metrics/locale/es.yml
new file mode 100644
index 000000000..31c1e17dd
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/locale/es.yml
@@ -0,0 +1,13 @@
+title: Consumo
+Supplier: Proveedor
+supplierData: Datos del proveedor
+dated: Fecha
+From: Desde
+To: Hasta
+supplier: Proveedor {0}
+reference: Referencia
+Quantity: Cantidad
+entry: Entrada
+itemName: Artículo
+price: Precio
+total: Total
\ No newline at end of file
diff --git a/print/templates/reports/supplier-campaign-metrics/sql/buys.sql b/print/templates/reports/supplier-campaign-metrics/sql/buys.sql
new file mode 100644
index 000000000..a094ac205
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/sql/buys.sql
@@ -0,0 +1,33 @@
+SELECT
+ b.id AS buyId,
+ b.itemFk,
+ b.entryFk,
+ CAST(b.buyingValue AS DECIMAL(10,2)) AS price,
+ b.quantity,
+ i.id,
+ i.description,
+ i.name AS itemName,
+ i.subName,
+ i.size AS itemSize,
+ i.typeFk AS itemTypeFk,
+ i.tag5,
+ i.value5,
+ i.tag6,
+ i.value6,
+ i.tag7,
+ i.value7,
+ i.tag8,
+ i.value8,
+ i.tag9,
+ i.value9,
+ i.tag10,
+ i.value10,
+ it.id,
+ it.workerFk,
+ it.categoryFk,
+ it.code AS itemTypeCode
+ FROM buy b
+ JOIN item i ON i.id = b.itemFk
+ JOIN itemType it ON it.id = i.typeFk
+ WHERE b.entryFk IN(:entriesId) AND b.quantity > 0
+ ORDER BY i.typeFk , i.name
\ No newline at end of file
diff --git a/print/templates/reports/supplier-campaign-metrics/sql/entries.sql b/print/templates/reports/supplier-campaign-metrics/sql/entries.sql
new file mode 100644
index 000000000..aa458dda0
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/sql/entries.sql
@@ -0,0 +1,8 @@
+SELECT
+ e.id,
+ e.ref,
+ e.supplierFk,
+ t.shipped
+ FROM vn.entry e
+ JOIN vn.travel t ON t.id = e.travelFk
+ WHERE e.supplierFk = ? AND DATE(t.shipped) BETWEEN ? AND ?
diff --git a/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql b/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql
new file mode 100644
index 000000000..0c2fa12ed
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/sql/supplier.sql
@@ -0,0 +1,12 @@
+SELECT
+ s.street,
+ s.city,
+ s.postcode,
+ s.id,
+ s.name AS supplierName,
+ p.name AS province,
+ co.country
+ FROM supplier s
+ JOIN province p ON s.provinceFk = p.id
+ JOIN country co ON s.countryFk = co.id
+ WHERE s.id = ?
diff --git a/print/templates/reports/supplier-campaign-metrics/supplier-campaign-metrics.html b/print/templates/reports/supplier-campaign-metrics/supplier-campaign-metrics.html
new file mode 100644
index 000000000..1303f2266
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/supplier-campaign-metrics.html
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{$t('title')}}
+
+
+
+
+ {{$t('Supplier')}} |
+ {{supplier.id}} |
+
+
+ {{$t('From')}} |
+ {{from | date('%d-%m-%Y')}} |
+
+
+ {{$t('To')}} |
+ {{to | date('%d-%m-%Y')}} |
+
+
+
+
+
+
+
+
+
+ {{supplier.supplierName}}
+
+ {{supplier.street}}
+
+
+ {{supplier.postcode}}, {{supplier.city}} ({{supplier.province}})
+
+
+ {{supplier.country}}
+
+
+
+
+
+
+
+ {{$t('entry')}} {{entry.id}}
+ {{$t('dated')}} {{entry.shipped | date('%d-%m-%Y')}}
+ {{$t('reference')}} {{entry.ref}}
+
+
+
+
+ {{$t('itemName')}} |
+ {{$t('Quantity')}} |
+ {{$t('price')}} |
+ {{$t('total')}} |
+
+
+
+
+ {{buy.itemName}} |
+ {{buy.quantity}} |
+ {{buy.price | currency('EUR', $i18n.locale)}} |
+ {{buy.quantity * buy.price | currency('EUR', $i18n.locale)}} |
+
+
+
+
+ {{buy.tag5}} {{buy.value5}}
+
+
+ {{buy.tag6}} {{buy.value6}}
+
+
+ {{buy.tag7}} {{buy.value7}}
+
+ |
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
\ No newline at end of file
diff --git a/print/templates/reports/supplier-campaign-metrics/supplier-campaign-metrics.js b/print/templates/reports/supplier-campaign-metrics/supplier-campaign-metrics.js
new file mode 100755
index 000000000..8a0a378a2
--- /dev/null
+++ b/print/templates/reports/supplier-campaign-metrics/supplier-campaign-metrics.js
@@ -0,0 +1,61 @@
+const Component = require(`${appPath}/core/component`);
+const reportHeader = new Component('report-header');
+const reportFooter = new Component('report-footer');
+
+module.exports = {
+ name: 'supplier-campaign-metrics',
+ async serverPrefetch() {
+ this.supplier = await this.fetchSupplier(this.recipientId);
+ let entries = await this.fetchEntries(this.recipientId, this.from, this.to);
+
+ const entriesId = [];
+
+ for (let entry of entries)
+ entriesId.push(entry.id);
+
+ const buys = await this.fetchBuys(entriesId);
+
+ const entriesMap = new Map();
+ for (let entry of entries)
+ entriesMap.set(entry.id, entry);
+
+ for (let buy of buys) {
+ const entry = entriesMap.get(buy.entryFk);
+ if (entry) {
+ if (!entry.buys) entry.buys = [];
+
+ entry.buys.push(buy);
+ }
+ }
+
+ this.entries = entries;
+ if (!this.supplier)
+ throw new Error('Something went wrong');
+ },
+ methods: {
+ fetchSupplier(supplierId) {
+ return this.findOneFromDef('supplier', [supplierId]);
+ },
+ fetchEntries(supplierId, from, to) {
+ return this.rawSqlFromDef('entries', [supplierId, from, to]);
+ },
+ fetchBuys(entriesId) {
+ return this.rawSqlFromDef('buys', {entriesId});
+ }
+ },
+ components: {
+ 'report-header': reportHeader.build(),
+ 'report-footer': reportFooter.build()
+ },
+ props: {
+ recipientId: {
+ required: true
+ },
+ from: {
+ required: true
+ },
+ to: {
+ required: true
+ }
+ }
+};
diff --git a/e2e/dms/ecc/3.jpeg b/storage/dms/8f1/7.jpeg
similarity index 100%
rename from e2e/dms/ecc/3.jpeg
rename to storage/dms/8f1/7.jpeg
diff --git a/e2e/dms/a87/4.txt b/storage/dms/a87/4.txt
similarity index 100%
rename from e2e/dms/a87/4.txt
rename to storage/dms/a87/4.txt
diff --git a/e2e/dms/c4c/1.txt b/storage/dms/c4c/1.txt
similarity index 100%
rename from e2e/dms/c4c/1.txt
rename to storage/dms/c4c/1.txt
diff --git a/e2e/dms/c81/2.txt b/storage/dms/c81/2.txt
similarity index 100%
rename from e2e/dms/c81/2.txt
rename to storage/dms/c81/2.txt
diff --git a/storage/dms/ecc/3.jpeg b/storage/dms/ecc/3.jpeg
new file mode 100644
index 000000000..fb2483f69
Binary files /dev/null and b/storage/dms/ecc/3.jpeg differ
diff --git a/e2e/dms/ecc/3.txt b/storage/dms/ecc/3.txt
similarity index 100%
rename from e2e/dms/ecc/3.txt
rename to storage/dms/ecc/3.txt
diff --git a/storage/image/catalog/1600x900/1.png b/storage/image/catalog/1600x900/1.png
new file mode 100644
index 000000000..5d3eb42f8
Binary files /dev/null and b/storage/image/catalog/1600x900/1.png differ
diff --git a/storage/image/catalog/1600x900/10.png b/storage/image/catalog/1600x900/10.png
new file mode 100644
index 000000000..1fe9af8e7
Binary files /dev/null and b/storage/image/catalog/1600x900/10.png differ
diff --git a/storage/image/catalog/1600x900/11.png b/storage/image/catalog/1600x900/11.png
new file mode 100644
index 000000000..94777ed08
Binary files /dev/null and b/storage/image/catalog/1600x900/11.png differ
diff --git a/storage/image/catalog/1600x900/12.png b/storage/image/catalog/1600x900/12.png
new file mode 100644
index 000000000..adada3484
Binary files /dev/null and b/storage/image/catalog/1600x900/12.png differ
diff --git a/storage/image/catalog/1600x900/13.png b/storage/image/catalog/1600x900/13.png
new file mode 100644
index 000000000..b13916134
Binary files /dev/null and b/storage/image/catalog/1600x900/13.png differ
diff --git a/storage/image/catalog/1600x900/2.png b/storage/image/catalog/1600x900/2.png
new file mode 100644
index 000000000..feba73a5d
Binary files /dev/null and b/storage/image/catalog/1600x900/2.png differ
diff --git a/storage/image/catalog/1600x900/3.png b/storage/image/catalog/1600x900/3.png
new file mode 100644
index 000000000..bfad5fced
Binary files /dev/null and b/storage/image/catalog/1600x900/3.png differ
diff --git a/storage/image/catalog/1600x900/4.png b/storage/image/catalog/1600x900/4.png
new file mode 100644
index 000000000..98bb14765
Binary files /dev/null and b/storage/image/catalog/1600x900/4.png differ
diff --git a/storage/image/catalog/1600x900/5.png b/storage/image/catalog/1600x900/5.png
new file mode 100644
index 000000000..36f585235
Binary files /dev/null and b/storage/image/catalog/1600x900/5.png differ
diff --git a/storage/image/catalog/1600x900/6.png b/storage/image/catalog/1600x900/6.png
new file mode 100644
index 000000000..80464785e
Binary files /dev/null and b/storage/image/catalog/1600x900/6.png differ
diff --git a/storage/image/catalog/1600x900/7.png b/storage/image/catalog/1600x900/7.png
new file mode 100644
index 000000000..32d442ea0
Binary files /dev/null and b/storage/image/catalog/1600x900/7.png differ
diff --git a/storage/image/catalog/1600x900/8.png b/storage/image/catalog/1600x900/8.png
new file mode 100644
index 000000000..dea35b74f
Binary files /dev/null and b/storage/image/catalog/1600x900/8.png differ
diff --git a/storage/image/catalog/1600x900/9.png b/storage/image/catalog/1600x900/9.png
new file mode 100644
index 000000000..7e7885dc0
Binary files /dev/null and b/storage/image/catalog/1600x900/9.png differ
diff --git a/storage/image/catalog/200x200/1.png b/storage/image/catalog/200x200/1.png
new file mode 100644
index 000000000..5d3eb42f8
Binary files /dev/null and b/storage/image/catalog/200x200/1.png differ
diff --git a/storage/image/catalog/200x200/10.png b/storage/image/catalog/200x200/10.png
new file mode 100644
index 000000000..1fe9af8e7
Binary files /dev/null and b/storage/image/catalog/200x200/10.png differ
diff --git a/storage/image/catalog/200x200/11.png b/storage/image/catalog/200x200/11.png
new file mode 100644
index 000000000..1dd9c7c4c
Binary files /dev/null and b/storage/image/catalog/200x200/11.png differ
diff --git a/storage/image/catalog/200x200/12.png b/storage/image/catalog/200x200/12.png
new file mode 100644
index 000000000..87aaf2e43
Binary files /dev/null and b/storage/image/catalog/200x200/12.png differ
diff --git a/storage/image/catalog/200x200/13.png b/storage/image/catalog/200x200/13.png
new file mode 100644
index 000000000..b13916134
Binary files /dev/null and b/storage/image/catalog/200x200/13.png differ
diff --git a/storage/image/catalog/200x200/2.png b/storage/image/catalog/200x200/2.png
new file mode 100644
index 000000000..feba73a5d
Binary files /dev/null and b/storage/image/catalog/200x200/2.png differ
diff --git a/storage/image/catalog/200x200/3.png b/storage/image/catalog/200x200/3.png
new file mode 100644
index 000000000..bfad5fced
Binary files /dev/null and b/storage/image/catalog/200x200/3.png differ
diff --git a/storage/image/catalog/200x200/4.png b/storage/image/catalog/200x200/4.png
new file mode 100644
index 000000000..98bb14765
Binary files /dev/null and b/storage/image/catalog/200x200/4.png differ
diff --git a/storage/image/catalog/200x200/5.png b/storage/image/catalog/200x200/5.png
new file mode 100644
index 000000000..36f585235
Binary files /dev/null and b/storage/image/catalog/200x200/5.png differ
diff --git a/storage/image/catalog/200x200/6.png b/storage/image/catalog/200x200/6.png
new file mode 100644
index 000000000..80464785e
Binary files /dev/null and b/storage/image/catalog/200x200/6.png differ
diff --git a/storage/image/catalog/200x200/7.png b/storage/image/catalog/200x200/7.png
new file mode 100644
index 000000000..681e143d0
Binary files /dev/null and b/storage/image/catalog/200x200/7.png differ
diff --git a/storage/image/catalog/200x200/8.png b/storage/image/catalog/200x200/8.png
new file mode 100644
index 000000000..dea35b74f
Binary files /dev/null and b/storage/image/catalog/200x200/8.png differ
diff --git a/storage/image/catalog/200x200/9.png b/storage/image/catalog/200x200/9.png
new file mode 100644
index 000000000..7e7885dc0
Binary files /dev/null and b/storage/image/catalog/200x200/9.png differ
diff --git a/storage/image/catalog/50x50/1.png b/storage/image/catalog/50x50/1.png
new file mode 100644
index 000000000..47e7f4177
Binary files /dev/null and b/storage/image/catalog/50x50/1.png differ
diff --git a/storage/image/catalog/50x50/10.png b/storage/image/catalog/50x50/10.png
new file mode 100644
index 000000000..96836af36
Binary files /dev/null and b/storage/image/catalog/50x50/10.png differ
diff --git a/storage/image/catalog/50x50/11.png b/storage/image/catalog/50x50/11.png
new file mode 100644
index 000000000..3d84470df
Binary files /dev/null and b/storage/image/catalog/50x50/11.png differ
diff --git a/storage/image/catalog/50x50/12.png b/storage/image/catalog/50x50/12.png
new file mode 100644
index 000000000..c62aa25ab
Binary files /dev/null and b/storage/image/catalog/50x50/12.png differ
diff --git a/storage/image/catalog/50x50/13.png b/storage/image/catalog/50x50/13.png
new file mode 100644
index 000000000..23065cb04
Binary files /dev/null and b/storage/image/catalog/50x50/13.png differ
diff --git a/storage/image/catalog/50x50/2.png b/storage/image/catalog/50x50/2.png
new file mode 100644
index 000000000..f06f90d7e
Binary files /dev/null and b/storage/image/catalog/50x50/2.png differ
diff --git a/storage/image/catalog/50x50/3.png b/storage/image/catalog/50x50/3.png
new file mode 100644
index 000000000..735d9f5e1
Binary files /dev/null and b/storage/image/catalog/50x50/3.png differ
diff --git a/storage/image/catalog/50x50/4.png b/storage/image/catalog/50x50/4.png
new file mode 100644
index 000000000..b5cb72675
Binary files /dev/null and b/storage/image/catalog/50x50/4.png differ
diff --git a/storage/image/catalog/50x50/5.png b/storage/image/catalog/50x50/5.png
new file mode 100644
index 000000000..e5503c939
Binary files /dev/null and b/storage/image/catalog/50x50/5.png differ
diff --git a/storage/image/catalog/50x50/6.png b/storage/image/catalog/50x50/6.png
new file mode 100644
index 000000000..890af5c4e
Binary files /dev/null and b/storage/image/catalog/50x50/6.png differ
diff --git a/storage/image/catalog/50x50/7.png b/storage/image/catalog/50x50/7.png
new file mode 100644
index 000000000..d8656ee01
Binary files /dev/null and b/storage/image/catalog/50x50/7.png differ
diff --git a/storage/image/catalog/50x50/8.png b/storage/image/catalog/50x50/8.png
new file mode 100644
index 000000000..0a0cb49a6
Binary files /dev/null and b/storage/image/catalog/50x50/8.png differ
diff --git a/storage/image/catalog/50x50/9.png b/storage/image/catalog/50x50/9.png
new file mode 100644
index 000000000..142702834
Binary files /dev/null and b/storage/image/catalog/50x50/9.png differ
diff --git a/storage/image/catalog/70x70/1.png b/storage/image/catalog/70x70/1.png
new file mode 100644
index 000000000..a333e9bc1
Binary files /dev/null and b/storage/image/catalog/70x70/1.png differ
diff --git a/storage/image/catalog/70x70/10.png b/storage/image/catalog/70x70/10.png
new file mode 100644
index 000000000..b0c34f48a
Binary files /dev/null and b/storage/image/catalog/70x70/10.png differ
diff --git a/storage/image/catalog/70x70/11.png b/storage/image/catalog/70x70/11.png
new file mode 100644
index 000000000..1888145dd
Binary files /dev/null and b/storage/image/catalog/70x70/11.png differ
diff --git a/storage/image/catalog/70x70/12.png b/storage/image/catalog/70x70/12.png
new file mode 100644
index 000000000..95b56c58c
Binary files /dev/null and b/storage/image/catalog/70x70/12.png differ
diff --git a/storage/image/catalog/70x70/13.png b/storage/image/catalog/70x70/13.png
new file mode 100644
index 000000000..26f345333
Binary files /dev/null and b/storage/image/catalog/70x70/13.png differ
diff --git a/storage/image/catalog/70x70/2.png b/storage/image/catalog/70x70/2.png
new file mode 100644
index 000000000..6e38388d5
Binary files /dev/null and b/storage/image/catalog/70x70/2.png differ
diff --git a/storage/image/catalog/70x70/3.png b/storage/image/catalog/70x70/3.png
new file mode 100644
index 000000000..9261a6cff
Binary files /dev/null and b/storage/image/catalog/70x70/3.png differ
diff --git a/storage/image/catalog/70x70/4.png b/storage/image/catalog/70x70/4.png
new file mode 100644
index 000000000..5d2a5490b
Binary files /dev/null and b/storage/image/catalog/70x70/4.png differ
diff --git a/storage/image/catalog/70x70/5.png b/storage/image/catalog/70x70/5.png
new file mode 100644
index 000000000..d5df8b819
Binary files /dev/null and b/storage/image/catalog/70x70/5.png differ
diff --git a/storage/image/catalog/70x70/6.png b/storage/image/catalog/70x70/6.png
new file mode 100644
index 000000000..15128891c
Binary files /dev/null and b/storage/image/catalog/70x70/6.png differ
diff --git a/storage/image/catalog/70x70/7.png b/storage/image/catalog/70x70/7.png
new file mode 100644
index 000000000..dd18081de
Binary files /dev/null and b/storage/image/catalog/70x70/7.png differ
diff --git a/storage/image/catalog/70x70/8.png b/storage/image/catalog/70x70/8.png
new file mode 100644
index 000000000..5d0fbbe9d
Binary files /dev/null and b/storage/image/catalog/70x70/8.png differ
diff --git a/storage/image/catalog/70x70/9.png b/storage/image/catalog/70x70/9.png
new file mode 100644
index 000000000..7fc877e20
Binary files /dev/null and b/storage/image/catalog/70x70/9.png differ
diff --git a/storage/image/catalog/full/1.png b/storage/image/catalog/full/1.png
new file mode 100644
index 000000000..5d3eb42f8
Binary files /dev/null and b/storage/image/catalog/full/1.png differ
diff --git a/storage/image/catalog/full/10.png b/storage/image/catalog/full/10.png
new file mode 100644
index 000000000..1fe9af8e7
Binary files /dev/null and b/storage/image/catalog/full/10.png differ
diff --git a/storage/image/catalog/full/11.png b/storage/image/catalog/full/11.png
new file mode 100644
index 000000000..fb1980036
Binary files /dev/null and b/storage/image/catalog/full/11.png differ
diff --git a/storage/image/catalog/full/12.png b/storage/image/catalog/full/12.png
new file mode 100644
index 000000000..505e56a08
Binary files /dev/null and b/storage/image/catalog/full/12.png differ
diff --git a/storage/image/catalog/full/13.png b/storage/image/catalog/full/13.png
new file mode 100644
index 000000000..b13916134
Binary files /dev/null and b/storage/image/catalog/full/13.png differ
diff --git a/storage/image/catalog/full/2.png b/storage/image/catalog/full/2.png
new file mode 100644
index 000000000..feba73a5d
Binary files /dev/null and b/storage/image/catalog/full/2.png differ
diff --git a/storage/image/catalog/full/3.png b/storage/image/catalog/full/3.png
new file mode 100644
index 000000000..bfad5fced
Binary files /dev/null and b/storage/image/catalog/full/3.png differ
diff --git a/storage/image/catalog/full/4.png b/storage/image/catalog/full/4.png
new file mode 100644
index 000000000..98bb14765
Binary files /dev/null and b/storage/image/catalog/full/4.png differ
diff --git a/storage/image/catalog/full/5.png b/storage/image/catalog/full/5.png
new file mode 100644
index 000000000..36f585235
Binary files /dev/null and b/storage/image/catalog/full/5.png differ
diff --git a/storage/image/catalog/full/6.png b/storage/image/catalog/full/6.png
new file mode 100644
index 000000000..80464785e
Binary files /dev/null and b/storage/image/catalog/full/6.png differ
diff --git a/storage/image/catalog/full/7.png b/storage/image/catalog/full/7.png
new file mode 100644
index 000000000..32d442ea0
Binary files /dev/null and b/storage/image/catalog/full/7.png differ
diff --git a/storage/image/catalog/full/8.png b/storage/image/catalog/full/8.png
new file mode 100644
index 000000000..dea35b74f
Binary files /dev/null and b/storage/image/catalog/full/8.png differ
diff --git a/storage/image/catalog/full/9.png b/storage/image/catalog/full/9.png
new file mode 100644
index 000000000..7e7885dc0
Binary files /dev/null and b/storage/image/catalog/full/9.png differ
diff --git a/storage/image/user/1600x1600/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png b/storage/image/user/1600x1600/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png
new file mode 100644
index 000000000..52f0fb9d1
Binary files /dev/null and b/storage/image/user/1600x1600/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png differ
diff --git a/storage/image/user/160x160/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png b/storage/image/user/160x160/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png
new file mode 100644
index 000000000..07f21ecd1
Binary files /dev/null and b/storage/image/user/160x160/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png differ
diff --git a/storage/image/user/160x160/e7723f0b24ff05b32ed09d95196f2f29.png b/storage/image/user/160x160/e7723f0b24ff05b32ed09d95196f2f29.png
deleted file mode 100644
index 2085c85f3..000000000
Binary files a/storage/image/user/160x160/e7723f0b24ff05b32ed09d95196f2f29.png and /dev/null differ
diff --git a/storage/image/user/520x520/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png b/storage/image/user/520x520/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png
new file mode 100644
index 000000000..52f0fb9d1
Binary files /dev/null and b/storage/image/user/520x520/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png differ
diff --git a/storage/image/user/full/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png b/storage/image/user/full/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png
new file mode 100644
index 000000000..52f0fb9d1
Binary files /dev/null and b/storage/image/user/full/4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd.png differ
diff --git a/storage/tmp/.keep b/storage/tmp/.keep
new file mode 100644
index 000000000..8e2556896
--- /dev/null
+++ b/storage/tmp/.keep
@@ -0,0 +1 @@
+Forces tmp folder creation!
\ No newline at end of file