#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
### Added
### Changed
### Fixed
## [2346.01] - 2023-11-16
### Added
- (Ticket -> Adelantar) Permite mover lineas sin generar negativos
- (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
## [2346.01] - 2023-11-16
### Added
### Changed
### Fixed
## [2342.01] - 2023-11-02

View File

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

View File

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

View File

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