Proceso de paso de proforma a factura
This commit is contained in:
parent
2c84dc26bd
commit
c8eff4e9fc
@ -1,8 +1,8 @@
|
|||||||
import { ITransactionManager } from "@erp/core/api";
|
import { ITransactionManager } from "@erp/core/api";
|
||||||
import { UniqueID, UtcDate } from "@repo/rdx-ddd";
|
import { UniqueID, UtcDate } from "@repo/rdx-ddd";
|
||||||
import { Maybe, Result } from "@repo/rdx-utils";
|
import { Result } from "@repo/rdx-utils";
|
||||||
import { InvalidProformaStatusError } from "../../domain";
|
import { ProformaCannotBeConvertedToInvoiceError } from "../../domain";
|
||||||
import { StatusInvoiceIsApprovedSpecification } from "../../domain/specs";
|
import { ProformaCanTranstionToIssuedSpecification } from "../../domain/specs";
|
||||||
import { CustomerInvoiceApplicationService } from "../customer-invoice-application.service";
|
import { CustomerInvoiceApplicationService } from "../customer-invoice-application.service";
|
||||||
|
|
||||||
type IssueCustomerInvoiceUseCaseInput = {
|
type IssueCustomerInvoiceUseCaseInput = {
|
||||||
@ -52,9 +52,9 @@ export class IssueCustomerInvoiceUseCase {
|
|||||||
const proforma = proformaResult.data;
|
const proforma = proformaResult.data;
|
||||||
|
|
||||||
/** 2. Comprobamos que la proforma origen está aprovada para generar la factura */
|
/** 2. Comprobamos que la proforma origen está aprovada para generar la factura */
|
||||||
const isApprovedSpec = new StatusInvoiceIsApprovedSpecification();
|
const isOk = new ProformaCanTranstionToIssuedSpecification();
|
||||||
if (!(await isApprovedSpec.isSatisfiedBy(proforma))) {
|
if (!(await isOk.isSatisfiedBy(proforma))) {
|
||||||
return Result.fail(new InvalidProformaStatusError(proformaId.toString()));
|
return Result.fail(new ProformaCannotBeConvertedToInvoiceError(proformaId.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 3. Generar nueva factura */
|
/** 3. Generar nueva factura */
|
||||||
@ -71,7 +71,7 @@ export class IssueCustomerInvoiceUseCase {
|
|||||||
|
|
||||||
// props base obtenidas del agregado proforma
|
// props base obtenidas del agregado proforma
|
||||||
const issuedInvoiceOrError = this.service.buildIssueInvoiceInCompany(companyId, proforma, {
|
const issuedInvoiceOrError = this.service.buildIssueInvoiceInCompany(companyId, proforma, {
|
||||||
invoiceNumber: Maybe.some(newIssueNumber),
|
invoiceNumber: newIssueNumber,
|
||||||
invoiceDate: UtcDate.today(),
|
invoiceDate: UtcDate.today(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
export * from "./status-invoice-is-approved.specification";
|
export * from "./proforma-can-transtion-to-issued.specification";
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
import { CompositeSpecification } from "@repo/rdx-ddd";
|
||||||
|
import { CustomerInvoice } from "../aggregates";
|
||||||
|
import { INVOICE_STATUS } from "../value-objects";
|
||||||
|
|
||||||
|
export class ProformaCanTranstionToIssuedSpecification extends CompositeSpecification<CustomerInvoice> {
|
||||||
|
public async isSatisfiedBy(proforma: CustomerInvoice): Promise<boolean> {
|
||||||
|
return proforma.isProforma && proforma.canTransitionTo(INVOICE_STATUS.ISSUED);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import { CompositeSpecification } from "@repo/rdx-ddd";
|
|
||||||
import { CustomerInvoice } from "../aggregates";
|
|
||||||
|
|
||||||
export class StatusInvoiceIsApprovedSpecification extends CompositeSpecification<CustomerInvoice> {
|
|
||||||
public async isSatisfiedBy(invoice: CustomerInvoice): Promise<boolean> {
|
|
||||||
return invoice.status.isApproved();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -11,9 +11,8 @@ export enum INVOICE_STATUS {
|
|||||||
APPROVED = "approved", // <- Proforma
|
APPROVED = "approved", // <- Proforma
|
||||||
REJECTED = "rejected", // <- Proforma
|
REJECTED = "rejected", // <- Proforma
|
||||||
|
|
||||||
// status === issued <- (si is_proforma === true) => Es una proforma (histórica)
|
// status === "issued" <- (si is_proforma === true) => Es una proforma (histórica)
|
||||||
// status === issued <- (si is_proforma === false) => Factura y enviará/enviada a Veri*Factu
|
// status === "issued" <- (si is_proforma === false) => Factura y enviará/enviada a Veri*Factu
|
||||||
|
|
||||||
ISSUED = "issued",
|
ISSUED = "issued",
|
||||||
}
|
}
|
||||||
export class CustomerInvoiceStatus extends ValueObject<ICustomerInvoiceStatusProps> {
|
export class CustomerInvoiceStatus extends ValueObject<ICustomerInvoiceStatusProps> {
|
||||||
@ -93,15 +92,6 @@ export class CustomerInvoiceStatus extends ValueObject<ICustomerInvoiceStatusPro
|
|||||||
return CustomerInvoiceStatus.TRANSITIONS[this.props.value].includes(nextStatus);
|
return CustomerInvoiceStatus.TRANSITIONS[this.props.value].includes(nextStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
transitionTo(nextStatus: string): Result<CustomerInvoiceStatus, Error> {
|
|
||||||
if (!this.canTransitionTo(nextStatus)) {
|
|
||||||
return Result.fail(
|
|
||||||
new Error(`Transición no permitida de ${this.props.value} a ${nextStatus}`)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return CustomerInvoiceStatus.create(nextStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
return String(this.props.value);
|
return String(this.props.value);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,19 @@
|
|||||||
import { DataTableColumnHeader } from '@repo/rdx-ui/components';
|
import { DataTableColumnHeader } from "@repo/rdx-ui/components";
|
||||||
import { InputGroup, InputGroupTextarea } from "@repo/shadcn-ui/components";
|
import { InputGroup, InputGroupTextarea } from "@repo/shadcn-ui/components";
|
||||||
import { cn } from "@repo/shadcn-ui/lib/utils";
|
import { cn } from "@repo/shadcn-ui/lib/utils";
|
||||||
import type { ColumnDef } from "@tanstack/react-table";
|
import type { ColumnDef } from "@tanstack/react-table";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Controller, useFormContext } from "react-hook-form";
|
import { Controller, useFormContext } from "react-hook-form";
|
||||||
import { useInvoiceContext } from '../../../context';
|
import { useInvoiceContext } from "../../../context";
|
||||||
import { CustomerInvoiceTaxesMultiSelect } from '../../customer-invoice-taxes-multi-select';
|
import { CustomerInvoiceTaxesMultiSelect } from "../../customer-invoice-taxes-multi-select";
|
||||||
import { AmountInputField } from './amount-input-field';
|
import { AmountInputField } from "./amount-input-field";
|
||||||
import { HoverCardTotalsSummary } from './hover-card-total-summary';
|
import { HoverCardTotalsSummary } from "./hover-card-total-summary";
|
||||||
import { ItemDataTableRowActions } from './items-data-table-row-actions';
|
import { ItemDataTableRowActions } from "./items-data-table-row-actions";
|
||||||
import { PercentageInputField } from './percentage-input-field';
|
import { PercentageInputField } from "./percentage-input-field";
|
||||||
import { QuantityInputField } from './quantity-input-field';
|
import { QuantityInputField } from "./quantity-input-field";
|
||||||
|
|
||||||
|
|
||||||
export interface InvoiceItemFormData {
|
export interface InvoiceItemFormData {
|
||||||
id: string; // ← mapea RHF field.id aquí
|
id: string; // ← mapea RHF field.id aquí
|
||||||
description: string;
|
description: string;
|
||||||
quantity: number | "";
|
quantity: number | "";
|
||||||
unit_amount: number | "";
|
unit_amount: number | "";
|
||||||
@ -22,53 +21,62 @@ export interface InvoiceItemFormData {
|
|||||||
tax_codes: string[];
|
tax_codes: string[];
|
||||||
total_amount: number | ""; // readonly calculado
|
total_amount: number | ""; // readonly calculado
|
||||||
}
|
}
|
||||||
export interface InvoiceFormData { items: InvoiceItemFormData[] }
|
export interface InvoiceFormData {
|
||||||
|
items: InvoiceItemFormData[];
|
||||||
|
}
|
||||||
|
|
||||||
export function useItemsColumns(): ColumnDef<InvoiceItemFormData>[] {
|
export function useItemsColumns(): ColumnDef<InvoiceItemFormData>[] {
|
||||||
const { t, readOnly, currency_code, language_code } = useInvoiceContext();
|
const { t, readOnly, currency_code, language_code } = useInvoiceContext();
|
||||||
const { control } = useFormContext<InvoiceFormData>();
|
const { control } = useFormContext<InvoiceFormData>();
|
||||||
|
|
||||||
// Atención: Memoizar siempre para evitar reconstrucciones y resets de estado de tabla
|
// Atención: Memoizar siempre para evitar reconstrucciones y resets de estado de tabla
|
||||||
return React.useMemo<ColumnDef<InvoiceItemFormData>[]>(() => [
|
return React.useMemo<ColumnDef<InvoiceItemFormData>[]>(
|
||||||
{
|
() => [
|
||||||
id: 'position',
|
{
|
||||||
header: ({ column }) => (
|
id: "position",
|
||||||
<DataTableColumnHeader column={column} title={"#"} className='text-center' />
|
header: ({ column }) => (
|
||||||
),
|
<DataTableColumnHeader column={column} title={"#"} className='text-center' />
|
||||||
cell: ({ row }) => row.index + 1,
|
),
|
||||||
enableSorting: false,
|
cell: ({ row }) => row.index + 1,
|
||||||
size: 32,
|
enableSorting: false,
|
||||||
},
|
size: 32,
|
||||||
{
|
},
|
||||||
accessorKey: "description",
|
{
|
||||||
header: ({ column }) => (
|
accessorKey: "description",
|
||||||
<DataTableColumnHeader column={column} title={t("form_fields.item.description.label")} className='text-left' />
|
header: ({ column }) => (
|
||||||
),
|
<DataTableColumnHeader
|
||||||
cell: ({ row }) => (
|
column={column}
|
||||||
<Controller
|
title={t("form_fields.item.description.label")}
|
||||||
control={control}
|
className='text-left'
|
||||||
name={`items.${row.index}.description`}
|
/>
|
||||||
render={({ field }) => (
|
),
|
||||||
<InputGroup>
|
cell: ({ row }) => (
|
||||||
<InputGroupTextarea {...field}
|
<Controller
|
||||||
id={`desc-${row.original.id}`} // ← estable
|
control={control}
|
||||||
rows={1}
|
name={`items.${row.index}.description`}
|
||||||
aria-label={t("form_fields.item.description.label")}
|
render={({ field }) => (
|
||||||
spellCheck
|
<InputGroup>
|
||||||
readOnly={readOnly}
|
<InputGroupTextarea
|
||||||
// auto-grow simple
|
{...field}
|
||||||
onInput={(e) => {
|
id={`desc-${row.original.id}`} // ← estable
|
||||||
const el = e.currentTarget;
|
rows={1}
|
||||||
el.style.height = "auto";
|
aria-label={t("form_fields.item.description.label")}
|
||||||
el.style.height = `${el.scrollHeight}px`;
|
spellCheck
|
||||||
}}
|
readOnly={readOnly}
|
||||||
className={cn(
|
// auto-grow simple
|
||||||
"min-w-[12rem] max-w-[46rem] w-full resize-none bg-transparent border-dashed transition",
|
onInput={(e) => {
|
||||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:bg-background focus-visible:border-solid",
|
const el = e.currentTarget;
|
||||||
"focus:resize-y"
|
el.style.height = "auto";
|
||||||
)}
|
el.style.height = `${el.scrollHeight}px`;
|
||||||
data-cell-focus />
|
}}
|
||||||
{/*<InputGroupAddon align="block-end">
|
className={cn(
|
||||||
|
"min-w-[12rem] max-w-[46rem] w-full resize-none bg-transparent border-dashed transition",
|
||||||
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:bg-background focus-visible:border-solid",
|
||||||
|
"focus:resize-y"
|
||||||
|
)}
|
||||||
|
data-cell-focus
|
||||||
|
/>
|
||||||
|
{/*<InputGroupAddon align="block-end">
|
||||||
<InputGroupText>Line 1, Column 1</InputGroupText>
|
<InputGroupText>Line 1, Column 1</InputGroupText>
|
||||||
<InputGroupButton
|
<InputGroupButton
|
||||||
variant="default"
|
variant="default"
|
||||||
@ -80,129 +88,186 @@ export function useItemsColumns(): ColumnDef<InvoiceItemFormData>[] {
|
|||||||
<span className="sr-only">Send</span>
|
<span className="sr-only">Send</span>
|
||||||
</InputGroupButton>
|
</InputGroupButton>
|
||||||
</InputGroupAddon>*/}
|
</InputGroupAddon>*/}
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
|
)}
|
||||||
)}
|
/>
|
||||||
/>
|
),
|
||||||
),
|
enableSorting: false,
|
||||||
enableSorting: false,
|
size: 480,
|
||||||
size: 480, minSize: 240, maxSize: 768,
|
minSize: 240,
|
||||||
},
|
maxSize: 768,
|
||||||
{
|
},
|
||||||
accessorKey: "quantity",
|
{
|
||||||
header: ({ column }) => (
|
accessorKey: "quantity",
|
||||||
<DataTableColumnHeader column={column} title={t("form_fields.item.quantity.label")} className='text-right' />
|
header: ({ column }) => (
|
||||||
),
|
<DataTableColumnHeader
|
||||||
cell: ({ row }) => (
|
column={column}
|
||||||
<QuantityInputField
|
title={t("form_fields.item.quantity.label")}
|
||||||
control={control}
|
className='text-right'
|
||||||
name={`items.${row.index}.quantity`}
|
/>
|
||||||
readOnly={readOnly}
|
),
|
||||||
inputId={`qty-${row.original.id}`}
|
cell: ({ row }) => (
|
||||||
emptyMode="blank"
|
<QuantityInputField
|
||||||
data-row-index={row.index}
|
control={control}
|
||||||
data-col-index={4}
|
name={`items.${row.index}.quantity`}
|
||||||
data-cell-focus
|
readOnly={readOnly}
|
||||||
className="font-base"
|
inputId={`qty-${row.original.id}`}
|
||||||
/>
|
emptyMode='blank'
|
||||||
),
|
data-row-index={row.index}
|
||||||
enableSorting: false,
|
data-col-index={4}
|
||||||
size: 52, minSize: 48, maxSize: 64,
|
data-cell-focus
|
||||||
},
|
className='font-base'
|
||||||
{
|
/>
|
||||||
accessorKey: "unit_amount",
|
),
|
||||||
header: ({ column }) => (
|
enableSorting: false,
|
||||||
<DataTableColumnHeader column={column} title={t("form_fields.item.unit_amount.label")} className='text-right' />
|
size: 52,
|
||||||
),
|
minSize: 48,
|
||||||
cell: ({ row }) => (
|
maxSize: 64,
|
||||||
<AmountInputField
|
},
|
||||||
control={control}
|
{
|
||||||
name={`items.${row.index}.unit_amount`}
|
accessorKey: "unit_amount",
|
||||||
readOnly={readOnly}
|
header: ({ column }) => (
|
||||||
inputId={`unit-${row.original.id}`}
|
<DataTableColumnHeader
|
||||||
scale={4}
|
column={column}
|
||||||
currencyCode={currency_code}
|
title={t("form_fields.item.unit_amount.label")}
|
||||||
languageCode={language_code}
|
className='text-right'
|
||||||
data-row-index={row.index}
|
/>
|
||||||
data-col-index={5}
|
),
|
||||||
data-cell-focus
|
cell: ({ row }) => (
|
||||||
className="font-base"
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
enableSorting: false,
|
|
||||||
size: 120, minSize: 100, maxSize: 160,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "discount_percentage",
|
|
||||||
header: ({ column }) => (
|
|
||||||
<DataTableColumnHeader column={column} title={t("form_fields.item.discount_percentage.label")} className='text-right' />
|
|
||||||
),
|
|
||||||
cell: ({ row }) => (
|
|
||||||
<PercentageInputField
|
|
||||||
control={control}
|
|
||||||
name={`items.${row.index}.discount_percentage`}
|
|
||||||
readOnly={readOnly}
|
|
||||||
inputId={`disc-${row.original.id}`}
|
|
||||||
scale={4}
|
|
||||||
data-row-index={row.index}
|
|
||||||
data-col-index={6}
|
|
||||||
data-cell-focus
|
|
||||||
className="font-base"
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
enableSorting: false,
|
|
||||||
size: 40, minSize: 40
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "tax_codes",
|
|
||||||
header: ({ column }) => (
|
|
||||||
<DataTableColumnHeader column={column} title={t("form_fields.item.tax_codes.label")} />
|
|
||||||
),
|
|
||||||
cell: ({ row }) => (
|
|
||||||
<Controller
|
|
||||||
control={control}
|
|
||||||
name={`items.${row.index}.tax_codes`}
|
|
||||||
render={({ field }) => (
|
|
||||||
<CustomerInvoiceTaxesMultiSelect
|
|
||||||
{...field}
|
|
||||||
inputId={`tax-${row.original.id}`}
|
|
||||||
data-row-index={row.index}
|
|
||||||
data-col-index={7}
|
|
||||||
data-cell-focus
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
enableSorting: false,
|
|
||||||
size: 240, minSize: 232, maxSize: 320,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "total_amount",
|
|
||||||
header: ({ column }) => (
|
|
||||||
<DataTableColumnHeader column={column} title={t("form_fields.item.total_amount.label")} className='text-right' />
|
|
||||||
),
|
|
||||||
cell: ({ row }) => (
|
|
||||||
<HoverCardTotalsSummary rowIndex={row.index}>
|
|
||||||
<AmountInputField
|
<AmountInputField
|
||||||
control={control}
|
control={control}
|
||||||
name={`items.${row.index}.total_amount`}
|
name={`items.${row.index}.unit_amount`}
|
||||||
readOnly
|
readOnly={readOnly}
|
||||||
inputId={`total-${row.original.id}`}
|
inputId={`unit-${row.original.id}`}
|
||||||
|
scale={4}
|
||||||
currencyCode={currency_code}
|
currencyCode={currency_code}
|
||||||
languageCode={language_code}
|
languageCode={language_code}
|
||||||
className="font-semibold"
|
data-row-index={row.index}
|
||||||
|
data-col-index={5}
|
||||||
|
data-cell-focus
|
||||||
|
className='font-base'
|
||||||
/>
|
/>
|
||||||
</HoverCardTotalsSummary>
|
),
|
||||||
),
|
enableSorting: false,
|
||||||
enableSorting: false,
|
size: 120,
|
||||||
size: 120, minSize: 100, maxSize: 160,
|
minSize: 100,
|
||||||
},
|
maxSize: 160,
|
||||||
{
|
},
|
||||||
id: "actions",
|
{
|
||||||
header: ({ column }) => (
|
accessorKey: "discount_percentage",
|
||||||
<DataTableColumnHeader column={column} title={t("components.datatable.actions")} />
|
header: ({ column }) => (
|
||||||
),
|
<DataTableColumnHeader
|
||||||
cell: ({ row, table }) => <ItemDataTableRowActions row={row} table={table} />,
|
column={column}
|
||||||
},
|
title={t("form_fields.item.discount_percentage.label")}
|
||||||
], [t, readOnly, control, currency_code, language_code,]);
|
className='text-right'
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<PercentageInputField
|
||||||
|
control={control}
|
||||||
|
name={`items.${row.index}.discount_percentage`}
|
||||||
|
readOnly={readOnly}
|
||||||
|
inputId={`disc-${row.original.id}`}
|
||||||
|
scale={4}
|
||||||
|
data-row-index={row.index}
|
||||||
|
data-col-index={6}
|
||||||
|
data-cell-focus
|
||||||
|
className='font-base'
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
enableSorting: false,
|
||||||
|
size: 40,
|
||||||
|
minSize: 40,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "taxable_amount",
|
||||||
|
header: ({ column }) => (
|
||||||
|
<DataTableColumnHeader
|
||||||
|
column={column}
|
||||||
|
title={t("form_fields.item.taxable_amount.label")}
|
||||||
|
className='text-right'
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<AmountInputField
|
||||||
|
control={control}
|
||||||
|
name={`items.${row.index}.taxable_amount`}
|
||||||
|
readOnly={readOnly}
|
||||||
|
inputId={`unit-${row.original.id}`}
|
||||||
|
scale={4}
|
||||||
|
currencyCode={currency_code}
|
||||||
|
languageCode={language_code}
|
||||||
|
data-row-index={row.index}
|
||||||
|
data-col-index={5}
|
||||||
|
data-cell-focus
|
||||||
|
className='font-base'
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
enableSorting: false,
|
||||||
|
size: 120,
|
||||||
|
minSize: 100,
|
||||||
|
maxSize: 160,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "tax_codes",
|
||||||
|
header: ({ column }) => (
|
||||||
|
<DataTableColumnHeader column={column} title={t("form_fields.item.tax_codes.label")} />
|
||||||
|
),
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<Controller
|
||||||
|
control={control}
|
||||||
|
name={`items.${row.index}.tax_codes`}
|
||||||
|
render={({ field }) => (
|
||||||
|
<CustomerInvoiceTaxesMultiSelect
|
||||||
|
{...field}
|
||||||
|
inputId={`tax-${row.original.id}`}
|
||||||
|
data-row-index={row.index}
|
||||||
|
data-col-index={7}
|
||||||
|
data-cell-focus
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
enableSorting: false,
|
||||||
|
size: 120,
|
||||||
|
minSize: 130,
|
||||||
|
maxSize: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "total_amount",
|
||||||
|
header: ({ column }) => (
|
||||||
|
<DataTableColumnHeader
|
||||||
|
column={column}
|
||||||
|
title={t("form_fields.item.total_amount.label")}
|
||||||
|
className='text-right'
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<HoverCardTotalsSummary rowIndex={row.index}>
|
||||||
|
<AmountInputField
|
||||||
|
control={control}
|
||||||
|
name={`items.${row.index}.total_amount`}
|
||||||
|
readOnly
|
||||||
|
inputId={`total-${row.original.id}`}
|
||||||
|
currencyCode={currency_code}
|
||||||
|
languageCode={language_code}
|
||||||
|
className='font-semibold'
|
||||||
|
/>
|
||||||
|
</HoverCardTotalsSummary>
|
||||||
|
),
|
||||||
|
enableSorting: false,
|
||||||
|
size: 120,
|
||||||
|
minSize: 100,
|
||||||
|
maxSize: 160,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
header: ({ column }) => (
|
||||||
|
<DataTableColumnHeader column={column} title={t("components.datatable.actions")} />
|
||||||
|
),
|
||||||
|
cell: ({ row, table }) => <ItemDataTableRowActions row={row} table={table} />,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[t, readOnly, control, currency_code, language_code]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user