7383-testToMaster #2445

Merged
alexm merged 233 commits from 7383-testToMaster into master 2024-05-14 05:44:13 +00:00
3 changed files with 6 additions and 21 deletions
Showing only changes of commit 0537a3eca3 - Show all commits

View File

@ -6,5 +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 ORDER BY t.shipped DESC;
t.shipped DESC;

View File

@ -65,6 +65,8 @@
<span v-if="buy.value5"> <strong>{{buy.tag5}}</strong> {{buy.value5}} </span> <span v-if="buy.value5"> <strong>{{buy.tag5}}</strong> {{buy.value5}} </span>
<span v-if="buy.value6"> <strong>{{buy.tag6}}</strong> {{buy.value6}} </span> <span v-if="buy.value6"> <strong>{{buy.tag6}}</strong> {{buy.value6}} </span>
<span v-if="buy.value7"> <strong>{{buy.tag7}}</strong> {{buy.value7}} </span> <span v-if="buy.value7"> <strong>{{buy.tag7}}</strong> {{buy.value7}} </span>
<div>{{total.quantity}}</div>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -7,9 +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]);
let totalEntry; this.total = {quantity: 0, price: 0};
let total;
const entriesId = []; const entriesId = [];
for (let entry of entries) for (let entry of entries)
@ -25,26 +23,13 @@ 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);
} }
} }
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) { getTotal(entry) {
if (entry.buys) { if (entry.buys) {
@ -54,7 +39,6 @@ module.exports = {
return total; return total;
} }
console.log('total', total);
}, },
props: { props: {
id: { id: {