2293 - getVolume() call to saleVolume
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-06-12 11:26:32 +02:00
parent a66cc4a36d
commit dddfe2773a
4 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ module.exports = Self => {
}); });
Self.getVolume = async ticketFk => { Self.getVolume = async ticketFk => {
let [volume] = await Self.rawSql(`CALL vn.ticketListVolume(?)`, [ticketFk]); return Self.rawSql(`SELECT * FROM vn.saleVolume
return volume; WHERE ticketFk = ?`, [ticketFk]);
}; };
}; };

View File

@ -5,7 +5,7 @@ describe('ticket getVolume()', () => {
let ticketFk = 1; let ticketFk = 1;
await app.models.Ticket.getVolume(ticketFk) await app.models.Ticket.getVolume(ticketFk)
.then(response => { .then(response => {
expect(response[0].m3).toEqual(1.09); expect(response[0].volume).toEqual(1.09);
}); });
}); });
}); });

View File

@ -50,7 +50,7 @@
sub-name="::sale.item.subName"/> sub-name="::sale.item.subName"/>
</vn-td> </vn-td>
<vn-td number>{{::sale.quantity}}</vn-td> <vn-td number>{{::sale.quantity}}</vn-td>
<vn-td number>{{::sale.volume.m3 | number:3}}</vn-td> <vn-td number>{{::sale.saleVolume.volume | number:3}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>
</vn-table> </vn-table>

View File

@ -39,7 +39,7 @@ class Controller extends Section {
this.sales.forEach(sale => { this.sales.forEach(sale => {
this.volumes.forEach(volume => { this.volumes.forEach(volume => {
if (sale.id === volume.saleFk) if (sale.id === volume.saleFk)
sale.volume = volume; sale.saleVolume = volume;
}); });
}); });
} }