refs #6976 changes back supplier consumption
This commit is contained in:
parent
db8d48ccee
commit
b706d1c1c6
|
@ -18,3 +18,7 @@ h2 {
|
||||||
.description strong {
|
.description strong {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.black {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -7,6 +7,8 @@ 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]);
|
||||||
|
let totalEntry;
|
||||||
|
let total;
|
||||||
|
|
||||||
const entriesId = [];
|
const entriesId = [];
|
||||||
|
|
||||||
|
@ -29,6 +31,30 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.entries = entries;
|
this.entries = entries;
|
||||||
|
|
||||||
|
// for (let buy of entry.buys)
|
||||||
|
// total += buy.total;
|
||||||
|
|
||||||
|
// getTotal(entry) {
|
||||||
|
// if (entry.buys) {
|
||||||
|
// let total = 0;
|
||||||
|
// for (let buy of entry.buys)
|
||||||
|
// total += buy.total;
|
||||||
|
|
||||||
|
// return total;
|
||||||
|
// }
|
||||||
|
// console.log('total', total);
|
||||||
|
// };
|
||||||
|
},
|
||||||
|
getTotal(entry) {
|
||||||
|
if (entry.buys) {
|
||||||
|
let total = 0;
|
||||||
|
for (let buy of entry.buys)
|
||||||
|
total += buy.total;
|
||||||
|
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
console.log('total', total);
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
|
|
Loading…
Reference in New Issue