fix(web): local default dates, styled selects and currency on the new capture screens
Build and Push Images / Build jorgecuadros-web (push) Successful in 2m6s
Build and Push Images / Build jorgecuadros-api (push) Successful in 2m16s

Found driving /clientes/alta and /efectivo in the browser: the default date
was UTC's (tomorrow, every evening), selects lacked the input style, the
service rows stretched one input per line, and the printed receipt showed a
bare $ with no currency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rmancinasandClaude Opus 5.5 committed 2026-10-12 19:30:37 -07:00
1 parent 6468811955
commit c239c1a866
3 files changed
+13 -9

No files matched your search

+7 -6
View File
@@ -23,7 +23,8 @@ export default function AltaClientePage() {
type ServiceRow = { kind: ServiceKind; accountNumber: string; meterNumber: string }; type ServiceRow = { kind: ServiceKind; accountNumber: string; meterNumber: string };
const today = () => new Date().toISOString().slice(0, 10); // The office's calendar day, not UTC's — in the evening UTC is already tomorrow.
const today = () => new Date().toLocaleDateString("en-CA");
const t = (v: string) => v.trim() || undefined; const t = (v: string) => v.trim() || undefined;
function Alta() { function Alta() {
@@ -174,7 +175,7 @@ function Alta() {
<input className="input" value={mobile} onChange={(e) => setMobile(e.target.value)} /> <input className="input" value={mobile} onChange={(e) => setMobile(e.target.value)} />
</Field> </Field>
<Field label="Moneda preferida"> <Field label="Moneda preferida">
<select className="select" value={preferredCurrency} <select className="input select" value={preferredCurrency}
onChange={(e) => setPreferredCurrency(e.target.value as Currency)}> onChange={(e) => setPreferredCurrency(e.target.value as Currency)}>
<option value="USD">USD</option> <option value="USD">USD</option>
<option value="MXN">MXN</option> <option value="MXN">MXN</option>
@@ -197,8 +198,8 @@ function Alta() {
</Field> </Field>
</div> </div>
{services.map((s, i) => ( {services.map((s, i) => (
<div key={i} className="inline-form" style={{ flexWrap: "wrap", gap: 12, marginTop: 12 }}> <div key={i} className="form-grid" style={{ marginTop: 12, alignItems: "end" }}>
<select className="select" value={s.kind} <select className="input select" value={s.kind}
onChange={(e) => setService(i, { kind: e.target.value as ServiceKind })}> onChange={(e) => setService(i, { kind: e.target.value as ServiceKind })}>
{Object.entries(SERVICE_KIND_LABELS).map(([k, label]) => ( {Object.entries(SERVICE_KIND_LABELS).map(([k, label]) => (
<option key={k} value={k}>{label}</option> <option key={k} value={k}>{label}</option>
@@ -229,14 +230,14 @@ function Alta() {
onChange={(e) => setPayAmount(e.target.value)} /> onChange={(e) => setPayAmount(e.target.value)} />
</Field> </Field>
<Field label="Moneda"> <Field label="Moneda">
<select className="select" value={payCurrency} <select className="input select" value={payCurrency}
onChange={(e) => setPayCurrency(e.target.value as Currency)}> onChange={(e) => setPayCurrency(e.target.value as Currency)}>
<option value="MXN">MXN</option> <option value="MXN">MXN</option>
<option value="USD">USD</option> <option value="USD">USD</option>
</select> </select>
</Field> </Field>
<Field label="Forma de pago"> <Field label="Forma de pago">
<select className="select" value={payMethod} <select className="input select" value={payMethod}
onChange={(e) => setPayMethod(e.target.value as "CASH" | "CHECK")}> onChange={(e) => setPayMethod(e.target.value as "CASH" | "CHECK")}>
<option value="CASH">Efectivo (emite recibo EFE)</option> <option value="CASH">Efectivo (emite recibo EFE)</option>
<option value="CHECK">Cheque</option> <option value="CHECK">Cheque</option>
+3 -1
View File
@@ -63,7 +63,9 @@ export default function CashReceiptPrint({ params }: { params: { folio: string }
{r.customer.folderNumber != null && ` · Carpeta ${r.customer.folderNumber}`} {r.customer.folderNumber != null && ` · Carpeta ${r.customer.folderNumber}`}
</Row> </Row>
<Row label="Monto"> <Row label="Monto">
<strong>{formatMoney(r.amount, r.currency)}</strong> <strong>
{formatMoney(r.amount, r.currency)} {r.currency}
</strong>
{converted && {converted &&
` (abonado ${formatMoney(r.transaction.amount, r.transaction.currency)} a T.C. ${Number(r.exchangeRate).toFixed(4)})`} ` (abonado ${formatMoney(r.transaction.amount, r.transaction.currency)} a T.C. ${Number(r.exchangeRate).toFixed(4)})`}
</Row> </Row>
+3 -2
View File
@@ -27,7 +27,8 @@ export default function EfectivoPage() {
); );
} }
const today = () => new Date().toISOString().slice(0, 10); // The office's calendar day, not UTC's — in the evening UTC is already tomorrow.
const today = () => new Date().toLocaleDateString("en-CA");
function CashBook() { function CashBook() {
const canCapture = useCan("ledger:create"); const canCapture = useCan("ledger:create");
@@ -204,7 +205,7 @@ function ReceiptForm({ onIssued }: { onIssued: () => void }) {
</label> </label>
<label className="field"> <label className="field">
<span className="field-label">Moneda</span> <span className="field-label">Moneda</span>
<select className="select" value={currency} <select className="input select" value={currency}
onChange={(e) => setCurrency(e.target.value as Currency)}> onChange={(e) => setCurrency(e.target.value as Currency)}>
<option value="MXN">MXN</option> <option value="MXN">MXN</option>
<option value="USD">USD</option> <option value="USD">USD</option>