5914-transferInvoiceOut #1761

Merged
jorgep merged 55 commits from 5914-transferInvoiceOut into dev 2023-10-26 12:39:11 +00:00
Member
No description provided.
jorgep added 18 commits 2023-09-21 07:16:13 +00:00
gitea/salix/pipeline/head This commit looks good Details
50155cea8d
refs #5914 WIP transfer invoiceOut
gitea/salix/pipeline/head There was a failure building this commit Details
22f76ec6a9
refs #5914 WIP clone method created
gitea/salix/pipeline/head There was a failure building this commit Details
bd122e6327
refs #5014 WIP trasactions added
gitea/salix/pipeline/head There was a failure building this commit Details
725fe674c0
refs #5914 WIP fixing transacticions
gitea/salix/pipeline/head There was a failure building this commit Details
700ba4a7b1
refs #5914 feat(transferInvoiceOut): optimization
gitea/salix/pipeline/head There was a failure building this commit Details
3d4a99b07e
refs 5914 transferInvoice created
gitea/salix/pipeline/head There was a failure building this commit Details
4870b0830b
ref #5914 fix refund and change method name
gitea/salix/pipeline/head This commit looks good Details
ac4aea7d38
ref #5914 created transfer issued invoice
jorgep added 1 commit 2023-09-21 14:09:38 +00:00
gitea/salix/pipeline/head This commit looks good Details
82f14e62ad
ref #5914 tests fixed
jorgep requested review from jgallego 2023-09-21 14:12:33 +00:00
jgallego requested changes 2023-09-22 05:38:58 +00:00
@ -0,0 +3,4 @@
('CplusRectificationType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('CplusInvoiceType477', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('InvoiceCorrectionType', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
('InvoiceOut', 'transferInvoice', 'WRITE', 'ALLOW', 'ROLE', 'employee');
Owner

solo debe de poder transferir una factura el rol administrative.
Por otra parte, recuerda que la carpeta del changes esta desfasada, lo tienes que mover a la 2340

solo debe de poder transferir una factura el rol administrative. Por otra parte, recuerda que la carpeta del changes esta desfasada, lo tienes que mover a la 2340
jorgep marked this conversation as resolved
@ -322,0 +319,4 @@
"Ticket without Route": "Ticket sin ruta",
"Select a different customer": "Seleccione un cliente distinto",
"Fill all the fields": "Rellene todos los campos"
}
Owner

"NIF/CIF invalido" podría llevar una tilde: "NIF/CIF inválido".
"Cuidad no puede estar en blanco" tiene un pequeño error tipográfico, debe ser "Ciudad no puede estar en blanco".
"Is invalid" y "is invalid" no se han traducido al español.
"This postal code is not valid" también está en inglés.
"Role already assigned", "Invalid role name", etc. están en inglés y no se han traducido.
"No puedes cambiar los datos basicos de una orden con artículos" podría llevar tilde en "básicos".
"El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ" podría llevar tilde en "está"
"La fecha de inicio debe ser menor que la fecha de fín" sin tilde en "fin".
"Debes especificar una fecha de inicio o de fín" sin tilde en "fin".
[chatgpt]

"NIF/CIF invalido" podría llevar una tilde: "NIF/CIF inválido". "Cuidad no puede estar en blanco" tiene un pequeño error tipográfico, debe ser "Ciudad no puede estar en blanco". "Is invalid" y "is invalid" no se han traducido al español. "This postal code is not valid" también está en inglés. "Role already assigned", "Invalid role name", etc. están en inglés y no se han traducido. "No puedes cambiar los datos basicos de una orden con artículos" podría llevar tilde en "básicos". "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ" podría llevar tilde en "está" "La fecha de inicio debe ser menor que la fecha de fín" sin tilde en "fin". "Debes especificar una fecha de inicio o de fín" sin tilde en "fin". [chatgpt]
jorgep marked this conversation as resolved
@ -0,0 +54,4 @@
const {clientFk} = await models.InvoiceOut.findById(args.id);
if (clientFk == args.newClientFk)
throw new UserError(`Select a different customer`);
Owner

mejor client

mejor client
jorgep marked this conversation as resolved
@ -43,6 +44,7 @@ module.exports = Self => {
Self.makePdf = async function(id, options) {
const fields = ['id', 'hasPdf', 'ref'];
const invoiceOut = await Self.findById(id, {fields}, options);
console.log('Recoge invoiceOut?');
Owner

olvido

olvido
jorgep marked this conversation as resolved
@ -6,2 +22,4 @@
<vn-menu vn-id="menu">
<vn-list>
<vn-item
vn-acl="administrative"
Owner

fijate que aquí sí lo has puesto, pero en los acl no. En próximas ocasiones que vayan "juntos"

fijate que aquí sí lo has puesto, pero en los acl no. En próximas ocasiones que vayan "juntos"
jorgep marked this conversation as resolved
@ -25,0 +25,4 @@
}
@media screen and (min-width: 1000px) {
.transferInvoice {
min-width: 900px;
Owner

@alexm valorad si es estrictamente necesario y si lo es no poner un 1000px si no algo relativo

@alexm valorad si es estrictamente necesario y si lo es no poner un 1000px si no algo relativo
jorgep marked this conversation as resolved
@ -0,0 +123,4 @@
]
};
const ticket = await models.Ticket.findById(ticketId, filter, myOptions);
const refundTicket = await models.Ticket.create({
Owner

conviene que uses /salix/modules/ticket/back/methods/ticket/new.js
ya que tiene y tendrá las verificaciones necesarias

conviene que uses /salix/modules/ticket/back/methods/ticket/new.js ya que tiene y tendrá las verificaciones necesarias
jorgep marked this conversation as resolved
@ -42,4 +43,2 @@
let refundTicket = null;
try {
const refundAgencyMode = await models.AgencyMode.findOne({
Owner

esta logica donde esta ahora?

esta logica donde esta ahora?
Author
Member

Está dentro del método clone

Está dentro del método clone
jorgep marked this conversation as resolved
@ -39,7 +39,6 @@ module.exports = Self => {
Owner

modules/ticket/back/methods/ticket/invoiceTicketsWithPdf.js este porque sale?

modules/ticket/back/methods/ticket/invoiceTicketsWithPdf.js este porque sale?
Author
Member

Se me olvidó borrarlo

Se me olvidó borrarlo
jorgep marked this conversation as resolved
@ -136,6 +136,11 @@
"type": "belongsTo",
"model": "Zone",
"foreignKey": "zoneFk"
},
Owner

esta repetido arriba con ticketSales

esta repetido arriba con ticketSales
jorgep marked this conversation as resolved
alexm requested changes 2023-09-22 06:04:19 +00:00
@ -0,0 +56,4 @@
if (clientFk == args.newClientFk)
throw new UserError(`Select a different customer`);
if (!args.newClientFk || !args.cplusRectificationId || !args.cplusInvoiceType477Id || !args.invoiceCorrectionTypeId)
Member

Per a ficar esta restriccio pots ficar
required: true en les validacions (dalt)

Per a ficar esta restriccio pots ficar `required: true` en les validacions (dalt)
jorgep marked this conversation as resolved
@ -0,0 +28,4 @@
const refundTickets = [];
const mappedTickets = new Map();
const now = Date.vnNew();
const [firstTicketId] = ticketsIds;
Member
if(group) ticketsIds = ticketsIds[0]

                for (let ticketId of ticketsIds) {
                    await createTicketRefund(
                        ticketId,
                        withWarehouse,
                        refundTickets,
                        mappedTickets,
                        now,
                        myOptions
                    );
                }

y te ahorres fer if y else

``` if(group) ticketsIds = ticketsIds[0] for (let ticketId of ticketsIds) { await createTicketRefund( ticketId, withWarehouse, refundTickets, mappedTickets, now, myOptions ); } ``` y te ahorres fer if y else
jorgep marked this conversation as resolved
@ -0,0 +44,4 @@
ticketId,
withWarehouse,
refundTickets,
mappedTickets,
Member

El map de mappedTickets realment el pots omplir fer el bucle

El map de mappedTickets realment el pots omplir fer el bucle
jorgep marked this conversation as resolved
jorgep added 2 commits 2023-09-22 12:52:41 +00:00
jorgep added 1 commit 2023-09-22 12:53:42 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
731bad5981
ref #5914 create ticket with new and refactor
jorgep added 1 commit 2023-09-25 08:50:45 +00:00
gitea/salix/pipeline/head This commit looks good Details
c8c06f498c
ref #5914 fixed tests e2e
jorgep added 1 commit 2023-09-25 10:55:21 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
98ee9bbaf3
ref #5914 back test added
jorgep changed title from WIP 5914-transferInvoiceOut to 5914-transferInvoiceOut 2023-09-25 10:55:46 +00:00
jorgep requested review from alexm 2023-09-25 10:55:49 +00:00
jorgep requested review from jgallego 2023-09-25 10:55:54 +00:00
jgallego requested changes 2023-09-25 11:18:53 +00:00
@ -0,0 +7,4 @@
INSERT INTO `vn`.`invoiceCorrectionType` (description)
VALUES
('Error en el cálculo del IVA')
Owner

este registro ya existe en la tabla, es normal?

este registro ya existe en la tabla, es normal?
Author
Member

A mí en local no me aparece el registro

A mí en local no me aparece el registro
Member

Entonces deberias poner una fixture (en ingles)

Entonces deberias poner una fixture (en ingles)
jorgep marked this conversation as resolved
@ -24,1 +23,4 @@
}
@media screen and (min-width: 1000px) {
Owner

el 1000 no lo podemos quitar?

el 1000 no lo podemos quitar?
jorgep marked this conversation as resolved
jorgep added 1 commit 2023-09-25 11:39:02 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
092180b3b2
Merge branch 'dev' into 5914-transferInvoiceOut
jorgep requested review from jgallego 2023-09-25 11:41:19 +00:00
jorgep added 2 commits 2023-09-25 12:02:25 +00:00
alexm requested changes 2023-09-25 12:06:21 +00:00
@ -0,0 +7,4 @@
INSERT INTO `vn`.`invoiceCorrectionType` (description)
VALUES
('Error en el cálculo del IVA')
Member

En access solo tienen esa opcion?

En access solo tienen esa opcion?
Author
Member

Hay más, pero es para probar. ¿Quieres que las ponga todas?

Hay más, pero es para probar. ¿Quieres que las ponga todas?
jorgep marked this conversation as resolved
@ -0,0 +1,123 @@
module.exports = Self => {
Member

Si quieres usar refundTickets en varios sitios no seria mejor ponerlo fuera de las funciones? (No estoy seguro de que funcione)

Si quieres usar refundTickets en varios sitios no seria mejor ponerlo fuera de las funciones? (No estoy seguro de que funcione)
Author
Member

Mirado juntos.

Mirado juntos.
jorgep marked this conversation as resolved
@ -0,0 +36,4 @@
ctx,
ticketsIds[ticketId],
withWarehouse,
refundTickets,
Member

Aqui

Aqui
jorgep marked this conversation as resolved
@ -0,0 +62,4 @@
await models.SaleComponent.create(components, myOptions);
}
if (servicesIds && servicesIds.length > 0) {
Member

if (servicesIds && servicesIds.length)

if (servicesIds && servicesIds.length)
jorgep marked this conversation as resolved
@ -0,0 +114,4 @@
refundTickets.push(refundTicket);
}
async function getTicketRefundId(group, ticketId, refundTickets, mappedTickets) {
Member

Esta funcio te la pots ahorrar no?
Fent mappedTickets.get(ticketId) ja te torna lo que vols pq quan has fet el set esta ja agrupat o no

Esta funcio te la pots ahorrar no? Fent mappedTickets.get(ticketId) ja te torna lo que vols pq quan has fet el set esta ja agrupat o no
jorgep marked this conversation as resolved
jorgep requested review from alexm 2023-09-25 13:23:14 +00:00
jorgep added 1 commit 2023-09-25 13:24:40 +00:00
gitea/salix/pipeline/head This commit looks good Details
474399b383
ref #5914 refactor
jorgep added 1 commit 2023-09-26 06:36:52 +00:00
gitea/salix/pipeline/head This commit looks good Details
45fbe6f174
Merge branch 'dev' into 5914-transferInvoiceOut
jorgep added 2 commits 2023-09-26 10:43:40 +00:00
alexm requested changes 2023-09-27 12:46:16 +00:00
@ -2977,0 +2977,4 @@
INSERT INTO `vn`.`invoiceCorrectionType` (`id`, `description`)
VALUES
(1, 'Error en el cálculo del IVA'),
Member

En ingles

En ingles
jorgep marked this conversation as resolved
jorgep added 1 commit 2023-09-28 06:21:50 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
463fc8ae95
ref #5914 added fixtures in English
jorgep requested review from alexm 2023-09-28 06:37:21 +00:00
jorgep added 1 commit 2023-09-28 11:32:39 +00:00
jorgep added 1 commit 2023-09-29 06:18:28 +00:00
gitea/salix/pipeline/head This commit looks good Details
19fc2a4523
Merge branch 'dev' into 5914-transferInvoiceOut
jorgep added 2 commits 2023-09-29 06:20:51 +00:00
jgallego requested changes 2023-09-29 07:21:48 +00:00
jgallego left a comment
Owner

cambiar a la carpeta changes actual

cambiar a la carpeta changes actual
jorgep added 1 commit 2023-09-29 09:25:20 +00:00
gitea/salix/pipeline/head This commit looks good Details
6691cbf32f
ref #5914 changes moved
jorgep requested review from jgallego 2023-09-29 09:54:05 +00:00
jorgep added the
CR / Tests passed
label 2023-09-29 09:54:11 +00:00
jgallego approved these changes 2023-10-04 05:33:22 +00:00
Dismissed
alexm approved these changes 2023-10-04 05:44:03 +00:00
Dismissed
jorgep added 1 commit 2023-10-04 06:41:48 +00:00
jorgep dismissed jgallego’s review 2023-10-04 06:41:48 +00:00
Reason:

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

jorgep dismissed alexm’s review 2023-10-04 06:41:48 +00:00
Reason:

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

jgallego approved these changes 2023-10-06 12:43:10 +00:00
Dismissed
Author
Member

Carlos S. me ha dicho que ha encontrado un fallo, lo revisaré el lunes con él

Carlos S. me ha dicho que ha encontrado un fallo, lo revisaré el lunes con él
jorgep added 1 commit 2023-10-10 09:32:10 +00:00
jorgep dismissed jgallego’s review 2023-10-10 09:32:11 +00:00
Reason:

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

Author
Member

Carlos S. me ha dicho que ha encontrado un fallo, lo revisaré el lunes con él

Lo hemos comprobado y funciona correctamente

> Carlos S. me ha dicho que ha encontrado un fallo, lo revisaré el lunes con él Lo hemos comprobado y funciona correctamente
jgallego approved these changes 2023-10-13 10:55:01 +00:00
Dismissed
jorgep added 1 commit 2023-10-13 11:15:10 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
6b8a6c7a69
Merge branch 'dev' into 5914-transferInvoiceOut
jorgep added 1 commit 2023-10-13 11:17:18 +00:00
jorgep added 2 commits 2023-10-13 11:17:36 +00:00
jorgep added 1 commit 2023-10-16 06:19:53 +00:00
jorgep added 1 commit 2023-10-18 11:43:45 +00:00
jorgep added 1 commit 2023-10-19 06:27:52 +00:00
jorgep added 1 commit 2023-10-19 08:02:11 +00:00
jorgep dismissed jgallego’s review 2023-10-19 08:02:12 +00:00
Reason:

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

jorgep added 1 commit 2023-10-24 06:36:41 +00:00
jorgep added 1 commit 2023-10-24 06:37:23 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
5529f08ce6
ref #5914 fix locale
jorgep added 1 commit 2023-10-24 08:11:51 +00:00
gitea/salix/pipeline/head This commit looks good Details
f1deeb69ca
ref #5914 add ticketrefund and fix text
jorgep added 1 commit 2023-10-24 08:17:25 +00:00
alexm approved these changes 2023-10-25 07:19:42 +00:00
Dismissed
alexm requested changes 2023-10-25 08:20:14 +00:00
@ -0,0 +88,4 @@
throw e;
}
async function createTicketRefund(
Member

Pero no quedarem en que clone.js no debia tindre res relacionat en refund

Pero no quedarem en que clone.js no debia tindre res relacionat en refund
jorgep marked this conversation as resolved
alexm requested changes 2023-10-25 08:21:50 +00:00
@ -126,1 +51,4 @@
true,
myOptions
);
Member

Deuria ser per aci on fa que el ticket siga refund

Deuria ser per aci on fa que el ticket siga refund
jorgep marked this conversation as resolved
jorgep added 1 commit 2023-10-26 06:29:41 +00:00
jorgep dismissed alexm’s review 2023-10-26 06:29:41 +00:00
Reason:

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

jorgep added 1 commit 2023-10-26 07:22:05 +00:00
gitea/salix/pipeline/head This commit looks good Details
3a1227bdc2
ref #5914 fix ticketrefund
jorgep requested review from alexm 2023-10-26 07:22:24 +00:00
jorgep added 1 commit 2023-10-26 07:31:02 +00:00
jorgep added 1 commit 2023-10-26 07:32:24 +00:00
gitea/salix/pipeline/head This commit looks good Details
e0b4ac733e
ref #5914 move changes
alexm reviewed 2023-10-26 07:47:07 +00:00
@ -0,0 +109,4 @@
const newTicket = await models.Ticket.new(ctx, myOptions);
if (negative) {
Member

En un futur se podria refactoritzar i extraure esta part a refund o un hipotetic ticket/clone

En un futur se podria refactoritzar i extraure esta part a refund o un hipotetic ticket/clone
alexm approved these changes 2023-10-26 07:47:23 +00:00
jorgep merged commit 7fe0641817 into dev 2023-10-26 12:39:11 +00:00
jorgep deleted branch 5914-transferInvoiceOut 2023-10-26 12:39:11 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 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#1761
No description provided.