Skip to content

Conversation

@maticotens
Copy link
Contributor

No description provided.

val minDate = dateFormat.format(now.time)

val cursor = db.rawQuery(
"SELECT ti.category_id, SUM(ti.price * ti.quantity) as total, c.color FROM ticket_items ti " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originalmente pensé que el precio sea independiente de la cantidad, o sea que estaría mal multiplicarlo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guarda Pato que en ticket_items se guarda cantidad y precio unitario. En stats se guarda el sumarizado, normalizado para simplificar. Si no te referis a eso, lo fixeo en otro pr. Asi no sigo bloqueando con esto

);
""")
}
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No termino de entender esto, para qué se usaría? Igual es una duda, dejo el approve y por mi mergealo así avanzamos que nos bloquea un poco esto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es un método que se ejecuta al cambiar de versión de la db. Elimina la tabla y la vuelve a crear. No lo vamos a usar igual

@maticotens maticotens merged commit 0ed7b53 into main Oct 7, 2025
@maticotens maticotens deleted the ticket_repository branch October 7, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants