Merge branch 'dev' into 8227-roadmap
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
a6908aa8c0
|
@ -19,6 +19,7 @@ BEGIN
|
||||||
sub2.iptd futureIpt,
|
sub2.iptd futureIpt,
|
||||||
sub2.state futureState,
|
sub2.state futureState,
|
||||||
t.clientFk,
|
t.clientFk,
|
||||||
|
cl.salespersonFk,
|
||||||
t.warehouseFk,
|
t.warehouseFk,
|
||||||
ts.alertLevel,
|
ts.alertLevel,
|
||||||
sub2.alertLevel futureAlertLevel,
|
sub2.alertLevel futureAlertLevel,
|
||||||
|
@ -38,6 +39,7 @@ BEGIN
|
||||||
JOIN vn.province p ON p.id = a.provinceFk
|
JOIN vn.province p ON p.id = a.provinceFk
|
||||||
JOIN vn.country c ON c.id = p.countryFk
|
JOIN vn.country c ON c.id = p.countryFk
|
||||||
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
||||||
|
JOIN vn.client cl ON cl.id = t.clientFk
|
||||||
JOIN vn.state st ON st.id = ts.stateFk
|
JOIN vn.state st ON st.id = ts.stateFk
|
||||||
JOIN vn.alertLevel al ON al.id = ts.alertLevel
|
JOIN vn.alertLevel al ON al.id = ts.alertLevel
|
||||||
LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
|
LEFT JOIN vn.ticketParking tp ON tp.ticketFk = t.id
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
|
||||||
SQL SECURITY DEFINER
|
|
||||||
VIEW `vn2008`.`Split_lines`
|
|
||||||
AS SELECT `sl`.`id` AS `Id_Split_lines`,
|
|
||||||
`sl`.`splitFk` AS `Id_Split`,
|
|
||||||
`sl`.`itemFk` AS `Id_Article`,
|
|
||||||
`sl`.`buyFk` AS `Id_Compra`
|
|
||||||
FROM `vn`.`splitLine` `sl`
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
RENAME TABLE vn.sorter TO vn.sorter__;
|
||||||
|
ALTER TABLE vn.sorter__ COMMENT='@deprecated 2025-01-22';
|
||||||
|
|
||||||
|
RENAME TABLE vn.splitLine TO vn.splitLine__;
|
||||||
|
ALTER TABLE vn.splitLine__ COMMENT='@deprecated 2025-01-22';
|
|
@ -40,21 +40,23 @@ module.exports = Self => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (let ticket of tickets) {
|
for (let ticket of tickets) {
|
||||||
const originFullPath = `${url}ticket/${ticket.originId}/summary`;
|
|
||||||
const destinationFullPath = `${url}ticket/${ticket.destinationId}/summary`;
|
|
||||||
const message = $t('Ticket merged', {
|
|
||||||
originDated: dateUtil.toString(new Date(ticket.originShipped)),
|
|
||||||
destinationDated: dateUtil.toString(new Date(ticket.destinationShipped)),
|
|
||||||
originId: ticket.originId,
|
|
||||||
destinationId: ticket.destinationId,
|
|
||||||
originFullPath,
|
|
||||||
destinationFullPath
|
|
||||||
});
|
|
||||||
if (!ticket.originId || !ticket.destinationId) continue;
|
if (!ticket.originId || !ticket.destinationId) continue;
|
||||||
|
|
||||||
await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions);
|
await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions);
|
||||||
if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions))
|
if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions)) {
|
||||||
await models.Chat.sendCheckingPresence(ctx, ticket.workerFk, message);
|
if (!ticket.salesPersonFk) continue;
|
||||||
|
const originFullPath = `${url}ticket/${ticket.originId}/summary`;
|
||||||
|
const destinationFullPath = `${url}ticket/${ticket.destinationId}/summary`;
|
||||||
|
const message = $t('Ticket merged', {
|
||||||
|
originDated: dateUtil.toString(new Date(ticket.originShipped)),
|
||||||
|
destinationDated: dateUtil.toString(new Date(ticket.destinationShipped)),
|
||||||
|
originId: ticket.originId,
|
||||||
|
destinationId: ticket.destinationId,
|
||||||
|
originFullPath,
|
||||||
|
destinationFullPath
|
||||||
|
});
|
||||||
|
await models.Chat.sendCheckingPresence(ctx, ticket.salesPersonFk, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (tx)
|
if (tx)
|
||||||
await tx.commit();
|
await tx.commit();
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe('ticket merge()', () => {
|
||||||
destinationId: 12,
|
destinationId: 12,
|
||||||
originShipped: Date.vnNew(),
|
originShipped: Date.vnNew(),
|
||||||
destinationShipped: Date.vnNew(),
|
destinationShipped: Date.vnNew(),
|
||||||
workerFk: 1
|
salesPersonFk: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
it('should merge two tickets', async() => {
|
it('should merge two tickets', async() => {
|
||||||
|
|
Loading…
Reference in New Issue