Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
This commit is contained in:
commit
1ac820478e
|
@ -151,7 +151,7 @@ pipeline {
|
|||
if (!env.COMMITTER_EMAIL) return
|
||||
try {
|
||||
mail(
|
||||
to: env.GIT_COMMITTER_EMAIL,
|
||||
to: env.COMMITTER_EMAIL,
|
||||
subject: "Pipeline: ${env.JOB_NAME} (${env.BUILD_NUMBER}): ${currentBuild.currentResult}",
|
||||
body: "Check status at ${env.BUILD_URL}"
|
||||
)
|
||||
|
|
|
@ -273,7 +273,7 @@ export default {
|
|||
sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',
|
||||
firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span',
|
||||
popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover 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(4)',
|
||||
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)'
|
||||
},
|
||||
ticketsIndex: {
|
||||
|
@ -341,18 +341,18 @@ export default {
|
|||
firstSaleQuantity: `vn-textfield[model="sale.quantity"]:nth-child(1) input`,
|
||||
firstSaleQuantityClearInput: `vn-textfield[model="sale.quantity"] div.suffix > i`,
|
||||
firstSaleID: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(4) > span',
|
||||
firstSalePrice: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(7)',
|
||||
firstSalePrice: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) > vn-td:nth-child(7) > span',
|
||||
firstSalePriceInput: 'vn-ticket-sale:nth-child(1) > vn-vertical > vn-popover.edit.dialog-summary.ng-isolate-scope.vn-popover.shown > div > div.content > div > vn-textfield',
|
||||
firstSaleDiscount: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(8)',
|
||||
firstSaleDiscount: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(8) > span',
|
||||
firstSaleDiscountInput: 'vn-ticket-sale:nth-child(1) vn-ticket-sale-edit-discount > div > vn-textfield > div > div > div.infix > input.ng-not-empty',
|
||||
firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(9)',
|
||||
firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)',
|
||||
firstSaleColour: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(5) section:nth-child(1)`,
|
||||
firstSaleLength: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(5) section:nth-child(3)`,
|
||||
firstSaleColour: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(6) section:nth-child(1)`,
|
||||
firstSaleLength: `vn-ticket-sale vn-tr:nth-child(1) vn-td:nth-child(6) section:nth-child(3)`,
|
||||
firstSaleCheckbox: `vn-ticket-sale vn-tr:nth-child(1) vn-check[field="sale.checked"] md-checkbox`,
|
||||
secondSaleClaimIcon: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > a > vn-icon',
|
||||
secondSaleColour: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(5) section:nth-child(5)`,
|
||||
secondSalePrice: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(7)`,
|
||||
secondSaleColour: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(6) section:nth-child(5)`,
|
||||
secondSalePrice: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(7) > span`,
|
||||
secondSaleDiscount: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(8)`,
|
||||
secondSaleImport: `vn-ticket-sale vn-tr:nth-child(2) vn-td:nth-child(9)`,
|
||||
secondSaleText: `vn-table div > vn-tbody > vn-tr:nth-child(2)`,
|
||||
|
|
|
@ -538,16 +538,16 @@ xdescribe('Ticket Edit sale path', () => {
|
|||
describe('when state is preparation and loged as Production', () => {
|
||||
it(`should not be able to edit the sale price`, async() => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketSales.firstSalePrice)
|
||||
.exists(selectors.ticketSales.firstSalePriceInput);
|
||||
.wait(selectors.ticketSales.firstSaleID)
|
||||
.exists(selectors.ticketSales.firstSalePrice);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it(`should not be able to edit the sale discount`, async() => {
|
||||
const result = await nightmare
|
||||
.waitToClick(selectors.ticketSales.firstSaleDiscount)
|
||||
.exists(selectors.ticketSales.firstSaleDiscountInput);
|
||||
.waitToClick(selectors.ticketSales.firstSaleID)
|
||||
.exists(selectors.ticketSales.firstSaleDiscount);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
vn-button {
|
||||
& i[class="material-icons"] {
|
||||
margin-top: 6px;
|
||||
& > button > vn-icon {
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
@import "variables";
|
||||
|
||||
vn-fetched-tags {
|
||||
&.noTitle vn-one {
|
||||
display: none !important;
|
||||
}
|
||||
& > vn-horizontal {
|
||||
align-items: center;
|
||||
|
||||
@media screen and (max-width: 1600px) {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
|
||||
& > vn-one {
|
||||
padding-bottom: .2em;
|
||||
}
|
||||
}
|
||||
& > vn-one {
|
||||
min-width: 12em;
|
||||
}
|
||||
& > vn-auto > .inline-tag {
|
||||
display: inline-block;
|
||||
color: $color-font-secondary;
|
||||
margin-right: .4em;
|
||||
text-align: center;
|
||||
font-size: .8em;
|
||||
height: 1.25em;
|
||||
padding: .1em;
|
||||
border-radius: .1em;
|
||||
width: 4em;
|
||||
border: 1px solid $color-font-secondary;
|
||||
|
||||
&.empty {
|
||||
border: 1px solid $color-bg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -40,7 +40,6 @@ import './input-range';
|
|||
import './chip';
|
||||
import './input-number';
|
||||
import './input-time';
|
||||
import './fetched-tags';
|
||||
import './log';
|
||||
import './treeview';
|
||||
import './treeview/child';
|
||||
|
|
|
@ -72,10 +72,11 @@ vn-table {
|
|||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 6em;
|
||||
max-width: 5em;
|
||||
|
||||
&[number] {
|
||||
text-align: right;
|
||||
width: 6em;
|
||||
}
|
||||
&[center] {
|
||||
text-align: center;
|
||||
|
@ -85,7 +86,7 @@ vn-table {
|
|||
text-align: center;
|
||||
}
|
||||
&[expand] {
|
||||
max-width: 40em;
|
||||
max-width: 10em;
|
||||
min-width: 0;
|
||||
}
|
||||
vn-icon.bright, i.bright {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import './md-override.scss';
|
||||
import './mdl-override.scss';
|
||||
import './mdi-override.css';
|
||||
import './zoom-image.scss';
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
html {
|
||||
background-color: initial;
|
||||
}
|
||||
|
||||
// Disable ng-repeat effects
|
||||
|
||||
.ng-enter,
|
||||
.ng-leave {
|
||||
transition: none !important;
|
||||
}
|
|
@ -20,7 +20,7 @@ body {
|
|||
.mdl-textfield--floating-label.has-placeholder .mdl-textfield__label {
|
||||
color: $color-main !important;
|
||||
}
|
||||
.mdl-checkbox.is-checked .mdl-checkbox__box-outline, {
|
||||
.mdl-checkbox.is-checked .mdl-checkbox__box-outline {
|
||||
border: 2px solid $color-main;
|
||||
}
|
||||
fieldset[disabled] .mdl-checkbox .mdl-checkbox__box-outline, .mdl-checkbox.is-disabled .mdl-checkbox__box-outline {
|
||||
|
|
|
@ -23,9 +23,3 @@
|
|||
background-color: $color-active;
|
||||
color: $color-active-font;
|
||||
}
|
||||
|
||||
// Disable ng-repeat effects
|
||||
.ng-enter, .ng-leave {
|
||||
-webkit-transition: none !important;
|
||||
transition: none !important
|
||||
}
|
|
@ -1,17 +1,4 @@
|
|||
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
html [full-height], .full-height {
|
||||
height: 100%;
|
||||
}
|
||||
html [self-scroll], .self-scroll {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Horizontal & vertical */
|
||||
|
||||
html [vn-horizontal], vn-horizontal, .vn-horizontal,
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
@import "./variables";
|
||||
@import "./effects";
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a:focus,
|
||||
input:focus,
|
||||
button:focus {
|
||||
|
|
|
@ -22,12 +22,12 @@ module.exports = function(Self) {
|
|||
oldInstance = await fkToValue(oldInstanceFk, ctx);
|
||||
if (ctx.where && !ctx.currentInstance) {
|
||||
let fields = Object.keys(ctx.data);
|
||||
ctx.oldInstances = await Self.modelBuilder.models[ctx.Model.definition.name].find({where: ctx.where, fields: fields});
|
||||
ctx.oldInstances = await ctx.Model.app.models[ctx.Model.definition.name].find({where: ctx.where, fields: fields});
|
||||
}
|
||||
}
|
||||
if (ctx.isNewInstance) {
|
||||
if (ctx.isNewInstance)
|
||||
newInstance = await fkToValue(ctx.instance.__data, ctx);
|
||||
}
|
||||
|
||||
ctx.hookState.oldInstance = oldInstance;
|
||||
ctx.hookState.newInstance = newInstance;
|
||||
});
|
||||
|
@ -36,7 +36,7 @@ module.exports = function(Self) {
|
|||
if (ctx.where) {
|
||||
let affectedModel = ctx.Model.definition.name;
|
||||
let definition = ctx.Model.definition;
|
||||
let deletedInstances = await Self.modelBuilder.models[affectedModel].find({where: ctx.where});
|
||||
let deletedInstances = await ctx.Model.app.models[affectedModel].find({where: ctx.where});
|
||||
let relation = definition.settings.log.relation;
|
||||
|
||||
if (relation) {
|
||||
|
@ -81,12 +81,11 @@ module.exports = function(Self) {
|
|||
};
|
||||
|
||||
let transaction = {};
|
||||
if (ctx.options && ctx.options.transaction) {
|
||||
if (ctx.options && ctx.options.transaction)
|
||||
transaction = ctx.options.transaction;
|
||||
}
|
||||
|
||||
let logModel = definition.settings.log.model;
|
||||
await Self.modelBuilder.models[logModel].create(logRecord, transaction);
|
||||
await ctx.Model.app.models[logModel].create(logRecord, transaction);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -147,25 +146,23 @@ module.exports = function(Self) {
|
|||
if (changedModelValue && (!ctx.instance || !ctx.instance[changedModelValue])) {
|
||||
var where = [];
|
||||
changedModelId = [];
|
||||
let changedInstances = await Self.modelBuilder.models[definition.name].find({where: ctx.where, fields: ['id', changedModelValue]});
|
||||
let changedInstances = await ctx.Model.app.models[definition.name].find({where: ctx.where, fields: ['id', changedModelValue]});
|
||||
changedInstances.forEach(element => {
|
||||
where.push(element[changedModelValue]);
|
||||
changedModelId.push(element.id);
|
||||
});
|
||||
} else if (ctx.hookState.oldInstance) {
|
||||
} else if (ctx.hookState.oldInstance)
|
||||
where = ctx.instance[changedModelValue];
|
||||
}
|
||||
|
||||
|
||||
// Set oldInstance, newInstance, userFk and action
|
||||
let oldInstance = {};
|
||||
if (ctx.hookState.oldInstance) {
|
||||
if (ctx.hookState.oldInstance)
|
||||
Object.assign(oldInstance, ctx.hookState.oldInstance);
|
||||
}
|
||||
|
||||
let newInstance = {};
|
||||
if (ctx.hookState.newInstance) {
|
||||
if (ctx.hookState.newInstance)
|
||||
Object.assign(newInstance, ctx.hookState.newInstance);
|
||||
}
|
||||
|
||||
let userFk;
|
||||
if (loopBackContext)
|
||||
|
@ -189,17 +186,16 @@ module.exports = function(Self) {
|
|||
let logModel = definition.settings.log.model;
|
||||
|
||||
let transaction = {};
|
||||
if (ctx.options && ctx.options.transaction) {
|
||||
if (ctx.options && ctx.options.transaction)
|
||||
transaction = ctx.options.transaction;
|
||||
}
|
||||
|
||||
await Self.modelBuilder.models[logModel].create(logsToSave, transaction);
|
||||
await ctx.Model.app.models[logModel].create(logsToSave, transaction);
|
||||
}
|
||||
|
||||
// this function retuns all the instances changed in case this is an updateAll
|
||||
function setLogsToSave(changedInstances, changedInstancesIds, logRecord, ctx) {
|
||||
let promises = [];
|
||||
if (changedInstances && typeof changedInstances == "object") {
|
||||
if (changedInstances && typeof changedInstances == 'object') {
|
||||
for (let i = 0; i < changedInstances.length; i++) {
|
||||
logRecord.changedModelId = changedInstancesIds[i];
|
||||
logRecord.changedModelValue = changedInstances[i];
|
||||
|
@ -207,9 +203,9 @@ module.exports = function(Self) {
|
|||
logRecord.oldInstance = ctx.oldInstances[i];
|
||||
promises.push(JSON.parse(JSON.stringify(logRecord)));
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
return logRecord;
|
||||
}
|
||||
|
||||
return promises;
|
||||
}
|
||||
|
||||
|
@ -217,11 +213,11 @@ module.exports = function(Self) {
|
|||
let oldInstance = ctx.hookState.oldInstance;
|
||||
let newInstance = ctx.hookState.newInstance;
|
||||
|
||||
if (oldInstance && newInstance) {
|
||||
if (oldInstance && newInstance)
|
||||
return 'update';
|
||||
} else if (!oldInstance && newInstance) {
|
||||
else if (!oldInstance && newInstance)
|
||||
return 'insert';
|
||||
}
|
||||
|
||||
return 'delete';
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<vn-horizontal>
|
||||
<vn-one>{{::$ctrl.title}}</vn-one>
|
||||
<vn-auto>
|
||||
<section
|
||||
class="inline-tag ellipsize"
|
||||
ng-class="::{empty: !fetchedTag.value}"
|
||||
ng-repeat="fetchedTag in $ctrl.tags track by $index"
|
||||
title="{{::fetchedTag.name}}: {{::fetchedTag.value}}">
|
||||
{{::fetchedTag.value}}
|
||||
</section>
|
||||
</vn-auto>
|
||||
</vn-horizontal>
|
|
@ -1,4 +1,4 @@
|
|||
import ngModule from '../../module';
|
||||
import ngModule from '../module';
|
||||
import './style.scss';
|
||||
|
||||
export default class FetchedTags {
|
|
@ -0,0 +1,56 @@
|
|||
@import "variables";
|
||||
|
||||
vn-fetched-tags {
|
||||
&.noTitle vn-one {
|
||||
display: none !important;
|
||||
}
|
||||
& > vn-horizontal {
|
||||
align-items: center;
|
||||
|
||||
& > vn-one {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 5em;
|
||||
}
|
||||
& > vn-auto {
|
||||
display: flex;
|
||||
padding-left: .4em;
|
||||
min-width: 12em;
|
||||
|
||||
& > .inline-tag {
|
||||
display: inline-block;
|
||||
color: $color-font-secondary;
|
||||
margin-left: .4em;
|
||||
text-align: center;
|
||||
font-size: .8em;
|
||||
height: 1.25em;
|
||||
padding: .1em;
|
||||
border-radius: .1em;
|
||||
width: 4em;
|
||||
min-width: 4em;
|
||||
border: 1px solid $color-spacer;
|
||||
|
||||
&.empty {
|
||||
border: 1px solid $color-spacer-light;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1600px) {
|
||||
flex-direction: column;
|
||||
|
||||
& > vn-one {
|
||||
padding-bottom: .2em;
|
||||
}
|
||||
& > vn-auto {
|
||||
white-space: initial;
|
||||
padding-left: 0;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
|
||||
& > .inline-tag {
|
||||
margin: .1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import './card';
|
|||
import './descriptor';
|
||||
import './descriptor-popover';
|
||||
import './data';
|
||||
import './fetched-tags';
|
||||
import './tags';
|
||||
import './tax';
|
||||
// import './history';
|
||||
|
|
|
@ -23,15 +23,15 @@
|
|||
<vn-th th-id="picture"></vn-th>
|
||||
<vn-th field="id" number>Id</vn-th>
|
||||
<vn-th th-id="description" style="text-align: center">Description</vn-th>
|
||||
<vn-th th-id="stems">Stems</vn-th>
|
||||
<vn-th th-id="stems" number>Stems</vn-th>
|
||||
<vn-th th-id="type">Type</vn-th>
|
||||
<vn-th th-id="category">Category</vn-th>
|
||||
<vn-th th-id="intrastat">Intrastat</vn-th>
|
||||
<vn-th th-id="origin">Origin</vn-th>
|
||||
<vn-th th-id="salesperson">Sales person</vn-th>
|
||||
<vn-th th-id="density">Density</vn-th>
|
||||
<vn-th th-id="density" number>Density</vn-th>
|
||||
<vn-th th-id="taxClass">Tax class</vn-th>
|
||||
<vn-th th-id="active">Active</vn-th>
|
||||
<vn-th th-id="active" shrink>Active</vn-th>
|
||||
<vn-th></vn-th>
|
||||
</vn-tr>
|
||||
</vn-thead>
|
||||
|
@ -46,7 +46,7 @@
|
|||
ng-click="$ctrl.stopEvent($event)"
|
||||
on-error-src/>
|
||||
</vn-td>
|
||||
<vn-td expand>
|
||||
<vn-td number>
|
||||
<span
|
||||
class="link"
|
||||
ng-click="$ctrl.showItemDescriptor($event, item.id)">
|
||||
|
@ -74,7 +74,7 @@
|
|||
</vn-td>
|
||||
<vn-td number>{{::item.density}}</vn-td>
|
||||
<vn-td>{{::item.taxClass}}</vn-td>
|
||||
<vn-td>
|
||||
<vn-td shrink>
|
||||
<vn-check
|
||||
disabled="true"
|
||||
field="::item.isActive">
|
||||
|
@ -97,7 +97,7 @@
|
|||
</a>
|
||||
</vn-tbody>
|
||||
</vn-table>
|
||||
<vn-card margin-medium-v>
|
||||
</vn-card>
|
||||
<vn-pagination model="model"></vn-pagination>
|
||||
</div>
|
||||
<a ui-sref="item.create" vn-tooltip="New item" vn-bind="+" fixed-bottom-right>
|
||||
|
|
|
@ -3,21 +3,21 @@ const app = require('vn-loopback/server/server');
|
|||
describe('ticket deleted()', () => {
|
||||
let ticket;
|
||||
|
||||
beforeAll(async () => {
|
||||
beforeAll(async() => {
|
||||
let originalTicket = await app.models.Ticket.findOne({where: {id: 16}});
|
||||
originalTicket.id = null;
|
||||
ticket = await app.models.Ticket.create(originalTicket);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
afterAll(async() => {
|
||||
await app.models.Ticket.destroyById(ticket.id);
|
||||
});
|
||||
|
||||
it('should make sure the ticket is not deleted yet', async () => {
|
||||
it('should make sure the ticket is not deleted yet', async() => {
|
||||
expect(ticket.isDeleted).toEqual(false);
|
||||
});
|
||||
|
||||
it('should set a ticket to deleted and log the change on TicketState table', async () => {
|
||||
it('should set a ticket to deleted and log the change on TicketState table', async() => {
|
||||
let ctx = {req: {accessToken: {userId: 9}}};
|
||||
let params = {id: ticket.id};
|
||||
await app.models.Ticket.deleted(ctx, params);
|
||||
|
@ -29,7 +29,7 @@ describe('ticket deleted()', () => {
|
|||
expect(changedState.stateFk).toEqual(17);
|
||||
});
|
||||
|
||||
it('should throw an error if the given ticket has a claim', async () => {
|
||||
it('should throw an error if the given ticket has a claim', async() => {
|
||||
let ctx = {req: {accessToken: {userId: 9}}};
|
||||
let params = {id: 16};
|
||||
let error;
|
||||
|
|
|
@ -135,14 +135,15 @@ module.exports = Self => {
|
|||
relation: 'user'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
}, {
|
||||
relation: 'atender',
|
||||
scope: {
|
||||
include: {
|
||||
relation: 'user'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
relation: 'sale'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{
|
||||
"name": "Ticket",
|
||||
"base": "VnModel",
|
||||
"base": "Loggable",
|
||||
"log": {
|
||||
"model":"TicketLog"
|
||||
},
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "ticket"
|
||||
|
|
|
@ -11,7 +11,7 @@ class Controller {
|
|||
{callback: this.showAddTurnDialog, name: 'Add turn', show: true},
|
||||
{callback: this.showAddStowaway, name: 'Add stowaway', show: () => this.isTicketModule()},
|
||||
{callback: this.showRemoveStowaway, name: 'Remove stowaway', show: () => this.shouldShowRemoveStowaway()},
|
||||
{callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true},
|
||||
/* {callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true}, */
|
||||
{callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true},
|
||||
/* callback: this.showChangeShipped, name: 'Change shipped hour', show: true} */
|
||||
];
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<vn-td number>
|
||||
<span
|
||||
ng-show="::request.saleFk"
|
||||
ng-click="$ctrl.showItemDescriptor($event, request.sale)"
|
||||
ng-click="$ctrl.showItemDescriptor($event, request.sale.itemFk)"
|
||||
class="link">
|
||||
{{request.saleFk | zeroFill:6}}
|
||||
</span>
|
||||
|
|
|
@ -44,18 +44,18 @@ class Controller {
|
|||
});
|
||||
}
|
||||
|
||||
showItemDescriptor(event, sale) {
|
||||
showItemDescriptor(event, itemFk) {
|
||||
this.quicklinks = {
|
||||
btnThree: {
|
||||
icon: 'icon-transaction',
|
||||
state: `item.card.diary({
|
||||
id: ${sale.itemFk},
|
||||
id: ${itemFk},
|
||||
ticketFk: ${this.$stateParams.id}
|
||||
})`,
|
||||
tooltip: 'Item diary'
|
||||
}
|
||||
};
|
||||
this.$.itemDescriptor.itemFk = sale.itemFk;
|
||||
this.$.itemDescriptor.itemFk = itemFk;
|
||||
this.$.itemDescriptor.parent = event.target;
|
||||
this.$.itemDescriptor.show();
|
||||
}
|
||||
|
|
|
@ -54,16 +54,16 @@
|
|||
<vn-table model="model">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th number>
|
||||
<vn-th shrink>
|
||||
<vn-multi-check
|
||||
data="$ctrl.sales">
|
||||
</vn-multi-check>
|
||||
</vn-th>
|
||||
<vn-th></vn-th>
|
||||
<vn-th style="text-align: center">Item</vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
<vn-th number>Id</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
<vn-th number>Quantity</vn-th>
|
||||
<vn-th>Quantity</vn-th>
|
||||
<vn-th>Item</vn-th>
|
||||
<vn-th number>Price</vn-th>
|
||||
<vn-th number>Disc</vn-th>
|
||||
<vn-th number>Amount</vn-th>
|
||||
|
@ -71,12 +71,12 @@
|
|||
</vn-thead>
|
||||
<vn-tbody>
|
||||
<vn-tr ng-repeat="sale in $ctrl.sales">
|
||||
<vn-td number >
|
||||
<vn-td shrink>
|
||||
<vn-check
|
||||
field="sale.checked">
|
||||
</vn-check>
|
||||
</vn-td>
|
||||
<vn-td>
|
||||
<vn-td shrink>
|
||||
<a ui-sref="claim.card.basicData({id: sale.claim.claimFk})">
|
||||
<vn-icon
|
||||
ng-show="sale.claim.claimFk"
|
||||
|
@ -94,7 +94,7 @@
|
|||
icon="icon-reserve"
|
||||
vn-tooltip="{{::$ctrl.$translate.instant('Reserved')}}"></vn-icon>
|
||||
</vn-td>
|
||||
<vn-td style="text-align: center">
|
||||
<vn-td shrink>
|
||||
<img
|
||||
ng-src="{{::$ctrl.imagesPath}}/50x50/{{::sale.image}}"
|
||||
zoom-image="{{::$ctrl.imagesPath}}/1600x900/{{::sale.image}}"
|
||||
|
@ -107,13 +107,6 @@
|
|||
{{::sale.itemFk | zeroFill:6}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td expand>
|
||||
<vn-fetched-tags
|
||||
max-length="6"
|
||||
item="::sale.tags"
|
||||
title="::sale.concept">
|
||||
</vn-fetched-tags>
|
||||
</vn-td>
|
||||
<vn-td ng-if="!$ctrl.isEditable" number>{{sale.quantity}}</vn-td>
|
||||
<vn-td ng-if="$ctrl.isEditable" number>
|
||||
<vn-textfield
|
||||
|
@ -122,22 +115,29 @@
|
|||
type="text">
|
||||
</vn-textfield>
|
||||
</vn-td>
|
||||
<vn-td number
|
||||
ng-if="$ctrl.isEditable"
|
||||
class="link"
|
||||
ng-click="$ctrl.showEditPricePopover($event, sale)"
|
||||
vn-tooltip="Edit price">
|
||||
{{sale.price | currency: 'EUR':2}}
|
||||
<vn-td expand>
|
||||
<vn-fetched-tags
|
||||
max-length="6"
|
||||
item="::sale.tags"
|
||||
title="::sale.concept">
|
||||
</vn-fetched-tags>
|
||||
</vn-td>
|
||||
<vn-td number ng-if="$ctrl.isEditable">
|
||||
<span class="link"
|
||||
vn-tooltip="Edit price"
|
||||
ng-click="$ctrl.showEditPricePopover($event, sale)">
|
||||
{{sale.price | currency: 'EUR':2}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number ng-if="!$ctrl.isEditable">
|
||||
{{sale.price | currency: 'EUR':2}}
|
||||
</vn-td>
|
||||
<vn-td number
|
||||
ng-if="$ctrl.isEditable"
|
||||
class="link"
|
||||
ng-click="$ctrl.showEditPopover($event, sale)"
|
||||
vn-tooltip="Edit discount">
|
||||
{{sale.discount}} %
|
||||
<vn-td number ng-if="$ctrl.isEditable">
|
||||
<span class="link"
|
||||
vn-tooltip="Edit discount"
|
||||
ng-click="$ctrl.showEditPopover($event, sale)">
|
||||
{{sale.discount}} %
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number
|
||||
ng-if="!$ctrl.isEditable">
|
||||
|
@ -158,7 +158,7 @@
|
|||
<!-- Edit Price Popover -->
|
||||
<vn-popover
|
||||
class="edit dialog-summary"
|
||||
vn-id="editPricePopover"
|
||||
vn-id="edit-price-popover"
|
||||
on-open="$ctrl.getManaSalespersonMana()">
|
||||
<vn-horizontal pad-medium class="header">
|
||||
<h5>MANÁ: {{$ctrl.mana | currency: 'EUR':0}}</h5>
|
||||
|
@ -185,7 +185,7 @@
|
|||
<!-- Edit Popover -->
|
||||
<vn-popover
|
||||
class="edit dialog-summary"
|
||||
vn-id="editPopover"
|
||||
vn-id="edit-popover"
|
||||
on-open="$ctrl.getManaSalespersonMana()">
|
||||
<vn-ticket-sale-edit-discount
|
||||
mana="$ctrl.mana"
|
||||
|
|
|
@ -55,10 +55,10 @@
|
|||
<vn-table class="vn-grid">
|
||||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th></vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
<vn-th number>Item</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
<vn-th number>Quantity</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
<vn-th number>Price</vn-th>
|
||||
<vn-th number>Discount</vn-th>
|
||||
<vn-th number>Amount</vn-th>
|
||||
|
@ -66,7 +66,7 @@
|
|||
</vn-thead>
|
||||
<vn-tbody>
|
||||
<vn-tr ng-repeat="sale in $ctrl.summary.sales track by sale.id">
|
||||
<vn-td>
|
||||
<vn-td shrink>
|
||||
<a ui-sref="claim.card.basicData({id: sale.claimBeginning.claimFk})">
|
||||
<vn-icon
|
||||
ng-show="sale.claimBeginning.claimFk"
|
||||
|
@ -89,8 +89,8 @@
|
|||
{{sale.itemFk | zeroFill:6}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td expand><vn-fetched-tags max-length="6" item="sale.item" title="sale.concept"/></vn-td>
|
||||
<vn-td number>{{::sale.quantity}}</vn-td>
|
||||
<vn-td expand><vn-fetched-tags max-length="6" item="sale.item" title="sale.concept"/></vn-td>
|
||||
<vn-td number>{{::sale.price | currency: 'EUR':2}}</vn-td>
|
||||
<vn-td number>{{::sale.discount}} %</vn-td>
|
||||
<vn-td number>{{::sale.quantity * sale.price | currency: 'EUR':2}}</vn-td>
|
||||
|
@ -123,8 +123,8 @@
|
|||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th number>Id</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
<vn-th number>Quantity</vn-th>
|
||||
<vn-th>Description</vn-th>
|
||||
<vn-th number>Price</vn-th>
|
||||
<vn-th>Tax class</vn-th>
|
||||
</vn-tr>
|
||||
|
@ -132,8 +132,8 @@
|
|||
<vn-tbody>
|
||||
<vn-tr ng-repeat="service in $ctrl.summary.services">
|
||||
<vn-td number>{{::service.id}}</vn-td>
|
||||
<vn-td expand>{{::service.description}}</vn-td>
|
||||
<vn-td number>{{::service.quantity}}</vn-td>
|
||||
<vn-td expand>{{::service.description}}</vn-td>
|
||||
<vn-td number>{{::service.price}}</vn-td>
|
||||
<vn-td>{{::service.taxClass.description}}</vn-td>
|
||||
</vn-tr>
|
||||
|
@ -151,7 +151,7 @@
|
|||
<vn-th>Atender</vn-th>
|
||||
<vn-th number>Quantity</vn-th>
|
||||
<vn-th number>Price</vn-th>
|
||||
<vn-th number>Sale id</vn-th>
|
||||
<vn-th number>Item</vn-th>
|
||||
<vn-th number>Ok</vn-th>
|
||||
</vn-tr>
|
||||
</vn-thead>
|
||||
|
@ -166,9 +166,9 @@
|
|||
<vn-td number>
|
||||
<span
|
||||
ng-show="::request.saleFk"
|
||||
ng-click="$ctrl.showDescriptor($event, request.saleFk)"
|
||||
ng-click="$ctrl.showDescriptor($event, request.sale.itemFk)"
|
||||
class="link">
|
||||
{{request.saleFk | zeroFill:6}}
|
||||
{{request.sale.itemFk | zeroFill:6}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>
|
||||
|
|
|
@ -1029,8 +1029,10 @@ INSERT INTO `hedera`.`tpvTransaction`(`id`,`merchantFk`, `clientFk`,`receiptFk`,
|
|||
VALUES
|
||||
(1, 1, 101, NULL, 2000, NULL, 'SIS0042', 'ok', CURDATE()),
|
||||
(2, 1, 101, NULL, 1000, NULL, 'SIS0051', 'started', CURDATE()),
|
||||
(3, 2, 101, NULL, 7268, 0, NULL, 'ok', CURDATE()),
|
||||
(4, 2, 101, NULL, 4698, 100, NULL, 'started', CURDATE());
|
||||
(3, 2, 101, NULL, 7268, NULL, NULL, 'ok', CURDATE()),
|
||||
(4, 2, 101, NULL, 4698, NULL, NULL, 'started', CURDATE()),
|
||||
(5, 1, 104, NULL, 2000, NULL, 'SIS0043', 'ok', CURDATE()),
|
||||
(6, 2, 104, NULL, 4000, NULL, 'SIS0044', 'started', CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`orderTicket`(`orderFk`, `ticketFk`)
|
||||
VALUES
|
||||
|
|
Loading…
Reference in New Issue