diff --git a/Ashx/SIGFacturacion.ashx b/Ashx/SIGFacturacion.ashx
index 5f4fb1591..d016019c6 100644
--- a/Ashx/SIGFacturacion.ashx
+++ b/Ashx/SIGFacturacion.ashx
@@ -763,7 +763,7 @@ Public Class SIGFacturacion : Implements IHttpHandler, IRequiresSessionState
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer) As Byte()
- Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1", CveVenta))))
+ Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", ClsPaginas.UrlSitio, Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 7a2b5318c..3b46b208e 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -2352,7 +2352,6 @@ Partial Class Bancos_IE
Dim tCveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero
Dim tImporteMonedaExtranjera As Decimal = 0
If tCveMoneda <> 1 Then tImporteMonedaExtranjera = TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal
- If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = TxtFolio.Text.ToEntero 'cheque
Dim PagueseA = ""
If HdnCveCliente.Value.ToEntero > 0 Then
@@ -2372,23 +2371,21 @@ Partial Class Bancos_IE
End If
If MsgError = "" Then
- CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
- 'valida prepoliza
- If CvePrePoliza > 0 Then
- Dim Folio As String = ""
- CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero,
+
+ CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, PagueseA, TxtImporte.Text.Trim.ToDouble, DdlMoneda.SelectedValue.ToEntero,
TxtTipoCambio.Text.Trim.ToDouble, TxtObservaciones.Text.Trim, TxtNotificarA.Text.Trim, ChkAbonoCuenta.Checked, ChkAplicaImpuestos.Checked, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaDeposito:=CveCuentaDeposito, CveEstatusIE:=DdlEstatusIE.SelectedValue.ToString.ToEntero, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1))
- If ObjIE.GetBancosIE(CveIE, UsuarioActual.CveEmpresa) Then
- Folio = ObjIE.Folio
- End If
+ If CveIE > 0 Then
- Dim Conc As String = If(TxtObservaciones.Text = "", Folio, TxtObservaciones.Text)
- Dim Ref As String = If(TxtObservaciones.Text = "", Folio, TxtObservaciones.Text)
+ If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque
+ CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
- If CveIE > 0 Then
+ 'valida prepoliza
+ If CvePrePoliza > 0 Then
+ Dim Conc As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text)
+ Dim Ref As String = If(TxtObservaciones.Text = "", ObjIE.Folio, TxtObservaciones.Text)
If Comprobante <> "" Then
ComprobanteIE = $"{CveIE}.{Comprobante}"
@@ -2467,7 +2464,7 @@ Partial Class Bancos_IE
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
importeMovimiento = 0
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
- Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", TxtFolio.Text)
+ Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio)
Select Case ConceptoContable
@@ -2567,7 +2564,7 @@ Partial Class Bancos_IE
Dim ImporteAplicar = 0.0D
Dim ImporteAplicarMN = 0.0D
Dim ImporteAplicarME = 0.0D
- Dim ReferenciaAplicar = Folio
+ Dim ReferenciaAplicar = ObjIE.Folio
Dim ConceptoAplicar = $"Devolución al cliente {PagueseA} {TxtImporte.Text} NC:{SerieFolioDevDin}"
ImporteAplicar = TxtImporte.Text.ToDecimal
@@ -2648,7 +2645,7 @@ Partial Class Bancos_IE
Dim ImporteAplicar = 0.0D
Dim ImporteAplicarMN = 0.0D
Dim ImporteAplicarME = 0.0D
- Dim ReferenciaAplicar = Folio
+ Dim ReferenciaAplicar = ObjIE.Folio
Dim ConceptoAplicar = $"Devolución de Proveedor {PagueseA} {TxtImporte.Text} NC:{SerieFolioDeCDin}"
@@ -2888,7 +2885,7 @@ Partial Class Bancos_IE
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
importeMovimiento = 0
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
- Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", TxtFolio.Text)
+ Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio)
Select Case ConceptoContable
@@ -3043,11 +3040,11 @@ Partial Class Bancos_IE
If DdlTipoTransaccion.SelectedValue = "1" Then TipoChq = "CHQ"
ConceptoRenglon = String.Format("Anticipo {0}", PagueseA)
- IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, Folio, TipoChq)
+ IDPoliza = Conta.AddPoliza(2, ConceptoRenglon, Total, Total, UsuarioActual.CveUsuario, Fecha, ObjIE.Folio, TipoChq)
If IDPoliza > 0 Then
FolioPoliza = Conta.Folio
- Referencia = Folio
+ Referencia = ObjIE.Folio
ConceptoRenglon = String.Format("Anticipo {0} {1}", PagueseA, TxtObservaciones.Text)
Total = TxtImporte.Text.ToDouble
@@ -3080,11 +3077,13 @@ Partial Class Bancos_IE
End If
Else
- MsgError = "No se insertó el encabezado"
+ MsgError = "No se pudo insertar la póliza"
End If
+
Else
- MsgError = "No se pudo insertar la póliza"
+ MsgError = "No se insertó el encabezado"
End If
+
End If
Else
diff --git a/Compras/RepRembolsoComprobaciones.aspx.vb b/Compras/RepRembolsoComprobaciones.aspx.vb
index efc17754c..b3484860e 100644
--- a/Compras/RepRembolsoComprobaciones.aspx.vb
+++ b/Compras/RepRembolsoComprobaciones.aspx.vb
@@ -160,10 +160,17 @@ Partial Class Compras_RepRembolsoComprobaciones
Private Sub LbkUnificar_Click(sender As Object, e As EventArgs) Handles LbkUnificar.Click
Dim ObjComp As New ClsCompras()
Dim ObjMov As New ClsContabilidad(ObjComp.IniciaTransacSQL)
+ Dim ObjAC As ClsContPAQi = Nothing
+ If UsuarioActual.Empresa.UsaAC Then
+ ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
+ ObjAC.IniciaTransacSQL()
+ End If
Dim TieneError = False
Dim CvePrePoliza As Integer = 0
+ Dim IdPoliza As Integer = 0
+ Dim Msg As New StringBuilder
- CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, txtfechaUnificacion.text.trim.todate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
+ CvePrePoliza = ObjMov.AddPrePolizas("Compras/Registrar", 1, DtDatos(0)("Original").ToString.ToDecimal, DtDatos(0)("Original").ToString.ToDecimal, CveMoneda, TxtFechaUnificacion.Text.Trim.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
If CvePrePoliza > 0 AndAlso DdlPersonal.SelectedValue.ToEntero > 0 Then
If Not ObjComp.UnificarComprasPersonal(CvePrePoliza, DdlPersonal.SelectedValue.ToEntero, -1, TxtNumeroReembolso.Text, UsuarioActual.CveEmpresa) Then
@@ -187,17 +194,43 @@ Partial Class Compras_RepRembolsoComprobaciones
End If
End If
+ If Not TieneError Then
+ Msg.AppendFormat("Se unificaron todas las compras con éxito")
+ End If
+
+ If UsuarioActual.Empresa.UsaAC AndAlso Not TieneError Then
+ If ObjAC Is Nothing Then
+ TieneError = True
+ Return
+ End If
+
+ If Not ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
+ TieneError = True
+ Alert($"Ocurrio un error al contabilizar {ObjMov.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
+ Else
+ IdPoliza = ObjMov.ContaIdPoliza
+ End If
+
+ If IdPoliza > 0 AndAlso Not TieneError Then
+ Msg.AppendFormat("
Ver Póliza", IdPoliza)
+ End If
+
+ End If
+
If Not TieneError Then
ObjComp.Commit()
- Alert("Se unificaron todas las compras con éxito", TipoMensaje.MsgInformacion)
+ If ObjAC IsNot Nothing Then ObjAC.Commit()
+ Alert(Msg.ToString, TipoMensaje.MsgInformacion)
Else
ObjComp.RollBack()
+ If ObjAC IsNot Nothing Then ObjAC.RollBack()
Alert("Ocurrió un error al unificar las compras", TipoMensaje.MsgAdvertencia)
End If
ObjComp.Dispose()
ObjMov.Dispose()
+ If ObjAC IsNot Nothing Then ObjAC.Dispose()
End Sub
#Region " CARGA DATOS "
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 8f60dce37..f3a8526a7 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -8186,8 +8186,9 @@ Partial Class Ventas
Else
'SI LA FACTURA VIENE DE SER CANCELADA SISTEMA CUANDO SE REFACTURO NO HAY QUE RELACIONAR
- If CveEstatusFacturaPadre <> 4 Then
+ If (CveEstatusFacturaPadre > 0 AndAlso CveEstatusFacturaPadre <> 4) OrElse (DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0) Then
If Obj.CveTipoRelacion > 0 Then
+
Select Case Obj.CveTipoRelacion
Case 1
Timbre.CFDIRelacionados.TipoRelacion = "01"
diff --git a/localhost.sln b/localhost.sln
deleted file mode 100644
index 57e824a65..000000000
--- a/localhost.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost", "http://localhost", "{82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}"
- ProjectSection(WebsiteProperties) = preProject
- SccProjectName = ""$/localhost", CAAAAAAA"
- SccAuxPath = ""
- SccLocalPath = "."
- SccProvider = "MSSCCI:Microsoft Visual SourceSafe"
- UseIISExpress = "false"
- TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.6"
- Debug.AspNetCompiler.VirtualPath = "/localhost"
- Debug.AspNetCompiler.PhysicalPath = "..\SIGIT\"
- Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\"
- Debug.AspNetCompiler.Updateable = "true"
- Debug.AspNetCompiler.ForceOverwrite = "true"
- Debug.AspNetCompiler.FixedNames = "false"
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.VirtualPath = "/localhost"
- Release.AspNetCompiler.PhysicalPath = "..\SIGIT\"
- Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost\"
- Release.AspNetCompiler.Updateable = "true"
- Release.AspNetCompiler.ForceOverwrite = "true"
- Release.AspNetCompiler.FixedNames = "false"
- Release.AspNetCompiler.Debug = "False"
- SlnRelativePath = "..\SIGIT\"
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {82D0C8D1-3CF5-471D-92AF-71A9AE4B4335}.Debug|Any CPU.Build.0 = Debug|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {B4590109-7BF9-411C-A1AE-792C02707CE6}
- EndGlobalSection
-EndGlobal