From 75738dadde73e94b0da24c9fb2c9c0035d79c50d Mon Sep 17 00:00:00 2001 From: david Date: Thu, 17 Jul 2025 10:50:28 +0200 Subject: [PATCH] Facturas de cliente --- .../customer-invoice-items-card-editor.tsx | 54 ++++-- .../src/web/pages/create/create.tsx | 2 +- .../create/customer-invoice-edit-form.tsx | 162 ++++++++++++++++-- .../src/web/components/client-selector.tsx | 12 +- .../src/components/form/DatePickerField.tsx | 2 +- .../components/form/DatePickerInputField.tsx | 2 +- .../src/components/form/NumberField.tsx | 2 +- .../src/components/form/TextAreaField.tsx | 2 +- .../rdx-ui/src/components/form/TextField.tsx | 2 +- packages/shadcn-ui/src/components/command.tsx | 107 +++++------- 10 files changed, 245 insertions(+), 102 deletions(-) diff --git a/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx b/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx index d11435d1..e36e0062 100644 --- a/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx +++ b/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx @@ -1,6 +1,20 @@ -import { FormControl, FormField, FormItem, FormMessage, Input } from "@repo/shadcn-ui/components"; +import { + Button, + Card, + CardAction, + CardContent, + CardDescription, + CardHeader, + CardTitle, + FormControl, + FormField, + FormItem, + FormMessage, + Input, +} from "@repo/shadcn-ui/components"; import { TextAreaField } from "@repo/rdx-ui/components"; +import { cn } from "@repo/shadcn-ui/lib/utils"; import { ColumnDef } from "@tanstack/react-table"; import { ChevronDownIcon, ChevronUpIcon, CopyIcon, Trash2Icon } from "lucide-react"; import { useState } from "react"; @@ -18,10 +32,12 @@ export const CustomerInvoiceItemsCardEditor = ({ //currency, //language, defaultValues, + className = "", }: { //currency: CurrencyData; //language: Language; defaultValues: Readonly<{ [x: string]: any }> | undefined; + className?: string; }) => { const { t } = useTranslation(); @@ -271,17 +287,29 @@ export const CustomerInvoiceItemsCardEditor = ({ const navCollapsedSize = 4; return ( -
- setArticlePickerDialogOpen(true), - //pickBlock: () => setBlockPickerDialogOpen(true), - }} - columns={columns} - data={fields} - defaultValues={defaultValues} - /> -
+ + + Contenido + Description + + + + + + + + + setArticlePickerDialogOpen(true), + //pickBlock: () => setBlockPickerDialogOpen(true), + }} + columns={columns} + data={fields} + defaultValues={defaultValues} + /> + + ); }; diff --git a/modules/customer-invoices/src/web/pages/create/create.tsx b/modules/customer-invoices/src/web/pages/create/create.tsx index 4cd2837c..2fbbaeaf 100644 --- a/modules/customer-invoices/src/web/pages/create/create.tsx +++ b/modules/customer-invoices/src/web/pages/create/create.tsx @@ -63,7 +63,7 @@ export const CustomerInvoiceCreate = () => { -
+
diff --git a/modules/customer-invoices/src/web/pages/create/customer-invoice-edit-form.tsx b/modules/customer-invoices/src/web/pages/create/customer-invoice-edit-form.tsx index 6dcb3df8..411fd3ab 100644 --- a/modules/customer-invoices/src/web/pages/create/customer-invoice-edit-form.tsx +++ b/modules/customer-invoices/src/web/pages/create/customer-invoice-edit-form.tsx @@ -10,8 +10,10 @@ import { Button, Calendar, Card, + CardAction, CardContent, CardDescription, + CardFooter, CardHeader, CardTitle, Form, @@ -276,27 +278,138 @@ export const CustomerInvoiceEditForm = ({ return (
- - {/* Cliente */} - + +
+ + + Cliente + Description + + + + + + + + + + + + + + {" "} + + {/* Información básica */} + + + Información Básica + Detalles generales de la factura + + + + + + + + + + + + +
+ + + ); + + return ( +
+ + Cliente + Description + + + + + + - - +
+
+

Radix Primitives

+

+ An open-source UI component library. +

+
+ +
+
Blog
+ +
Docs
+ +
Source
+
+
+ + + + {" "}
{/* Información básica */} - + Información Básica Detalles generales de la factura @@ -355,8 +468,29 @@ export const CustomerInvoiceEditForm = ({ + {/* Cliente */} + + + Cliente + + + + + + + {/*Items */} - + {/* Items */} diff --git a/modules/customers/src/web/components/client-selector.tsx b/modules/customers/src/web/components/client-selector.tsx index 16a6c175..0c6ffef2 100644 --- a/modules/customers/src/web/components/client-selector.tsx +++ b/modules/customers/src/web/components/client-selector.tsx @@ -128,8 +128,8 @@ export const ClientSelector = () => { return (
-
- +
+
- + - +
diff --git a/packages/rdx-ui/src/components/form/DatePickerField.tsx b/packages/rdx-ui/src/components/form/DatePickerField.tsx index 6ca5fb6e..e5878826 100644 --- a/packages/rdx-ui/src/components/form/DatePickerField.tsx +++ b/packages/rdx-ui/src/components/form/DatePickerField.tsx @@ -52,7 +52,7 @@ export function DatePickerField({ control={control} name={name} render={({ field }) => ( - + {label && (
{label} diff --git a/packages/rdx-ui/src/components/form/DatePickerInputField.tsx b/packages/rdx-ui/src/components/form/DatePickerInputField.tsx index 655c6bfc..6cc10260 100644 --- a/packages/rdx-ui/src/components/form/DatePickerInputField.tsx +++ b/packages/rdx-ui/src/components/form/DatePickerInputField.tsx @@ -81,7 +81,7 @@ export function DatePickerInputField({ }; return ( - +
{label} {required && {t("common.required")}} diff --git a/packages/rdx-ui/src/components/form/NumberField.tsx b/packages/rdx-ui/src/components/form/NumberField.tsx index a9ec6bf9..a8732185 100644 --- a/packages/rdx-ui/src/components/form/NumberField.tsx +++ b/packages/rdx-ui/src/components/form/NumberField.tsx @@ -44,7 +44,7 @@ export function NumberField({ control={control} name={name} render={({ field }) => ( - +
{label} {required && {t("common.required")}} diff --git a/packages/rdx-ui/src/components/form/TextAreaField.tsx b/packages/rdx-ui/src/components/form/TextAreaField.tsx index 36bf8b97..d4f75050 100644 --- a/packages/rdx-ui/src/components/form/TextAreaField.tsx +++ b/packages/rdx-ui/src/components/form/TextAreaField.tsx @@ -44,7 +44,7 @@ export function TextAreaField({ control={control} name={name} render={({ field }) => ( - + {label && (
{label} diff --git a/packages/rdx-ui/src/components/form/TextField.tsx b/packages/rdx-ui/src/components/form/TextField.tsx index 1588490d..6a7ce105 100644 --- a/packages/rdx-ui/src/components/form/TextField.tsx +++ b/packages/rdx-ui/src/components/form/TextField.tsx @@ -44,7 +44,7 @@ export function TextField({ control={control} name={name} render={({ field }) => ( - + {label && (
{label} diff --git a/packages/shadcn-ui/src/components/command.tsx b/packages/shadcn-ui/src/components/command.tsx index ab481e2f..e882e525 100644 --- a/packages/shadcn-ui/src/components/command.tsx +++ b/packages/shadcn-ui/src/components/command.tsx @@ -1,32 +1,29 @@ -"use client" +"use client"; -import * as React from "react" -import { Command as CommandPrimitive } from "cmdk" -import { SearchIcon } from "lucide-react" +import { Command as CommandPrimitive } from "cmdk"; +import { SearchIcon } from "lucide-react"; +import * as React from "react"; -import { cn } from "@repo/shadcn-ui/lib/utils" import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, -} from "@repo/shadcn-ui/components/dialog" +} from "@repo/shadcn-ui/components/dialog"; +import { cn } from "@repo/shadcn-ui/lib/utils"; -function Command({ - className, - ...props -}: React.ComponentProps) { +function Command({ className, ...props }: React.ComponentProps) { return ( - ) + ); } function CommandDialog({ @@ -35,22 +32,22 @@ function CommandDialog({ children, ...props }: React.ComponentProps & { - title?: string - description?: string + title?: string; + description?: string; }) { return ( - + {title} {description} - - + + {children} - ) + ); } function CommandInput({ @@ -58,13 +55,10 @@ function CommandInput({ ...props }: React.ComponentProps) { return ( -
- +
+
- ) + ); } -function CommandList({ - className, - ...props -}: React.ComponentProps) { +function CommandList({ className, ...props }: React.ComponentProps) { return ( - ) + ); } -function CommandEmpty({ - ...props -}: React.ComponentProps) { +function CommandEmpty({ ...props }: React.ComponentProps) { return ( - ) + ); } function CommandGroup({ @@ -109,14 +95,14 @@ function CommandGroup({ }: React.ComponentProps) { return ( - ) + ); } function CommandSeparator({ @@ -125,53 +111,44 @@ function CommandSeparator({ }: React.ComponentProps) { return ( - ) + ); } -function CommandItem({ - className, - ...props -}: React.ComponentProps) { +function CommandItem({ className, ...props }: React.ComponentProps) { return ( - ) + ); } -function CommandShortcut({ - className, - ...props -}: React.ComponentProps<"span">) { +function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) { return ( - ) + ); } export { Command, CommandDialog, - CommandInput, - CommandList, CommandEmpty, CommandGroup, + CommandInput, CommandItem, - CommandShortcut, + CommandList, CommandSeparator, -} + CommandShortcut, +};