USE [Clinica]
GO
/****** Object:  Table [Caja].[MovimientoCaja]    Script Date: 18-08-2025 21:40:49 ******/
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] NOT 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,
	[NroTransaccionTBK] [varchar](50) NULL,
	[OrigenBono] [varchar](100) NULL,
	[Seguros] [varchar](100) NULL,
	[SistemaSalud] [varchar](100) NULL,
	[TotalBono] [decimal](16, 2) 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  DEFAULT ((0)) FOR [Monto]
GO
ALTER TABLE [Caja].[MovimientoCaja]  WITH CHECK ADD  CONSTRAINT [FK__Movimient__IdCaj__3F865F66] FOREIGN KEY([IdCaja])
REFERENCES [Caja].[Caja] ([IdCaja])
GO
ALTER TABLE [Caja].[MovimientoCaja] CHECK CONSTRAINT [FK__Movimient__IdCaj__3F865F66]
GO
ALTER TABLE [Caja].[MovimientoCaja]  WITH CHECK ADD  CONSTRAINT [FK__Movimient__IdCic__3E923B2D] FOREIGN KEY([IdCicloCaja])
REFERENCES [Caja].[CicloCaja] ([IdCicloCaja])
GO
ALTER TABLE [Caja].[MovimientoCaja] CHECK CONSTRAINT [FK__Movimient__IdCic__3E923B2D]
GO
ALTER TABLE [Caja].[MovimientoCaja]  WITH CHECK ADD  CONSTRAINT [FK__Movimient__IdTip__407A839F] FOREIGN KEY([IdTipoModalidadPago])
REFERENCES [Caja].[TipoModalidadPago] ([IdTipoModalidadPago])
GO
ALTER TABLE [Caja].[MovimientoCaja] CHECK CONSTRAINT [FK__Movimient__IdTip__407A839F]
GO
ALTER TABLE [Caja].[MovimientoCaja]  WITH CHECK ADD  CONSTRAINT [FK__Movimient__IdTip__416EA7D8] FOREIGN KEY([IdTipoCopago])
REFERENCES [Caja].[TipoCopago] ([IdTipoCopago])
GO
ALTER TABLE [Caja].[MovimientoCaja] CHECK CONSTRAINT [FK__Movimient__IdTip__416EA7D8]
GO
