Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-04-25 14:24:08 +02:00
commit 3cb7319efa
3 changed files with 22 additions and 21 deletions

View File

@ -1,4 +1,12 @@
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
log_format upstreamlog
'[$time_local] $remote_addr -> $proxy_host:$upstream_addr '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/access.log upstreamlog;
upstream back { upstream back {
server back_1:3000; server back_1:3000;
server back_2:3000; server back_2:3000;

View File

@ -70,14 +70,16 @@ module.exports = Self => {
discount: 100 discount: 100
}, {transaction: transaction}); }, {transaction: transaction});
await sendMessage(ctx, { if (sale.ticket().client().salesPerson()) {
itemFk: sale.itemFk, await sendMessage(ctx, {
ticketFk: sale.ticketFk, itemFk: sale.itemFk,
recipientFk: sale.item().itemType().worker().userFk, ticketFk: sale.ticketFk,
quantity: sale.quantity, recipientFk: sale.ticket().client().salesPerson().userFk,
concept: sale.concept, quantity: sale.quantity,
nickname: address.nickname concept: sale.concept,
}, transaction); nickname: address.nickname
}, transaction);
}
} }
let claim = await Self.findById(params.claimFk); let claim = await Self.findById(params.claimFk);
@ -99,23 +101,14 @@ module.exports = Self => {
include: [ include: [
{ {
relation: 'ticket', relation: 'ticket',
scope: {fields: ['warehouseFk', 'companyFk']}
},
{
relation: 'item',
scope: { scope: {
fields: ['typeFk'], fields: ['clientFk', 'warehouseFk', 'companyFk'],
include: { include: {
relation: 'itemType', relation: 'client',
scope: { scope: {
fields: ['workerFk'],
include: { include: {
relation: 'worker', relation: 'salesPerson'
scope: {
fields: ['id', 'userFk'],
}
} }
} }
} }
} }

View File

@ -73,7 +73,7 @@ module.exports = Self => {
case 'search': case 'search':
return /^\d+$/.test(value) return /^\d+$/.test(value)
? {or: [{'i.id': value}, {'ib.code': value}]} ? {or: [{'i.id': value}, {'ib.code': value}]}
: {'i.name': {like: `%${value}%`}}; : {or: [{'i.name': {like: `%${value}%`}}, {'ib.code': value}]};
case 'id': case 'id':
return {'i.id': value}; return {'i.id': value};
case 'description': case 'description':