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', itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
itemDescriptorPopoverItemDiaryButton: 'vn-item-descriptor a[href="#!/item/2/diary?warehouseFk=5&lineFk=16"]', 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"]', 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)', 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(6)', 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', 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', setOk: 'vn-ticket-summary vn-button[label="SET OK"] > button',
descriptorTicketId: 'vn-ticket-descriptor > vn-descriptor-content > div > div.body > div.top > div' 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 => { Self.summary = async ticketFk => {
let models = Self.app.models; let models = Self.app.models;
let summaryObj = await getTicketData(Self, ticketFk); 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({ summaryObj.packagings = await models.TicketPackaging.find({
where: {ticketFk: ticketFk}, where: {ticketFk: ticketFk},
include: [{relation: 'packaging', include: [{relation: 'packaging',
@ -102,20 +102,6 @@ module.exports = Self => {
return await Self.findOne(filter); 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) { async function getRequests(Self, ticketFk) {
let filter = { let filter = {
where: { where: {

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>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>
<vn-th number>Price</vn-th> <vn-th number>Price</vn-th>
@ -137,12 +138,6 @@
vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}"> vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}">
</vn-icon> </vn-icon>
</a> </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-icon ng-show="sale.reserved" icon="icon-reserva"></vn-icon>
</vn-td> </vn-td>
<vn-td number shrink> <vn-td number shrink>
@ -152,6 +147,10 @@
{{sale.itemFk | zeroFill:6}} {{sale.itemFk | zeroFill:6}}
</span> </span>
</vn-td> </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 number shrink>{{::sale.quantity}}</vn-td>
<vn-td vn-fetched-tags wide> <vn-td vn-fetched-tags wide>
<vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one> <vn-one title="{{::sale.item.name}}">{{::sale.item.name}}</vn-one>