Merge pull request '2952-ticket.sale-tracking_part2' (!1310) from 2952-ticket.sale-tracking_part2 into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1310
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Vicent Llopis 2023-02-13 07:17:25 +00:00
commit c2735e54a0
7 changed files with 102 additions and 1 deletions

View File

@ -29,5 +29,12 @@
"pickingOrder": { "pickingOrder": {
"type": "number" "type": "number"
} }
},
"relations": {
"saleGroup": {
"type": "hasMany",
"model": "saleGroup",
"foreignKey": "parkingFk"
}
} }
} }

View File

@ -41,6 +41,12 @@
"SaleComponent": { "SaleComponent": {
"dataSource": "vn" "dataSource": "vn"
}, },
"SaleGroup": {
"dataSource": "vn"
},
"SaleGroupDetail": {
"dataSource": "vn"
},
"SaleTracking": { "SaleTracking": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -75,6 +75,11 @@
"type": "hasOne", "type": "hasOne",
"model": "ItemShelvingSale", "model": "ItemShelvingSale",
"foreignKey": "saleFk" "foreignKey": "saleFk"
},
"saleGroupDetail": {
"type": "hasOne",
"model": "SaleGroupDetail",
"foreignKey": "saleFk"
} }
} }
} }

View File

@ -0,0 +1,31 @@
{
"name": "SaleGroup",
"base": "VnModel",
"options": {
"mysql": {
"table": "saleGroup"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"description": "Identifier"
},
"parkingFk": {
"type": "number"
}
},
"relations": {
"saleGroupDetail": {
"type": "hasMany",
"model": "SaleGroupDetail",
"foreignKey": "saleGroupFk"
},
"parking": {
"type": "belongsTo",
"model": "Parking",
"foreignKey": "parkingFk"
}
}
}

View File

@ -0,0 +1,31 @@
{
"name": "SaleGroupDetail",
"base": "VnModel",
"options": {
"mysql": {
"table": "saleGroupDetail"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"description": "Identifier"
},
"saleFk": {
"type": "number"
}
},
"relations": {
"sale": {
"type": "belongsTo",
"model": "Sale",
"foreignKey": "saleFk"
},
"saleGroup": {
"type": "belongsTo",
"model": "SaleGroup",
"foreignKey": "saleGroupFk"
}
}
}

View File

@ -17,6 +17,7 @@
<vn-th field="itemFk" number>Item</vn-th> <vn-th field="itemFk" number>Item</vn-th>
<vn-th field="concept">Description</vn-th> <vn-th field="concept">Description</vn-th>
<vn-th field="quantity" number>Quantity</vn-th> <vn-th field="quantity" number>Quantity</vn-th>
<vn-th field="parking" center>Parking</vn-th>
<vn-th></vn-th> <vn-th></vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
@ -50,6 +51,7 @@
</vn-fetched-tags> </vn-fetched-tags>
</vn-td> </vn-td>
<vn-td number>{{::sale.quantity}}</vn-td> <vn-td number>{{::sale.quantity}}</vn-td>
<vn-td center>{{::sale.saleGroupDetail.saleGroup.parking.code | dashIfEmpty}}</vn-td>
<vn-td actions> <vn-td actions>
<vn-icon-button <vn-icon-button
vn-click-stop="$ctrl.showSaleTracking(sale)" vn-click-stop="$ctrl.showSaleTracking(sale)"

View File

@ -9,11 +9,30 @@ class Controller extends Section {
include: [ include: [
{ {
relation: 'item' relation: 'item'
}, { },
{
relation: 'saleTracking', relation: 'saleTracking',
scope: { scope: {
fields: ['isChecked'] fields: ['isChecked']
} }
},
{
relation: 'saleGroupDetail',
scope: {
fields: ['saleGroupFk'],
include: {
relation: 'saleGroup',
scope: {
fields: ['parkingFk'],
include: {
relation: 'parking',
scope: {
fields: ['code']
}
}
}
}
}
} }
] ]
}; };