diff --git a/@salix/crud/src/client/fiscal-data/index.html b/@salix/crud/src/client/fiscal-data/index.html index 47e2112b9..b677d9c0e 100644 --- a/@salix/crud/src/client/fiscal-data/index.html +++ b/@salix/crud/src/client/fiscal-data/index.html @@ -14,10 +14,11 @@ - + + + - - + @@ -31,7 +32,9 @@ Información de facturación - + + + diff --git a/@salix/crud/src/client/fiscal-data/index.js b/@salix/crud/src/client/fiscal-data/index.js index 7a84011b3..893b08ceb 100644 --- a/@salix/crud/src/client/fiscal-data/index.js +++ b/@salix/crud/src/client/fiscal-data/index.js @@ -9,6 +9,21 @@ export const COMPONENT = { client: '<' }, controller: function($http) { + $http.get('/client/api/Countries').then( + json => this.countries = json.data, + json => console.error(json.data.error.message) + ); + + $http.get('/client/api/Provinces').then( + json => this.provinces = json.data, + json => console.error(json.data.error.message) + ); + + $http.get('/client/api/PaymentMethods').then( + json => this.payments = json.data, + json => console.error(json.data.error.message) + ); + this.submit = function() { $http.put('/client/api/Clients', this.client).then( json => console.log(json.statusText), diff --git a/db.json b/db.json index db23d85b4..cf47f5171 100644 --- a/db.json +++ b/db.json @@ -18,7 +18,7 @@ "NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue": "{\"id\":\"NUf7o684TmteojFX9KmPOpaDLthjP5Def4wuy83Yjv31i43HHiWgV3FyBp6pX8Ue\",\"ttl\":1209600,\"created\":\"2016-11-21T11:06:11.113Z\",\"userId\":1}" }, "Client": { - "12": "{\"name\":\"Verdnatura\",\"id\":12,\"fi\":\"B97367486\",\"salesPerson\":\"1\",\"telefono\":\"963242100\",\"socialName\":\"Verdnatura Levante SL\",\"active\":true,\"user\":\"verdnatura\",\"fax\":\"963242100\",\"phone\":\"963242100\",\"email\":\"informatica@verdnatura.es\",\"surcharge\":true,\"cyc\":2345,\"credit\":1000,\"iban\":\"2352345234523452345\",\"street\":\"Avenida Espioca, 100\",\"city\":\"Silla\",\"postcode\":\"46680\",\"mobile\":\"654654654\",\"dueDay\":4,\"gestdoc\":23452343}", + "12": "{\"name\":\"Verdnatura\",\"id\":12,\"fi\":\"B97367486\",\"salesPerson\":\"1\",\"telefono\":\"963242100\",\"socialName\":\"Verdnatura Levante SL\",\"active\":true,\"user\":\"verdnatura\",\"fax\":\"963242100\",\"phone\":\"963242100\",\"email\":\"informatica@verdnatura.es\",\"surcharge\":true,\"cyc\":2345,\"credit\":1000,\"iban\":\"2352345234523452345\",\"street\":\"Avenida Espioca, 100\",\"city\":\"Silla\",\"postcode\":\"46680\",\"mobile\":\"654654654\",\"dueDay\":4,\"gestdoc\":23452343,\"payMethod\":\"1\",\"province\":1,\"country\":\"1\"}", "14": "{\"name\":\"Cliente 1\",\"id\":14,\"street\":\"Aaaaaaaaaa\",\"fi\":\"1234567890A\",\"socialName\":\"Cliente 1\",\"fax\":\"963242100\",\"dischargeDate\":\"01/01/2017\",\"telefono\":\"963242100\",\"salesPerson\":\"2\",\"email\":\"informatica@verdnatura.es\",\"city\":\"asdf\",\"postcode\":\"asdf\",\"phone\":\"asdf\",\"mobile\":\"asdf\",\"credit\":2345,\"cyc\":123,\"iban\":\"asdf\",\"dueDay\":345,\"gestdoc\":2435,\"surcharge\":true}" }, "PaymentMethod": { diff --git a/services/client/common/models/Client.json b/services/client/common/models/Client.json index a965ffd4a..e76911c2f 100644 --- a/services/client/common/models/Client.json +++ b/services/client/common/models/Client.json @@ -94,6 +94,16 @@ "type": "belongsTo", "model": "PaymentMethod", "foreingKey": "payId" + }, + "country":{ + "type": "belongsTo", + "model": "Country", + "foreignKey": "countryId" + }, + "province":{ + "type": "belongsTo", + "model": "Province", + "foreignKey": "provinceId" } } }