fix(web): local default dates, styled selects and currency on the new capture screens
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:
1 parent
6468811955
commit
c239c1a866
3 files changed
+13
-9
No files matched your search
@@ -23,7 +23,8 @@ export default function AltaClientePage() {
|
||||
|
||||
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;
|
||||
|
||||
function Alta() {
|
||||
@@ -174,7 +175,7 @@ function Alta() {
|
||||
<input className="input" value={mobile} onChange={(e) => setMobile(e.target.value)} />
|
||||
</Field>
|
||||
<Field label="Moneda preferida">
|
||||
<select className="select" value={preferredCurrency}
|
||||
<select className="input select" value={preferredCurrency}
|
||||
onChange={(e) => setPreferredCurrency(e.target.value as Currency)}>
|
||||
<option value="USD">USD</option>
|
||||
<option value="MXN">MXN</option>
|
||||
@@ -197,8 +198,8 @@ function Alta() {
|
||||
</Field>
|
||||
</div>
|
||||
{services.map((s, i) => (
|
||||
<div key={i} className="inline-form" style={{ flexWrap: "wrap", gap: 12, marginTop: 12 }}>
|
||||
<select className="select" value={s.kind}
|
||||
<div key={i} className="form-grid" style={{ marginTop: 12, alignItems: "end" }}>
|
||||
<select className="input select" value={s.kind}
|
||||
onChange={(e) => setService(i, { kind: e.target.value as ServiceKind })}>
|
||||
{Object.entries(SERVICE_KIND_LABELS).map(([k, label]) => (
|
||||
<option key={k} value={k}>{label}</option>
|
||||
@@ -229,14 +230,14 @@ function Alta() {
|
||||
onChange={(e) => setPayAmount(e.target.value)} />
|
||||
</Field>
|
||||
<Field label="Moneda">
|
||||
<select className="select" value={payCurrency}
|
||||
<select className="input select" value={payCurrency}
|
||||
onChange={(e) => setPayCurrency(e.target.value as Currency)}>
|
||||
<option value="MXN">MXN</option>
|
||||
<option value="USD">USD</option>
|
||||
</select>
|
||||
</Field>
|
||||
<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")}>
|
||||
<option value="CASH">Efectivo (emite recibo EFE)</option>
|
||||
<option value="CHECK">Cheque</option>
|
||||
|
||||
@@ -63,7 +63,9 @@ export default function CashReceiptPrint({ params }: { params: { folio: string }
|
||||
{r.customer.folderNumber != null && ` · Carpeta ${r.customer.folderNumber}`}
|
||||
</Row>
|
||||
<Row label="Monto">
|
||||
<strong>{formatMoney(r.amount, r.currency)}</strong>
|
||||
<strong>
|
||||
{formatMoney(r.amount, r.currency)} {r.currency}
|
||||
</strong>
|
||||
{converted &&
|
||||
` (abonado ${formatMoney(r.transaction.amount, r.transaction.currency)} a T.C. ${Number(r.exchangeRate).toFixed(4)})`}
|
||||
</Row>
|
||||
|
||||
@@ -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() {
|
||||
const canCapture = useCan("ledger:create");
|
||||
@@ -204,7 +205,7 @@ function ReceiptForm({ onIssued }: { onIssued: () => void }) {
|
||||
</label>
|
||||
<label className="field">
|
||||
<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)}>
|
||||
<option value="MXN">MXN</option>
|
||||
<option value="USD">USD</option>
|
||||
|
||||
Reference in new issue
Block a user