USE [Clinica]
GO
/****** Object:  Table [Caja].[MovimientoCaja]    Script Date: 18-08-2025 21:38:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Caja].[MovimientoCaja](
	[IdMovimientoCaja] [int] IDENTITY(1,1) NOT NULL,
	[IdCicloCaja] [int] NOT NULL,
	[IdCaja] [int] NOT NULL,
	[IdTipoModalidadPago] [int] NOT NULL,
	[IdTipoCopago] [int] NULL,
	[Monto] [decimal](16, 2) NOT NULL,
	[FechaMovimiento] [datetime] NOT NULL,
	[Excendentes] [decimal](16, 2) NULL,
	[FechaEmision] [datetime] NULL,
	[FechaRecepcion] [datetime] NULL,
	[MontoCopago] [decimal](16, 2) NULL,
	[MontoPagadoPrevision] [decimal](16, 2) NULL,
	[NroBono] [varchar](50) NULL,
	[NroBoleta] [varchar](50) NULL,
	[NroTransaccionTBK] [varchar](50) NULL,
	[OrigenBono] [varchar](100) NULL,
	[Seguros] [varchar](100) NULL,
	[SistemaSalud] [varchar](100) NULL,
	[TotalBono] [decimal](16, 2) NULL,
	[IdBanco] [int] NULL,
	[NroCuentaCheque] [int] NULL,
	[NroSerieCheque] [int] NULL,
	[FechaEmisionCheque] [date] NULL,
	[NumeroGarantia] [int] NULL,
	[IdCita] [int] NULL,
	[IdIsapre] [int] NULL,
	[IdTipoEstadoMovimientoCaja] [int] NOT NULL,
 CONSTRAINT [PK__Movimien__D126CD2D19B38750] PRIMARY KEY CLUSTERED 
(
	[IdMovimientoCaja] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [Caja].[MovimientoCaja] ADD  CONSTRAINT [DF_MovimientoCaja_IdTipoEstadoMovimientoCaja]  DEFAULT ((1)) FOR [IdTipoEstadoMovimientoCaja]
GO
ALTER TABLE [Caja].[MovimientoCaja]  WITH CHECK ADD  CONSTRAINT [FK_MovimientoCaja_TipoEstadoMovimientoCaja] FOREIGN KEY([IdTipoEstadoMovimientoCaja])
REFERENCES [Caja].[TipoEstadoMovimientoCaja] ([IdTipoEstadoMovimientoCaja])
GO
ALTER TABLE [Caja].[MovimientoCaja] CHECK CONSTRAINT [FK_MovimientoCaja_TipoEstadoMovimientoCaja]
GO
