Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 3023-client_webAccess_block_simultaneous_changes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-07-21 10:07:21 +02:00
commit c1162b1b8a
3 changed files with 25 additions and 3 deletions

View File

@ -60,8 +60,12 @@ module.exports = Self => {
const [salesAvailable] = await Self.rawSql(query, [id], myOptions); const [salesAvailable] = await Self.rawSql(query, [id], myOptions);
const itemAvailable = new Map(); const itemAvailable = new Map();
for (let sale of salesAvailable) for (let sale of salesAvailable) {
itemAvailable.set(sale.itemFk, sale.available); itemAvailable.set(sale.itemFk, {
visible: sale.visible,
available: sale.available
});
}
// Get claimed sales // Get claimed sales
const saleIds = sales.map(sale => sale.id); const saleIds = sales.map(sale => sale.id);
@ -84,7 +88,9 @@ module.exports = Self => {
for (let sale of sales) { for (let sale of sales) {
const problems = saleProblems.get(sale.id); const problems = saleProblems.get(sale.id);
sale.available = itemAvailable.get(sale.itemFk); const itemStock = itemAvailable.get(sale.itemFk);
sale.available = itemStock.available;
sale.visible = itemStock.visible;
sale.claim = claimedSales.get(sale.id); sale.claim = claimedSales.get(sale.id);
if (problems) { if (problems) {
sale.isAvailable = problems.isAvailable; sale.isAvailable = problems.isAvailable;

View File

@ -59,6 +59,7 @@
</vn-th> </vn-th>
<vn-th shrink></vn-th> <vn-th shrink></vn-th>
<vn-th shrink></vn-th> <vn-th shrink></vn-th>
<vn-th shrink>Visible</vn-th>
<vn-th shrink>Available</vn-th> <vn-th shrink>Available</vn-th>
<vn-th>Id</vn-th> <vn-th>Id</vn-th>
<vn-th shrink>Quantity</vn-th> <vn-th shrink>Quantity</vn-th>
@ -112,6 +113,13 @@
zoom-image="{{::$root.imagePath('catalog', '1600x900', sale.itemFk)}}" zoom-image="{{::$root.imagePath('catalog', '1600x900', sale.itemFk)}}"
on-error-src/> on-error-src/>
</vn-td> </vn-td>
<vn-td shrink>
<vn-chip
class="transparent"
ng-class="{'alert': sale.visible < 0}">
{{::sale.visible}}
</vn-chip>
</vn-td>
<vn-td shrink> <vn-td shrink>
<vn-chip <vn-chip
class="transparent" class="transparent"

View File

@ -120,6 +120,7 @@
<vn-tr> <vn-tr>
<vn-th shrink></vn-th> <vn-th shrink></vn-th>
<vn-th number shrink>Item</vn-th> <vn-th number shrink>Item</vn-th>
<vn-th number shrink>Visible</vn-th>
<vn-th number shrink>Available</vn-th> <vn-th number shrink>Available</vn-th>
<vn-th number shrink>Quantity</vn-th> <vn-th number shrink>Quantity</vn-th>
<vn-th>Description</vn-th> <vn-th>Description</vn-th>
@ -169,6 +170,13 @@
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
</vn-td> </vn-td>
<vn-td number shrink>
<vn-chip
class="transparent"
ng-class="{'alert': sale.visible < 0}">
{{::sale.visible}}
</vn-chip>
</vn-td>
<vn-td number shrink> <vn-td number shrink>
<vn-chip <vn-chip
class="transparent" class="transparent"