6976-supplierConsumption #2365
|
@ -17,4 +17,9 @@ h2 {
|
||||||
|
|
||||||
.description strong {
|
.description strong {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.black {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,3 +6,4 @@ SELECT
|
||||||
FROM vn.entry e
|
FROM vn.entry e
|
||||||
JOIN vn.travel t ON t.id = e.travelFk
|
JOIN vn.travel t ON t.id = e.travelFk
|
||||||
WHERE e.supplierFk = ? AND DATE(t.shipped) BETWEEN ? AND ?
|
WHERE e.supplierFk = ? AND DATE(t.shipped) BETWEEN ? AND ?
|
||||||
|
ORDER BY t.shipped DESC;
|
||||||
|
|
|
@ -37,7 +37,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-for="entry in entries" v-if="entry.buys">
|
<div v-for="entry in entries" v-if="entry.buys">
|
||||||
<h2>
|
<h2>
|
||||||
<span>{{$t('entry')}} {{entry.id}}</span>
|
<span>
|
||||||
|
<span>{{$t('entry')}}</span>
|
||||||
|
<span class="black"> {{entry.id}}</span>
|
||||||
|
</span>
|
||||||
<span>{{$t('dated')}} {{formatDate(entry.shipped, '%d-%m-%Y')}}</span>
|
<span>{{$t('dated')}} {{formatDate(entry.shipped, '%d-%m-%Y')}}</span>
|
||||||
<span class="pull-right">{{$t('reference')}} {{entry.reference}}</span>
|
<span class="pull-right">{{$t('reference')}} {{entry.reference}}</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
@ -67,6 +70,13 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<table>
|
||||||
|
<tr class="font bold no-page-break">
|
||||||
|
<td>{{$t('total')}}</td>
|
||||||
|
<td class="number">{{total.price | currency('EUR', $i18n.locale)}}</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
|
|
|
@ -7,7 +7,7 @@ module.exports = {
|
||||||
this.supplier = await this.findOneFromDef('supplier', [this.id]);
|
this.supplier = await this.findOneFromDef('supplier', [this.id]);
|
||||||
this.checkMainEntity(this.supplier);
|
this.checkMainEntity(this.supplier);
|
||||||
let entries = await this.rawSqlFromDef('entries', [this.id, this.from, this.to]);
|
let entries = await this.rawSqlFromDef('entries', [this.id, this.from, this.to]);
|
||||||
|
this.total = {quantity: 0, price: 0};
|
||||||
const entriesId = [];
|
const entriesId = [];
|
||||||
|
|
||||||
for (let entry of entries)
|
for (let entry of entries)
|
||||||
|
@ -23,7 +23,8 @@ module.exports = {
|
||||||
const entry = entriesMap.get(buy.entryFk);
|
const entry = entriesMap.get(buy.entryFk);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
if (!entry.buys) entry.buys = [];
|
if (!entry.buys) entry.buys = [];
|
||||||
|
this.total.quantity = this.total.quantity + buy.quantity;
|
||||||
|
this.total.price = this.total.price + (buy.price * buy.quantity);
|
||||||
entry.buys.push(buy);
|
entry.buys.push(buy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue