From 7c6586bbcec19bfcb471fbdc7b3e5ae620963866 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Wed, 2 Jul 2025 10:29:16 -0300 Subject: [PATCH] =?UTF-8?q?fixed:=20timezone=20de=20orders=20alterado=20pa?= =?UTF-8?q?ra=20exibi=C3=A7=C3=A3o=20utc=20-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comandas/templates/viewcomanda.html | 22 ++++++++++++++-- gestaoRaul/db.sqlite3 | Bin 364544 -> 364544 bytes .../__pycache__/settings.cpython-312.pyc | Bin 4405 -> 4405 bytes .../orders/__pycache__/models.cpython-312.pyc | Bin 2142 -> 2249 bytes gestaoRaul/orders/models.py | 5 +++- .../__pycache__/models.cpython-312.pyc | Bin 2418 -> 2418 bytes gestaoRaul/templates/static/base.js | 23 ++++++++++++++--- .../static/comandas/js/viewcomanda.js | 24 ++++++++++-------- 8 files changed, 58 insertions(+), 16 deletions(-) diff --git a/gestaoRaul/comandas/templates/viewcomanda.html b/gestaoRaul/comandas/templates/viewcomanda.html index 737c49e..c13ab05 100644 --- a/gestaoRaul/comandas/templates/viewcomanda.html +++ b/gestaoRaul/comandas/templates/viewcomanda.html @@ -19,8 +19,26 @@ Detalhes {{comanda.name}} } .posi { position: absolute !important; - top: 0.5em; - right: 0.5em; + background-color: rgba(72, 72, 72, 0.151); + color: rgba(255, 255, 255, 0.452); + border: 2px solid rgba(239, 239, 239, 0.107); + border-radius: 35px; + padding: 0px 15px 3px 15px ; + align-self: center; + font-size: 32px; + top: 0.1em; + right: 0.1em; + scale: 0.8; + } + .posi:hover{ + background-color: rgba(183, 3, 3, 0.598); + color: rgb(255, 255, 255); + } + .custom-toast-container { + z-index: 99999 !important; + } + .swal2-container { + z-index: 9999 !important; } {% endblock %} diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 20f68e2c0ebe7225241a35b8b332089137044d43..c60fbf746099432b5996c0e0fd362f6987adb505 100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0G&ebB>QUb2ZiC&o@v;7%r!06>HoEhk-wWcZ14GX0dI{SJa^RfxGdiCI?V zUes=D?`xathWf3VD{QmN^VYbRf`CXD!xicE$H?o5tnl11(gA&R3b+a@lN_(0V4tW^ zszLflL@XIg^pTe(_m`kSbWw-*jC)w;^Q4mB>mz|08I~=9vZWh4=DsOoOYaf=U%AgM A@c;k- diff --git a/gestaoRaul/gestaoRaul/__pycache__/settings.cpython-312.pyc b/gestaoRaul/gestaoRaul/__pycache__/settings.cpython-312.pyc index 0ea64b8859ac840bd7a294afd797e5bcea169ee2..09a277c8e3e06ecb62783bc4dda66416f06c2ade 100644 GIT binary patch delta 20 acmdn0v{i}wG%qg~0}yO8PTk0@B?tgHl?3hp delta 20 acmdn0v{i}wG%qg~0}zByirdJoB?tgH69ne~ diff --git a/gestaoRaul/orders/__pycache__/models.cpython-312.pyc b/gestaoRaul/orders/__pycache__/models.cpython-312.pyc index 69d7e7f8ca3e38dd79c243bb1e8847afffa15153..727c9d461d69875edbef4a7359fe7d41e34a83c9 100644 GIT binary patch delta 784 zcmZ`%OKTHR6u$RP=9Oe+Wp{BN4g5o1Z7e$niwr*lpA3g} zf61jbb$n}U(*g>P_GI+pPz7z$>SO=$!7_=;Gi zNgAjU;^(9!x1^N9h%GlUUzJRtil8qf^TfK?L&%`*Arl#`fxF1RNajH7P+qtPNnXZ@ znaY0@e)3;sgV_28>3Qqud1Mx4!=)8{%FR&k9%a^d_?9dVN6ofqL+zAxVxBR*nXtw23_;VhVXZW|!t&ebMOp2u`-}u=6~cXSmPI!p@)j- z8mNW*Y#~26#f}P(sQ_t+>vQyhKfOd9n+<|*Op4v+#BRNq3BrDW0e}=pv<0iWKpkqc z5#hc@Y!p(*0pOmxpbO${3s^(^z4A65k;|l~14$`s@K@?7l?{Vl<~wS#+1;{lq2^ju z+w#u1HE~v6Z&6LC0{I$5dK1n<*}>F6yCl?ghhAnEL;?=VJ1Jma!Wef@x`R%4(9l;j X@(GRqQcPSXt?8%5$Hm_Wc(>1A$iS|_ delta 713 zcmZ8fJ#5oJ6n=M(9p|q}njb(7G^j%r6(NN(@}nwESwci{Sg1sB<3lvqNjcl1ty0Rs zP$m@JM#TRp_Y9lTzyt3FDZMi6XzF^P;Rw$2qm=HW@&dindZvlx-qblylmi zoIU`tO!9G=Y6F5OUMoe~O$rhzkP#_%(e1wo8`7GW9ShQZQY_Hi$>=K@*7o3e!hnk2 z+=|tmGIQ4%H^negC2{dN(kun)eV_SEzA)l4`%a*_p6U6ni?_u^^;R|~6ZeILN3fqQ z?P~kto!YB@*%hu~t0&vJOmCPpB@yHm6F+;Sp%R5nN6X-_0)o$Ks zG=hnB-naaYSL-`w&oa4+aWcSHBA z)3=!IhAXB!;llr_qb)~|Q?FuQ=st%d$_O|y&@V_2-)5J1RZ{#<+!+an3L)eGN(XS} aJIs88`JY;z7<6~(X(RQd@e7cQT>b!9w4`_d diff --git a/gestaoRaul/orders/models.py b/gestaoRaul/orders/models.py index 6744de9..bbf91f1 100644 --- a/gestaoRaul/orders/models.py +++ b/gestaoRaul/orders/models.py @@ -1,5 +1,6 @@ from django.db import models from django.utils.formats import date_format +from datetime import timedelta from products.models import Product from comandas.models import Comanda, ProductComanda @@ -18,6 +19,8 @@ class Order(models.Model): def __str__(self): status = 'Em espera' + datetime = self.queue - timedelta(hours=3) + if self.preparing: status = 'Preparando' if self.finished: @@ -25,4 +28,4 @@ class Order(models.Model): if self.delivered: status = 'Entregue' - return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(self.queue, 'd/m/Y H:i')}" \ No newline at end of file + return f"{self.id_product}| {self.obs}|{status}|{self.id_comanda.name}|{self.id_comanda.mesa.name}|{date_format(datetime, 'd/m/Y H:i')}" \ No newline at end of file diff --git a/gestaoRaul/payments/__pycache__/models.cpython-312.pyc b/gestaoRaul/payments/__pycache__/models.cpython-312.pyc index d0cb77af2f89062be6dd3e883171479151f7941d..4ff6d213937d2454dc92ff75efed37fd1da73555 100644 GIT binary patch delta 20 acmew)^ht>OG%qg~0}xy=PTk0z&ItfPiv^be delta 20 acmew)^ht>OG%qg~0}!ypMQr3w=L7&exCH3{ diff --git a/gestaoRaul/templates/static/base.js b/gestaoRaul/templates/static/base.js index 9a0f4d5..04c9f03 100644 --- a/gestaoRaul/templates/static/base.js +++ b/gestaoRaul/templates/static/base.js @@ -181,8 +181,6 @@ function openFullscreen() { var feedbackMsg = Swal.fire({ color: 'white', title: message, - // toast: true, - // position: 'top', text: subMessage || '', icon: icon || 'info', background: 'rgb(23, 38, 54)', @@ -190,4 +188,23 @@ function openFullscreen() { }); -} \ No newline at end of file +} +function toast(){ + + const Toast = Swal.mixin({ + toast: true, + theme:"dark", + position: "top", + showConfirmButton: false, + background: 'rgb(30, 42, 58)', + color: 'white', + showCloseButton: true, + timer: 2500, + timerProgressBar: true, + didOpen: (toast) => { + toast.onmouseenter = Swal.stopTimer; + toast.onmouseleave = Swal.resumeTimer; + } + }); + return Toast; + } \ No newline at end of file diff --git a/gestaoRaul/templates/static/comandas/js/viewcomanda.js b/gestaoRaul/templates/static/comandas/js/viewcomanda.js index 24e4da4..169911d 100644 --- a/gestaoRaul/templates/static/comandas/js/viewcomanda.js +++ b/gestaoRaul/templates/static/comandas/js/viewcomanda.js @@ -1,26 +1,21 @@ - async function openModal() { var htmlModal = document.getElementById('addProduct').innerHTML htmlModal = htmlModal.replace('search-product','search-product-modal') htmlModal = htmlModal.replace('product-list','product-list-modal') -const { value: formValues } = await Swal.fire({ +Swal.fire({ title: "Adicionar Produto", html: htmlModal, - width: '100em', position:"top", theme: "dark", - didOpen: () => { - Swal.getPopup().classList.add('swal2-noautoclose'); - }, + showConfirmButton: false, showCancelButton: true, cancelButtonText: '×', customClass:{ cancelButton:'posi' }, - focusConfirm: false, }); @@ -396,7 +391,16 @@ async function addProductComanda(productId, comandaId, cuisine) { // Trata resposta if (!response.ok) { const errorData = await response.json().catch(() => ({})); + Swal.update({ + title: 'Falha ao adicionar!', + html: `
+ ${error.message || 'Erro desconhecido'} +
`, + icon: 'error', + + }); throw new Error(errorData.message || `Erro HTTP: ${response.status}`); + } const result = await response.text(); @@ -407,12 +411,12 @@ async function addProductComanda(productId, comandaId, cuisine) { listElement.innerHTML = result; } - // Feedback de sucesso + Swal.update({ - title: 'Produto adicionado! 😁', + title: '✅ Produto adicionado!', }); - // Reseta após 2.5 segundos + setTimeout(() => { Swal.update({ title: 'Adicionar Produto'