Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 5000-invoiceOut.global-invoicing
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
67f9cae2f2
|
@ -131,7 +131,7 @@ module.exports = Self => {
|
|||
WHERE u.id = ?`, [userId], options);
|
||||
|
||||
let roles = [];
|
||||
for (role of result)
|
||||
for (const role of result)
|
||||
roles.push(role.name);
|
||||
|
||||
return roles;
|
||||
|
|
|
@ -1828,7 +1828,12 @@ INSERT INTO vn.claimRma (`id`, `code`, `created`, `workerFk`)
|
|||
(4, '02676A049183', DEFAULT, 1107),
|
||||
(5, '01837B023653', DEFAULT, 1106);
|
||||
|
||||
|
||||
INSERT INTO `vn`.`claimLog` (`originFk`, userFk, `action`, changedModel, oldInstance, newInstance, changedModelId, `description`)
|
||||
VALUES
|
||||
(1, 18, 'update', 'Claim', '{"hasToPickUp":false}', '{"hasToPickUp":true}', 1, NULL),
|
||||
(1, 18, 'update', 'ClaimObservation', '{}', '{"claimFk":1,"text":"Waiting for customer"}', 1, NULL),
|
||||
(1, 18, 'insert', 'ClaimBeginning', '{}', '{"claimFk":1,"saleFk":1,"quantity":10}', 1, NULL),
|
||||
(1, 18, 'insert', 'ClaimDms', '{}', '{"claimFk":1,"dmsFk":1}', 1, NULL);
|
||||
|
||||
INSERT INTO `hedera`.`tpvMerchant`(`id`, `description`, `companyFk`, `bankFk`, `secretKey`)
|
||||
VALUES
|
||||
|
@ -2760,7 +2765,6 @@ INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldIns
|
|||
(7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL),
|
||||
(7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'");
|
||||
|
||||
|
||||
INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`)
|
||||
VALUES
|
||||
(0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', '1,6', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all');
|
||||
|
|
10246
db/dump/structure.sql
10246
db/dump/structure.sql
File diff suppressed because it is too large
Load Diff
|
@ -12,6 +12,9 @@ services:
|
|||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
resources:
|
||||
limits:
|
||||
memory: 1G
|
||||
back:
|
||||
image: registry.verdnatura.es/salix-back:${BRANCH_NAME:?}
|
||||
build: .
|
||||
|
@ -38,6 +41,9 @@ services:
|
|||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
configs:
|
||||
datasources:
|
||||
external: true
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
|
||||
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||
const buildFilter = require('vn-loopback/util/filter').buildFilter;
|
||||
const {mergeFilters, mergeWhere} = require('vn-loopback/util/filter');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('logs', {
|
||||
description: 'Find all claim logs of the claim entity matched by a filter',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'id',
|
||||
type: 'Number',
|
||||
description: 'The claim id',
|
||||
http: {source: 'path'}
|
||||
},
|
||||
{
|
||||
arg: 'filter',
|
||||
type: 'object',
|
||||
http: {source: 'query'}
|
||||
},
|
||||
{
|
||||
arg: 'search',
|
||||
type: 'string',
|
||||
http: {source: 'query'}
|
||||
},
|
||||
{
|
||||
arg: 'userFk',
|
||||
type: 'number',
|
||||
http: {source: 'query'}
|
||||
},
|
||||
{
|
||||
arg: 'created',
|
||||
type: 'date',
|
||||
http: {source: 'query'}
|
||||
},
|
||||
],
|
||||
returns: {
|
||||
type: ['object'],
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/:id/logs`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.logs = async(ctx, id, filter, options) => {
|
||||
const conn = Self.dataSource.connector;
|
||||
const args = ctx.args;
|
||||
const myOptions = {};
|
||||
let to;
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
let where = buildFilter(args, (param, value) => {
|
||||
switch (param) {
|
||||
case 'search':
|
||||
return {
|
||||
or: [
|
||||
{changedModel: {like: `%${value}%`}},
|
||||
{oldInstance: {like: `%${value}%`}}
|
||||
]
|
||||
};
|
||||
case 'userFk':
|
||||
return {'cl.userFk': value};
|
||||
case 'created':
|
||||
value.setHours(0, 0, 0, 0);
|
||||
to = new Date(value);
|
||||
to.setHours(23, 59, 59, 999);
|
||||
|
||||
return {creationDate: {between: [value, to]}};
|
||||
}
|
||||
});
|
||||
where = mergeWhere(where, {['cl.originFk']: id});
|
||||
filter = mergeFilters(args.filter, {where});
|
||||
|
||||
const stmts = [];
|
||||
|
||||
const stmt = new ParameterizedSQL(
|
||||
`SELECT
|
||||
cl.id,
|
||||
cl.userFk,
|
||||
u.name AS userName,
|
||||
cl.oldInstance,
|
||||
cl.newInstance,
|
||||
cl.changedModel,
|
||||
cl.action,
|
||||
cl.creationDate AS created
|
||||
FROM claimLog cl
|
||||
JOIN account.user u ON u.id = cl.userFk
|
||||
`
|
||||
);
|
||||
|
||||
stmt.merge(conn.makeSuffix(filter));
|
||||
stmts.push(stmt);
|
||||
|
||||
const sql = ParameterizedSQL.join(stmts, ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
|
||||
const logs = [];
|
||||
for (const row of result) {
|
||||
const changes = [];
|
||||
const oldInstance = JSON.parse(row.oldInstance);
|
||||
const newInstance = JSON.parse(row.newInstance);
|
||||
const mergedProperties = [...Object.keys(oldInstance), ...Object.keys(newInstance)];
|
||||
const properties = new Set(mergedProperties);
|
||||
for (const property of properties) {
|
||||
let oldValue = oldInstance[property];
|
||||
let newValue = newInstance[property];
|
||||
|
||||
const change = {
|
||||
property: property,
|
||||
before: oldValue,
|
||||
after: newValue,
|
||||
};
|
||||
|
||||
changes.push(change);
|
||||
}
|
||||
|
||||
logs.push({
|
||||
model: row.changedModel,
|
||||
action: row.action,
|
||||
created: row.created,
|
||||
userFk: row.userFk,
|
||||
userName: row.userName,
|
||||
changes: changes,
|
||||
});
|
||||
}
|
||||
|
||||
return logs;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,23 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('claim log()', () => {
|
||||
const claimId = 1;
|
||||
const salesPersonId = 18;
|
||||
|
||||
it('should return results filtering by user id', async() => {
|
||||
const result = await app.models.Claim.logs({args: {userFk: salesPersonId}}, claimId);
|
||||
|
||||
const expectedObject = {
|
||||
model: 'Claim',
|
||||
action: 'update',
|
||||
changes: [
|
||||
{property: 'hasToPickUp', before: false, after: true}
|
||||
]
|
||||
};
|
||||
|
||||
const firstRow = result[0];
|
||||
|
||||
expect(result.length).toBeGreaterThan(0);
|
||||
expect(firstRow).toEqual(jasmine.objectContaining(expectedObject));
|
||||
});
|
||||
});
|
|
@ -11,7 +11,7 @@ module.exports = Self => {
|
|||
|
||||
Self.observe('before save', async ctx => {
|
||||
if (ctx.isNewInstance) return;
|
||||
await claimIsEditable(ctx);
|
||||
//await claimIsEditable(ctx);
|
||||
});
|
||||
|
||||
Self.observe('before delete', async ctx => {
|
||||
|
@ -29,21 +29,21 @@ module.exports = Self => {
|
|||
myOptions.transaction = ctx.options.transaction;
|
||||
|
||||
const claimBeginning = await Self.findById(ctx.where.id);
|
||||
|
||||
|
||||
const filter = {
|
||||
where: {id: claimBeginning.claimFk},
|
||||
include: [
|
||||
{
|
||||
relation: 'claimState',
|
||||
scope: {
|
||||
fields: ['id', 'code', 'description']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
where: {id: claimBeginning.claimFk},
|
||||
include: [
|
||||
{
|
||||
relation: 'claimState',
|
||||
scope: {
|
||||
fields: ['id', 'code', 'description']
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const [claim] = await models.Claim.find(filter, myOptions);
|
||||
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.ClaimState());
|
||||
const isEditable = await models.ClaimState.isEditable(httpCtx, claim.claimState().id);
|
||||
|
||||
if (!isEditable)
|
||||
throw new UserError(`The current claim can't be modified`);
|
||||
|
|
|
@ -10,4 +10,5 @@ module.exports = Self => {
|
|||
require('../methods/claim/downloadFile')(Self);
|
||||
require('../methods/claim/claimPickupPdf')(Self);
|
||||
require('../methods/claim/claimPickupEmail')(Self);
|
||||
require('../methods/claim/logs')(Self);
|
||||
};
|
||||
|
|
|
@ -100,8 +100,8 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
setClaimedQuantity(id, claimedQuantity) {
|
||||
let params = {id: id, quantity: claimedQuantity};
|
||||
let query = `ClaimBeginnings/`;
|
||||
let params = {quantity: claimedQuantity};
|
||||
let query = `ClaimBeginnings/${id}`;
|
||||
this.$http.patch(query, params).then(() => {
|
||||
this.vnApp.showSuccess(this.$t('Data saved!'));
|
||||
this.calculateTotals();
|
||||
|
|
|
@ -89,9 +89,12 @@ describe('claim', () => {
|
|||
|
||||
describe('setClaimedQuantity(id, claimedQuantity)', () => {
|
||||
it('should make a patch and call refresh and showSuccess', () => {
|
||||
const id = 1;
|
||||
const claimedQuantity = 1;
|
||||
|
||||
jest.spyOn(controller.vnApp, 'showSuccess');
|
||||
$httpBackend.expectPATCH(`ClaimBeginnings/`).respond({});
|
||||
controller.setClaimedQuantity(1, 1);
|
||||
$httpBackend.expectPATCH(`ClaimBeginnings/${id}`).respond({});
|
||||
controller.setClaimedQuantity(id, claimedQuantity);
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.vnApp.showSuccess).toHaveBeenCalled();
|
||||
|
|
|
@ -32,45 +32,66 @@ module.exports = Self => {
|
|||
|
||||
Self.confirm = async(signatureVersion, merchantParameters, signature) => {
|
||||
const $ = Self.app.models;
|
||||
let transaction;
|
||||
|
||||
const decodedParams = JSON.parse(
|
||||
base64url.decode(merchantParameters, 'utf8'));
|
||||
const params = {};
|
||||
try {
|
||||
const decodedParams = JSON.parse(
|
||||
base64url.decode(merchantParameters, 'utf8'));
|
||||
const params = {};
|
||||
|
||||
for (const param in decodedParams)
|
||||
params[param] = decodeURIComponent(decodedParams[param]);
|
||||
for (const param in decodedParams)
|
||||
params[param] = decodeURIComponent(decodedParams[param]);
|
||||
|
||||
const orderId = params['Ds_Order'];
|
||||
const merchantId = parseInt(params['Ds_MerchantCode']);
|
||||
const orderId = params['Ds_Order'];
|
||||
if (!orderId)
|
||||
throw new UserError('Order id not provided');
|
||||
|
||||
if (!orderId)
|
||||
throw new UserError('Order id not found');
|
||||
if (!merchantId)
|
||||
throw new UserError('Mechant id not found');
|
||||
transaction = await Self.findById(orderId, {fields: ['id']});
|
||||
if (!transaction)
|
||||
throw new UserError('Order not found');
|
||||
|
||||
const merchant = await $.TpvMerchant.findById(merchantId, {
|
||||
fields: ['id', 'secretKey']
|
||||
});
|
||||
await transaction.updateAttributes({
|
||||
merchantParameters,
|
||||
signature,
|
||||
signatureVersion,
|
||||
});
|
||||
|
||||
const base64hmac = Self.createSignature(
|
||||
orderId,
|
||||
merchant.secretKey,
|
||||
merchantParameters
|
||||
);
|
||||
const merchantId = parseInt(params['Ds_MerchantCode']);
|
||||
if (!merchantId)
|
||||
throw new UserError('Merchant id not provided');
|
||||
|
||||
if (base64hmac !== base64url.toBase64(signature))
|
||||
throw new UserError('Invalid signature');
|
||||
const merchant = await $.TpvMerchant.findById(merchantId, {
|
||||
fields: ['id', 'secretKey']
|
||||
});
|
||||
if (!merchant)
|
||||
throw new UserError('Merchant not found');
|
||||
|
||||
await Self.rawSql(
|
||||
'CALL hedera.tpvTransaction_confirm(?, ?, ?, ?, ?, ?)', [
|
||||
params['Ds_Amount'],
|
||||
const base64hmac = Self.createSignature(
|
||||
orderId,
|
||||
merchantId,
|
||||
params['Ds_Currency'],
|
||||
params['Ds_Response'],
|
||||
params['Ds_ErrorCode']
|
||||
]);
|
||||
merchant.secretKey,
|
||||
merchantParameters
|
||||
);
|
||||
|
||||
return true;
|
||||
if (base64hmac !== base64url.toBase64(signature))
|
||||
throw new UserError('Invalid signature');
|
||||
|
||||
await Self.rawSql(
|
||||
'CALL hedera.tpvTransaction_confirm(?, ?, ?, ?, ?, ?)', [
|
||||
params['Ds_Amount'],
|
||||
orderId,
|
||||
merchantId,
|
||||
params['Ds_Currency'],
|
||||
params['Ds_Response'],
|
||||
params['Ds_ErrorCode']
|
||||
]);
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (transaction)
|
||||
await transaction.updateAttribute('responseError', err.message);
|
||||
else
|
||||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -154,6 +154,11 @@
|
|||
"model": "Account",
|
||||
"foreignKey": "id"
|
||||
},
|
||||
"user": {
|
||||
"type": "belongsTo",
|
||||
"model": "Account",
|
||||
"foreignKey": "id"
|
||||
},
|
||||
"payMethod": {
|
||||
"type": "belongsTo",
|
||||
"model": "PayMethod",
|
||||
|
|
|
@ -35,6 +35,18 @@
|
|||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"merchantParameters": {
|
||||
"type": "string"
|
||||
},
|
||||
"signature": {
|
||||
"type": "string"
|
||||
},
|
||||
"signatureVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"responseError": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
@ -45,4 +57,3 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ module.exports = Self => {
|
|||
try {
|
||||
await fs.access(file.path);
|
||||
} catch (error) {
|
||||
await Self.createPdf(ctx, id);
|
||||
await Self.createPdf(ctx, id, myOptions);
|
||||
}
|
||||
|
||||
const stream = fs.createReadStream(file.path);
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
describe('InvoiceOut downloadZip()', () => {
|
||||
const userId = 9;
|
||||
const invoiceIds = '1,2';
|
||||
const ctx = {
|
||||
req: {
|
||||
|
||||
accessToken: {userId: userId},
|
||||
headers: {origin: 'http://localhost:5000'},
|
||||
}
|
||||
};
|
||||
|
||||
it('should return part of link to dowloand the zip', async() => {
|
||||
const tx = await models.InvoiceOut.beginTransaction({});
|
||||
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
const result = await models.InvoiceOut.downloadZip(ctx, invoiceIds, options);
|
||||
|
||||
expect(result).toBeDefined();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should return an error if the size of the files is too large', async() => {
|
||||
const tx = await models.InvoiceOut.beginTransaction({});
|
||||
|
||||
let error;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
const zipConfig = {
|
||||
maxSize: 0
|
||||
};
|
||||
await models.ZipConfig.create(zipConfig, options);
|
||||
|
||||
await models.InvoiceOut.downloadZip(ctx, invoiceIds, options);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toEqual(new UserError(`Files are too large`));
|
||||
});
|
||||
});
|
|
@ -3,7 +3,7 @@
|
|||
description="$ctrl.invoiceOut.ref"
|
||||
summary="$ctrl.$.summary">
|
||||
<slot-dot-menu>
|
||||
<vn-invoice-out-descriptor-menu
|
||||
<vn-invoice-out-descriptor-menu
|
||||
invoice-out="$ctrl.invoiceOut"
|
||||
parent-reload="$ctrl.reload()"
|
||||
/>
|
||||
|
@ -11,23 +11,23 @@
|
|||
<slot-body>
|
||||
<div class="attributes">
|
||||
<vn-label-value
|
||||
label="Date"
|
||||
label="Date"
|
||||
value="{{$ctrl.invoiceOut.issued | date: 'dd/MM/yyyy'}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Import"
|
||||
label="Import"
|
||||
value="{{$ctrl.invoiceOut.amount | currency: 'EUR': 2}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Client">
|
||||
<span
|
||||
<span
|
||||
ng-click="clientDescriptor.show($event, $ctrl.invoiceOut.client.id)"
|
||||
class="link">
|
||||
{{$ctrl.invoiceOut.client.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Company"
|
||||
label="Company"
|
||||
value="{{$ctrl.invoiceOut.company.code}}">
|
||||
</vn-label-value>
|
||||
</div>
|
||||
|
@ -53,4 +53,7 @@
|
|||
</vn-descriptor-content>
|
||||
<vn-popup vn-id="summary">
|
||||
<vn-invoice-out-summary invoice-out="$ctrl.invoiceOut"></vn-invoice-out-summary>
|
||||
</vn-popup>
|
||||
</vn-popup>
|
||||
<vn-client-descriptor-popover
|
||||
vn-id="clientDescriptor">
|
||||
</vn-client-descriptor-popover>
|
||||
|
|
|
@ -59,17 +59,10 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
const writeStream = fs.createWriteStream(filePath);
|
||||
writeStream.on('open', () => {
|
||||
response.pipe(writeStream);
|
||||
});
|
||||
|
||||
writeStream.on('error', async error => {
|
||||
await errorHandler(image.itemFk, error, filePath);
|
||||
});
|
||||
|
||||
writeStream.on('finish', async function() {
|
||||
writeStream.end();
|
||||
});
|
||||
writeStream.on('open', () => response.pipe(writeStream));
|
||||
writeStream.on('error', async error =>
|
||||
await errorHandler(image.itemFk, error, filePath));
|
||||
writeStream.on('finish', writeStream.end());
|
||||
|
||||
writeStream.on('close', async function() {
|
||||
try {
|
||||
|
|
|
@ -15,7 +15,7 @@ vn-sale-tracking {
|
|||
align-items: center;
|
||||
border-radius: 50%;
|
||||
font-size: .9rem;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
height: 28px;
|
||||
width: 28px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -13,55 +13,59 @@ module.exports = Self => {
|
|||
type: 'Object',
|
||||
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
arg: 'tags',
|
||||
type: ['Object'],
|
||||
description: 'List of tags to filter with',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'search',
|
||||
type: 'String',
|
||||
description: `If it's and integer searchs by id, otherwise it searchs by name`,
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'id',
|
||||
type: 'Integer',
|
||||
description: 'The worker id',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'userFk',
|
||||
type: 'Integer',
|
||||
description: 'The user id',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'fi',
|
||||
type: 'String',
|
||||
description: 'The worker fi',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'departmentFk',
|
||||
type: 'Integer',
|
||||
description: 'The worker department id',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'extension',
|
||||
type: 'Integer',
|
||||
description: 'The worker extension id',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
arg: 'firstName',
|
||||
type: 'String',
|
||||
description: 'The worker firstName',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
arg: 'name',
|
||||
},
|
||||
{
|
||||
arg: 'lastName',
|
||||
type: 'String',
|
||||
description: 'The worker name',
|
||||
description: 'The worker lastName',
|
||||
http: {source: 'query'}
|
||||
}, {
|
||||
arg: 'nickname',
|
||||
},
|
||||
{
|
||||
arg: 'userName',
|
||||
type: 'String',
|
||||
description: 'The worker nickname',
|
||||
description: 'The worker user name',
|
||||
http: {source: 'query'}
|
||||
}
|
||||
],
|
||||
|
@ -93,10 +97,10 @@ module.exports = Self => {
|
|||
return {'w.id': value};
|
||||
case 'userFk':
|
||||
return {'w.userFk': value};
|
||||
case 'name':
|
||||
return {'w.lastName': {like: `%${value}%`}};
|
||||
case 'firstName':
|
||||
return {'w.firstName': {like: `%${value}%`}};
|
||||
case 'lastName':
|
||||
return {'w.lastName': {like: `%${value}%`}};
|
||||
case 'extension':
|
||||
return {'p.extension': value};
|
||||
case 'fi':
|
||||
|
|
|
@ -16,7 +16,7 @@ describe('worker filter()', () => {
|
|||
});
|
||||
|
||||
it('should return 2 results filtering by name', async() => {
|
||||
let result = await app.models.Worker.filter({args: {filter: {}, name: 'agency'}});
|
||||
let result = await app.models.Worker.filter({args: {filter: {}, firstName: 'agency'}});
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
expect(result[0].nickname).toEqual('agencyNick');
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<vn-textfield
|
||||
vn-one
|
||||
label="Last name"
|
||||
ng-model="filter.name">
|
||||
ng-model="filter.lastName">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"filename": "incoterms-authorization.pdf",
|
||||
"component": "incoterms-authorization"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"filename": "letter-debtor.pdf",
|
||||
"component": "letter-debtor"
|
||||
}
|
||||
]
|
|
@ -0,0 +1,6 @@
|
|||
[
|
||||
{
|
||||
"filename": "letter-debtor.pdf",
|
||||
"component": "letter-debtor"
|
||||
}
|
||||
]
|
Binary file not shown.
|
@ -7,37 +7,27 @@ description:
|
|||
followGuide: Puedes utilizar como guía, el vídeo del montaje del ribon y la cinta
|
||||
<a href='https://www.youtube.com/watch?v=qhb0kgQF3o8' title='Youtube' target='_blank'
|
||||
style='color:#8dba25'>https://www.youtube.com/watch?v=qhb0kgQF3o8</a>. También
|
||||
necesitarás el QLabel, el programa para imprimir las cintas.
|
||||
downloadFrom: Puedes descargarlo desde este enlace <a href='https://cdn.verdnatura.es/public/QLabel_IV_V1.37_Install_en.exe'
|
||||
title='Descargar QLabel' target='_blank' style='color:#8dba25'>https://cdn.verdnatura.es/public/QLabel_IV_V1.37_Install_en.exe</a>
|
||||
necesitarás el GoLabel, el programa para imprimir las cintas.
|
||||
downloadFrom: Puedes descargarlo desde este enlace <a href='https://godex.s3-accelerate.amazonaws.com/_6f5glRrVhQAEBGhdUsqJA.file?v01'
|
||||
title='Descargar GoLabel' target='_blank' style='color:#8dba25'>https://godex.s3-accelerate.amazonaws.com/_6f5glRrVhQAEBGhdUsqJA.file?v01</a>
|
||||
downloadDriver: En este enlace puedes descargar el driver de la impresora <a href='https://es.seagullscientific.com/support/downloads/drivers/godex/download/'
|
||||
title='Descargar driver' target='_blank' style='color:#8dba25'>https://es.seagullscientific.com/support/downloads/drivers/godex/download/</a>
|
||||
sections:
|
||||
QLabel:
|
||||
title: Utilización de QLabel
|
||||
GoLabel:
|
||||
title: Utilización de GoLabel
|
||||
description: Para utilizar el programa de impresión de cintas sigue estos pasos
|
||||
steps:
|
||||
- Abre el programa QLabel
|
||||
- Haz clic en el icono de la barra superior con forma de 'carpeta'
|
||||
- Selecciona el archivo llamado 'model.ezp' adjunto en este correo, y haz clic
|
||||
en abrir
|
||||
- Ve a 'File' -> 'Save as' y guárdalo en el escritorio con otro nombre
|
||||
- Cierra el Qlabel y abre el archivo que acabamos de guardar
|
||||
- Haz clic <strong>encima del texto</strong> con el botón secundario del ratón
|
||||
- Elige la primera opción 'setup'
|
||||
- Cambia el texto para imprimir
|
||||
- Haz clic en el botón 'Ok'
|
||||
- Desplázate con el ratón para ver la medida máxima que ocupa el texto
|
||||
- Haz clic <strong>encima del texto</strong> con el botón secundario del ratón
|
||||
- Elige la segunda opción 'Setup printer'
|
||||
- Haz clic en la primera pestaña 'Label Setup'
|
||||
- Modifica la propiedad 'Paper Height' con la medida máxima consultada anteriormente
|
||||
- 'Comprueba el puerto de la impresora, botón de de la derecha ''SETUP PRINTER''
|
||||
y en la parte derecha, igual como la imagen que adjuntamos, seleccionar la que
|
||||
ponga ''USB00x: GODEX'''
|
||||
- Haz clic en el botón 'Ok'
|
||||
- Haz clic sobre el icono de la impresora
|
||||
- Haz clic en 'Print'
|
||||
- Abre el programa GoLabel
|
||||
- Haz clic en el icono de la barra superior con forma de carpeta con una hoja.
|
||||
- Selecciona el archivo llamado 'model.ezp'(que seguramente este en 'Descargas') adjunto en este correo, haz clic en abrir.
|
||||
- Una vez abierto el archivo, haz doble click sobre el texto, en el cuadro que nos sale pulse donde esta el texto de ejemplo (En este caso "TUS HERMANOS") y nos saldra en ese mismo recuadro a la parte izquierda para editarlo y escribir lo que quiera.
|
||||
- Cuando ya tenga el texto que desee pulse en el boton 'OK'.
|
||||
- Ve a 'Archivo' → 'Guardar Como' y guárdelo en el escritorio en el escritorio con otro nombre.
|
||||
- Luego para imprimir primero deberá configurar la impresora.
|
||||
- Pulse en el octavo icono de la barra de arriba, que en este caso será una impresora con un engranaje naranja.
|
||||
- Una vez ahí, pulsaremos en el desplegable de modelo de impresora y elegiremos el modelo que coincida con el nuestro 'G***'.
|
||||
- Pulse guardar y ya tendremos nuestra impresora con la configuración guardada.
|
||||
- Y por último, para imprimir, haz click en el noveno icono, el cual corresponde a una impresora azul.
|
||||
help:
|
||||
title: "¿Necesitas ayuda?"
|
||||
description: Si necesitas ayuda, descárgate nuestro programa de soporte para poder
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
<p v-html="$t('description.downloadFrom')"></p>
|
||||
<p v-html="$t('description.downloadDriver')"></p>
|
||||
|
||||
<h1>{{$t('sections.QLabel.title')}}</h1>
|
||||
<p>{{$t('sections.QLabel.description')}}:</p>
|
||||
<h1>{{$t('sections.GoLabel.title')}}</h1>
|
||||
<p>{{$t('sections.GoLabel.description')}}:</p>
|
||||
<ol>
|
||||
<li v-for="step in $t('sections.QLabel.steps')">
|
||||
<li v-for="step in $t('sections.GoLabel.steps')">
|
||||
<span v-html="step"></span>
|
||||
</li>
|
||||
</ol>
|
||||
|
|
|
@ -22,6 +22,7 @@ module.exports = {
|
|||
this.labelsData = await this.rawSqlFromDef('labelData', this.id);
|
||||
this.username = await this.findOneFromDef('username', this.userFk);
|
||||
this.labelData = this.labelsData[0];
|
||||
this.checkMainEntity(this.labelData);
|
||||
|
||||
let QRdata = JSON.stringify({
|
||||
company: 'vnl',
|
||||
|
@ -32,7 +33,6 @@ module.exports = {
|
|||
});
|
||||
|
||||
this.QR = await this.getQR(QRdata);
|
||||
this.checkMainEntity(this.labelsData);
|
||||
},
|
||||
methods: {
|
||||
getQR(id) {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
SELECT
|
||||
io.amount,
|
||||
io.ref,
|
||||
io.issued,
|
||||
io2.amount,
|
||||
io2.ref,
|
||||
io2.issued,
|
||||
ict.description
|
||||
FROM invoiceOut io
|
||||
JOIN invoiceCorrection ic ON ic.correctingFk = io.id
|
||||
JOIN invoiceCorrectionType ict ON ict.id = ic.invoiceCorrectionTypeFk
|
||||
JOIN invoiceOut io2 ON io2.id = ic.correctedFk
|
||||
LEFT JOIN ticket t ON t.refFk = io.ref
|
||||
WHERE io.ref = ?
|
||||
JOIN invoiceCorrectionType ict ON ict.id = ic.invoiceCorrectionTypeFk
|
||||
WHERE io.ref = ?
|
||||
|
|
Loading…
Reference in New Issue