5652-ItemTrash #1747
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#1747
Loading…
Reference in New Issue
No description provided.
Delete Branch "5652-ItemTrash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +1,14 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_getLoses`()
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í
}
});
`
@ -0,0 +14,4 @@
SELECT barcodeToItem(vItemFk) INTO vItemFk;
SELECT companyDefaultFk INTO vCompanyVnlFk
SELECT DEFAULT(companyFk) FROM vn.ticket LIMIT 1;
Açò trau el valor per defecte de la taula.
@ -0,0 +20,4 @@
SELECT c.id INTO vClientFk
FROM client c
JOIN address a ON a.clientFk = c.id
WHERE a.id = vAddressFk;
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.
@ -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)),
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
@ -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';
açò ja no cal crear sabenT lo de
SELECT DEFAULT(companyFk) FROM vn.ticket LIMIT 1
@ -0,0 +5,4 @@
-- Se desactivan por utilizarse muy poco
UPDATE vn.address
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'
per a que necesites el created modificat?
pensa que açò canvia la local tb
@ -0,0 +14,4 @@
});
Self.getAddress = async() => {
const query = `CALL vn.address_getLoses()`;
aci el codi de loopback que t'he posat abans
@ -0,0 +19,4 @@
description: 'The quantity to modify'
},
{
arg: 'addressFk',
lo mateix, intentar anar al clientFk
@ -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
no comprovem contra =1 perque podria ser que access pose true com a -1
AND a.isActive <> FALSE
Llevat el procediment
@ -0,0 +16,4 @@
SELECT DEFAULT(companyFk) INTO vCompanyVnlFk
FROM vn.ticket LIMIT 1;
SELECT c.id INTO vClientFk
posa bot de linea
Fet
@ -0,0 +19,4 @@
SELECT c.id INTO vClientFk
FROM client c
JOIN address a ON a.clientFk = c.id
WHERE a.id = vAddressFk;
no necesites el join contra client
LLevat
@ -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
no es pot posar en el mateix insert del client?
Canviat en el INSERT
@ -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
<> FALSE
Fet
New commits pushed, approval review dismissed automatically according to repository settings