Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
This commit is contained in:
commit
1d6edabb10
|
@ -14,18 +14,7 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getWasteDetail = async() => {
|
Self.getWasteDetail = async() => {
|
||||||
const wastes = await Self.rawSql(`
|
const [wastes] = await Self.rawSql(`CALL bs.weekWaste_getDetail()`);
|
||||||
SELECT *, 100 * dwindle / total AS percentage
|
|
||||||
FROM (
|
|
||||||
SELECT buyer,
|
|
||||||
ws.family,
|
|
||||||
sum(ws.saleTotal) AS total,
|
|
||||||
sum(ws.saleWaste) AS dwindle
|
|
||||||
FROM bs.waste ws
|
|
||||||
WHERE year = YEAR(CURDATE()) AND week = WEEK(CURDATE(), 1)
|
|
||||||
GROUP BY buyer, family
|
|
||||||
) sub
|
|
||||||
ORDER BY percentage DESC;`);
|
|
||||||
|
|
||||||
const details = [];
|
const details = [];
|
||||||
|
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
<vn-table>
|
<vn-table>
|
||||||
<vn-thead>
|
<vn-thead>
|
||||||
<vn-tr>
|
<vn-tr>
|
||||||
<vn-th>Family</vn-th>
|
<vn-th class="waste-family">Family</vn-th>
|
||||||
<vn-th shrink>Percentage</vn-th>
|
<vn-th number>Percentage</vn-th>
|
||||||
<vn-th number>Dwindle</vn-th>
|
<vn-th number>Dwindle</vn-th>
|
||||||
<vn-th number>Total</vn-th>
|
<vn-th number>Total</vn-th>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
<vn-tbody>
|
<vn-tbody>
|
||||||
<vn-tr ng-repeat="waste in detail.lines">
|
<vn-tr ng-repeat="waste in detail.lines">
|
||||||
<vn-td>{{::waste.family}}</vn-td>
|
<vn-td class="waste-family">{{::waste.family}}</vn-td>
|
||||||
<vn-td shrink>{{::(waste.percentage / 100) | percentage: 2}}</vn-td>
|
<vn-td number>{{::(waste.percentage / 100) | percentage: 2}}</vn-td>
|
||||||
<vn-td number>{{::waste.dwindle | currency: 'EUR'}}</vn-td>
|
<vn-td number>{{::waste.dwindle | currency: 'EUR'}}</vn-td>
|
||||||
<vn-td number>{{::waste.total | currency: 'EUR'}}</vn-td>
|
<vn-td number>{{::waste.total | currency: 'EUR'}}</vn-td>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
|
|
|
@ -16,4 +16,10 @@ vn-item-waste {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vn-table vn-th.waste-family,
|
||||||
|
vn-table vn-td.waste-family {
|
||||||
|
max-width: 4em;
|
||||||
|
width: 4em
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue