#841 claim relation added

This commit is contained in:
Gerard 2018-11-21 10:09:36 +01:00
parent bad8e63f95
commit baacc351fd
3 changed files with 18 additions and 5 deletions

View File

@ -67,6 +67,14 @@
<tbody> <tbody>
<tr ng-repeat="sale in $ctrl.summary.sales track by sale.id"> <tr ng-repeat="sale in $ctrl.summary.sales track by sale.id">
<td> <td>
<a ui-sref="claim.card.basicData({id: sale.claimBeginning.claimFk})">
<vn-icon
ng-show="sale.claimBeginning.claimFk"
orange
icon="icon-claims"
vn-tooltip="{{::$ctrl.$translate.instant('Claim')}}: {{::sale.claimBeginning.claimFk}}">
</vn-icon>
</a>
<vn-icon <vn-icon
ng-show="sale.visible || sale.available" ng-show="sale.visible || sale.available"
orange orange

View File

@ -68,7 +68,7 @@ module.exports = Self => {
} }
}, },
{ {
relation: 'tracking', relation: 'state',
scope: { scope: {
fields: ['stateFk'], fields: ['stateFk'],
include: { include: {
@ -90,11 +90,11 @@ module.exports = Self => {
ticketFk: ticketFk ticketFk: ticketFk
}, },
order: 'itemFk ASC', order: 'itemFk ASC',
include: [{ include: [
relation: 'item', {relation: 'item'},
}] {relation: 'claimBeginning'}
]
}; };
return await Sale.find(filter); return await Sale.find(filter);
} }

View File

@ -57,6 +57,11 @@
"model": "SaleComponent", "model": "SaleComponent",
"foreignKey": "saleFk" "foreignKey": "saleFk"
}, },
"claimBeginning": {
"type": "hasOne",
"model": "ClaimBeginning",
"foreignKey": "saleFk"
},
"saleTracking": { "saleTracking": {
"type": "hasOne", "type": "hasOne",
"model": "SaleTracking", "model": "SaleTracking",