--option strict ON
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
'Imports Microsoft.Office.Core
|
||||
'Imports Microsoft.VisualBasic
|
||||
Imports System.Data
|
||||
Imports ADSNetLibrary.Helpers
|
||||
|
||||
Public Class NodeArbol
|
||||
Public nivel As String
|
||||
Public nivel As Integer
|
||||
Public id As String
|
||||
Public padre As String
|
||||
Public titulo As String
|
||||
@@ -26,7 +27,7 @@ Public Class Arbolito
|
||||
For Each row As DataRow In TDatos.Rows
|
||||
Dim newnodo As New NodeArbol
|
||||
newnodo.id = row(nodoid).ToString
|
||||
newnodo.nivel = row(nivel).ToString
|
||||
newnodo.nivel = row(nivel).ToString.ToEntero
|
||||
newnodo.padre = row(padre).ToString
|
||||
newnodo.titulo = row(titulo).ToString
|
||||
listaarbol.Add(newnodo)
|
||||
|
||||
@@ -2842,35 +2842,6 @@ Public Class ClsContabilidad
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdatePoliza(FechaPoliza As Date, Folio As Integer, CvePoliza As Integer, Concepto As String, TipoPoliza As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Conta_PolizasUpdate")
|
||||
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@Folio", SqlDbType.Int).Value = Folio
|
||||
.Add("@Concepto", SqlDbType.VarChar).Value = Concepto
|
||||
.Add("@FechaPoliza", SqlDbType.DateTime).Value = FechaPoliza
|
||||
.Add("@TipoPoliza", SqlDbType.Int).Value = TipoPoliza
|
||||
.Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
|
||||
Catch ex As SqlException
|
||||
If ex.Number = 50000 Then
|
||||
OnError("No se puede registrar la poliza porque ya existe una con el mismo Folio", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar la Póliza.", ex)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Public Function UpdatePolizaDetalle(CvePolizaDetalle As Integer, IdCuenta As Integer, CveSubProyecto As Integer, TipoMovto As Boolean, Importe As Double, Referencia As String,
|
||||
Concepto As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
@@ -5921,9 +5892,8 @@ Public Class ClsContabilidad
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddContaEjercicio(FechaIng As String, CveUsuario As Integer, CveEmpresa As Integer, Optional Ejercicio As Integer = -1, Optional PeriodoActual As Integer = 0,
|
||||
Optional CveCuentaCierre As Integer = -1, Optional CvePoliza As Integer = -1, Optional CvePrePoliza As Integer = -1,
|
||||
Optional Estatus As Boolean = False) As Boolean
|
||||
Public Function AddContaEjercicio(Ejercicio As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional PeriodoActual As Integer = 0,
|
||||
Optional CveCuentaCierre As Integer = -1, Optional CvePoliza As Integer = -1, Optional CvePrePoliza As Integer = -1) As Boolean
|
||||
Dim Retorno = False
|
||||
|
||||
DataAdapter("PA_Conta_ContaEjerciciosAdd")
|
||||
@@ -5934,8 +5904,6 @@ Public Class ClsContabilidad
|
||||
.Add("@CveCuentaCierre", SqlDbType.Int).Value = CveCuentaCierre
|
||||
.Add("@CvePoliza", SqlDbType.Int).Value = CvePoliza
|
||||
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
|
||||
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
|
||||
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
@@ -1198,7 +1198,7 @@ Public Class ClsGPS
|
||||
If rdr.GetName(i) = "Coordenadas" Then
|
||||
jsonWriter.WritePropertyName(rdr.GetName(i))
|
||||
jsonWriter.WriteStartArray()
|
||||
For Each Coord As JObject In SQLToGmapsJArray(rdr(i), "POLYGON")
|
||||
For Each Coord As JObject In SQLToGmapsJArray(rdr(i).ToString, "POLYGON")
|
||||
jsonWriter.WriteStartObject()
|
||||
jsonWriter.WritePropertyName("Lat")
|
||||
jsonWriter.WriteValue(Coord("lat").ToString().ToDouble())
|
||||
|
||||
@@ -987,7 +987,7 @@ Public Class ClsNominas
|
||||
Me.SeTimbro = Data.Rows(0)("SeTimbro").ToString
|
||||
Me.CvePeriodo = Data.Rows(0)("CvePeriodo").ToString.ToEntero
|
||||
Me.TipoPeriodo = Data.Rows(0)("TipoPeriodo").ToString
|
||||
Me.CveTipoPeriodo = Data.Rows(0)("CveTipoPeriodo").ToString
|
||||
Me.CveTipoPeriodo = Data.Rows(0)("CveTipoPeriodo").ToString.ToEntero
|
||||
Me.CvePersonal = Data.Rows(0)("CvePersonal").ToString.ToEntero
|
||||
Me.Codigo = Data.Rows(0)("Codigo").ToString
|
||||
Me.Nombre = Data.Rows(0)("Nombre").ToString
|
||||
|
||||
@@ -684,7 +684,7 @@ Public Class ClsOC
|
||||
_CveDireccionEnvio = dr("CveDireccionEnvio").ToString.ToEntero
|
||||
_CveUsoCFDI = dr("CveUsoCFDI").ToString.ToEntero
|
||||
_UsoCFDI = dr("UsoCFDI").ToString
|
||||
Promocion = IfNull(dr("Promocion"), "", dr("Promocion").ToString)
|
||||
Promocion = IfNull(dr("Promocion"), "", dr("Promocion").ToString).ToString
|
||||
CveProveedorContacto = If(Not IsDBNull(dr("CveProveedorContacto")), dr("CveProveedorContacto").ToString.ToEntero, -1)
|
||||
NumRemision = dr("NumRemision").ToString
|
||||
|
||||
@@ -704,7 +704,7 @@ Public Class ClsOC
|
||||
pFechaEstimadaEntrega As String, pLugarEntrega As String, pCveUsuario As Integer, pCveEmpresa As Integer, pCvePresupuestoEgreso As Integer,
|
||||
Optional pCveProveedor As Integer = -1, Optional pCveProveedorSucursal As Integer = -1, Optional IDPoliza As Integer = -1, Optional RequiereCotizacion As Boolean = False, Optional CveUsuarioAsignado As Integer = -1,
|
||||
Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "",
|
||||
Optional PorcentajeIVA As Decimal = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
|
||||
Optional PorcentajeIVA As Decimal = 0.16D, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
|
||||
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
|
||||
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1, Optional NumRemision As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
@@ -913,7 +913,7 @@ Public Class ClsOC
|
||||
pCveProveedor As Integer, pCveOrdenCompra As Integer, pCveUsuarioModifico As Integer, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "",
|
||||
Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "",
|
||||
Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1",
|
||||
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16, Optional NumRemision As String = "-1") As Boolean
|
||||
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16D, Optional NumRemision As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_OC_OrdenesCompraUpdate")
|
||||
|
||||
@@ -535,7 +535,7 @@ Public Class ClsOS
|
||||
Me.UsuarioAtendio = Data.Rows(0)("UsuarioAtendio").ToString
|
||||
Me.CveUsuarioEntrego = Data.Rows(0)("CveUsuarioEntrego").ToString.ToEntero
|
||||
Me.UsuarioEntrego = Data.Rows(0)("UsuarioEntrego").ToString
|
||||
Me.CveSubProyecto = Data.Rows(0)("CveSubproyecto").ToString
|
||||
Me.CveSubProyecto = Data.Rows(0)("CveSubproyecto").ToString.ToEntero
|
||||
Me.CveOSTipo = Data.Rows(0)("CveOrdenServicioTipo").ToString.ToEntero
|
||||
|
||||
Me.Telefono = Data.Rows(0)("TelefonoContacto").ToString
|
||||
|
||||
@@ -8048,7 +8048,7 @@ Public Class ClsPaginas
|
||||
End If
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, tOtTipoMovto, ImporteMovimiento, ImporteMovimiento, tOtCveCon, VentaActual.SerieFolio, Concepto, CveVenta:=VentaActual.CveVenta, CveCliente:=VentaActual.CveCliente, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveSubProyecto:=VentaActual.CveSubProyecto, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME) Then ErrorMovtos = True
|
||||
End If
|
||||
If Not ErrorMovtos AndAlso TCValuacionVenta <> TCValuacionPago Then
|
||||
If Not ErrorMovtos AndAlso TCValuacionVenta <> TCValuacionPago OrElse Pago.ImporteFluctuacionAdicional <> 0 Then 'si hay aplicación de exc, y no hay varación en el pago
|
||||
Dim ConceptoContable As Integer
|
||||
Dim TipoMovimiento As Boolean
|
||||
Dim Diferencia As Decimal = 0
|
||||
|
||||
@@ -176,7 +176,8 @@ Public Class ClsSisMail
|
||||
|
||||
Dim FS As New FileStream(FileName, FileMode.Open, FileAccess.Read)
|
||||
' Create a byte array of file stream length
|
||||
Dim FileData As Byte() = New Byte(FS.Length - 1) {}
|
||||
Dim longitud As Integer = FS.Length.ToEntero - 1
|
||||
Dim FileData As Byte() = New Byte(longitud) {}
|
||||
'Read block of bytes from stream into the byte array
|
||||
FS.Read(FileData, 0, System.Convert.ToInt32(FS.Length))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Option Explicit On
|
||||
Option Strict Off
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
@@ -1518,7 +1519,7 @@ Public Class ClsSisNotificaciones
|
||||
For Each Dr As DataRow In DTNotificacionesVentana.Rows
|
||||
Dim Encabezado As String = Dr("Encabezado").ToString.Replace("{Vehiculo}", Dr("Vehiculo").ToString).Replace("{Clase}", Dr("Clase").ToString)
|
||||
Dim Mensaje As String = Dr("Cuerpo").ToString.Replace("{Mensaje}", $"{Dr("Nombre").ToString} {Dr("FechaEvento")}")
|
||||
Dim CveUsuario = Dr("CveUsuario").ToString
|
||||
Dim CveUsuario As Integer = Dr("CveUsuario").ToString.ToEntero
|
||||
Dim TipoNotificacion As Integer = Dr("TipoNotificacion").ToString().ToEntero()
|
||||
Dim Pie As String = Dr("Pie").ToString
|
||||
Dim Sonido As String = Dr("Sonido").ToString
|
||||
|
||||
@@ -220,9 +220,9 @@ Public Class ClsTSoft
|
||||
MyCurrentError = String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)
|
||||
OnError(Mensaje, Exeption, InfoAdicional)
|
||||
End Sub
|
||||
Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")
|
||||
GuardaLogAD(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional), "LogClsTsoft")
|
||||
Alert(Obj, Mensaje, TipoMensaje.MsgError)
|
||||
'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
|
||||
End Sub
|
||||
'Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")
|
||||
' GuardaLogAD(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional), "LogClsTsoft")
|
||||
' Alert(Obj, Mensaje, TipoMensaje.MsgError)
|
||||
' 'If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional))
|
||||
'End Sub
|
||||
End Class
|
||||
|
||||
@@ -28,7 +28,7 @@ Public Class ClsValidaCFDi
|
||||
Public Property Receptor As String
|
||||
Public Property RFCPAC As String
|
||||
Public Property FechaCertificacion As String
|
||||
Public Property Monto As String
|
||||
Public Property Monto As Decimal
|
||||
Public Property FechaCancelacion As String
|
||||
Public Property ResponseHTML As String
|
||||
|
||||
@@ -40,7 +40,7 @@ Public Class ClsValidaCFDi
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub New(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, Optional Importe As Decimal = 0.00)
|
||||
Public Sub New(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, Optional Importe As Decimal = 0)
|
||||
Me.LFolioFiscal = HttpUtility.UrlEncode(FolioFiscal)
|
||||
Me.LRFCEmisor = HttpUtility.UrlEncode(RFCEmisor)
|
||||
Me.LRFCReceptor = HttpUtility.UrlEncode(RFCReceptor)
|
||||
@@ -59,7 +59,7 @@ Public Class ClsValidaCFDi
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function Verificar(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, Optional Importe As Decimal = 0.00) As Integer
|
||||
Public Function Verificar(FolioFiscal As String, RFCEmisor As String, RFCReceptor As String, Optional Importe As Decimal = 0) As Integer
|
||||
Me.LFolioFiscal = HttpUtility.UrlEncode(FolioFiscal)
|
||||
Me.LRFCEmisor = RFCEmisor
|
||||
Me.LRFCReceptor = RFCReceptor
|
||||
@@ -83,7 +83,7 @@ Public Class ClsValidaCFDi
|
||||
End Function
|
||||
|
||||
Private Sub VerificaCFDI()
|
||||
Dim Importe As String = LImporte.ToString("F6").PadLeft(17, "0")
|
||||
Dim Importe As String = LImporte.ToString("F6").PadLeft(17, "0"c)
|
||||
Dim MsgError As String = ""
|
||||
Dim MsgError2 As String = ""
|
||||
Try
|
||||
@@ -239,7 +239,7 @@ Public Class ClsValidaCFDi
|
||||
Me.Receptor = ExtraeDatos(HTML, "ctl00_MainContent_LblNombreReceptor"">", 200)
|
||||
Me.RFCPAC = ExtraeDatos(HTML, "ctl00_MainContent_LblRfcPac"">", 13)
|
||||
Me.FechaCertificacion = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaCertificacion"">", 19)
|
||||
Me.Monto = ExtraeDatos(HTML, "ctl00_MainContent_LblMonto"">", 15)
|
||||
Me.Monto = ExtraeDatos(HTML, "ctl00_MainContent_LblMonto"">", 15).ToDecimal
|
||||
Me.FechaCancelacion = ExtraeDatos(HTML, "ctl00_MainContent_LblFechaCancelacion"">", 19)
|
||||
If Estado.ToLower = "vigente" Then
|
||||
EsValida = 1
|
||||
|
||||
@@ -4914,7 +4914,7 @@ Public Class ClsVentas
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
Public Function GetRepMetasVendedores(FechaMesActual As String, CveEmpresa As Integer, CveVendedor As Integer, CveCategoria As Integer, CveClasificacion As Integer,
|
||||
Public Function GetRepMetasVendedores(FechaMesActual As Date, CveEmpresa As Integer, CveVendedor As Integer, CveCategoria As Integer, CveClasificacion As Integer,
|
||||
CveClasificacion2 As Integer, CveMarca As Integer, CveSubProyecto As Integer, CveCliente As Integer, EsDistribuidor As Integer,
|
||||
Optional GrupoSuperior As Integer = 0) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
Case "Single"
|
||||
prop.SetValue(Me, CSng(row(prop.Name)))
|
||||
Case "String"
|
||||
If String.IsNullOrEmpty(row(prop.Name)) Then
|
||||
If String.IsNullOrEmpty(row(prop.Name).ToString) Then
|
||||
prop.SetValue(Me, "")
|
||||
Else
|
||||
prop.SetValue(Me, CStr(row(prop.Name)))
|
||||
|
||||
@@ -709,7 +709,7 @@ Namespace Modelos
|
||||
Public Property FolioUsado As String
|
||||
|
||||
End Class
|
||||
Public Function RegenerarPrePolizas(Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing, Optional ObjACTransac As ClsContPAQi = Nothing) As Boolean
|
||||
Public Function RegenerarPrePolizas(Optional TransaccionCompartida As SqlClient.SqlTransaction = Nothing) As Boolean
|
||||
Dim ErrorPrePolizas As Boolean = False
|
||||
|
||||
Dim ObjVentas As ClsVentas = Nothing
|
||||
@@ -723,17 +723,8 @@ Namespace Modelos
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
|
||||
If ObjACTransac Is Nothing Then
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
Else
|
||||
ObjAC = ObjACTransac
|
||||
End If
|
||||
|
||||
ErrorPrePolizas = Not RegeneracionPolizas(Me, ObjVentas, ObjAC, ObjConta, ObjBancos, ObjEventos)
|
||||
ErrorPrePolizas = Not RegeneracionPolizas(Me, ObjVentas, ObjConta, ObjBancos, ObjEventos)
|
||||
|
||||
If TransaccionCompartida Is Nothing Then
|
||||
ObjVentas.Commit()
|
||||
@@ -742,16 +733,9 @@ Namespace Modelos
|
||||
ObjEventos.Dispose()
|
||||
End If
|
||||
|
||||
If ObjACTransac Is Nothing Then
|
||||
If ObjAC IsNot Nothing Then
|
||||
ObjAC.Commit()
|
||||
ObjAC.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Not ErrorPrePolizas
|
||||
End Function
|
||||
Private Function RegeneracionPolizas(ObjFactura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjAC As ClsContPAQi, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos, ObjEventos As ClsOIEventos) As Boolean
|
||||
Private Function RegeneracionPolizas(ObjFactura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ObjBancos As ClsBancos, ObjEventos As ClsOIEventos) As Boolean
|
||||
Dim ErrorPrePolizas As Boolean = False
|
||||
|
||||
'REMOVEMOS LOS CONCEPTOS DE LA PREPOLIZA
|
||||
@@ -759,7 +743,7 @@ Namespace Modelos
|
||||
|
||||
'VUELVE A GENERAR LAS PREPOLIZAS
|
||||
If Not ErrorPrePolizas Then
|
||||
ErrorPrePolizas = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, ValorMultiplicador:=1, ObjBancos:=ObjBancos, ObjVentas:=ObjVentas, ObjEventos:=ObjEventos, DtRemisionesRelacionadas:=New DataTable, SeCancelaRemisionProceso:=False,
|
||||
ErrorPrePolizas = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ValorMultiplicador:=1, ObjBancos:=ObjBancos, ObjVentas:=ObjVentas, ObjEventos:=ObjEventos, DtRemisionesRelacionadas:=New DataTable, SeCancelaRemisionProceso:=False,
|
||||
CancelarRemisiones:=False, ListaRemisionesCancelar:=New List(Of Integer))
|
||||
End If
|
||||
|
||||
@@ -767,7 +751,7 @@ Namespace Modelos
|
||||
|
||||
Return Not ErrorPrePolizas
|
||||
End Function
|
||||
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional ObjContPaqTransac As ClsContPAQi = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM") As MMensajeFactura
|
||||
Public Function EmitirFactura(Optional Timbrar As Boolean = True, Optional Transac As SqlClient.SqlTransaction = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM") As MMensajeFactura
|
||||
Dim Retorno As New MMensajeFactura()
|
||||
|
||||
If Me.Version = "3.3" AndAlso Not Me.TipoDocto.Contiene("Ped", "PeC") Then
|
||||
@@ -835,19 +819,9 @@ Namespace Modelos
|
||||
Dim ObjDocCliente As New ClsEdocumentacion(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjGeneral As New ClsGenerales(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
Dim MensajeAlert = New StringBuilder
|
||||
|
||||
Try
|
||||
'CONTABILIDAD AUTOMATICA Y AC
|
||||
If ObjContPaqTransac IsNot Nothing Then
|
||||
ObjContPaq = ObjContPaqTransac
|
||||
Else
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1") Then
|
||||
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'GUARDA VENTA
|
||||
Dim TieneAnticipo As Boolean = False
|
||||
@@ -868,7 +842,7 @@ Namespace Modelos
|
||||
|
||||
Dim CveTimbreCartaPorte As Integer = -1
|
||||
|
||||
GuardarVenta(Me, ObjVentas, ObjConta, ObjInventario, ObjContr, DtDetalle, Me.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, ObjAcum:=ObjAcum, Resp:=Retorno, Modulo:=Modulo)
|
||||
GuardarVenta(Me, ObjVentas, ObjConta, ObjInventario, ObjContr, DtDetalle, Me.CveNCaVincular, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, ObjAcum:=ObjAcum, Resp:=Retorno, Modulo:=Modulo)
|
||||
|
||||
If ErrorList.Count = 0 AndAlso Me.EmitirCartaPorte AndAlso Me.TipoDocto = "Ing" Then
|
||||
CveTimbreCartaPorte = GuardarCartaPorte(Me, ObjGeneral, ObjVentas)
|
||||
@@ -882,7 +856,7 @@ Namespace Modelos
|
||||
If ErrorList.Count = 0 Then
|
||||
If NuevaFactura = 1 AndAlso FacturaDevolucion IsNot Nothing Then
|
||||
|
||||
ObjNC = GeneraNC(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, FacturaDevolucion, ObjBancos, ObjEventos)
|
||||
ObjNC = GeneraNC(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, ObjEventos)
|
||||
|
||||
If ObjNC Is Nothing Then
|
||||
ErrorList.Add("No se pudo Cancelar la Factura")
|
||||
@@ -908,7 +882,7 @@ Namespace Modelos
|
||||
If TieneAnticipo Then
|
||||
Try
|
||||
'DESCOMENTAR
|
||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, FacturaDevolucion, ObjBancos, Nothing, Nothing) Then
|
||||
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, Nothing, Nothing) Then
|
||||
Obj2.Add(FacturaDevolucion)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -1046,9 +1020,6 @@ Namespace Modelos
|
||||
If Transac Is Nothing Then
|
||||
ObjVentas.Commit()
|
||||
End If
|
||||
If ObjContPaqTransac Is Nothing Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
End If
|
||||
|
||||
Try
|
||||
If Not String.IsNullOrEmpty(DirectorioServidor) Then
|
||||
@@ -1263,9 +1234,6 @@ Namespace Modelos
|
||||
If Transac Is Nothing Then
|
||||
ObjVentas.RollBack()
|
||||
End If
|
||||
If ObjContPaqTransac Is Nothing Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
End If
|
||||
Retorno.Mensajes = ErrorList
|
||||
Retorno.TieneError = True
|
||||
End If
|
||||
@@ -1275,10 +1243,6 @@ Namespace Modelos
|
||||
ObjVentas.RollBack()
|
||||
End If
|
||||
|
||||
If ObjContPaqTransac Is Nothing Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
End If
|
||||
|
||||
ErrorList.Add("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.")
|
||||
Retorno.Mensajes = ErrorList
|
||||
Retorno.TieneError = True
|
||||
@@ -1289,9 +1253,6 @@ Namespace Modelos
|
||||
If Transac Is Nothing Then
|
||||
ObjVentas.RollBack()
|
||||
End If
|
||||
If ObjContPaqTransac Is Nothing Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
End If
|
||||
|
||||
Retorno.Mensajes = ErrorList
|
||||
Retorno.TieneError = True
|
||||
@@ -1306,9 +1267,6 @@ Namespace Modelos
|
||||
ObjClientes.Dispose()
|
||||
ObjAcum.Dispose()
|
||||
End If
|
||||
If ObjContPaqTransac Is Nothing Then
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
End If
|
||||
End Try
|
||||
Else
|
||||
Retorno.Mensajes.Add("No se han agregado productos/servicios")
|
||||
@@ -1941,7 +1899,7 @@ Namespace Modelos
|
||||
End Function
|
||||
|
||||
#Region " GUARDAR - VENTA, PREPOLIZAS, INV, NC , ESTIMACIONES, AC, NOTA DE CRÉDITO "
|
||||
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
||||
Private Function RegistrarNCAmortizacion(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
||||
Dim ProcesoCorrecto As Boolean = True
|
||||
|
||||
'Generamos el nuevo folio
|
||||
@@ -2035,7 +1993,7 @@ Namespace Modelos
|
||||
factura.CveVentaPadre = CveVentaP
|
||||
|
||||
'Registramos la venta
|
||||
GuardarVenta(factura, ObjVentas, ObjConta, ObjInventario, ObjContr, tmpcon, -1, ObjContPaq, ObjBancos)
|
||||
GuardarVenta(factura, ObjVentas, ObjConta, ObjInventario, ObjContr, tmpcon, -1, ObjBancos)
|
||||
|
||||
''Timbramos
|
||||
Else
|
||||
@@ -2202,7 +2160,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
End Function
|
||||
Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing, ByRef Optional Resp As MMensajeFactura = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM")
|
||||
Public Sub GuardarVenta(ByRef factura As Modelos.Factura, ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef TmpDTDetalle As DataTable, CveNCaVincular As Integer, Optional ByRef ObjBancos As ClsBancos = Nothing, Optional ByRef ObjOS As ClsOS = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjCGame As ClsCGame = Nothing, ByRef Optional ObjCliente As ClsClientes = Nothing, Optional EsNotaCredito As Boolean = False, Optional ObjAcum As ClsAcumuladores = Nothing, ByRef Optional Resp As MMensajeFactura = Nothing, Optional Modulo As String = "Modelos/GuardarVentaM")
|
||||
Dim Msgok As New StringBuilder
|
||||
|
||||
factura.CvePrePoliza = ObjConta.AddPrePolizas(Modulo, factura.CvePlantillaPoliza, factura.TotalTC, factura.TotalTC, factura.CveMoneda, factura.Fecha, If(factura.CveEmpresaCRM > 0, factura.EmpresaCRM, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
|
||||
@@ -2531,7 +2489,7 @@ Namespace Modelos
|
||||
|
||||
If ErrorList.Count = 0 Then
|
||||
'prepoliza
|
||||
GuardarVentaPrePolizas(factura, ObjConta, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, ObjInventario:=ObjInventario)
|
||||
GuardarVentaPrePolizas(factura, ObjConta, TmpDTDetalle, CveNCaVincular, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, ObjInventario:=ObjInventario)
|
||||
If ErrorList.Count = 0 Then
|
||||
'inventarios
|
||||
GuardarVentaInventarios(Resp, factura, ObjInventario, ObjConta, ObjVentas, ObjAcum)
|
||||
@@ -2543,7 +2501,7 @@ Namespace Modelos
|
||||
GuardarVentaEstimaciones(factura, ObjContr)
|
||||
If ErrorList.Count = 0 Then
|
||||
'armonizaccionContable
|
||||
GuardarVentaAC(factura, ObjVentas, Msgok, objContPaqi)
|
||||
'GuardarVentaAC(factura, ObjVentas, Msgok, objContPaqi)
|
||||
If ErrorList.Count = 0 Then
|
||||
'Impuestos Locales
|
||||
If GuardarVentaImpuestosLocales(factura, ObjVentas, ObjConta) Then
|
||||
@@ -3055,7 +3013,7 @@ Namespace Modelos
|
||||
Return Resultado
|
||||
|
||||
End Function
|
||||
Private Sub GuardarVentaPrePolizas(ByRef factura As Modelos.Factura, ByRef ObjConta As ClsContabilidad, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer, ByRef objContPaqi As ClsContPAQi, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjInventario As ClsInventarios = Nothing)
|
||||
Private Sub GuardarVentaPrePolizas(ByRef factura As Modelos.Factura, ByRef ObjConta As ClsContabilidad, TmpDTDetalleMovimientos As DataTable, CveNCaVincular As Integer, Optional ByRef ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing, ByRef Optional ObjInventario As ClsInventarios = Nothing)
|
||||
|
||||
Dim CveIE As Integer = -1
|
||||
Dim DT As DataTable = Nothing
|
||||
@@ -3073,7 +3031,7 @@ Namespace Modelos
|
||||
'P R E P O L I Z A S
|
||||
If Me.TipoDocto <> "Cot" Then
|
||||
If Me.CvePrePoliza > 0 Then
|
||||
If ProcesoPrepolizas(factura, ObjConta, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, ObjInventario:=ObjInventario) Then
|
||||
If ProcesoPrepolizas(factura, ObjConta, CveIE, TmpDTDetalleMovimientos, 1, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, ObjInventario:=ObjInventario) Then
|
||||
ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
Else
|
||||
@@ -3081,7 +3039,7 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Function ProcesoPrepolizas(ObjFactura As Factura, ByRef ObjConta As ClsContabilidad, CveIE As Integer, TmpDTDetalle As DataTable, ByRef objContPaqi As ClsContPAQi,
|
||||
Private Function ProcesoPrepolizas(ObjFactura As Factura, ByRef ObjConta As ClsContabilidad, CveIE As Integer, TmpDTDetalle As DataTable,
|
||||
Optional ValorMultiplicador As Integer = 1, ByRef Optional ObjBancos As ClsBancos = Nothing, ByRef Optional ObjVentas As ClsVentas = Nothing, ByRef Optional ObjEventos As ClsOIEventos = Nothing,
|
||||
Optional ByRef DtRemisionesRelacionadas As DataTable = Nothing, Optional SeCancelaRemisionProceso As Boolean = False, Optional CancelarRemisiones As Boolean = False, Optional ListaRemisionesCancelar As List(Of Integer) = Nothing,
|
||||
Optional CveEstatusRefacturacion As Integer = 0, Optional ByRef ObjInventario As ClsInventarios = Nothing, Optional FechaCancelacion As DateTime = MinFecha) As Boolean
|
||||
@@ -4222,7 +4180,7 @@ Namespace Modelos
|
||||
|
||||
If AutoConta Then
|
||||
If idCuentaContabilizacion > 0 Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=objContPaqi) Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa) Then
|
||||
ErrorList.Add("Ocurrio un Error al contabilizar, pongase en contacto con Soporte Técnico")
|
||||
'ErrorPrepoliza = True
|
||||
End If
|
||||
@@ -4276,7 +4234,6 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||
OcurrioError = True
|
||||
ErrorList.Add("Ocurrió un error al agregar los Movimientos de entrada al Inventario.<br />")
|
||||
@@ -4962,31 +4919,31 @@ Namespace Modelos
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
Private Sub GuardarVentaAC(ByRef factura As Modelos.Factura, ObjVentas As ClsVentas, Msgok As StringBuilder, ObjAC As ClsContPAQi)
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
'Private Sub GuardarVentaAC(ByRef factura As Modelos.Factura, ObjVentas As ClsVentas, Msgok As StringBuilder )
|
||||
' If UsuarioActual.Empresa.UsaAC Then
|
||||
|
||||
If factura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
|
||||
' If factura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
|
||||
|
||||
'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(factura, ObjAC)
|
||||
' 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
' Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(factura, ObjAC)
|
||||
|
||||
If IDPoliza.IdPoliza > 0 Then
|
||||
' If IDPoliza.IdPoliza > 0 Then
|
||||
|
||||
If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, factura.CvePrePoliza, factura.CveVenta, factura.CveEmpresa) Then
|
||||
' If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, factura.CvePrePoliza, factura.CveVenta, factura.CveEmpresa) Then
|
||||
|
||||
'Si se facturó la cotización hay que vincular la venta
|
||||
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
|
||||
End If
|
||||
Else
|
||||
ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
End If
|
||||
' 'Si se facturó la cotización hay que vincular la venta
|
||||
' Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
|
||||
' End If
|
||||
' Else
|
||||
' ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
' End If
|
||||
|
||||
Else
|
||||
Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
|
||||
End If
|
||||
' Else
|
||||
' Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
|
||||
' End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
' End If
|
||||
'End Sub
|
||||
Private Function GuardarVentaImpuestosLocales(factura As Modelos.Factura, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, Optional ValorMultiplicador As Integer = 1) As Boolean
|
||||
Dim ErrorPrepoliza As Boolean = False
|
||||
|
||||
@@ -5036,7 +4993,7 @@ Namespace Modelos
|
||||
|
||||
Return ErrorPrepoliza
|
||||
End Function
|
||||
Private Function GeneraNC(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByRef ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ByRef ObjBancos As ClsBancos, ByRef ObjEventos As ClsOIEventos) As List(Of Object)
|
||||
Private Function GeneraNC(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjInventario As ClsInventarios, ByRef ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ByRef ObjBancos As ClsBancos, ByRef ObjEventos As ClsOIEventos) As List(Of Object)
|
||||
Dim Obj As New List(Of Object)
|
||||
Dim CveVentaNueva As Integer = ObjVentas.CveVenta
|
||||
Dim BanderaGeneraNC As Boolean = False
|
||||
@@ -5114,7 +5071,7 @@ Namespace Modelos
|
||||
|
||||
'CANCELA FACTURA
|
||||
If Month(factura.Fecha) = Month(Now) OrElse BanderaGeneraNC = True Then
|
||||
If CancelarFactura(ObjVentas, ObjConta, ObjContPaq, ObjBancos) Then
|
||||
If CancelarFactura(ObjVentas, ObjConta, ObjBancos) Then
|
||||
Obj.Add(factura)
|
||||
Else
|
||||
Return Nothing
|
||||
@@ -5122,7 +5079,7 @@ Namespace Modelos
|
||||
Else
|
||||
FacturaDevolucion.TipoDocto = "Egs"
|
||||
FacturaDevolucion.Fecha = Now
|
||||
If RegistrarNC(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, FacturaDevolucion, ObjBancos, TmpDTconceptos, ObjEventos) Then
|
||||
If RegistrarNC(ObjVentas, ObjConta, ObjInventario, ObjContr, FacturaDevolucion, ObjBancos, TmpDTconceptos, ObjEventos) Then
|
||||
Obj.Add(FacturaDevolucion)
|
||||
Else
|
||||
Return Nothing
|
||||
@@ -5666,11 +5623,6 @@ Namespace Modelos
|
||||
Dim ObjContrato As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjEventos As New ClsOIEventos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
|
||||
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso (UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1") Then
|
||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
End If
|
||||
|
||||
Try
|
||||
If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
|
||||
@@ -5705,7 +5657,7 @@ Namespace Modelos
|
||||
|
||||
'CANCELA PREPOLIZA
|
||||
If Not ErrorCancelar Then
|
||||
ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, ObjAC, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, SeCancelaRemisionProceso:=SeCancelaRemisionProceso,
|
||||
ErrorCancelar = ProcesoPrepolizas(ObjFactura, ObjConta, -1, ObjFactura.DtDetalle, -1, ObjBancos, ObjVentas, ObjEventos, DtRemisionesRelacionadas:=DtRemisionesRelacionadas, SeCancelaRemisionProceso:=SeCancelaRemisionProceso,
|
||||
CancelarRemisiones:=CancelarRemisiones, ListaRemisionesCancelar:=ListaRemisionesCancelar, CveEstatusRefacturacion:=CveEstatusRefacturacion, ObjInventario:=ObjInventario, FechaCancelacion:=CancelacionFecha)
|
||||
MensajeError = "Ocurrió un error al generar la prepoliza de cancelación."
|
||||
End If
|
||||
@@ -5942,7 +5894,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
If AutoConta And Not ErrorCancelar Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaDev, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al contabilizar la prepoliza."
|
||||
End If
|
||||
@@ -6277,16 +6229,16 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
'POLIZA DE CANCELACION
|
||||
If Not ErrorCancelar Then
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
Dim Pol As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjFactura, ObjAC, True)
|
||||
IDPoliza = Pol.IdPoliza
|
||||
If IDPoliza <= 0 Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al generar la poliza de cancelación."
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'If Not ErrorCancelar Then
|
||||
' If UsuarioActual.Empresa.UsaAC Then
|
||||
' Dim Pol As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjFactura, ObjAC, True)
|
||||
' IDPoliza = Pol.IdPoliza
|
||||
' If IDPoliza <= 0 Then
|
||||
' ErrorCancelar = True
|
||||
' MensajeError = "Ocurrió un error al generar la poliza de cancelación."
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'DESVINCULA REMISIONES PREDECESORAS
|
||||
If Not ErrorCancelar Then
|
||||
@@ -6348,7 +6300,6 @@ Namespace Modelos
|
||||
End Select
|
||||
End If
|
||||
|
||||
|
||||
If CveEstatus.Contiene(4, 5) Then
|
||||
If Not ObjVentas.UpdateCancelaVenta(CveVenta, CancelacionFecha, CancelacionAcuse, UsuarioActual.CveEmpresa, CvePACCancelacion, CveEstatusRefacturacion, EstadoCancelacion:=EstadoCancelacion, CveEstadoCancelacion:=CveEstadoCancelacion) Then
|
||||
ErrorCancelar = True
|
||||
@@ -6375,16 +6326,13 @@ Namespace Modelos
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If Not ObjVentas.UpdateCancelaRemision(CveVenta, SeCancelaRemisionProceso) Then
|
||||
ErrorCancelar = True
|
||||
MensajeError = "Ocurrió un error al actualizar que la remision sea cancelable."
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
For Each CveRemisionCancelar In ListaRemisionesCancelar
|
||||
If Not ObjVentas.UpdateEstatusFactura(12, "", "", CancelacionFecha, CveRemisionCancelar) Then
|
||||
@@ -6406,7 +6354,6 @@ Namespace Modelos
|
||||
Finally
|
||||
If Not ErrorCancelar Then
|
||||
ObjVentas.Commit()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||
|
||||
If CveEstatus = 5 Then
|
||||
Dim MensajeAlert As New StringBuilder
|
||||
@@ -6427,7 +6374,6 @@ Namespace Modelos
|
||||
ObjFactura.CveEstatus = CveEstatus
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||
|
||||
Retorno.Mensaje = MensajeError
|
||||
Retorno.HuboError = True
|
||||
@@ -6442,7 +6388,6 @@ Namespace Modelos
|
||||
ObjInventario.Dispose()
|
||||
ObjContrato.Dispose()
|
||||
ObjConta.Dispose()
|
||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
@@ -6906,7 +6851,7 @@ Namespace Modelos
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi, ByRef ObjBancos As ClsBancos) As Boolean
|
||||
Protected Function CancelarFactura(ByRef ObjVentas As ClsVentas, ByRef ObjConta As ClsContabilidad, ByRef ObjBancos As ClsBancos) As Boolean
|
||||
|
||||
Dim IDPoliza As Integer = -1
|
||||
Dim CvePrePoliza As Integer
|
||||
@@ -6933,9 +6878,9 @@ Namespace Modelos
|
||||
If ObjVentas.GetVentaDetalle(FacturaDevolucion.CveVenta) Then
|
||||
DtDetalle = ObjVentas.DtResultados
|
||||
End If
|
||||
ErrorCancelar = ProcesoPrepolizas(FacturaDevolucion, ObjConta, -1, DtDetalle, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
ErrorCancelar = ProcesoPrepolizas(FacturaDevolucion, ObjConta, -1, DtDetalle, -1, ObjBancos, ObjVentas)
|
||||
Else
|
||||
ErrorCancelar = ProcesoPrepolizas(FacturaDevolucion, ObjConta, -1, DtDetalle, ObjAC, -1, ObjBancos, ObjVentas)
|
||||
ErrorCancelar = ProcesoPrepolizas(FacturaDevolucion, ObjConta, -1, DtDetalle, -1, ObjBancos, ObjVentas)
|
||||
End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
@@ -6974,15 +6919,15 @@ Namespace Modelos
|
||||
|
||||
If Resp.Verificado Then
|
||||
'falta verificar traer el acuse y reenviarlo
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
Dim Pol As Modelos.RetornoPolizaConta = GenerarPolizaAC(Me, ObjAC, True)
|
||||
IDPoliza = Pol.IdPoliza
|
||||
'If UsuarioActual.Empresa.UsaAC Then
|
||||
' Dim Pol As Modelos.RetornoPolizaConta = GenerarPolizaAC(Me, ObjAC, True)
|
||||
' IDPoliza = Pol.IdPoliza
|
||||
|
||||
If IDPoliza <= 0 Then
|
||||
Mensaje = "No se pudo generar la poliza"
|
||||
ErrorCancelar = True
|
||||
End If
|
||||
End If
|
||||
' If IDPoliza <= 0 Then
|
||||
' Mensaje = "No se pudo generar la poliza"
|
||||
' ErrorCancelar = True
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If Not ErrorCancelar Then
|
||||
If ObjVentas.UpdateEstatusFactura(CveEstatus, FolioFiscal, ObjCancelacion.CancelacionAcuse, Now, CveVenta, IDPoliza, CvePAC:=UsuarioActual.Empresa.CvePAC) Then
|
||||
@@ -6999,13 +6944,13 @@ Namespace Modelos
|
||||
|
||||
Return Not ErrorCancelar
|
||||
End Function
|
||||
Private Function RegistrarNC(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ObjContPaq As ClsContPAQi, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
||||
Private Function RegistrarNC(ObjVentas As ClsVentas, ObjConta As ClsContabilidad, ObjInventario As ClsInventarios, ObjContr As ClsContratos, ByVal factura As Modelos.Factura, ObjBancos As ClsBancos, TmpDTconceptos As DataTable, ByRef ObjEventos As ClsOIEventos) As Boolean
|
||||
Dim ProcesoCorrecto As Boolean = True
|
||||
RefacturacionGeneroNC = True
|
||||
factura.Folio = -1
|
||||
|
||||
'Registramos la venta
|
||||
GuardarVenta(factura, ObjVentas, ObjConta, ObjInventario, ObjContr, TmpDTconceptos, -1, ObjContPaq, ObjBancos)
|
||||
GuardarVenta(factura, ObjVentas, ObjConta, ObjInventario, ObjContr, TmpDTconceptos, -1, ObjBancos)
|
||||
|
||||
If ErrorList.Count > 0 Then
|
||||
ProcesoCorrecto = False
|
||||
@@ -7016,107 +6961,107 @@ Namespace Modelos
|
||||
|
||||
|
||||
|
||||
Private Function GenerarPolizaAC(ObjFactura As Modelos.Factura, ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As RetornoPolizaConta
|
||||
Dim Retorno As New RetornoPolizaConta
|
||||
Dim IDPoliza As Integer = 0
|
||||
'Private Function GenerarPolizaAC(ObjFactura As Modelos.Factura, ObjAC As ClsContPAQi, Optional CancelacionIngreso As Boolean = False) As RetornoPolizaConta
|
||||
' Dim Retorno As New RetornoPolizaConta
|
||||
' Dim IDPoliza As Integer = 0
|
||||
|
||||
Dim ErrorAC As Boolean = False
|
||||
'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
Dim Fecha As Date = ObjFactura.Fecha
|
||||
Dim Concepto As String = String.Format("GD {0}", ObjFactura.Cliente.Nombre)
|
||||
Dim Paridad As Integer = 1
|
||||
Dim TipoMovto As Boolean = False
|
||||
' Dim ErrorAC As Boolean = False
|
||||
' 'Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa) : ObjAC.IniciaTransacSQL()
|
||||
' Dim Fecha As Date = ObjFactura.Fecha
|
||||
' Dim Concepto As String = String.Format("GD {0}", ObjFactura.Cliente.Nombre)
|
||||
' Dim Paridad As Integer = 1
|
||||
' Dim TipoMovto As Boolean = False
|
||||
|
||||
If CancelacionIngreso Then
|
||||
Concepto = String.Format("Cancelación GD {0}", ObjFactura.Cliente.Nombre)
|
||||
Paridad = -1
|
||||
TipoMovto = True
|
||||
End If
|
||||
Dim TipoPoliza = If(ObjFactura.TipoDocto = "OP" Or ObjFactura.TipoDocto = "Com", 3, 1)
|
||||
' If CancelacionIngreso Then
|
||||
' Concepto = String.Format("Cancelación GD {0}", ObjFactura.Cliente.Nombre)
|
||||
' Paridad = -1
|
||||
' TipoMovto = True
|
||||
' End If
|
||||
' Dim TipoPoliza = If(ObjFactura.TipoDocto = "OP" Or ObjFactura.TipoDocto = "Com", 3, 1)
|
||||
|
||||
IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, ObjFactura.Total * 2, ObjFactura.Total * 2, UsuarioActual.CveUsuario, Fecha)
|
||||
Dim dr As DataRow
|
||||
Dim CtaCliente As Integer = -1
|
||||
Dim CtaISSSTESON As Integer = 643
|
||||
Dim CtaISPT As Integer = 1745
|
||||
' IDPoliza = ObjAC.AddPoliza(TipoPoliza, Concepto, ObjFactura.Total * 2, ObjFactura.Total * 2, UsuarioActual.CveUsuario, Fecha)
|
||||
' Dim dr As DataRow
|
||||
' Dim CtaCliente As Integer = -1
|
||||
' Dim CtaISSSTESON As Integer = 643
|
||||
' Dim CtaISPT As Integer = 1745
|
||||
|
||||
If IDPoliza > 0 Then
|
||||
Retorno.IdPoliza = IDPoliza
|
||||
Retorno.FolioPoliza = ObjAC.Folio
|
||||
'Orden de PAGO
|
||||
If ObjFactura.TipoDocto = "OP" Then
|
||||
'ORDEN DE PAGO
|
||||
If ObjFactura.Num3 = 1 Then
|
||||
'ISSSTESON
|
||||
' If IDPoliza > 0 Then
|
||||
' Retorno.IdPoliza = IDPoliza
|
||||
' Retorno.FolioPoliza = ObjAC.Folio
|
||||
' 'Orden de PAGO
|
||||
' If ObjFactura.TipoDocto = "OP" Then
|
||||
' 'ORDEN DE PAGO
|
||||
' If ObjFactura.Num3 = 1 Then
|
||||
' 'ISSSTESON
|
||||
|
||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
'ISPT
|
||||
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
' If Not ObjAC.AddMovimiento(IDPoliza, CtaISSSTESON, True, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' 'ISPT
|
||||
|
||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
End If
|
||||
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, False, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
' If Not ObjAC.AddMovimiento(IDPoliza, CtaISPT, True, Paridad * ObjFactura.Total, "", Concepto, 0, Fecha, "") Then
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' NORMAL
|
||||
Else
|
||||
Dim DTPresupuestoIngresos As New DataTable
|
||||
Dim AC As New ClsAC
|
||||
If AC.GetPresupuestoIngresos(-1, Now.Year, True, UsuarioActual.CveEmpresa) Then
|
||||
DTPresupuestoIngresos = AC.DtResultados.Copy()
|
||||
End If
|
||||
AC.Dispose()
|
||||
' ' NORMAL
|
||||
' Else
|
||||
' Dim DTPresupuestoIngresos As New DataTable
|
||||
' Dim AC As New ClsAC
|
||||
' If AC.GetPresupuestoIngresos(-1, Now.Year, True, UsuarioActual.CveEmpresa) Then
|
||||
' DTPresupuestoIngresos = AC.DtResultados.Copy()
|
||||
' End If
|
||||
' AC.Dispose()
|
||||
|
||||
For Each grp As DataRow In DtDetalleAC.Rows
|
||||
dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp("CvePresupuestoIngreso")))
|
||||
Concepto = String.Format("{0} - {1}: {2}", ObjFactura.Cliente.Nombre, ObjFactura.TipoDocumento, ObjFactura.Folio)
|
||||
' For Each grp As DataRow In DtDetalleAC.Rows
|
||||
' dr = DTPresupuestoIngresos.FiltroPrimero(String.Format("CvePresupuestoIngreso = {0}", grp("CvePresupuestoIngreso")))
|
||||
' Concepto = String.Format("{0} - {1}: {2}", ObjFactura.Cliente.Nombre, ObjFactura.TipoDocumento, ObjFactura.Folio)
|
||||
|
||||
If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString.ToEntero, False, Paridad * grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString.ToEntero, True, Paridad * grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
'CARGO la deuda del cliente
|
||||
If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
'abono,
|
||||
If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString.ToEntero, Not TipoMovto, grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaPorEjecutar").ToString.ToEntero, False, Paridad * grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
' If ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaDevengado").ToString.ToEntero, True, Paridad * grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
' 'CARGO la deuda del cliente
|
||||
' If ObjAC.AddMovimiento(IDPoliza, CtaCliente, TipoMovto, grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
' 'abono,
|
||||
' If Not ObjAC.AddMovimiento(IDPoliza, dr("IdCuentaMatriz").ToString.ToEntero, Not TipoMovto, grp("TotalImporte").ToString().ToDouble(), "", Concepto, 0, Fecha, "") Then
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
|
||||
Else
|
||||
ErrorAC = True
|
||||
End If
|
||||
' Else
|
||||
' ErrorAC = True
|
||||
' End If
|
||||
|
||||
If Not ErrorAC Then
|
||||
ObjAC.AjustaPoliza(IDPoliza)
|
||||
' If Not ErrorAC Then
|
||||
' ObjAC.AjustaPoliza(IDPoliza)
|
||||
|
||||
' Retorno = IDPoliza
|
||||
Else
|
||||
'Retorno = -1
|
||||
'Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError)
|
||||
End If
|
||||
' ' Retorno = IDPoliza
|
||||
' Else
|
||||
' 'Retorno = -1
|
||||
' 'Alert("Error al Agregar la Póliza de AC.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
Return Retorno
|
||||
' Return Retorno
|
||||
|
||||
End Function
|
||||
'End Function
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -7384,7 +7329,7 @@ Namespace Modelos
|
||||
Public Property MonedaSAT As String
|
||||
Public Property UsuarioCreo As String
|
||||
Public Property MonedaAbreviatura As String
|
||||
Public Property TipoCambio As Decimal
|
||||
Public Property TipoCambio As Decimal = 1
|
||||
Public Property TipoCambioDolares As Decimal
|
||||
Public Property ConvertirPesos As Boolean
|
||||
Public Property ConvertirDolares As Boolean
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.Collections.Concurrent
|
||||
Option Strict Off
|
||||
Imports System.Collections.Concurrent
|
||||
Imports Extensiones
|
||||
Imports Microsoft.AspNet.SignalR
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports Extensiones
|
||||
Option Strict Off
|
||||
Imports Extensiones
|
||||
Imports Microsoft.AspNet.SignalR
|
||||
|
||||
Public Class MyHub
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports Extensiones
|
||||
Option Strict Off
|
||||
Imports Extensiones
|
||||
Imports Microsoft.AspNet.SignalR
|
||||
|
||||
Public Enum TipoNotificacion As Integer
|
||||
|
||||
@@ -2102,16 +2102,18 @@ Public Class Timbrado
|
||||
Dim ConfigVehicularSeguros As New ProfactCartaPorte.CartaPorteMercanciasAutotransporteSeguros
|
||||
ConfigVehicularSeguros.AseguraRespCivil = Carta.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil
|
||||
ConfigVehicularSeguros.PolizaRespCivil = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil
|
||||
ConfigVehicularSeguros.AseguraMedAmbiente = Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente
|
||||
ConfigVehicularSeguros.PolizaMedAmbiente = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente
|
||||
ConfigVehicularSeguros.AseguraCarga = Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga
|
||||
ConfigVehicularSeguros.PolizaCarga = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga
|
||||
|
||||
If Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente <> "" Then
|
||||
ConfigVehicularSeguros.AseguraMedAmbiente = Carta.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente
|
||||
ConfigVehicularSeguros.PolizaMedAmbiente = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente
|
||||
End If
|
||||
If Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga <> "" Then
|
||||
ConfigVehicularSeguros.AseguraCarga = Carta.FiguraTransporte.AutoTransporte.NombreSeguroCarga
|
||||
ConfigVehicularSeguros.PolizaCarga = Carta.FiguraTransporte.AutoTransporte.PolizaSeguroCarga
|
||||
End If
|
||||
If Carta.FiguraTransporte.AutoTransporte.PrimaSeguro > 0 Then
|
||||
ConfigVehicularSeguros.PrimaSeguro = Carta.FiguraTransporte.AutoTransporte.PrimaSeguro
|
||||
ConfigVehicularSeguros.PrimaSeguroSpecified = True
|
||||
End If
|
||||
|
||||
ComCartaPorte.Mercancias.Autotransporte.Seguros = ConfigVehicularSeguros
|
||||
|
||||
If Carta.FiguraTransporte.AutoTransporte.Remolques IsNot Nothing AndAlso Carta.FiguraTransporte.AutoTransporte.Remolques.Count > 0 Then
|
||||
|
||||
@@ -184,12 +184,12 @@ Public Class Timbres
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
|
||||
|
||||
If drT("ClaveTipoRemolque1").ToString <> "" Then
|
||||
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
|
||||
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1").ToString, .Placa = drT("PlacaRemolque1").ToString}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
|
||||
End If
|
||||
|
||||
If drT("ClaveTipoRemolque2").ToString <> "" Then
|
||||
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
|
||||
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2").ToString, .Placa = drT("PlacaRemolque2").ToString}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
|
||||
End If
|
||||
|
||||
@@ -301,12 +301,12 @@ Public Class Timbres
|
||||
.Embalaje = drr("ClaveEmbalaje").ToString,
|
||||
.DescripEmbalaje = drr("Embalaje").ToString,
|
||||
.ValorMercancia = drr("PU").ToString.ToDecimal,
|
||||
.Moneda = IIf(drr("PU").ToString.ToDecimal > 0, "MXN", ""), 'temporal
|
||||
.Moneda = If(drr("PU").ToString.ToDecimal > 0, "MXN", ""), 'temporal
|
||||
.FraccionArrancelaria = "",
|
||||
.UUIDComercioExt = ""
|
||||
}
|
||||
|
||||
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
|
||||
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToEntero}
|
||||
conceptoCarta.DetalleMercancia = DetalleMercancia
|
||||
|
||||
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
|
||||
@@ -468,12 +468,12 @@ Public Class Timbres
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
|
||||
|
||||
If drT("ClaveTipoRemolque1").ToString <> "" Then
|
||||
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
|
||||
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1").ToString, .Placa = drT("PlacaRemolque1").ToString}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
|
||||
End If
|
||||
|
||||
If drT("ClaveTipoRemolque2").ToString <> "" Then
|
||||
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
|
||||
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2").ToString, .Placa = drT("PlacaRemolque2").ToString}
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
|
||||
End If
|
||||
|
||||
@@ -582,7 +582,7 @@ Public Class Timbres
|
||||
.UUIDComercioExt = ""
|
||||
}
|
||||
|
||||
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
|
||||
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal * drr("Cantidad").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToEntero}
|
||||
conceptoCarta.DetalleMercancia = DetalleMercancia
|
||||
|
||||
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
|
||||
|
||||
@@ -75,7 +75,7 @@ Namespace SIG
|
||||
'dr("CveComplementoPagoTimbre") = CveComplementoPagoTimbre
|
||||
dr("FolioTimbre") = Folio
|
||||
dr("CveComplementoPagoSinc") = CveComplementoPagoSinc
|
||||
If Not Banco.BlockComplementodePago(dr("CveIE").ToString().ToEntero(), 1, CveComplementoPagoSinc) Then
|
||||
If Not Banco.BlockComplementodePago(dr("CveIE").ToString().ToEntero(), True, CveComplementoPagoSinc) Then
|
||||
thencommit = False
|
||||
Exit For
|
||||
End If
|
||||
@@ -113,7 +113,7 @@ Namespace SIG
|
||||
Dim continuar As Boolean = True
|
||||
For Each dr As System.Data.DataRow In dt.Rows
|
||||
If continuar AndAlso dr("Sincronizado").ToString() <> "1" Then
|
||||
If dr("SeTimbro").ToString() = 1 Then
|
||||
If dr("SeTimbro").ToString() = "1" Then
|
||||
Dim CveComplementoPagoTimbre As Integer
|
||||
Try
|
||||
Using ArchivoW As New IO.StreamWriter(String.Format("{0}\{1}.xml", rutaxml, dr("FolioFiscalTimbre").ToString()), True, System.Text.Encoding.UTF8)
|
||||
@@ -127,10 +127,10 @@ Namespace SIG
|
||||
continuar = False
|
||||
End Try
|
||||
If continuar Then
|
||||
CveComplementoPagoTimbre = objbancos.AddComplementoPago(dr("CveIE").ToString().ToEntero(), -1, "Pag", dr("FolioTimbre"), Me.CveUsuario, CveEmpresa, CvePrePoliza:=-1, Estatus:=1)
|
||||
CveComplementoPagoTimbre = objbancos.AddComplementoPago(dr("CveIE").ToString().ToEntero(), -1, "Pag", dr("FolioTimbre").ToString.ToEntero, Me.CveUsuario, CveEmpresa, CvePrePoliza:=-1, Estatus:=1)
|
||||
continuar = CveComplementoPagoTimbre > 0
|
||||
End If
|
||||
If continuar Then continuar = objbancos.UpdateComplementoPago(CveComplementoPagoTimbre, dr("FolioFiscalTimbre").ToString(), "4.0", dr("CvePAC").ToString().ToEntero(), CveEmpresa)
|
||||
If continuar Then continuar = objbancos.UpdateComplementoPago(CveComplementoPagoTimbre, dr("FolioFiscalTimbre").ToString(), dr("CvePAC").ToString().ToEntero(), "4.0", CveEmpresa)
|
||||
If continuar Then
|
||||
dr("Sincronizado") = 1
|
||||
End If
|
||||
|
||||
@@ -45,7 +45,7 @@ Public Class WsRespaldos
|
||||
Dim Lista As New List(Of String)
|
||||
Dim NO_SCAN As String()
|
||||
|
||||
NO_SCAN = EXCEP.Split(New Char() {","})
|
||||
NO_SCAN = EXCEP.Split(New Char() {","c})
|
||||
|
||||
Lista = EscanearDirectorio(PATH, New List(Of String), NO_SCAN)
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ Namespace Sigfox
|
||||
Dim TipoDato As New JObject()
|
||||
Dim Titulo As String = ""
|
||||
For Each dato As XmlNode In node.ChildNodes
|
||||
Dim arreglo = dato.InnerXml.Split(":")
|
||||
Dim arreglo = dato.InnerXml.Split(":"c)
|
||||
|
||||
If dato Is node.ChildNodes(0) AndAlso arreglo(0) = "Tipo de Dato" Then
|
||||
Titulo = String.Format("Tipo-{0}", arreglo(1))
|
||||
|
||||
@@ -1861,153 +1861,8 @@ Namespace Extensiones
|
||||
ObjIE.Dispose()
|
||||
|
||||
'cuando es cheque
|
||||
If Folio <> "" AndAlso CveTipoTransaccion = 1 Then
|
||||
'Try
|
||||
|
||||
' Dim TC As Double = 1
|
||||
' Dim Excel As msExcel.Application = New msExcel.Application()
|
||||
' Dim VB_Module As VBComponent = Nothing
|
||||
' Excel.Visible = True
|
||||
' Excel.ScreenUpdating = True
|
||||
' Excel.DisplayAlerts = True
|
||||
|
||||
' If Not IO.File.Exists(String.Format("{0}Cheques\", Ruta)) Then IO.Directory.CreateDirectory(String.Format("{0}Cheques\", Ruta))
|
||||
|
||||
' If Not IO.File.Exists(Ruta & FormatoCheque) Then
|
||||
' IO.File.Copy(String.Format("{0}Empresas\Grales\Cheque.xlsm", ModExtensiones.DirectorioBaseEmpresas), Ruta & FormatoCheque, False)
|
||||
' End If
|
||||
|
||||
' Dim ArchivoBase As New System.IO.FileInfo(Ruta & FormatoCheque)
|
||||
' If Not IO.Directory.Exists(String.Format("{0}Formatos\", Ruta)) Then IO.Directory.CreateDirectory(String.Format("{0}Formatos\", Ruta))
|
||||
' ArchivoBase.CopyTo(String.Format("{0}Formatos\{1}.xlsm", Ruta, pCveIE), True)
|
||||
' Dim ArchivoTemp As New System.IO.FileInfo(String.Format("{0}Formatos\{1}.xlsm", Ruta, pCveIE))
|
||||
|
||||
|
||||
' Dim Libro As msExcel.Workbook = Excel.Workbooks.Open(ArchivoTemp.FullName, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
|
||||
' Libro.Activate()
|
||||
|
||||
' Dim Hoja As msExcel.Worksheet = CType(Libro.Worksheets(1), Microsoft.Office.Interop.Excel.Worksheet)
|
||||
' Hoja.Visible = Microsoft.Office.Interop.Excel.XlSheetVisibility.xlSheetVisible
|
||||
' Hoja.Activate()
|
||||
' Try
|
||||
|
||||
' Hoja.Range("B1:B1").Value = If(tCveEmpresa.Contiene(48, 66), AbonoCuenta, "")
|
||||
' Hoja.Range("G1:G1").Value = FechaExpedicion.ToString("yyyy-MM-dd")
|
||||
' Hoja.Range("B3:B3").Value = PagueseA
|
||||
' Hoja.Range("G3:G3").Value = Importe.ToString("N2")
|
||||
' 'Generales
|
||||
|
||||
' Hoja.Range("B4:B4").Value = TextoImporte.ToUpper
|
||||
' Hoja.Range("C6:C6").Value = Folio
|
||||
' Hoja.Range("D1:D1").Value = Folio
|
||||
' Hoja.Range("B7:B7").Value = Observacion
|
||||
' 'Hoja.Range("C10:C10").Value = UsuarioRegistro
|
||||
|
||||
|
||||
' 'Movimientos del IE
|
||||
' If tIdPoliza > 0 Then
|
||||
' Dim ObjConta As New ClsContPAQi(tEmpresa)
|
||||
' If ObjConta.GetPoliza(tIdPoliza, -1, -1, -1, -1) Then
|
||||
' DtMovimientosPoliza = ObjConta.DtResultados
|
||||
|
||||
' End If
|
||||
|
||||
' ObjConta.Dispose()
|
||||
' End If
|
||||
|
||||
' If DtMovimientosPoliza IsNot Nothing AndAlso DtMovimientosPoliza.Rows.Count > 0 Then
|
||||
' VB_Module = CType(Libro.VBProject.VBComponents.Add(Microsoft.Vbe.Interop.vbext_ComponentType.vbext_ct_StdModule), VBComponent)
|
||||
' VB_Module.CodeModule.AddFromString(GetMacro)
|
||||
|
||||
' 'Hoja.Range("A8:A8").Value = "Cuenta"
|
||||
' 'Hoja.Range("C8:C8").Value = "Nombre"
|
||||
' 'Hoja.Range("E8:E8").Value = "Debe"
|
||||
' 'Hoja.Range("G8:G8").Value = "Haber"
|
||||
|
||||
' Dim CeldaI As Integer = 9
|
||||
' Dim CeldaF As Integer = 9
|
||||
' Dim TotalDebe, TotalHaber As Double
|
||||
' TotalDebe = DtMovimientosPoliza.SUM("Cargo")
|
||||
' TotalHaber = DtMovimientosPoliza.SUM("Abono")
|
||||
|
||||
' 'Conceptos
|
||||
' For Each Row As DataRow In DtMovimientosPoliza.Rows
|
||||
' Hoja.Range(String.Format("A{0}:A{0}", CeldaF)).Value = Row("CODIGO").ToString
|
||||
' Hoja.Range(String.Format("C{0}:C{0}", CeldaF)).Value = Row("Cuenta").ToString
|
||||
' Hoja.Range(String.Format("E{0}:E{0}", CeldaF)).Value = Row("Cargo").ToString.FormatoNumero
|
||||
' Hoja.Range(String.Format("G{0}:G{0}", CeldaF)).Value = Row("Abono").ToString.FormatoNumero
|
||||
|
||||
' 'Suma Totales
|
||||
' 'TotalDebe += Row("Cargo").ToString.ToDouble
|
||||
' 'TotalHaber += Row("Abono").ToString.ToDouble
|
||||
|
||||
' 'LIMITE DE CONCEPTOS
|
||||
' If CeldaF - CeldaI + 1 = 25 Then
|
||||
' Exit For
|
||||
' End If
|
||||
' CeldaF += 1
|
||||
' 'If DtMovimientosPoliza.Rows.Count > 1 AndAlso CeldaF - CeldaI < DtMovimientosPoliza.Rows.Count - 1 Then
|
||||
' ' CeldaF = CeldaF + 1
|
||||
' ' Libro.Application.Run("AddRow", (CeldaF - 1).ToString, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing,
|
||||
' ' missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
|
||||
' ' Libro.Save()
|
||||
' ' Libro.Application.DisplayAlerts = False
|
||||
' ' Libro.Application.ScreenUpdating = False
|
||||
' 'End If
|
||||
' Next
|
||||
|
||||
' 'Totales
|
||||
' 'Hoja.Range(String.Format("E{0}:E{0}", CeldaF + 3)).Value = TotalDebe.ToString.FormatoNumero
|
||||
' 'Hoja.Range(String.Format("G{0}:G{0}", CeldaF + 3)).Value = TotalHaber.ToString.FormatoNumero
|
||||
' Hoja.Range("E39:E39").Value = TotalDebe.ToString.FormatoNumero
|
||||
' Hoja.Range("G39:G39").Value = TotalHaber.ToString.FormatoNumero
|
||||
|
||||
' End If
|
||||
|
||||
' If Not IO.Directory.Exists(String.Format("{0}PDF\", Ruta)) Then IO.Directory.CreateDirectory(String.Format("{0}PDF\", Ruta))
|
||||
|
||||
' 'Exportar PDF
|
||||
' Dim pdfFileOut As String = String.Format("{0}PDF\Chq-{1}.pdf", Ruta, pCveIE)
|
||||
' Dim outputFileName As Object = pdfFileOut
|
||||
' Dim fileFormat As msExcel.XlFixedFormatType = msExcel.XlFixedFormatType.xlTypePDF
|
||||
' Libro.ExportAsFixedFormat(fileFormat, outputFileName, missing, missing, missing, missing, missing, missing, missing)
|
||||
' Catch ex As Exception
|
||||
' Dim Msgerr As String = ""
|
||||
' Msgerr.Alert(String.Format("Ocurrió un error {0}", ex.Message), TipoMensaje.MsgError)
|
||||
' End Try
|
||||
|
||||
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Hoja)
|
||||
' Hoja = Nothing
|
||||
' Dim saveChanges As Object = msExcel.XlSaveAction.xlDoNotSaveChanges
|
||||
' CType(Libro, msExcel._Workbook).Close(saveChanges, missing, missing)
|
||||
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Libro)
|
||||
' Libro = Nothing
|
||||
' Excel.Quit()
|
||||
' System.Runtime.InteropServices.Marshal.ReleaseComObject(Excel)
|
||||
' Excel = Nothing
|
||||
' GC.Collect()
|
||||
' GC.WaitForPendingFinalizers()
|
||||
|
||||
' ArchivoTemp.Delete()
|
||||
|
||||
' If MuestraAlert Then
|
||||
' Dim Descargas As New StringBuilder()
|
||||
' Descargas.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Empresas/{0}/PDF/Chq-{1}.pdf?{2}"">Cheque</a></li>", tCveEmpresa, pCveIE, Now.Ticks)
|
||||
' Descargas.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Bancos/Reportes.aspx?Opcion=ImprimeMov&CveIE={0}"">Listado</a></li>", pCveIE)
|
||||
' If IDPoliza > 0 Then Descargas.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Póliza</a></li>", IDPoliza)
|
||||
|
||||
' Dim Msg As String = String.Format("<br />El Documento se generó correctamente.<br /><br /><br />Descargas:<ul>{0}</ul>", Descargas.ToString) 'TipoMensaje.MsgInformacion
|
||||
' '
|
||||
' Msg.Alert(Msg, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}""", HttpContext.Current.Request.Url.AbsoluteUri))
|
||||
' End If
|
||||
|
||||
|
||||
'Catch ex As Exception
|
||||
|
||||
' Dim Msg As String = "No se pudo generar el documento."
|
||||
' Msg.OnError(Msg, ex, "CveIE=" & pCveIE)
|
||||
|
||||
'End Try
|
||||
If Folio <> "" AndAlso CveTipoTransaccion = 1 Then
|
||||
|
||||
Else
|
||||
Dim RFC As String = ""
|
||||
Dim Correo As String = ""
|
||||
|
||||
@@ -548,7 +548,7 @@ Public Class wsSIG
|
||||
End Function
|
||||
|
||||
<WebMethod()>
|
||||
Public Function ProspectosGet2(CveProspecto As Integer, Nombres As Integer, CveEmpresa As Integer, CveVendedor As Integer) As DataTable
|
||||
Public Function ProspectosGet2(CveProspecto As Integer, Nombres As String, CveEmpresa As Integer, CveVendedor As Integer) As DataTable
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim Str As New StringBuilder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user