2891 - Get ticket problems for every sale #629

Merged
carlosjr merged 7 commits from 2891-ticket_sale_problems into dev 2021-05-27 09:49:44 +00:00
3 changed files with 8 additions and 23 deletions
Showing only changes of commit 60185bdf34 - Show all commits

View File

@ -461,8 +461,8 @@ export default {
itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
itemDescriptorPopoverItemDiaryButton: 'vn-item-descriptor a[href="#!/item/2/diary?warehouseFk=5&lineFk=16"]',
popoverDiaryButton: '.vn-popover.shown vn-item-descriptor vn-icon[icon="icon-transaction"]',
firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(3)',
firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)',
firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(4)',
firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(7)',
invoiceOutRef: 'vn-ticket-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(7) > section > span',
setOk: 'vn-ticket-summary vn-button[label="SET OK"] > button',
descriptorTicketId: 'vn-ticket-descriptor > vn-descriptor-content > div > div.body > div.top > div'

View File

@ -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: {

View File

@ -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>