diff --git a/modules/client/back/methods/address/filter.js b/modules/client/back/methods/address/filter.js
new file mode 100644
index 000000000..f84499695
--- /dev/null
+++ b/modules/client/back/methods/address/filter.js
@@ -0,0 +1,53 @@
+
+const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
+
+module.exports = Self => {
+ Self.remoteMethod('filter', {
+ 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',
+ http: {source: 'query'}
+ }
+
+ ],
+ returns: {
+ type: ['Object'],
+ root: true
+ },
+ http: {
+ path: `/filter`,
+ verb: 'GET'
+ }
+ });
+
+ Self.filter = async filter => {
+ let conn = Self.dataSource.connector;
+
+ let stmts = [];
+ let stmt;
+
+ filter.order = [
+ 'c.defaultAddressFk DESC',
+ 'a.isActive DESC',
+ 'a.nickname ASC'
+ ];
+
+ stmt = new ParameterizedSQL(
+ `SELECT a.*
+ FROM vn.address a
+ LEFT JOIN vn.client c ON c.defaultAddressFk = a.id`
+ );
+
+ stmt.merge(conn.makeSuffix(filter));
+ let itemsIndex = stmts.push(stmt) - 1;
+
+ let sql = ParameterizedSQL.join(stmts, ';');
+ let result = await conn.executeStmt(sql);
+ return itemsIndex === 0 ? result : result[itemsIndex];
+ };
+};
+
diff --git a/modules/client/back/models/address.js b/modules/client/back/models/address.js
index d0cfd0900..f0f1efa35 100644
--- a/modules/client/back/models/address.js
+++ b/modules/client/back/models/address.js
@@ -5,6 +5,7 @@ let isMultiple = require('vn-loopback/util/hook').isMultiple;
module.exports = Self => {
// Methods
require('../methods/address/createDefaultAddress')(Self);
+ require('../methods/address/filter')(Self);
Self.validateAsync('isEqualizated', cannotHaveET, {
message: 'Cannot check Equalization Tax in this NIF/CIF'
diff --git a/modules/client/front/address/index/index.html b/modules/client/front/address/index/index.html
index d8971cd35..cdfd4d5a7 100644
--- a/modules/client/front/address/index/index.html
+++ b/modules/client/front/address/index/index.html
@@ -1,72 +1,74 @@