SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
http://sistemasddm.blogspot.com
FACTURA – BOLETA
BD. SQL SERVER
CREATE DATABASE SISTEMA
GO
USE SISTEMA
GO
CREATE TABLE CLIENTES
(IDCLI VARCHAR(5)NOT NULL ,
NOMBRE VARCHAR(20)NOT NULL,
APELLIDOS VARCHAR(50)NOT NULL,
SEXO VARCHAR(1)NULL,
Primary Key (IDCLI))
GO
INSERT INTO CLIENTES VALUES('C0001','LUIS','GOMEZ','M')
INSERT INTO CLIENTES VALUES('C0002','CARLOS','SANCHEZ','M')
INSERT INTO CLIENTES VALUES('C0003','ELIANA','CASTRO','M')
GO
CREATE TABLE EMPLEADOS
(IDEMP VARCHAR(5)NOT NULL,
NOMBRE VARCHAR(20)NOT NULL,
APELLIDOS VARCHAR(50)NOT NULL,
SEXO VARCHAR(1)NULL,
Primary Key (IDEMP))
GO
INSERT INTO EMPLEADOS VALUES('E0001','LUIS','GOMEZ','M')
INSERT INTO EMPLEADOS VALUES('E0002','FERNANDA','PEREZ','M')
INSERT INTO EMPLEADOS VALUES('E0003','LUISA','VERASTEGUI','M')
GO
--DOCUMENTO--
CREATE TABLE CAB_DOCUMENTO
(NDOC VARCHAR (5) NOT NULL,
TIP_DOC VARCHAR (30) NOT NULL,
IDCLI VARCHAR(5) NOT NULL,
IDEMP VARCHAR (5)NOT NULL,
FECHA DATETIME NOT NULL,
SUBTOTAL REAL NULL,
IGV REAL NULL,
TOTAL REAL NULL,
ESTADO VARCHAR(20) NOT NULL,
PRIMARY KEY(NDOC,TIP_DOC))
GO
CREATE TABLE DETALLE_DOCUMENTO(
NDOC VARCHAR (5)NOT NULL,
TIP_DOC VARCHAR (30) NOT NULL,
ITEM INT NOT NULL,
PRODUCTO VARCHAR(20) NOT NULL,
PRECIO REAL NULL,
CANTIDAD INT NULL,
PRIMARY KEY(ITEM,NDOC,TIP_DOC))
GO
ALTER TABLE CAB_DOCUMENTO
ADD FOREIGN KEY(IDCLI) REFERENCES CLIENTES
http://sistemasddm.blogspot.com
ALTER TABLE CAB_DOCUMENTO
ADD FOREIGN KEY(IDEMP) REFERENCES EMPLEADOS
ALTER TABLE DETALLE_DOCUMENTO
ADD FOREIGN KEY (NDOC,TIP_DOC) REFERENCES CAB_DOCUMENTO
GO
--CREACION DE LA TABLA GENERADOR
GO
CREATE TABLE GENERADOR(
PARAMETRO Varchar(40) Not Null,
ULTIMO Int Null
)
GO
-- INSERCCION DE DATOS EN LA TABLA GENERADOR
INSERT INTO GENERADOR values('DOCUMENTO',0)
GO
CREATE PROCEDURE SP_MANTEDOCUMENTO
@NDO VARCHAR (5),
@TIP VARCHAR (30),
@IDC VARCHAR(5),
@IDE VARCHAR (5),
@FEC DATETIME ,
@SUBTOT REAL,
@IGV REAL,
@TOT REAL,
@EST VARCHAR(20)
AS
BEGIN
INSERT INTO CAB_DOCUMENTO VALUES (@NDO, @TIP, @IDC,@IDE,
@FEC,@SUBTOT,@IGV,@TOT,@EST)
END
GO
SELECT * FROM CLIENTES
SELECT * FROM EMPLEADOS
SELECT * FROM CAB_DOCUMENTO
SELECT * FROM DETALLE_DOCUMENTO
SELECT * FROM GENERADOR
APLICACIÓN. VISUAL STUDIO.NET
http://sistemasddm.blogspot.com
http://sistemasddm.blogspot.com
CODIGO Facturacion (Form1.vb)
Imports System.Data.SqlClient
Public Class Facturacion
Dim fila As Integer = -1
Dim TIPO As String = ""
Dim D As Integer = 0
Dim pre As Double
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Me.txtFecha.Text = Now
End Sub
Private Sub btnAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnAgregar.Click
Me.DatosGrid.Rows.Add("")
End Sub
Private Sub btnQuitar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnQuitar.Click
If fila <> -1 Then
Me.DatosGrid.Rows.RemoveAt(fila)
fila = -1
Else
MsgBox("Debe eliminar una fila")
End If
End Sub
Private Sub btnGrabar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnGrabar.Click
Try
'CONDICIONES EN BOLETA
If radBoleta.Checked = True Then
TIPO = "BOLETA"
End If
If radFactura.Checked = True Then
TIPO = "FACTURA"
End If
'CABECERA
cn.Open()
Dim cmd As New SqlCommand("SP_MANTEDOCUMENTO", cn)
Dim prm As New SqlParameter
With cmd
.CommandType = CommandType.StoredProcedure
prm = .Parameters.Add("@NDO", SqlDbType.VarChar, 5)
prm.Value = Me.txtNum.Text
prm = .Parameters.Add("@TIP", SqlDbType.VarChar, 30)
prm.Value = TIPO
http://sistemasddm.blogspot.com
prm = .Parameters.Add("@IDC", SqlDbType.VarChar, 5)
prm.Value = Me.txtCodCli.Text
prm = .Parameters.Add("@IDE", SqlDbType.VarChar, 5)
prm.Value = Me.txtCodEmpl.Text
prm = .Parameters.Add("@FEC", SqlDbType.DateTime)
prm.Value = Me.txtFecha.Text
prm = .Parameters.Add("@SUBTOT", SqlDbType.Real)
prm.Value = Me.txtSubTotal.Text
prm = .Parameters.Add("@IGV", SqlDbType.Real)
prm.Value = Me.txtIgv.Text
prm = .Parameters.Add("@TOT", SqlDbType.Real)
prm.Value = Me.txtTotal.Text
prm = .Parameters.Add("@EST", SqlDbType.VarChar, 20)
prm.Value = Me.cbEstado.SelectedItem
.ExecuteNonQuery()
End With
cn.Close()
cmd.Dispose()
'DETALLE
Dim I As Integer
Dim prod, precio, cant, imp, sql2 As String
For I = 0 To DatosGrid.Rows.Count - 1
prod = DatosGrid.Rows(I).Cells(0).Value
precio = DatosGrid.Rows(I).Cells(1).Value
cant = DatosGrid.Rows(I).Cells(2).Value
imp = DatosGrid.Rows(I).Cells(3).Value
sql2 = "INSERT INTO DETALLE_DOCUMENTO VALUES('" + Me.txtNum.Text + "','" + TIPO + "','" +
(I + 1).ToString + "', '" + prod + "' , '" + precio + "' , '" + cant + "')"
Dim cmd2 As New SqlCommand(sql2, cn)
cn.Open()
cmd2.ExecuteNonQuery()
cn.Close()
cmd2.Dispose()
Next
MsgBox("Documento Almacenado")
'ACTUALIZAR
Dim cmd3 As New SqlCommand("UPDATE GENERADOR SET ULTIMO = ULTIMO + 1
WHERE PARAMETRO = 'DOCUMENTO'", cn)
cn.Open()
cmd3.ExecuteNonQuery()
cn.Close()
cmd3.Dispose()
pre = 0
Catch ex As Exception
MsgBox(ex.Message)
cn.Close()
End Try
End Sub
http://sistemasddm.blogspot.com
Private Sub btnBusCliente_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnBusCliente.Click
Try
Dim NR As Integer = -1
Dim Codigo As String = ""
Codigo = InputBox("Ingrese Cliente:")
Dim Da1 As New SqlDataAdapter("select * from CLIENTES where IdCLI = '" + Codigo + "'", cn)
Da1.Fill(dsEntorno, "Busq1")
NR = dsEntorno.Tables("Busq1").Rows.Count
If NR > 0 Then
Me.txtCodCli.Text = dsEntorno.Tables("Busq1").Rows(0)(0)
Me.txtNomCli.Text = dsEntorno.Tables("Busq1").Rows(0)(1)
Else
MsgBox("Cliente no Existe")
End If
dsEntorno.Tables("Busq1").Rows.Clear()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnBusEmpleado_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnBusEmpleado.Click
Try
Dim NR As Integer = -1
Dim Codigo As String = ""
Codigo = InputBox("Ingrese Empleado:")
Dim Da1 As New SqlDataAdapter("select * from EMPLEADOS where IDEMP = '" + Codigo + "'", cn)
Da1.Fill(dsEntorno, "Busq2")
NR = dsEntorno.Tables("Busq2").Rows.Count
If NR > 0 Then
Me.txtCodEmpl.Text = dsEntorno.Tables("Busq2").Rows(0)(0)
Me.txtNomEmp.Text = dsEntorno.Tables("Busq2").Rows(0)(1)
Else
MsgBox("Empleado no Existe")
End If
dsEntorno.Tables("Busq2").Rows.Clear()
Catch ex As Exception
MsgBox(ex.Message)
MsgBox(ex.ToString)
End Try
End Sub
Private Sub btnNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnNuevo.Click
Call limpiar()
Me.txtNum.Text = Generadores("DOCUMENTO")
End Sub
Sub limpiar()
Me.txtNum.Text = ""
Me.txtCodCli.Text = ""
Me.txtNomCli.Text = ""
Me.txtCodEmpl.Text = ""
Me.txtNomEmp.Text = ""
http://sistemasddm.blogspot.com
Me.txtSubTotal.Text = ""
Me.txtIgv.Text = ""
Me.txtTotal.Text = ""
Me.cbEstado.Text = ""
Me.DatosGrid.Rows.Clear()
Me.DatosGrid.DataSource = Nothing
D = 0
End Sub
Private Sub DatosGrid_CellClick(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles DatosGrid.CellClick
fila = e.RowIndex
End Sub
Private Sub DatosGrid_CellEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles DatosGrid.CellEnter
Try
If (DatosGrid.Rows(D).Cells(2).Value > 0) Then
Me.DatosGrid.Rows(D).Cells(3).Value = Me.DatosGrid.Rows(D).Cells(2).Value *
Me.DatosGrid.Rows(D).Cells(1).Value
End If
If (radBoleta.Checked = True) Then
If (DatosGrid.Rows(D).Cells(3).Value > 0) Then
pre = pre + DatosGrid.Rows(D).Cells(3).Value
Me.txtSubTotal.Text = pre
Me.txtIgv.Text = 0
Me.txtTotal.Text = Me.txtSubTotal.Text
D = D + 1
End If
ElseIf (radFactura.Checked = True) Then
If (DatosGrid.Rows(D).Cells(3).Value > 0) Then
pre = pre + DatosGrid.Rows(D).Cells(3).Value
Me.txtSubTotal.Text = pre
Me.txtIgv.Text = (Val(Me.txtSubTotal.Text) * 0.19)
Me.txtTotal.Text = (Val(Me.txtSubTotal.Text) + Val(Me.txtIgv.Text))
D = D + 1
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnImprimir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
btnImprimir.Click
tipoDocu = cbTipoDocu.SelectedItem
codDocu = txtCodigoDocu.Text
frmImprimir.Show()
End Sub
End Class
http://sistemasddm.blogspot.com
MODULO DE CONEXION Y AUTOGENERADOR DE CODIGO (Generar.vb)
Imports System.Data.SqlClient
Module Generar
Public cn As New SqlConnection("server=localhost;database=SISTEMA; integrated security = true")
Public dsEntorno As New DataSet
Public tipoDocu As String
Public codDocu As String
Public Function Generadores(ByVal TABLA As String) As String
Dim RESULT As String = ""
Dim DR1 As SqlDataReader
Dim ULT As Integer = 0
Dim CMD As New SqlCommand("SELECT ULTIMO FROM GENERADOR WHERE PARAMETRO = '" +
TABLA + "'", cn)
cn.Open()
DR1 = CMD.ExecuteReader
While DR1.Read
ULT = Val(DR1("ULTIMO") + 1)
End While
cn.Close()
Dim CEROS As Integer
CEROS = 5 - Len(Str(ULT))
Select Case CEROS
Case 3 : RESULT = Left(TABLA, 1) + "000" + Trim(Str(ULT))
Case 2 : RESULT = Left(TABLA, 1) + "00" + Trim(Str(ULT))
Case 1 : RESULT = Left(TABLA, 1) + "0" + Trim(Str(ULT))
Case 0 : RESULT = Left(TABLA, 1) + "" + Trim(Str(ULT))
End Select
Generadores = RESULT
End Function
End Module
http://sistemasddm.blogspot.com
MODELO CRISTAL REPORT (Reporte.rpt)
http://sistemasddm.blogspot.com
FORMULARIO PARA VISUALIZAR EL REPORTE (FrmImprimir.vb)
CODIGO DE FrmImprimir
Imports System.Data.SqlClient
Public Class frmImprimir
Dim Cn As New SqlConnection("Server=LocalHost;Uid=sa;Password=123;Database=SISTEMA")
Dim INFORME1 As Reporte
Dim MITABLA As CrystalDecisions.CrystalReports.Engine.Table
Dim MILOGIN As CrystalDecisions.Shared.TableLogOnInfo
Private Sub frmImprimir_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Try
INFORME1 = New Reporte
For Each Me.MITABLA In INFORME1.Database.Tables
MILOGIN = MITABLA.LogOnInfo
MILOGIN.ConnectionInfo.Password = "123"
MILOGIN.ConnectionInfo.UserID = "sa"
MITABLA.ApplyLogOnInfo(MILOGIN)
Next
Me.CrystalReportViewer1.ReportSource = INFORME1
INFORME1.RecordSelectionFormula = "{CAB_DOCUMENTO.TIP_DOC}='" + tipoDocu + "' And
{DETALLE_DOCUMENTO.NDOC}='" + codDocu + "'"
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Más contenido relacionado

La actualidad más candente

proyecto conexion netbeans con Mysql
proyecto conexion netbeans con Mysqlproyecto conexion netbeans con Mysql
proyecto conexion netbeans con MysqlBrenditaLr
 
Ejercicios pilas y_colas
Ejercicios pilas y_colasEjercicios pilas y_colas
Ejercicios pilas y_colaskelvinst
 
Método de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sortMétodo de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sortlinkinpark03
 
Ejemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPC
Ejemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPCEjemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPC
Ejemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPCIvan Luis Jimenez
 
Estructura de Datos: Recursividad
Estructura de Datos: RecursividadEstructura de Datos: Recursividad
Estructura de Datos: RecursividadYanahui Bc
 
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL TuningPgDay.Seoul
 
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVERINSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVERDarwin Durand
 
Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)
Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)
Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)Sergio Sanchez
 
Bucles en python
Bucles en pythonBucles en python
Bucles en pythonElim Aqp
 
Método de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sortMétodo de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sortlinkinpark03
 
Manual de microsoft sql server
Manual de microsoft sql serverManual de microsoft sql server
Manual de microsoft sql serverManuel Zatarain
 
Programación MySQL-Ejercicios
Programación MySQL-EjerciciosProgramación MySQL-Ejercicios
Programación MySQL-Ejerciciostestgrupocomex
 
EJECICIO DE BASE DE DATOS TIENDA SQL
EJECICIO DE BASE DE DATOS TIENDA SQLEJECICIO DE BASE DE DATOS TIENDA SQL
EJECICIO DE BASE DE DATOS TIENDA SQLRuth Cujilan
 

La actualidad más candente (20)

proyecto conexion netbeans con Mysql
proyecto conexion netbeans con Mysqlproyecto conexion netbeans con Mysql
proyecto conexion netbeans con Mysql
 
Ejercicios pilas y_colas
Ejercicios pilas y_colasEjercicios pilas y_colas
Ejercicios pilas y_colas
 
Método de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sortMétodo de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sort
 
B tree long
B tree longB tree long
B tree long
 
Ejemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPC
Ejemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPCEjemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPC
Ejemplo de RPC (Servidor de Archivos) enviar archivo en Java utilizando RPC
 
Estructura de Datos: Recursividad
Estructura de Datos: RecursividadEstructura de Datos: Recursividad
Estructura de Datos: Recursividad
 
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning
 
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVERINSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
 
Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)
Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)
Unidad 6 Lenguaje Sql 4 (Consultas Dml Avanzado)
 
Bucles en python
Bucles en pythonBucles en python
Bucles en python
 
Método de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sortMétodo de ordenamiento por selección (selection sort
Método de ordenamiento por selección (selection sort
 
Matricula
MatriculaMatricula
Matricula
 
Programación 3: colas
Programación 3: colasProgramación 3: colas
Programación 3: colas
 
Ejercicios sql
Ejercicios sqlEjercicios sql
Ejercicios sql
 
Manual de microsoft sql server
Manual de microsoft sql serverManual de microsoft sql server
Manual de microsoft sql server
 
Listas, pilas y colas
Listas, pilas y colasListas, pilas y colas
Listas, pilas y colas
 
Programación MySQL-Ejercicios
Programación MySQL-EjerciciosProgramación MySQL-Ejercicios
Programación MySQL-Ejercicios
 
Sql server T-sql basics ppt-3
Sql server T-sql basics  ppt-3Sql server T-sql basics  ppt-3
Sql server T-sql basics ppt-3
 
EJECICIO DE BASE DE DATOS TIENDA SQL
EJECICIO DE BASE DE DATOS TIENDA SQLEJECICIO DE BASE DE DATOS TIENDA SQL
EJECICIO DE BASE DE DATOS TIENDA SQL
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
 

Destacado

TUTORIAL DE ADO.NET MUY BUENO
TUTORIAL DE ADO.NET MUY BUENOTUTORIAL DE ADO.NET MUY BUENO
TUTORIAL DE ADO.NET MUY BUENOiberhack
 
ResolucióN De Problemas
ResolucióN De ProblemasResolucióN De Problemas
ResolucióN De Problemasguest796d29
 
Recursividad
RecursividadRecursividad
Recursividadbetzy
 
52 ejercicios resueltos en pseudocodigo
52 ejercicios resueltos en pseudocodigo52 ejercicios resueltos en pseudocodigo
52 ejercicios resueltos en pseudocodigoBrivé Soluciones
 
7222014 ejercicios-resueltos-con-pseint
7222014 ejercicios-resueltos-con-pseint7222014 ejercicios-resueltos-con-pseint
7222014 ejercicios-resueltos-con-pseintJoselo Chushig
 
U1 Analisis Algoritmos Complejidad
U1 Analisis Algoritmos ComplejidadU1 Analisis Algoritmos Complejidad
U1 Analisis Algoritmos Complejidadrezzaca
 
manual de visual basic.net 2008
manual de visual basic.net 2008manual de visual basic.net 2008
manual de visual basic.net 2008genaro martinez
 
Pasos para crear un proyecto de visual studio 2008[1][1]
Pasos para crear un proyecto de visual studio 2008[1][1]Pasos para crear un proyecto de visual studio 2008[1][1]
Pasos para crear un proyecto de visual studio 2008[1][1]carechupona
 
Pasos para crear un proyecto de visual studio 2008
Pasos para crear un proyecto de visual studio 2008Pasos para crear un proyecto de visual studio 2008
Pasos para crear un proyecto de visual studio 2008vnslgars
 
Sistema de ventas, compras y almacén
Sistema de ventas, compras y almacénSistema de ventas, compras y almacén
Sistema de ventas, compras y almacénLeo Ruelas Rojas
 
INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010
INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010
INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010Estefy Sanchez
 
Sistema de ventas 1
Sistema de ventas 1Sistema de ventas 1
Sistema de ventas 1guzadis
 
Como diseñar un sistema de ventas
Como diseñar un sistema de ventasComo diseñar un sistema de ventas
Como diseñar un sistema de ventasBien Pensado
 
Procesador caracteristicas
Procesador caracteristicasProcesador caracteristicas
Procesador caracteristicasaletzuco1
 
Diapositivas de microprocesador
Diapositivas de microprocesadorDiapositivas de microprocesador
Diapositivas de microprocesadorAnGelitto LosaDa
 

Destacado (20)

TUTORIAL DE ADO.NET MUY BUENO
TUTORIAL DE ADO.NET MUY BUENOTUTORIAL DE ADO.NET MUY BUENO
TUTORIAL DE ADO.NET MUY BUENO
 
Recursividad
RecursividadRecursividad
Recursividad
 
ResolucióN De Problemas
ResolucióN De ProblemasResolucióN De Problemas
ResolucióN De Problemas
 
Recursividad
RecursividadRecursividad
Recursividad
 
Recursividad
RecursividadRecursividad
Recursividad
 
52 ejercicios resueltos en pseudocodigo
52 ejercicios resueltos en pseudocodigo52 ejercicios resueltos en pseudocodigo
52 ejercicios resueltos en pseudocodigo
 
7222014 ejercicios-resueltos-con-pseint
7222014 ejercicios-resueltos-con-pseint7222014 ejercicios-resueltos-con-pseint
7222014 ejercicios-resueltos-con-pseint
 
U1 Analisis Algoritmos Complejidad
U1 Analisis Algoritmos ComplejidadU1 Analisis Algoritmos Complejidad
U1 Analisis Algoritmos Complejidad
 
manual de visual basic.net 2008
manual de visual basic.net 2008manual de visual basic.net 2008
manual de visual basic.net 2008
 
Pasos para crear un proyecto de visual studio 2008[1][1]
Pasos para crear un proyecto de visual studio 2008[1][1]Pasos para crear un proyecto de visual studio 2008[1][1]
Pasos para crear un proyecto de visual studio 2008[1][1]
 
Programación III
Programación IIIProgramación III
Programación III
 
MANUAL DE VISUAL BASIC. 2010
MANUAL DE VISUAL BASIC. 2010MANUAL DE VISUAL BASIC. 2010
MANUAL DE VISUAL BASIC. 2010
 
Pasos para crear un proyecto de visual studio 2008
Pasos para crear un proyecto de visual studio 2008Pasos para crear un proyecto de visual studio 2008
Pasos para crear un proyecto de visual studio 2008
 
Sistema de ventas, compras y almacén
Sistema de ventas, compras y almacénSistema de ventas, compras y almacén
Sistema de ventas, compras y almacén
 
Visual studio 2010
Visual studio 2010Visual studio 2010
Visual studio 2010
 
INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010
INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010
INTRODUCCIÓN A MICROSOFT VISUAL STUDIO 2010
 
Sistema de ventas 1
Sistema de ventas 1Sistema de ventas 1
Sistema de ventas 1
 
Como diseñar un sistema de ventas
Como diseñar un sistema de ventasComo diseñar un sistema de ventas
Como diseñar un sistema de ventas
 
Procesador caracteristicas
Procesador caracteristicasProcesador caracteristicas
Procesador caracteristicas
 
Diapositivas de microprocesador
Diapositivas de microprocesadorDiapositivas de microprocesador
Diapositivas de microprocesador
 

Similar a SISTEMA DE FACTURACION (Ejemplo desarrollado)

Sistema de ventas
Sistema de ventasSistema de ventas
Sistema de ventasDAYANA RETO
 
Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01mafv1976
 
Vb Project ขั้นเทพ
Vb Project ขั้นเทพVb Project ขั้นเทพ
Vb Project ขั้นเทพSinchai Lanon
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetDiaz Alfahrezy
 
Codes
CodesCodes
CodesOSit3
 
Inventory management
Inventory managementInventory management
Inventory managementRajeev Sharan
 
OOP - PREFINAL ACTIVITY - ACLC
OOP - PREFINAL ACTIVITY - ACLCOOP - PREFINAL ACTIVITY - ACLC
OOP - PREFINAL ACTIVITY - ACLCMarlo Tinio
 
Puerto serialarduino
Puerto serialarduinoPuerto serialarduino
Puerto serialarduinozadkiel_123
 
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .netEjercicio sql server vs visual .net
Ejercicio sql server vs visual .netAyuda Universidad
 
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY GOKUL SREE
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88Mahmoud Samir Fayed
 
A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)Alan Manifold
 
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31Mahmoud Samir Fayed
 
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdfapnashop1
 

Similar a SISTEMA DE FACTURACION (Ejemplo desarrollado) (20)

Sistema de ventas
Sistema de ventasSistema de ventas
Sistema de ventas
 
Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01Sistemadeventas 100707084319-phpapp01
Sistemadeventas 100707084319-phpapp01
 
Vb Project ขั้นเทพ
Vb Project ขั้นเทพVb Project ขั้นเทพ
Vb Project ขั้นเทพ
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnet
 
Kode vb.net
Kode vb.netKode vb.net
Kode vb.net
 
Kode vb.net
Kode vb.netKode vb.net
Kode vb.net
 
Codes
CodesCodes
Codes
 
Inventory management
Inventory managementInventory management
Inventory management
 
OOP - PREFINAL ACTIVITY - ACLC
OOP - PREFINAL ACTIVITY - ACLCOOP - PREFINAL ACTIVITY - ACLC
OOP - PREFINAL ACTIVITY - ACLC
 
Puerto serialarduino
Puerto serialarduinoPuerto serialarduino
Puerto serialarduino
 
VB net lab.pdf
VB net lab.pdfVB net lab.pdf
VB net lab.pdf
 
Vb.net programs
Vb.net programsVb.net programs
Vb.net programs
 
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .netEjercicio sql server vs visual .net
Ejercicio sql server vs visual .net
 
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY DOT NET LAB PROGRAM PERIYAR UNIVERSITY
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
 
Assist9 bmis
Assist9 bmisAssist9 bmis
Assist9 bmis
 
The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88The Ring programming language version 1.3 book - Part 83 of 88
The Ring programming language version 1.3 book - Part 83 of 88
 
A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)A Matter Of Form: Access Forms to make reporting a snap (or a click)
A Matter Of Form: Access Forms to make reporting a snap (or a click)
 
Rumus VB-1
Rumus VB-1Rumus VB-1
Rumus VB-1
 
The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31The Ring programming language version 1.5 book - Part 8 of 31
The Ring programming language version 1.5 book - Part 8 of 31
 
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf  Imports System.Net.Sockets Imports System.Text Public Class Form1   .pdf
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
 

Más de Darwin Durand

Ejemplos Borland C++ Builder
Ejemplos Borland C++ BuilderEjemplos Borland C++ Builder
Ejemplos Borland C++ BuilderDarwin Durand
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSDarwin Durand
 
PERSISTENCIA BASADA EN ARCHIVOS
PERSISTENCIA BASADA EN ARCHIVOSPERSISTENCIA BASADA EN ARCHIVOS
PERSISTENCIA BASADA EN ARCHIVOSDarwin Durand
 
PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)
PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)
PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)Darwin Durand
 
CONEXION VISUAL STUDIO.NET - SQL SERVER
CONEXION VISUAL STUDIO.NET - SQL SERVERCONEXION VISUAL STUDIO.NET - SQL SERVER
CONEXION VISUAL STUDIO.NET - SQL SERVERDarwin Durand
 
CREACION DE DLL Y USO (Ejemplo desarrollado)
CREACION DE DLL Y USO (Ejemplo desarrollado)CREACION DE DLL Y USO (Ejemplo desarrollado)
CREACION DE DLL Y USO (Ejemplo desarrollado)Darwin Durand
 
CURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOL
CURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOLCURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOL
CURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOLDarwin Durand
 
INDICES EN SQL SERVER
INDICES EN SQL SERVERINDICES EN SQL SERVER
INDICES EN SQL SERVERDarwin Durand
 
APLICACIONES EMPRESARIALES
APLICACIONES EMPRESARIALESAPLICACIONES EMPRESARIALES
APLICACIONES EMPRESARIALESDarwin Durand
 
CREACION Y MANEJO DE LA BASE DE DATOS
CREACION Y MANEJO DE LA BASE DE DATOSCREACION Y MANEJO DE LA BASE DE DATOS
CREACION Y MANEJO DE LA BASE DE DATOSDarwin Durand
 

Más de Darwin Durand (14)

Ejemplos Borland C++ Builder
Ejemplos Borland C++ BuilderEjemplos Borland C++ Builder
Ejemplos Borland C++ Builder
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
EJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOSEJEMPLOS DESARROLLADOS
EJEMPLOS DESARROLLADOS
 
PERSISTENCIA BASADA EN ARCHIVOS
PERSISTENCIA BASADA EN ARCHIVOSPERSISTENCIA BASADA EN ARCHIVOS
PERSISTENCIA BASADA EN ARCHIVOS
 
PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)
PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)
PROYECTO PRUEBA DE CONEXIONES (Mantenimiento)
 
CONEXION VISUAL STUDIO.NET - SQL SERVER
CONEXION VISUAL STUDIO.NET - SQL SERVERCONEXION VISUAL STUDIO.NET - SQL SERVER
CONEXION VISUAL STUDIO.NET - SQL SERVER
 
CREACION DE DLL Y USO (Ejemplo desarrollado)
CREACION DE DLL Y USO (Ejemplo desarrollado)CREACION DE DLL Y USO (Ejemplo desarrollado)
CREACION DE DLL Y USO (Ejemplo desarrollado)
 
CURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOL
CURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOLCURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOL
CURSO DE PROGRAMACION AVANZADA EN JAVA EN ESPAÑOL
 
SERVLET BASICS
SERVLET BASICSSERVLET BASICS
SERVLET BASICS
 
INDICES EN SQL SERVER
INDICES EN SQL SERVERINDICES EN SQL SERVER
INDICES EN SQL SERVER
 
INTEGRIDAD DE DATOS
INTEGRIDAD DE DATOSINTEGRIDAD DE DATOS
INTEGRIDAD DE DATOS
 
APLICACIONES EMPRESARIALES
APLICACIONES EMPRESARIALESAPLICACIONES EMPRESARIALES
APLICACIONES EMPRESARIALES
 
CREACION Y MANEJO DE LA BASE DE DATOS
CREACION Y MANEJO DE LA BASE DE DATOSCREACION Y MANEJO DE LA BASE DE DATOS
CREACION Y MANEJO DE LA BASE DE DATOS
 
CREACION DE TABLAS
CREACION DE TABLASCREACION DE TABLAS
CREACION DE TABLAS
 

Último

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 

Último (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

SISTEMA DE FACTURACION (Ejemplo desarrollado)

  • 1. http://sistemasddm.blogspot.com FACTURA – BOLETA BD. SQL SERVER CREATE DATABASE SISTEMA GO USE SISTEMA GO CREATE TABLE CLIENTES (IDCLI VARCHAR(5)NOT NULL , NOMBRE VARCHAR(20)NOT NULL, APELLIDOS VARCHAR(50)NOT NULL, SEXO VARCHAR(1)NULL, Primary Key (IDCLI)) GO INSERT INTO CLIENTES VALUES('C0001','LUIS','GOMEZ','M') INSERT INTO CLIENTES VALUES('C0002','CARLOS','SANCHEZ','M') INSERT INTO CLIENTES VALUES('C0003','ELIANA','CASTRO','M') GO CREATE TABLE EMPLEADOS (IDEMP VARCHAR(5)NOT NULL, NOMBRE VARCHAR(20)NOT NULL, APELLIDOS VARCHAR(50)NOT NULL, SEXO VARCHAR(1)NULL, Primary Key (IDEMP)) GO INSERT INTO EMPLEADOS VALUES('E0001','LUIS','GOMEZ','M') INSERT INTO EMPLEADOS VALUES('E0002','FERNANDA','PEREZ','M') INSERT INTO EMPLEADOS VALUES('E0003','LUISA','VERASTEGUI','M') GO --DOCUMENTO-- CREATE TABLE CAB_DOCUMENTO (NDOC VARCHAR (5) NOT NULL, TIP_DOC VARCHAR (30) NOT NULL, IDCLI VARCHAR(5) NOT NULL, IDEMP VARCHAR (5)NOT NULL, FECHA DATETIME NOT NULL, SUBTOTAL REAL NULL, IGV REAL NULL, TOTAL REAL NULL, ESTADO VARCHAR(20) NOT NULL, PRIMARY KEY(NDOC,TIP_DOC)) GO CREATE TABLE DETALLE_DOCUMENTO( NDOC VARCHAR (5)NOT NULL, TIP_DOC VARCHAR (30) NOT NULL, ITEM INT NOT NULL, PRODUCTO VARCHAR(20) NOT NULL, PRECIO REAL NULL, CANTIDAD INT NULL, PRIMARY KEY(ITEM,NDOC,TIP_DOC)) GO ALTER TABLE CAB_DOCUMENTO ADD FOREIGN KEY(IDCLI) REFERENCES CLIENTES
  • 2. http://sistemasddm.blogspot.com ALTER TABLE CAB_DOCUMENTO ADD FOREIGN KEY(IDEMP) REFERENCES EMPLEADOS ALTER TABLE DETALLE_DOCUMENTO ADD FOREIGN KEY (NDOC,TIP_DOC) REFERENCES CAB_DOCUMENTO GO --CREACION DE LA TABLA GENERADOR GO CREATE TABLE GENERADOR( PARAMETRO Varchar(40) Not Null, ULTIMO Int Null ) GO -- INSERCCION DE DATOS EN LA TABLA GENERADOR INSERT INTO GENERADOR values('DOCUMENTO',0) GO CREATE PROCEDURE SP_MANTEDOCUMENTO @NDO VARCHAR (5), @TIP VARCHAR (30), @IDC VARCHAR(5), @IDE VARCHAR (5), @FEC DATETIME , @SUBTOT REAL, @IGV REAL, @TOT REAL, @EST VARCHAR(20) AS BEGIN INSERT INTO CAB_DOCUMENTO VALUES (@NDO, @TIP, @IDC,@IDE, @FEC,@SUBTOT,@IGV,@TOT,@EST) END GO SELECT * FROM CLIENTES SELECT * FROM EMPLEADOS SELECT * FROM CAB_DOCUMENTO SELECT * FROM DETALLE_DOCUMENTO SELECT * FROM GENERADOR APLICACIÓN. VISUAL STUDIO.NET
  • 4. http://sistemasddm.blogspot.com CODIGO Facturacion (Form1.vb) Imports System.Data.SqlClient Public Class Facturacion Dim fila As Integer = -1 Dim TIPO As String = "" Dim D As Integer = 0 Dim pre As Double Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.txtFecha.Text = Now End Sub Private Sub btnAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAgregar.Click Me.DatosGrid.Rows.Add("") End Sub Private Sub btnQuitar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuitar.Click If fila <> -1 Then Me.DatosGrid.Rows.RemoveAt(fila) fila = -1 Else MsgBox("Debe eliminar una fila") End If End Sub Private Sub btnGrabar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGrabar.Click Try 'CONDICIONES EN BOLETA If radBoleta.Checked = True Then TIPO = "BOLETA" End If If radFactura.Checked = True Then TIPO = "FACTURA" End If 'CABECERA cn.Open() Dim cmd As New SqlCommand("SP_MANTEDOCUMENTO", cn) Dim prm As New SqlParameter With cmd .CommandType = CommandType.StoredProcedure prm = .Parameters.Add("@NDO", SqlDbType.VarChar, 5) prm.Value = Me.txtNum.Text prm = .Parameters.Add("@TIP", SqlDbType.VarChar, 30) prm.Value = TIPO
  • 5. http://sistemasddm.blogspot.com prm = .Parameters.Add("@IDC", SqlDbType.VarChar, 5) prm.Value = Me.txtCodCli.Text prm = .Parameters.Add("@IDE", SqlDbType.VarChar, 5) prm.Value = Me.txtCodEmpl.Text prm = .Parameters.Add("@FEC", SqlDbType.DateTime) prm.Value = Me.txtFecha.Text prm = .Parameters.Add("@SUBTOT", SqlDbType.Real) prm.Value = Me.txtSubTotal.Text prm = .Parameters.Add("@IGV", SqlDbType.Real) prm.Value = Me.txtIgv.Text prm = .Parameters.Add("@TOT", SqlDbType.Real) prm.Value = Me.txtTotal.Text prm = .Parameters.Add("@EST", SqlDbType.VarChar, 20) prm.Value = Me.cbEstado.SelectedItem .ExecuteNonQuery() End With cn.Close() cmd.Dispose() 'DETALLE Dim I As Integer Dim prod, precio, cant, imp, sql2 As String For I = 0 To DatosGrid.Rows.Count - 1 prod = DatosGrid.Rows(I).Cells(0).Value precio = DatosGrid.Rows(I).Cells(1).Value cant = DatosGrid.Rows(I).Cells(2).Value imp = DatosGrid.Rows(I).Cells(3).Value sql2 = "INSERT INTO DETALLE_DOCUMENTO VALUES('" + Me.txtNum.Text + "','" + TIPO + "','" + (I + 1).ToString + "', '" + prod + "' , '" + precio + "' , '" + cant + "')" Dim cmd2 As New SqlCommand(sql2, cn) cn.Open() cmd2.ExecuteNonQuery() cn.Close() cmd2.Dispose() Next MsgBox("Documento Almacenado") 'ACTUALIZAR Dim cmd3 As New SqlCommand("UPDATE GENERADOR SET ULTIMO = ULTIMO + 1 WHERE PARAMETRO = 'DOCUMENTO'", cn) cn.Open() cmd3.ExecuteNonQuery() cn.Close() cmd3.Dispose() pre = 0 Catch ex As Exception MsgBox(ex.Message) cn.Close() End Try End Sub
  • 6. http://sistemasddm.blogspot.com Private Sub btnBusCliente_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBusCliente.Click Try Dim NR As Integer = -1 Dim Codigo As String = "" Codigo = InputBox("Ingrese Cliente:") Dim Da1 As New SqlDataAdapter("select * from CLIENTES where IdCLI = '" + Codigo + "'", cn) Da1.Fill(dsEntorno, "Busq1") NR = dsEntorno.Tables("Busq1").Rows.Count If NR > 0 Then Me.txtCodCli.Text = dsEntorno.Tables("Busq1").Rows(0)(0) Me.txtNomCli.Text = dsEntorno.Tables("Busq1").Rows(0)(1) Else MsgBox("Cliente no Existe") End If dsEntorno.Tables("Busq1").Rows.Clear() Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub btnBusEmpleado_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBusEmpleado.Click Try Dim NR As Integer = -1 Dim Codigo As String = "" Codigo = InputBox("Ingrese Empleado:") Dim Da1 As New SqlDataAdapter("select * from EMPLEADOS where IDEMP = '" + Codigo + "'", cn) Da1.Fill(dsEntorno, "Busq2") NR = dsEntorno.Tables("Busq2").Rows.Count If NR > 0 Then Me.txtCodEmpl.Text = dsEntorno.Tables("Busq2").Rows(0)(0) Me.txtNomEmp.Text = dsEntorno.Tables("Busq2").Rows(0)(1) Else MsgBox("Empleado no Existe") End If dsEntorno.Tables("Busq2").Rows.Clear() Catch ex As Exception MsgBox(ex.Message) MsgBox(ex.ToString) End Try End Sub Private Sub btnNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNuevo.Click Call limpiar() Me.txtNum.Text = Generadores("DOCUMENTO") End Sub Sub limpiar() Me.txtNum.Text = "" Me.txtCodCli.Text = "" Me.txtNomCli.Text = "" Me.txtCodEmpl.Text = "" Me.txtNomEmp.Text = ""
  • 7. http://sistemasddm.blogspot.com Me.txtSubTotal.Text = "" Me.txtIgv.Text = "" Me.txtTotal.Text = "" Me.cbEstado.Text = "" Me.DatosGrid.Rows.Clear() Me.DatosGrid.DataSource = Nothing D = 0 End Sub Private Sub DatosGrid_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DatosGrid.CellClick fila = e.RowIndex End Sub Private Sub DatosGrid_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DatosGrid.CellEnter Try If (DatosGrid.Rows(D).Cells(2).Value > 0) Then Me.DatosGrid.Rows(D).Cells(3).Value = Me.DatosGrid.Rows(D).Cells(2).Value * Me.DatosGrid.Rows(D).Cells(1).Value End If If (radBoleta.Checked = True) Then If (DatosGrid.Rows(D).Cells(3).Value > 0) Then pre = pre + DatosGrid.Rows(D).Cells(3).Value Me.txtSubTotal.Text = pre Me.txtIgv.Text = 0 Me.txtTotal.Text = Me.txtSubTotal.Text D = D + 1 End If ElseIf (radFactura.Checked = True) Then If (DatosGrid.Rows(D).Cells(3).Value > 0) Then pre = pre + DatosGrid.Rows(D).Cells(3).Value Me.txtSubTotal.Text = pre Me.txtIgv.Text = (Val(Me.txtSubTotal.Text) * 0.19) Me.txtTotal.Text = (Val(Me.txtSubTotal.Text) + Val(Me.txtIgv.Text)) D = D + 1 End If End If Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub btnImprimir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImprimir.Click tipoDocu = cbTipoDocu.SelectedItem codDocu = txtCodigoDocu.Text frmImprimir.Show() End Sub End Class
  • 8. http://sistemasddm.blogspot.com MODULO DE CONEXION Y AUTOGENERADOR DE CODIGO (Generar.vb) Imports System.Data.SqlClient Module Generar Public cn As New SqlConnection("server=localhost;database=SISTEMA; integrated security = true") Public dsEntorno As New DataSet Public tipoDocu As String Public codDocu As String Public Function Generadores(ByVal TABLA As String) As String Dim RESULT As String = "" Dim DR1 As SqlDataReader Dim ULT As Integer = 0 Dim CMD As New SqlCommand("SELECT ULTIMO FROM GENERADOR WHERE PARAMETRO = '" + TABLA + "'", cn) cn.Open() DR1 = CMD.ExecuteReader While DR1.Read ULT = Val(DR1("ULTIMO") + 1) End While cn.Close() Dim CEROS As Integer CEROS = 5 - Len(Str(ULT)) Select Case CEROS Case 3 : RESULT = Left(TABLA, 1) + "000" + Trim(Str(ULT)) Case 2 : RESULT = Left(TABLA, 1) + "00" + Trim(Str(ULT)) Case 1 : RESULT = Left(TABLA, 1) + "0" + Trim(Str(ULT)) Case 0 : RESULT = Left(TABLA, 1) + "" + Trim(Str(ULT)) End Select Generadores = RESULT End Function End Module
  • 10. http://sistemasddm.blogspot.com FORMULARIO PARA VISUALIZAR EL REPORTE (FrmImprimir.vb) CODIGO DE FrmImprimir Imports System.Data.SqlClient Public Class frmImprimir Dim Cn As New SqlConnection("Server=LocalHost;Uid=sa;Password=123;Database=SISTEMA") Dim INFORME1 As Reporte Dim MITABLA As CrystalDecisions.CrystalReports.Engine.Table Dim MILOGIN As CrystalDecisions.Shared.TableLogOnInfo Private Sub frmImprimir_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try INFORME1 = New Reporte For Each Me.MITABLA In INFORME1.Database.Tables MILOGIN = MITABLA.LogOnInfo MILOGIN.ConnectionInfo.Password = "123" MILOGIN.ConnectionInfo.UserID = "sa" MITABLA.ApplyLogOnInfo(MILOGIN) Next Me.CrystalReportViewer1.ReportSource = INFORME1 INFORME1.RecordSelectionFormula = "{CAB_DOCUMENTO.TIP_DOC}='" + tipoDocu + "' And {DETALLE_DOCUMENTO.NDOC}='" + codDocu + "'" Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub End Class