5652-ItemTrash #1747

Merged
sergiodt merged 12 commits from 5652-ItemTrash into dev 2023-09-18 05:44:32 +00:00
Member
No description provided.
sergiodt added 5 commits 2023-09-11 14:17:38 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
022d3d08e6
refs #5652 feat:itemTrash_new
gitea/salix/pipeline/head There was a failure building this commit Details
2fffa56d70
refs #5652 feat:itemTrash_new
gitea/salix/pipeline/head Build queued... Details
9d367b8299
refs #5652 feat:itemTrash_new
gitea/salix/pipeline/head This commit looks good Details
8218eb2a6b
refs #5652 feat:itemTrash_new
sergiodt added 1 commit 2023-09-11 14:18:40 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
5f5a0645be
refs #5652 feat:itemTrash_new
sergiodt requested review from jgallego 2023-09-11 14:19:11 +00:00
sergiodt added 1 commit 2023-09-12 06:45:07 +00:00
gitea/salix/pipeline/head This commit looks good Details
1d25355423
refs #5652 fix:without fit
jgallego requested changes 2023-09-12 14:37:34 +00:00
@ -0,0 +1,14 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLoses`()
Owner

intentar no crear proc, chatGPT me l'ha pasat a loopback

`const Ticket = app.models.Ticket; // Asegúrate de reemplazar 'app' con tu instancia de LoopBack

Ticket.find({
include: [
{
relation: 'address',
scope: {
where: {
isactive: 1,
},
include: {
relation: 'client',
scope: {
where: {
typeFk: 'loses',
},
},
},
},
},
],
fields: ['addressFk'], // Puedes seleccionar los campos que necesites aquí
group: 'addressFk',
}, (err, results) => {
if (err) {
console.error(err);
// Manejar el error aquí
} else {
console.log(results);
// Procesar los resultados aquí
}
});
`

intentar no crear proc, chatGPT me l'ha pasat a loopback `const Ticket = app.models.Ticket; // Asegúrate de reemplazar 'app' con tu instancia de LoopBack Ticket.find({ include: [ { relation: 'address', scope: { where: { isactive: 1, }, include: { relation: 'client', scope: { where: { typeFk: 'loses', }, }, }, }, }, ], fields: ['addressFk'], // Puedes seleccionar los campos que necesites aquí group: 'addressFk', }, (err, results) => { if (err) { console.error(err); // Manejar el error aquí } else { console.log(results); // Procesar los resultados aquí } }); `
sergiodt marked this conversation as resolved
@ -0,0 +14,4 @@
SELECT barcodeToItem(vItemFk) INTO vItemFk;
SELECT companyDefaultFk INTO vCompanyVnlFk
Owner

SELECT DEFAULT(companyFk) FROM vn.ticket LIMIT 1;

Açò trau el valor per defecte de la taula.

SELECT DEFAULT(companyFk) FROM vn.ticket LIMIT 1; Açò trau el valor per defecte de la taula.
sergiodt marked this conversation as resolved
@ -0,0 +20,4 @@
SELECT c.id INTO vClientFk
FROM client c
JOIN address a ON a.clientFk = c.id
WHERE a.id = vAddressFk;
Owner

es extrany perque pases un address pero despues no el gastes sino que vas al client. seria mes clar, si el proc esperara directamente el id de client.

es extrany perque pases un address pero despues no el gastes sino que vas al client. seria mes clar, si el proc esperara directamente el id de client.
sergiodt marked this conversation as resolved
@ -0,0 +51,4 @@
INSERT INTO sale(ticketFk, itemFk, concept, quantity)
SELECT vTicketFk,
vItemFk,
CONCAT(longName,' ', getWorkerCode(), ' ', LEFT(CAST(util.VN_NOW() AS TIME),5)),
Owner

valorar llevar açò, en els historics actuals ja tenen ixa info, a mes en salix tenen un botó per consultar qui ho ha fet.
https://test-salix.verdnatura.es/#!/ticket/4454858/sale

valorar llevar açò, en els historics actuals ja tenen ixa info, a mes en salix tenen un botó per consultar qui ho ha fet. https://test-salix.verdnatura.es/#!/ticket/4454858/sale
sergiodt marked this conversation as resolved
@ -0,0 +1,18 @@
ALTER TABLE `vn`.`ticketConfig` ADD companyDefaultFk int(10) unsigned DEFAULT 442 NOT NULL COMMENT 'Compañía por defecto para crear ticket';
Owner

açò ja no cal crear sabenT lo de
SELECT DEFAULT(companyFk) FROM vn.ticket LIMIT 1

açò ja no cal crear sabenT lo de SELECT DEFAULT(companyFk) FROM vn.ticket LIMIT 1
sergiodt marked this conversation as resolved
@ -0,0 +5,4 @@
-- Se desactivan por utilizarse muy poco
UPDATE vn.address
Owner

fes-ho en producció, estos canvis no poden pujar a tots els entorns, podrien colisionar

fes-ho en producció, estos canvis no poden pujar a tots els entorns, podrien colisionar
@ -2961,0 +2965,4 @@
WHERE id=1101;
UPDATE vn.ticket
SET created='2023-08-01 00:00:00'
Owner

per a que necesites el created modificat?
pensa que açò canvia la local tb

per a que necesites el created modificat? pensa que açò canvia la local tb
sergiodt marked this conversation as resolved
@ -0,0 +14,4 @@
});
Self.getAddress = async() => {
const query = `CALL vn.address_getLoses()`;
Owner

aci el codi de loopback que t'he posat abans

aci el codi de loopback que t'he posat abans
sergiodt marked this conversation as resolved
@ -0,0 +19,4 @@
description: 'The quantity to modify'
},
{
arg: 'addressFk',
Owner

lo mateix, intentar anar al clientFk

lo mateix, intentar anar al clientFk
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2023-09-14 05:47:39 +00:00
gitea/salix/pipeline/head This commit looks good Details
d2cd522842
refs #5652 modify:without fit
sergiodt requested review from jgallego 2023-09-14 06:18:32 +00:00
sergiodt added 1 commit 2023-09-14 07:06:24 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
43f5bbb04e
Merge branch 'dev' into 5652-ItemTrash
jgallego requested changes 2023-09-14 08:24:26 +00:00
@ -0,0 +7,4 @@
JOIN address a ON a.id = t.addressFk
JOIN client c ON a.clientFk = c.id
WHERE c.typeFk = 'loses'
AND a.isactive = 1
Owner

no comprovem contra =1 perque podria ser que access pose true com a -1

AND a.isActive <> FALSE

no comprovem contra =1 perque podria ser que access pose true com a -1 `AND a.isActive <> FALSE`
Author
Member

Llevat el procediment

Llevat el procediment
sergiodt marked this conversation as resolved
@ -0,0 +16,4 @@
SELECT DEFAULT(companyFk) INTO vCompanyVnlFk
FROM vn.ticket LIMIT 1;
SELECT c.id INTO vClientFk
Owner

posa bot de linea

posa bot de linea
Author
Member

Fet

Fet
sergiodt marked this conversation as resolved
@ -0,0 +19,4 @@
SELECT c.id INTO vClientFk
FROM client c
JOIN address a ON a.clientFk = c.id
WHERE a.id = vAddressFk;
Owner

no necesites el join contra client

no necesites el join contra client
Author
Member

LLevat

LLevat
sergiodt marked this conversation as resolved
@ -2975,2 +2975,3 @@
(6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
(6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
--fixtures for getaddress
Owner

no es pot posar en el mateix insert del client?

no es pot posar en el mateix insert del client?
Author
Member

Canviat en el INSERT

Canviat en el INSERT
sergiodt marked this conversation as resolved
@ -0,0 +16,4 @@
let getAddressQuery = `
SELECT a.id, a.nickname
FROM vn.address a
JOIN vn.client c ON a.clientFk = c.id AND c.isActive = 1
Owner

<> FALSE

<> FALSE
Author
Member

Fet

Fet
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2023-09-14 16:04:01 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
b756d2f938
refs #5652 modify
sergiodt requested review from jgallego 2023-09-14 16:07:29 +00:00
jgallego approved these changes 2023-09-14 16:54:29 +00:00
Dismissed
sergiodt added 1 commit 2023-09-15 05:47:06 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
0403c67bad
Merge branch 'dev' into 5652-ItemTrash
sergiodt added 1 commit 2023-09-15 09:24:43 +00:00
gitea/salix/pipeline/head This commit looks good Details
881a1ee0b8
refs #5652 modify: solved Tests
sergiodt dismissed jgallego’s review 2023-09-15 09:24:44 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

jgallego approved these changes 2023-09-18 05:41:25 +00:00
sergiodt merged commit 3782170b9e into dev 2023-09-18 05:44:32 +00:00
sergiodt deleted branch 5652-ItemTrash 2023-09-18 05:44:32 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#1747
No description provided.