Errores en relaciones solucionados

This commit is contained in:
Juan Ferrer Toribio 2017-05-12 13:36:12 +02:00
parent 89f397da2c
commit ebb59d1eef
8 changed files with 26 additions and 24 deletions

View File

@ -7,7 +7,7 @@ export const COMPONENT = {
controllerAs: 'card',
controller: function($http, $stateParams) {
this.client = null;
$http.get(`/client/api/Clients/${$stateParams.id}?filter[include][accountFk]`).then(
$http.get(`/client/api/Clients/${$stateParams.id}?filter[include][account]`).then(
json => this.client = json.data
);

View File

@ -44,17 +44,17 @@
},
"validations": [],
"relations": {
"provinceFk": {
"province": {
"type": "belongsTo",
"model": "Province",
"foreignKey": "provinceFk"
},
"clientFk": {
"client": {
"type": "belongsTo",
"model": "Client",
"foreignKey": "clientFk"
},
"defaultAgencyFk": {
"defaultAgency": {
"type": "belongsTo",
"model": "Agency",
"foreignKey": "defaultAgencyFk"

View File

@ -26,12 +26,12 @@
}
},
"relations": {
"agencyFk": {
"agency": {
"type": "belongsTo",
"model": "Agency",
"foreignKey": "agencyFk"
},
"agencyTypeFk": {
"agencyType": {
"type": "belongsTo",
"model": "AgencyType",
"foreignKey": "agencyTypeFk"

View File

@ -94,46 +94,48 @@
"isRelevant": {
"type": "boolean"
},
"typeFk": {
"type": "Number"
},
"accountingAccount": {
"type": "string"
}
},
"validations": [],
"relations": {
"accountFk": {
"account": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "id"
},
"payMethodFk": {
"payMethod": {
"type": "belongsTo",
"model": "PayMethod",
"foreignKey": "payMethodFk"
},
"salesPersonFk": {
"salesPerson": {
"type": "belongsTo",
"model": "Employee",
"foreignKey": "salesPersonFk"
},
"provinceFk":{
"province":{
"type": "belongsTo",
"model": "Province",
"foreignKey": "provinceFk"
},
"countryFk":{
"country":{
"type": "belongsTo",
"model": "Country",
"foreignKey": "countryFk"
},
"contactChannelFk":{
"contactChannel":{
"type": "belongsTo",
"model": "ContactChannel",
"foreignKey": "contactChannelFk"
},
"addressesFk": {
"type": {
"type": "belongsTo",
"model": "ClientType",
"foreignKey": "typeFk"
},
"addresses": {
"type": "hasMany",
"model": "Address",
"foreignKey": "clientFk"

View File

@ -22,12 +22,12 @@
}
},
"relations": {
"employeeFk": {
"employee": {
"type": "belongsTo",
"model": "Employee",
"foreignKey": "employeeFk"
},
"clientFk": {
"client": {
"type": "hasOne",
"model": "Client",
"foreignKey": "id"

View File

@ -20,12 +20,12 @@
}
},
"relations": {
"currencyFk": {
"currency": {
"type": "belongsTo",
"model": "Currency",
"foreignKey": "currencyFk"
},
"realCountryFk": {
"realCountry": {
"type": "belongsTo",
"model": "Country",
"foreignKey": "realCountryFk"

View File

@ -14,7 +14,7 @@
}
},
"relations": {
"userFk": {
"user": {
"type": "belongsTo",
"model": "Account",
"foreignKey": "userFk"

View File

@ -14,17 +14,17 @@
}
},
"relations": {
"countryFk": {
"country": {
"type": "belongsTo",
"model": "Country",
"foreignKey": "countryFk"
},
"warehouseFk": {
"warehouse": {
"type": "belongsTo",
"model": "Warehouse",
"foreignKey": "warehouseFk"
},
"zoneFk": {
"zone": {
"type": "belongsTo",
"model": "Zone",
"foreignKey": "zoneFk"