Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -1776,27 +1776,72 @@ Public Class ClsCompras
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function AddFactura(Serie As String, Folio As String, FechaFactura As DateTime, NombreProveedor As String, RFCDe As String, SubTotal As Double,
|
'Public Function AddFactura(Serie As String, Folio As String, FechaFactura As DateTime, NombreProveedor As String, RFCDe As String, SubTotal As Double,
|
||||||
IVA As Double, Total As Double, UUID As String, RFCPara As String, XML As String, PDF As String,
|
'IVA As Double, Total As Double, UUID As String, RFCPara As String, XML As String, PDF As String,
|
||||||
VersionCFD As String, Descuento As Double, Moneda As String, TipodeComprobante As String, TipoCambio As Double, FueValidado As Integer,
|
'VersionCFD As String, Descuento As Double, Moneda As String, TipodeComprobante As String, TipoCambio As Double, FueValidado As Integer,
|
||||||
CveEmpresa As Integer, PreFijo As String) As Integer
|
'CveEmpresa As Integer, PreFijo As String) As Integer
|
||||||
Dim Retorno As Integer = -1
|
' Dim Retorno As Integer = -1
|
||||||
|
|
||||||
Dim StrSQL As StringBuilder = New StringBuilder()
|
' Dim StrSQL As StringBuilder = New StringBuilder()
|
||||||
StrSQL.Append(" BEGIN ")
|
' StrSQL.Append(" BEGIN ")
|
||||||
StrSQL.Append(" DECLARE @tTotal INT; ")
|
' StrSQL.Append(" DECLARE @tTotal INT; ")
|
||||||
StrSQL.Append(" ")
|
' StrSQL.Append(" ")
|
||||||
StrSQL.Append(" SELECT @tTotal = ISNULL(MAX(CveFactura),0) FROM Comp_Facturas WHERE UUID = @UUID;")
|
' StrSQL.Append(" SELECT @tTotal = ISNULL(MAX(CveFactura),0) FROM Comp_Facturas WHERE UUID = @UUID;")
|
||||||
StrSQL.Append(" IF @tTotal = 0 ")
|
' StrSQL.Append(" IF @tTotal = 0 ")
|
||||||
StrSQL.Append(" BEGIN ")
|
' StrSQL.Append(" BEGIN ")
|
||||||
StrSQL.Append(" INSERT INTO Comp_Facturas (Serie, Folio, FechaFactura, NombreProveedor, RFCDe, Total, UUID, RFCPara, XML, PDF, FueValidado, CveEmpresa, TipoFactura,Version, TipoComprobante) ")
|
' StrSQL.Append(" INSERT INTO Comp_Facturas (Serie, Folio, FechaFactura, NombreProveedor, RFCDe, Total, UUID, RFCPara, XML, PDF, FueValidado, CveEmpresa, TipoFactura,Version, TipoComprobante,) ")
|
||||||
StrSQL.Append(" VALUES (@Serie, @Folio, @FechaFactura, @NombreProveedor, @RFCDe, @Total, @UUID, @RFCPara, @XML, @PDF, @FueValidado, @CveEmpresa, @PreFijo, @Version,@TipodeComprobante); ")
|
' StrSQL.Append(" VALUES (@Serie, @Folio, @FechaFactura, @NombreProveedor, @RFCDe, @Total, @UUID, @RFCPara, @XML, @PDF, @FueValidado, @CveEmpresa, @PreFijo, @Version,@TipodeComprobante); ")
|
||||||
StrSQL.Append(" SET @Retorno = 1; ")
|
' StrSQL.Append(" SET @Retorno = 1; ")
|
||||||
StrSQL.Append(" SET @CveFactura = SCOPE_IDENTITY(); ")
|
' StrSQL.Append(" SET @CveFactura = SCOPE_IDENTITY(); ")
|
||||||
StrSQL.Append(" UPDATE Comp_Facturas SET XML = CONCAT(@CveFactura,'.xml'), PDF = CONCAT(@CveFactura ,'.pdf') WHERE CveFactura = @CveFactura; ")
|
' StrSQL.Append(" UPDATE Comp_Facturas SET XML = CONCAT(@CveFactura,'.xml'), PDF = CONCAT(@CveFactura ,'.pdf') WHERE CveFactura = @CveFactura; ")
|
||||||
StrSQL.Append(" END ")
|
' StrSQL.Append(" END ")
|
||||||
StrSQL.Append(" ELSE BEGIN SET @CveFactura = @tTotal; END ")
|
' StrSQL.Append(" ELSE BEGIN SET @CveFactura = @tTotal; END ")
|
||||||
StrSQL.Append(" END ")
|
' StrSQL.Append(" END ")
|
||||||
|
|
||||||
|
' If PreFijo.ToLower() = "cfdi" Then
|
||||||
|
' PreFijo = "CFDi"
|
||||||
|
' ElseIf PreFijo.ToLower() = "cfd" Then
|
||||||
|
' PreFijo = "CFD"
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' DataAdapter(StrSQL.ToString(), CommandType.Text)
|
||||||
|
' With SqlAdapter.SelectCommand.Parameters
|
||||||
|
' .Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||||
|
' .Add("@Folio", SqlDbType.VarChar).Value = Folio
|
||||||
|
' .Add("@FechaFactura", SqlDbType.[Date]).Value = FechaFactura
|
||||||
|
' .Add("@NombreProveedor", SqlDbType.VarChar).Value = NombreProveedor
|
||||||
|
' .Add("@RFCDe", SqlDbType.VarChar).Value = RFCDe
|
||||||
|
' .Add("@Total", SqlDbType.Money).Value = Total
|
||||||
|
' .Add("@UUID", SqlDbType.VarChar).Value = UUID
|
||||||
|
' .Add("@RFCPara", SqlDbType.VarChar).Value = RFCPara
|
||||||
|
' .Add("@XML", SqlDbType.VarChar).Value = XML
|
||||||
|
' .Add("@PDF", SqlDbType.VarChar).Value = PDF
|
||||||
|
' .Add("@Version", SqlDbType.VarChar).Value = VersionCFD
|
||||||
|
' .Add("@FueValidado", SqlDbType.Int).Value = FueValidado
|
||||||
|
' .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
' .Add("@PreFijo", SqlDbType.VarChar).Value = PreFijo
|
||||||
|
' .Add("@TipodeComprobante", SqlDbType.VarChar).Value = TipodeComprobante.ToUpper
|
||||||
|
' .Add("@CveFactura", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
' .Add("@Retorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
' End With
|
||||||
|
|
||||||
|
|
||||||
|
' Try
|
||||||
|
' SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
' Retorno = SqlAdapter.SelectCommand.Parameters("@Retorno").Value.ToString().ToEntero()
|
||||||
|
|
||||||
|
' CveFactura = SqlAdapter.SelectCommand.Parameters("@CveFactura").Value.ToString().ToEntero()
|
||||||
|
' Catch ex As Exception
|
||||||
|
' ModExtensiones.OnError(Me, "Ocurrió un error al intentar Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
|
' End Try
|
||||||
|
|
||||||
|
' Return Retorno
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
|
||||||
|
Public Function AddFactura(Serie As String, Folio As String, FechaFactura As DateTime, NombreProveedor As String, RFCDe As String, SubTotal As Decimal, IVA As Decimal, Total As Decimal, UUID As String, RFCPara As String, XML As String, PDF As String, VersionCFD As String, Descuento As Decimal, TipoCambio As Decimal, FueValidado As Integer, CveEmpresa As Integer, PreFijo As String, TipoComprobante As String, MONEDA As String, METODODEPAGO As String, Optional TipoRecepcion As Integer = 0, Optional Version As String = "3.3", Optional IEPS As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0) As Integer
|
||||||
|
Dim Retorno As Integer = -1
|
||||||
|
|
||||||
If PreFijo.ToLower() = "cfdi" Then
|
If PreFijo.ToLower() = "cfdi" Then
|
||||||
PreFijo = "CFDi"
|
PreFijo = "CFDi"
|
||||||
@@ -1804,40 +1849,50 @@ Public Class ClsCompras
|
|||||||
PreFijo = "CFD"
|
PreFijo = "CFD"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
DataAdapter(StrSQL.ToString(), CommandType.Text)
|
DataAdapter("PA_eFacturas_FacturasAdd", CommandType.StoredProcedure)
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
|
||||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
|
||||||
.Add("@Folio", SqlDbType.VarChar).Value = Folio
|
|
||||||
.Add("@FechaFactura", SqlDbType.[Date]).Value = FechaFactura
|
|
||||||
.Add("@NombreProveedor", SqlDbType.VarChar).Value = NombreProveedor
|
|
||||||
.Add("@RFCDe", SqlDbType.VarChar).Value = RFCDe
|
|
||||||
.Add("@Total", SqlDbType.Money).Value = Total
|
|
||||||
.Add("@UUID", SqlDbType.VarChar).Value = UUID
|
|
||||||
.Add("@RFCPara", SqlDbType.VarChar).Value = RFCPara
|
|
||||||
.Add("@XML", SqlDbType.VarChar).Value = XML
|
|
||||||
.Add("@PDF", SqlDbType.VarChar).Value = PDF
|
|
||||||
.Add("@Version", SqlDbType.VarChar).Value = VersionCFD
|
|
||||||
.Add("@FueValidado", SqlDbType.Int).Value = FueValidado
|
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
|
||||||
.Add("@PreFijo", SqlDbType.VarChar).Value = PreFijo
|
|
||||||
.Add("@TipodeComprobante", SqlDbType.VarChar).Value = TipodeComprobante.ToUpper
|
|
||||||
.Add("@CveFactura", SqlDbType.Int).Direction = ParameterDirection.Output
|
|
||||||
.Add("@Retorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
|
||||||
End With
|
|
||||||
|
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@Folio", SqlDbType.VarChar).Value = Folio
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@FechaFactura", SqlDbType.Date).Value = FechaFactura
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@NombreProveedor", SqlDbType.VarChar).Value = NombreProveedor
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@RFCDe", SqlDbType.VarChar).Value = RFCDe
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@TipoComprobante", SqlDbType.VarChar).Value = TipoComprobante
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@Total", SqlDbType.Money).Value = Total
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@UUID", SqlDbType.VarChar).Value = UUID
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@RFCPara", SqlDbType.VarChar).Value = RFCPara
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@XML", SqlDbType.VarChar).Value = XML
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@PDF", SqlDbType.VarChar).Value = PDF
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@Version", SqlDbType.VarChar).Value = VersionCFD
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@FueValidado", SqlDbType.Int).Value = FueValidado
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@PreFijo", SqlDbType.VarChar).Value = PreFijo
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@TipoRecepcion", SqlDbType.Int).Value = TipoRecepcion
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@CveFactura", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@Retorno", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@MONEDA", SqlDbType.VarChar).Value = MONEDA
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@METODODEPAGO", SqlDbType.VarChar).Value = METODODEPAGO
|
||||||
|
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@TipoCambio", SqlDbType.SmallMoney).Value = TipoCambio
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@SubTotal", SqlDbType.Money).Value = SubTotal
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@IVA", SqlDbType.Money).Value = IVA
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@IEPS", SqlDbType.Money).Value = IEPS
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@RetIVA", SqlDbType.Money).Value = RetIVA
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@RetISR", SqlDbType.Money).Value = RetISR
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@Descuento", SqlDbType.Money).Value = Descuento
|
||||||
|
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
Retorno = SqlAdapter.SelectCommand.Parameters("@Retorno").Value.ToString().ToEntero()
|
Retorno = Convert.ToInt32(SqlAdapter.SelectCommand.Parameters("@Retorno").Value)
|
||||||
|
CveFactura = Convert.ToInt32(SqlAdapter.SelectCommand.Parameters("@CveFactura").Value)
|
||||||
|
|
||||||
CveFactura = SqlAdapter.SelectCommand.Parameters("@CveFactura").Value.ToString().ToEntero()
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ModExtensiones.OnError(Me, "Ocurrió un error al intentar Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
ModExtensiones.OnError(Me, "Ocurrió un error al intentar Guardar", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function UpdateArchivo(CveFactura As Integer, Columna As String) As Boolean
|
Public Function UpdateArchivo(CveFactura As Integer, Columna As String) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
Dim Str As String = ""
|
Dim Str As String = ""
|
||||||
@@ -1851,9 +1906,12 @@ Public Class ClsCompras
|
|||||||
DataAdapter(Str, CommandType.Text)
|
DataAdapter(Str, CommandType.Text)
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|
||||||
|
SqlAdapter.SelectCommand.Parameters.Add("@CveFactura", SqlDbType.Int).Value = CveFactura
|
||||||
|
|
||||||
Retorno = True
|
Retorno = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ModExtensiones.OnError(Me, "Ocurrió un error al agregar el Tipo de Cambio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
ModExtensiones.OnError(Me, "Ocurrió un error al actualizar la factura", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||||
End Try
|
End Try
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -2014,6 +2014,12 @@ Namespace Extensiones
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Public Function CopyToDataTable(Of T)(ByVal source As IEnumerable(Of T), ByVal flag As Boolean) As DataTable
|
||||||
|
Return New ObjectShredder(Of T)().Shred(source, Nothing, Nothing)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Sub ExportToExcel2(GridView As GridView, NombreArchivoXLSX As String)
|
Public Sub ExportToExcel2(GridView As GridView, NombreArchivoXLSX As String)
|
||||||
|
|
||||||
|
|||||||
@@ -9155,7 +9155,7 @@ Partial Class Compras_Compras
|
|||||||
ObjCompra.RollBack()
|
ObjCompra.RollBack()
|
||||||
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
If ObjContaAC IsNot Nothing Then ObjContaAC.RollBack()
|
||||||
|
|
||||||
SeActualizoDetalle = False
|
|
||||||
Finally
|
Finally
|
||||||
If Retorno Then
|
If Retorno Then
|
||||||
If ObjContabilidad.MensajePolizaDescuadre IsNot Nothing AndAlso ObjContabilidad.MensajePolizaDescuadre.ToString <> "" Then
|
If ObjContabilidad.MensajePolizaDescuadre IsNot Nothing AndAlso ObjContabilidad.MensajePolizaDescuadre.ToString <> "" Then
|
||||||
@@ -9192,23 +9192,22 @@ Partial Class Compras_Compras
|
|||||||
UpBitacora.Update()
|
UpBitacora.Update()
|
||||||
|
|
||||||
|
|
||||||
If SeActualizoDetalle Then
|
If SeActualizoDetalle AndAlso UsuarioActual.CveEmpresa = 119 Then
|
||||||
MandaCorreoActualizacionDetalle(CveCompra)
|
MandaCorreoActualizacionDetalle()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub MandaCorreoActualizacionDetalle(CveCompra As Integer)
|
Private Sub MandaCorreoActualizacionDetalle()
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.CveRol <> 1 Then
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim DTCorreos As New DataTable
|
Dim DTCorreos As New DataTable
|
||||||
Dim DTMovimientos As New DataTable
|
Dim DTMovimientos As New DataTable
|
||||||
Dim strBody As New StringBuilder
|
Dim strBody As New StringBuilder
|
||||||
Dim Asunto, Para, ArrayCC, Body As String
|
Dim Asunto, Para, ArrayCC, Body As String
|
||||||
Para = GlobalDTUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("Correo")
|
'Para = GlobalDTUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("Correo")
|
||||||
|
Para = "fernanda.romo@agrojam.com.mx"
|
||||||
|
|
||||||
If Para.ToString = "" AndAlso UsuarioActual.CveRol = 1 Then
|
If Para.ToString = "" AndAlso UsuarioActual.CveRol = 1 Then
|
||||||
Para = Para & ";oscar.irigoyen@adssistemas.mx;rene.molina@adssistemas.mx"
|
Para = Para & ";oscar.irigoyen@adssistemas.mx;rene.molina@adssistemas.mx"
|
||||||
@@ -9260,8 +9259,8 @@ Partial Class Compras_Compras
|
|||||||
Asunto = $"Actualizacion de Compra: {SerieFolioCompra} Proveedor: {HplProveedor.Text}"
|
Asunto = $"Actualizacion de Compra: {SerieFolioCompra} Proveedor: {HplProveedor.Text}"
|
||||||
ArrayCC = ""
|
ArrayCC = ""
|
||||||
Body = strBody.ToString
|
Body = strBody.ToString
|
||||||
Dim Mail As New ClsSisMail()
|
Dim Mail As New ClsSisMail()
|
||||||
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayCC)
|
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body, ArrayCC)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12239,7 +12239,7 @@ Partial Class Ventas
|
|||||||
ObjFactura.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim
|
ObjFactura.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim
|
||||||
ObjFactura.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim
|
ObjFactura.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim
|
||||||
ObjFactura.Det_ContraRecibo = TxtDet_ContraRecibo.Text.Trim
|
ObjFactura.Det_ContraRecibo = TxtDet_ContraRecibo.Text.Trim
|
||||||
ObjFactura.MonedaAbreviatura = ""
|
ObjFactura.MonedaAbreviatura = DdlMoneda.SelectedItem.Text
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
|
If UsuarioActual.Empresa.Funcionalidad(578) = "1" AndAlso DvModalRequiereOSFecha.Visible Then
|
||||||
ObjFactura.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
|
ObjFactura.FechaEjecucion = TxtFechaOS.Text.Trim.ToDateTime
|
||||||
|
|||||||
Reference in New Issue
Block a user