Merge pull request '3028 - Added visible column on ticket sales' (#698) from 3028-sale_visible into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #698 Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
commit
4c76ec0d01
|
@ -60,8 +60,12 @@ module.exports = Self => {
|
|||
const [salesAvailable] = await Self.rawSql(query, [id], myOptions);
|
||||
|
||||
const itemAvailable = new Map();
|
||||
for (let sale of salesAvailable)
|
||||
itemAvailable.set(sale.itemFk, sale.available);
|
||||
for (let sale of salesAvailable) {
|
||||
itemAvailable.set(sale.itemFk, {
|
||||
visible: sale.visible,
|
||||
available: sale.available
|
||||
});
|
||||
}
|
||||
|
||||
// Get claimed sales
|
||||
const saleIds = sales.map(sale => sale.id);
|
||||
|
@ -84,7 +88,9 @@ module.exports = Self => {
|
|||
|
||||
for (let sale of sales) {
|
||||
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);
|
||||
if (problems) {
|
||||
sale.isAvailable = problems.isAvailable;
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
</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>Id</vn-th>
|
||||
<vn-th shrink>Quantity</vn-th>
|
||||
|
@ -112,6 +113,13 @@
|
|||
zoom-image="{{::$root.imagePath('catalog', '1600x900', sale.itemFk)}}"
|
||||
on-error-src/>
|
||||
</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-chip
|
||||
class="transparent"
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
<vn-tr>
|
||||
<vn-th shrink></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>Quantity</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
|
@ -169,6 +170,13 @@
|
|||
{{sale.itemFk | zeroFill:6}}
|
||||
</span>
|
||||
</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-chip
|
||||
class="transparent"
|
||||
|
|
Loading…
Reference in New Issue