#6335 -ticketAdvance_splitOrCreate #1817

Merged
alexm merged 15 commits from 6335-ticketAdvance_splitOrCreate into dev 2023-11-17 06:55:59 +00:00
4 changed files with 21 additions and 21 deletions
Showing only changes of commit 2eacf7391e - Show all commits

View File

@ -7,12 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [2348.01] - 2023-11-30 ## [2348.01] - 2023-11-30
### Added
### Changed
### Fixed
## [2346.01] - 2023-11-16
### Added ### Added
- (Ticket -> Adelantar) Permite mover lineas sin generar negativos - (Ticket -> Adelantar) Permite mover lineas sin generar negativos
- (Ticket -> Adelantar) Permite modificar la fecha de los tickets - (Ticket -> Adelantar) Permite modificar la fecha de los tickets
@ -22,6 +16,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- (Ticket -> RocketChat) Arreglada detección de cambios - (Ticket -> RocketChat) Arreglada detección de cambios
## [2346.01] - 2023-11-16
### Added
### Changed
### Fixed
## [2342.01] - 2023-11-02 ## [2342.01] - 2023-11-02

View File

@ -13,8 +13,7 @@ BEGIN
SELECT inventoried INTO vDateInventory FROM config; SELECT inventoried INTO vDateInventory FROM config;
DROP TEMPORARY TABLE IF EXISTS tmp.stock; CREATE OR REPLACE TEMPORARY TABLE tmp.stock
CREATE TEMPORARY TABLE tmp.stock
(itemFk INT PRIMARY KEY, (itemFk INT PRIMARY KEY,
amount INT) amount INT)
ENGINE = MEMORY; ENGINE = MEMORY;
@ -60,22 +59,23 @@ BEGIN
dest.totalWithVat, dest.totalWithVat,
origin.totalWithVat futureTotalWithVat, origin.totalWithVat futureTotalWithVat,
dest.agency, dest.agency,
dest.agencyModeFk,
origin.futureAgency, origin.futureAgency,
origin.agencyModeFk futureAgencyModeFk,
dest.lines, dest.lines,
dest.liters, dest.liters,
origin.futureLines - origin.hasStock AS notMovableLines, origin.futureLines - origin.hasStock AS notMovableLines,
(origin.futureLines = origin.hasStock) AS isFullMovable, (origin.futureLines = origin.hasStock) AS isFullMovable,
dest.zoneFk,
origin.futureZoneFk, origin.futureZoneFk,
origin.futureZoneName, origin.futureZoneName,
origin.classColor futureClassColor, origin.classColor futureClassColor,
dest.classColor, dest.classColor,
IFNULL(dest.clientFk, origin.clientFk) clientFk, origin.clientFk futureClientFk,
origin.addressFk futureAddressFk,
origin.warehouseFk futureWarehouseFk,
origin.companyFk futureCompanyFk,
IFNULL(dest.nickname, origin.nickname) nickname, IFNULL(dest.nickname, origin.nickname) nickname,
IFNULL(dest.addressFk, origin.addressFk) addressFk,
IFNULL(dest.zoneFk, origin.futureZoneFk) zoneFk,
IFNULL(dest.warehouseFk, origin.warehouseFk) warehouseFk,
IFNULL(dest.companyFk, origin.companyFk) companyFk,
IFNULL(dest.agencyModeFk, origin.agencyModeFk) agencyModeFk,
dest.landed dest.landed
FROM ( FROM (
SELECT SELECT
@ -145,7 +145,7 @@ BEGIN
AND st.order <= 5 AND st.order <= 5
GROUP BY t.id GROUP BY t.id
) dest ON dest.addressFk = origin.addressFk ) dest ON dest.addressFk = origin.addressFk
WHERE origin.hasStock != 0; WHERE origin.hasStock;
DROP TEMPORARY TABLE tmp.stock; DROP TEMPORARY TABLE tmp.stock;
END$$ END$$

View File

@ -196,7 +196,7 @@ module.exports = Self => {
] ]
}, myOptions); }, myOptions);
const originalTicket = JSON.parse(JSON.stringify(ticketToChange)); const originalTicket = JSON.parse(JSON.stringify(ticketToChange));
const ticketChages = { const ticketChanges = {
clientFk: args.clientFk, clientFk: args.clientFk,
nickname: args.nickname, nickname: args.nickname,
agencyModeFk: args.agencyModeFk, agencyModeFk: args.agencyModeFk,
@ -211,13 +211,13 @@ module.exports = Self => {
let response; let response;
if (args.keepPrice) { if (args.keepPrice) {
ticketChages.routeFk = null; ticketChanges.routeFk = null;
response = await ticketToChange.updateAttributes(ticketChages, myOptions); response = await ticketToChange.updateAttributes(ticketChanges, myOptions);
} else { } else {
const hasToBeUnrouted = true; const hasToBeUnrouted = true;
response = await Self.rawSql( response = await Self.rawSql(
'CALL vn.ticket_componentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', 'CALL vn.ticket_componentMakeUpdate(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
[args.id].concat(Object.values(ticketChages), [hasToBeUnrouted, args.option]), [args.id].concat(Object.values(ticketChanges), [hasToBeUnrouted, args.option]),
myOptions myOptions
); );
} }

View File

@ -215,9 +215,9 @@ export default class Controller extends Section {
const params = { const params = {
clientFk: ticket.clientFk, clientFk: ticket.clientFk,
nickname: ticket.nickname, nickname: ticket.nickname,
agencyModeFk: ticket.agencyModeFk, agencyModeFk: ticket.agencyModeFk ?? ticket.futureAgencyModeFk,
addressFk: ticket.addressFk, addressFk: ticket.addressFk,
zoneFk: ticket.zoneFk, zoneFk: ticket.zoneFk ?? ticket.futureZoneFk,
warehouseFk: ticket.warehouseFk, warehouseFk: ticket.warehouseFk,
companyFk: ticket.companyFk, companyFk: ticket.companyFk,
shipped: this.$.model.userParams.dateToAdvance, shipped: this.$.model.userParams.dateToAdvance,