refactor tod usa get sales
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
bc887bce8e
commit
df073cce2f
|
@ -22,7 +22,7 @@ module.exports = Self => {
|
|||
Self.summary = async ticketFk => {
|
||||
let models = Self.app.models;
|
||||
let summaryObj = await getTicketData(Self, ticketFk);
|
||||
summaryObj.sales = await getSales(models.Sale, ticketFk);
|
||||
summaryObj.sales = await models.Ticket.getSales(ticketFk);
|
||||
summaryObj.packagings = await models.TicketPackaging.find({
|
||||
where: {ticketFk: ticketFk},
|
||||
include: [{relation: 'packaging',
|
||||
|
@ -102,20 +102,6 @@ module.exports = Self => {
|
|||
return await Self.findOne(filter);
|
||||
}
|
||||
|
||||
async function getSales(Sale, ticketFk) {
|
||||
let filter = {
|
||||
where: {
|
||||
ticketFk: ticketFk
|
||||
},
|
||||
order: 'concept',
|
||||
include: [
|
||||
{relation: 'item'},
|
||||
{relation: 'claimBeginning'}
|
||||
]
|
||||
};
|
||||
return await Sale.find(filter);
|
||||
}
|
||||
|
||||
async function getRequests(Self, ticketFk) {
|
||||
let filter = {
|
||||
where: {
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
<vn-tr>
|
||||
<vn-th shrink></vn-th>
|
||||
<vn-th number shrink>Item</vn-th>
|
||||
<vn-th number shrink>Available</vn-th>
|
||||
<vn-th number shrink>Quantity</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
<vn-th number>Price</vn-th>
|
||||
|
@ -137,12 +138,6 @@
|
|||
vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}">
|
||||
</vn-icon>
|
||||
</a>
|
||||
<vn-icon
|
||||
ng-show="sale.visible || sale.available"
|
||||
color-main
|
||||
icon="warning"
|
||||
vn-tooltip="Visible: {{::sale.visible || 0}} <br> {{::$ctrl.translate.instant('Available')}} {{::sale.available || 0}}">
|
||||
</vn-icon>
|
||||
<vn-icon ng-show="sale.reserved" icon="icon-reserva"></vn-icon>
|
||||
</vn-td>
|
||||
<vn-td number shrink>
|
||||
|
@ -152,6 +147,10 @@
|
|||
{{sale.itemFk | zeroFill:6}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number shrink>
|
||||
<vn-chip class="transparent" ng-class="{'message': sale.available < 0}">{{::sale.available}}
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
<vn-td number shrink>{{::sale.quantity}}</vn-td>
|
||||
<vn-td vn-fetched-tags wide>
|
||||
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>
|
||||
|
|
Loading…
Reference in New Issue