Rebrand WK→Collina en paneles/mensajes + fix plantilla del edo de cuenta
Tras el merge de upstream (20 commits del wk-bot: módulo de cuentas por cliente, estado de cuenta PDF, bitácora, abonos, timeout de Sheets): - estado_cuenta.py: TEMPLATE_PATH apuntaba a Plantilla_WK2.docm (aquí renombrada) → Plantilla_Collina.docm. El estado de cuenta hereda el membrete Collina como fondo automáticamente. Título del PDF "WK FINANCING SOLUTIONS" → "COLLINA SYSTEMS" y acento morado-navy #3a3467 → verde membrete #336637. - Mensajes WhatsApp: saludo/despedida de cobro, "Pago WK Financing", "Recordatorios WK" → Collina Systems. - admin_ui.py: títulos del panel de recordatorios. - web/cobranza.html: título, badge del header (WK→CS), userline y prefijo de folios de export (WK-→CS-). Solo textos/branding visibles — la lógica del merge queda intacta.
This commit is contained in:
1 parent
a54761cce0
commit
65c3e82b92
6 files changed
+21
-21
No files matched your search
+3
-3
@@ -28,7 +28,7 @@ _HTML_EXPIRED = """<!DOCTYPE html>
|
|||||||
<html lang="es"><head>
|
<html lang="es"><head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Link expirado · Recordatorios WK</title>
|
<title>Link expirado · Recordatorios Collina</title>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||||
@@ -79,7 +79,7 @@ _HTML_PAGE = """<!DOCTYPE html>
|
|||||||
<html lang="es"><head>
|
<html lang="es"><head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Recordatorios WK · Cotizador Collina</title>
|
<title>Recordatorios · Cotizador Collina</title>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||||
@@ -356,7 +356,7 @@ input[type=time].input{ font-variant-numeric:tabular-nums; }
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="icon-wrap">🔔</div>
|
<div class="icon-wrap">🔔</div>
|
||||||
<h1>Recordatorios WK</h1>
|
<h1>Recordatorios Collina</h1>
|
||||||
<p class="subtitle" id="userName">Cargando…</p>
|
<p class="subtitle" id="userName">Cargando…</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="list"></div>
|
<div id="list"></div>
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ def _armar_mensaje_consolidado(
|
|||||||
def _mensaje_cobro(cliente: str, vehiculo: str, concepto: str,
|
def _mensaje_cobro(cliente: str, vehiculo: str, concepto: str,
|
||||||
monto: float, link: str) -> str:
|
monto: float, link: str) -> str:
|
||||||
return (
|
return (
|
||||||
f"Hola, le saludamos de WK Financing. Le compartimos su pago pendiente:\n\n"
|
f"Hola, le saludamos de Collina Systems. Le compartimos su pago pendiente:\n\n"
|
||||||
f"Cliente: {cliente}\n"
|
f"Cliente: {cliente}\n"
|
||||||
f"Vehículo: {vehiculo}\n"
|
f"Vehículo: {vehiculo}\n"
|
||||||
f"Concepto: {concepto}\n"
|
f"Concepto: {concepto}\n"
|
||||||
@@ -772,7 +772,7 @@ async def _generar_cobro_para_renglon(
|
|||||||
if monto <= 0:
|
if monto <= 0:
|
||||||
raise HTTPException(status_code=400, detail="Monto inválido")
|
raise HTTPException(status_code=400, detail="Monto inválido")
|
||||||
concepto_final = (
|
concepto_final = (
|
||||||
concepto or f"Pago WK Financing - {renglon.get('cliente','')}"
|
concepto or f"Pago Collina Systems - {renglon.get('cliente','')}"
|
||||||
)
|
)
|
||||||
|
|
||||||
id_abono = ""
|
id_abono = ""
|
||||||
|
|||||||
+3
-3
@@ -211,7 +211,7 @@ _TEXTO_AYUDA = """🤖 *Cotizador Collina Smart Assistant — Comandos disponibl
|
|||||||
parámetros históricos en un solo mensaje
|
parámetros históricos en un solo mensaje
|
||||||
|
|
||||||
*📄 Clonar cotización (PDF):*
|
*📄 Clonar cotización (PDF):*
|
||||||
- Manda un PDF de cotización WK → el bot extrae los ratios y muestra:
|
- Manda un PDF de cotización → el bot extrae los ratios y muestra:
|
||||||
1️⃣ _Clonar parámetros para otro vehículo_ — manda _vehículo pr precio_
|
1️⃣ _Clonar parámetros para otro vehículo_ — manda _vehículo pr precio_
|
||||||
(ej. _Hilux 2025 pr 520,000_) → genera PDF proporcional al nuevo precio
|
(ej. _Hilux 2025 pr 520,000_) → genera PDF proporcional al nuevo precio
|
||||||
2️⃣ _Cambiar número de unidades_ — responde con la cantidad (ej. _15_)
|
2️⃣ _Cambiar número de unidades_ — responde con la cantidad (ej. _15_)
|
||||||
@@ -371,7 +371,7 @@ async def procesar_mensaje(msg: WebhookMessage):
|
|||||||
try:
|
try:
|
||||||
r = await pagos.crear_link_cobro(
|
r = await pagos.crear_link_cobro(
|
||||||
monto=monto_cobrar,
|
monto=monto_cobrar,
|
||||||
descripcion=f"Pago WK Financing - {nombre_cobrar}",
|
descripcion=f"Pago Collina Systems - {nombre_cobrar}",
|
||||||
cliente_nombre=nombre_cobrar,
|
cliente_nombre=nombre_cobrar,
|
||||||
)
|
)
|
||||||
texto = (
|
texto = (
|
||||||
@@ -3621,7 +3621,7 @@ async def _enviar_link_admin(msg: WebhookMessage) -> None:
|
|||||||
base_url = os.getenv("BASE_URL", "http://191.101.233.43:8001").rstrip("/")
|
base_url = os.getenv("BASE_URL", "http://191.101.233.43:8001").rstrip("/")
|
||||||
link = f"{base_url}/admin/ui?token={token}"
|
link = f"{base_url}/admin/ui?token={token}"
|
||||||
texto = (
|
texto = (
|
||||||
"🔗 *Recordatorios WK*\n\n"
|
"🔗 *Recordatorios Collina*\n\n"
|
||||||
"Configura tus alertas de cobranza:\n\n"
|
"Configura tus alertas de cobranza:\n\n"
|
||||||
f"{link}\n\n"
|
f"{link}\n\n"
|
||||||
"_El enlace queda activo hasta que generes uno nuevo._"
|
"_El enlace queda activo hasta que generes uno nuevo._"
|
||||||
|
|||||||
@@ -1584,8 +1584,8 @@ async def eliminar_contacto_manual(numero: str, id: str) -> bool:
|
|||||||
KEY_CONFIG_GLOBAL = "cobranza_config_global"
|
KEY_CONFIG_GLOBAL = "cobranza_config_global"
|
||||||
|
|
||||||
DEFAULT_PLANTILLA: dict = {
|
DEFAULT_PLANTILLA: dict = {
|
||||||
"saludo": "Hola {cliente}, le saludamos de WK Financing Solutions.",
|
"saludo": "Hola {cliente}, le saludamos de Collina Systems.",
|
||||||
"despedida": "Gracias por su preferencia.\n\nWK Financing Solutions",
|
"despedida": "Gracias por su preferencia.\n\nCollina Systems",
|
||||||
"incluir_vehiculo": True,
|
"incluir_vehiculo": True,
|
||||||
"incluir_monto": True,
|
"incluir_monto": True,
|
||||||
"incluir_cliente": True,
|
"incluir_cliente": True,
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
MEXICO = ZoneInfo("America/Mexico_City")
|
MEXICO = ZoneInfo("America/Mexico_City")
|
||||||
|
|
||||||
# Membrete W+k: la MISMA hoja membretada de la plantilla de cotización
|
# Membrete Collina: la MISMA hoja membretada de la plantilla de cotización
|
||||||
# (Plantilla_WK2.docm → word/media/image1.jpeg, página carta completa con
|
# (Plantilla_Collina.docm → word/media/image1.jpeg, página carta completa con
|
||||||
# logo, dirección y marca de agua). Se extrae en runtime para heredar
|
# logo, dirección y marca de agua). Se extrae en runtime para heredar
|
||||||
# automáticamente cualquier cambio de branding en la plantilla.
|
# automáticamente cualquier cambio de branding en la plantilla.
|
||||||
TEMPLATE_PATH = Path(__file__).resolve().parents[2] / "Plantilla_WK2.docm"
|
TEMPLATE_PATH = Path(__file__).resolve().parents[2] / "Plantilla_Collina.docm"
|
||||||
|
|
||||||
_membrete_cache: ImageReader | None = None
|
_membrete_cache: ImageReader | None = None
|
||||||
_membrete_probado = False
|
_membrete_probado = False
|
||||||
@@ -57,15 +57,15 @@ def _membrete() -> ImageReader | None:
|
|||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"Sin membrete WK (%s): estado de cuenta sin fondo",
|
"Sin membrete (%s): estado de cuenta sin fondo",
|
||||||
TEMPLATE_PATH,
|
TEMPLATE_PATH,
|
||||||
)
|
)
|
||||||
_membrete_cache = None
|
_membrete_cache = None
|
||||||
return _membrete_cache
|
return _membrete_cache
|
||||||
|
|
||||||
|
|
||||||
# Navy del logotipo W+k consulting (encabezados de tabla y títulos).
|
# Verde del membrete Collina Systems (encabezados de tabla y títulos).
|
||||||
_ACCENT = colors.HexColor("#3a3467")
|
_ACCENT = colors.HexColor("#336637")
|
||||||
_GRIS = colors.HexColor("#586173")
|
_GRIS = colors.HexColor("#586173")
|
||||||
_LINEA = colors.HexColor("#d4dae4")
|
_LINEA = colors.HexColor("#d4dae4")
|
||||||
_FILA_ALT = colors.HexColor("#f4f6fa")
|
_FILA_ALT = colors.HexColor("#f4f6fa")
|
||||||
@@ -205,7 +205,7 @@ def generar_pdf(
|
|||||||
encabezado = [Paragraph("ESTADO DE CUENTA", st_titulo)]
|
encabezado = [Paragraph("ESTADO DE CUENTA", st_titulo)]
|
||||||
else:
|
else:
|
||||||
encabezado = [
|
encabezado = [
|
||||||
Paragraph("WK FINANCING SOLUTIONS", st_titulo),
|
Paragraph("COLLINA SYSTEMS", st_titulo),
|
||||||
Paragraph("ESTADO DE CUENTA", st_seccion),
|
Paragraph("ESTADO DE CUENTA", st_seccion),
|
||||||
]
|
]
|
||||||
story = encabezado + [
|
story = encabezado + [
|
||||||
|
|||||||
+4
-4
@@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Cobranza Acumulada · WK</title>
|
<title>Cobranza Acumulada · Collina</title>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
|
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
|
||||||
@@ -396,10 +396,10 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="header-icon">WK</div>
|
<div class="header-icon">CS</div>
|
||||||
<div class="header-text">
|
<div class="header-text">
|
||||||
<h1>Cobranza acumulada</h1>
|
<h1>Cobranza acumulada</h1>
|
||||||
<p id="userline">WK Cobranza</p>
|
<p id="userline">Collina Cobranza</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -2251,7 +2251,7 @@ function autoConcepto(r){
|
|||||||
}
|
}
|
||||||
const cliente = (r && r.cliente ? r.cliente : "CLIENTE").split(/\s+/)[0].toUpperCase();
|
const cliente = (r && r.cliente ? r.cliente : "CLIENTE").split(/\s+/)[0].toUpperCase();
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
return `WK-${tipoStr}-${cliente}-${_MESES_CORTO[d.getMonth()]}${String(d.getFullYear()).slice(-2)}`;
|
return `CS-${tipoStr}-${cliente}-${_MESES_CORTO[d.getMonth()]}${String(d.getFullYear()).slice(-2)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _aplicarVariables(tpl, vars){
|
function _aplicarVariables(tpl, vars){
|
||||||
|
|||||||
Reference in new issue
Block a user