Merge branch 'dev' into 6757-supplierMayus
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
commit
e56e5905c2
|
@ -20,6 +20,9 @@ pipeline {
|
|||
stage('Checkout') {
|
||||
steps {
|
||||
script {
|
||||
// Uncomment to enable debugging
|
||||
//env.DEBUG = 'strong-remoting:http-context,strong-remoting:shared-method'
|
||||
|
||||
switch (env.BRANCH_NAME) {
|
||||
case 'dev':
|
||||
env.NODE_ENV = 'dev'
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`observation_type`
|
||||
AS SELECT `co`.`id` AS `observation_type_id`,
|
||||
`co`.`description` AS `description`
|
||||
FROM `vn`.`observationType` `co`
|
|
@ -1,15 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`order`
|
||||
AS SELECT `hedera`.`order`.`id` AS `id`,
|
||||
`hedera`.`order`.`date_make` AS `date_make`,
|
||||
`hedera`.`order`.`date_send` AS `date_send`,
|
||||
`hedera`.`order`.`customer_id` AS `customer_id`,
|
||||
`hedera`.`order`.`delivery_method_id` AS `delivery_method_id`,
|
||||
`hedera`.`order`.`agency_id` AS `agency_id`,
|
||||
`hedera`.`order`.`address_id` AS `address_id`,
|
||||
`hedera`.`order`.`note` AS `note`,
|
||||
`hedera`.`order`.`confirmed` AS `confirmed`,
|
||||
`hedera`.`order`.`is_bionic` AS `is_bionic`,
|
||||
`hedera`.`order`.`source_app` AS `source_app`
|
||||
FROM `hedera`.`order`
|
|
@ -1,6 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`order_Tickets`
|
||||
AS SELECT `ot`.`orderFk` AS `order_id`,
|
||||
`ot`.`ticketFk` AS `Id_Ticket`
|
||||
FROM `vn`.`orderTicket` `ot`
|
|
@ -1,7 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`order_component`
|
||||
AS SELECT `c`.`order_row_id` AS `order_row_id`,
|
||||
`c`.`component_id` AS `component_id`,
|
||||
`c`.`price` AS `price`
|
||||
FROM `hedera`.`order_component` `c`
|
|
@ -1,14 +0,0 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn2008`.`order_row`
|
||||
AS SELECT `order_row`.`id` AS `id`,
|
||||
`order_row`.`order_id` AS `order_id`,
|
||||
`order_row`.`item_id` AS `item_id`,
|
||||
`order_row`.`warehouse_id` AS `warehouse_id`,
|
||||
`order_row`.`shipment` AS `shipment`,
|
||||
`order_row`.`amount` AS `amount`,
|
||||
`order_row`.`price` AS `price`,
|
||||
`order_row`.`rate` AS `rate`,
|
||||
`order_row`.`created` AS `created`,
|
||||
`order_row`.`Id_Movimiento` AS `Id_Movimiento`
|
||||
FROM `hedera`.`order_row`
|
|
@ -22,6 +22,7 @@ services:
|
|||
- 3000
|
||||
environment:
|
||||
- NODE_ENV
|
||||
- DEBUG
|
||||
configs:
|
||||
- source: datasources
|
||||
target: /etc/salix/datasources.json
|
||||
|
|
|
@ -72,24 +72,25 @@ module.exports = Self => {
|
|||
|
||||
async function createGestDoc(id) {
|
||||
const ticket = await models.Ticket.findById(id,
|
||||
{include: [
|
||||
{
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
{
|
||||
include: [
|
||||
{
|
||||
relation: 'warehouse',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}, {
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
}
|
||||
}, {
|
||||
relation: 'route',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}
|
||||
}, {
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
}
|
||||
}, {
|
||||
relation: 'route',
|
||||
scope: {
|
||||
fields: ['id']
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}, myOptions);
|
||||
const dmsType = await models.DmsType.findOne({where: {code: 'Ticket'}, fields: ['id']}, myOptions);
|
||||
const ctxUploadFile = Object.assign({}, ctx);
|
||||
|
@ -125,17 +126,17 @@ module.exports = Self => {
|
|||
if (await gestDocExists(ticketId))
|
||||
throw new UserError('Ticket is already signed');
|
||||
|
||||
if (location) setLocation(ticketId);
|
||||
if (location) await setLocation(ticketId);
|
||||
if (!gestDocCreated) await createGestDoc(ticketId);
|
||||
await models.TicketDms.create({ticketFk: ticketId, dmsFk: dms[0].id}, myOptions);
|
||||
const ticket = await models.Ticket.findById(ticketId, null, myOptions);
|
||||
await ticket.updateAttribute('isSigned', true, myOptions);
|
||||
|
||||
const deliveryState = await models.State.find({
|
||||
const deliveryState = await models.State.findOne({
|
||||
where: {
|
||||
code: 'DELIVERED'
|
||||
}
|
||||
}, options);
|
||||
}, myOptions);
|
||||
|
||||
await models.Ticket.state(ctx, {
|
||||
ticketFk: ticketId,
|
||||
|
|
|
@ -18,7 +18,6 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
async serverPrefetch() {
|
||||
await this.rawSql('SET @hasPrevia := 0');
|
||||
let ticketIds;
|
||||
const res = await this.rawSqlFromDef('tickets', [this.id]);
|
||||
if (res.length) {
|
||||
|
|
|
@ -16,7 +16,7 @@ SELECT c.itemPackingTypeFk code,
|
|||
DATE_FORMAT(t.shipped, '%d/%m/%y') shipped,
|
||||
tt.labelCount,
|
||||
t.nickName,
|
||||
SUM(IF(sgd.id, IF(@hasPrevia, 0, @hasPrevia := 1), 1)) lineCount,
|
||||
SUM(IF(sgd.id IS NULL, 1, 0)) + IF(sgd.id , 1, 0) lineCount,
|
||||
rm.routeFk
|
||||
FROM vn.ticket t
|
||||
JOIN vn.ticketCollection tc ON tc.ticketFk = t.id
|
||||
|
|
Loading…
Reference in New Issue