diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb
index 063d14778..5db814ec3 100644
--- a/AF/AF.aspx.vb
+++ b/AF/AF.aspx.vb
@@ -2498,7 +2498,7 @@ Partial Class AF_AF
FechaBaja:=FechaBaja, Lat:=TxtLatitud.Text, Longi:=TxtLongitud.Text, AgroCuenta:=TxtAgroCuenta.Text) > 0 Then
ViewState("CveActivoFijo") = ObjAF.CveActivoFijo
GlobalDTActivoFijos(UsuarioActual.CveEmpresa) = Nothing
- If UsuarioActual.Empresa.TipoContabilidad = 1 Then
+ If UsuarioActual.Empresa.TipoContabilidad = 1 AndAlso DdlCtaContable.SelectedValue.ToEntero > 0 Then
If Not ObjContabilidad.AddCuentasAsignaciones(49, UsuarioActual.CveEmpresa, CveCuenta:=DdlCtaContable.SelectedValue.ToEntero, CveActivoFijo:=ObjAF.CveActivoFijo) Then
ErrorGuardar = True
End If
diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb
index 81d76146e..b662d915d 100644
--- a/App_Code/ClsBancos.vb
+++ b/App_Code/ClsBancos.vb
@@ -1806,7 +1806,14 @@ Public Class ClsBancos
' Me.OnError("Ocurrió un error al guardar los cambios en el Banco", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
- OnError("Ocurrió un error al cancelar el movimiento en bancos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+
+ If ex.Message.Contains("El Movimiento no se puede eliminar porque tiene una cancelación relacionada") Then
+ OnError("El Movimiento no se puede eliminar porque tiene una cancelación relacionada, se tiene que eliminar primero la cancelación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ Else
+ OnError("Ocurrió un error al eliminar el movimiento en bancos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End If
+
+
End Try
Return Retorno
diff --git a/App_Code/ClsContPAQi.vb b/App_Code/ClsContPAQi.vb
index 4b81efaff..818c0babc 100644
--- a/App_Code/ClsContPAQi.vb
+++ b/App_Code/ClsContPAQi.vb
@@ -3099,6 +3099,33 @@ Public Class ClsContPAQi
End Function
+ Public Function UpdateMovimientoPrePolizaDetalle(IdPoliza As Integer, IdMovto As Integer, CvePrePolizaDetalle As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ StrSQL.Clear()
+
+ StrSQL.Append(" update mp set CvePrePolizaDetalle = @CvePrePolizaDetalle FROM MovimientosPoliza mp WHERE Id = @pId; ")
+
+ SqlDataAdapter(StrSQL.ToString, CommandType.Text)
+
+ With SqlAdapter.SelectCommand.Parameters
+
+ .Add("@CvePrePolizaDetalle", SqlDbType.Int).Value = CvePrePolizaDetalle
+ .Add("@pIdPoliza", SqlDbType.Int).Value = IdPoliza
+ .Add("@pId", SqlDbType.Int).Value = IdMovto
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un Error al actualizar la Póliza.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
Public Function RemoveMovimiento(Id As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 18b04303a..cb0596ad0 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -1279,6 +1279,27 @@ Public Class ClsContabilidad
End Try
Return Retorno
End Function
+ Public Function UpdateContabilizable(CvePrePolizaDetalle As Integer, Contabilizar As Boolean) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Conta_PrePolizasContabilizableUpdate")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePrePolizaDetalle", SqlDbType.Int).Value = CvePrePolizaDetalle
+ .Add("@Contabilizar", SqlDbType.Bit).Value = If(Contabilizar, 1, 0)
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+
+ Retorno = True
+ Catch ex As Exception
+ If ex.Message.Contains("50015;") Then
+ OnError("No se puede actualizar una póliza en un ejercicio Cerrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+
+ Else
+ OnError("Ocurrió un error al contabilizar las prepoliza detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ End Try
+ Return Retorno
+ End Function
Public Function ContabilizarPrePoliza(CvePrePoliza As Integer, CveUsuario As Integer, Empresa As Empresa, Optional Fecha As Date = MinFecha, Optional Concepto As String = "",
Optional ObjConta As ClsContPAQi = Nothing, Optional pIDPoliza As Integer = -1) As Boolean
@@ -1286,7 +1307,7 @@ Public Class ClsContabilidad
Dim Retorno As Boolean = False
Dim OcurrioError As Boolean = False
- StrLog.AppendFormat("CvePrep:{0} - Inicio -", CvePrePoliza)
+ StrLog.AppendFormat("CvePrep:{0} - CveE:{1} - Inicio -", CvePrePoliza, Empresa.CveEmpresa)
If Empresa.TipoContabilizacion = 1 Then ' contabilidad en SIG
@@ -6403,8 +6424,9 @@ Public Class ClsContabilidad
Dim MsgPrePoliza As String = SqlAdapter.SelectCommand.Parameters("@MsgPrePolizaSalida").Value.ToString
If MsgPrePoliza <> "" Then MsgPrePoliza.GuardaLogAD("LogPrePoliza")
- If MensajePolizaDescuadre = "" AndAlso AutoConta Then
- If UsuarioActual.Empresa.TipoContabilidad = 2 Then ' el tipocontabilidad deberá activarse en el PA
+ If MensajePolizaDescuadre = "" Then
+ ' el tipocontabilidad 1. deberá activarse en el PA, solo aplica para conta contpaq y que no tenga activada el no contabilzar automática
+ If AutoConta AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso Not UsuarioActual.Empresa.Funcionalidad(224) = "1" Then
If Not ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjConta) Then
MensajePolizaDescuadre = Mensaje.ToString ' regresa el mensaje de contabilización
Retorno = False
diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb
index 4bfc60525..3bc8643af 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -3405,14 +3405,15 @@ Public Class ClsNominas
End Function
#Region "Visor sat"
- Public Function SATSolicitudTimbreNominaGral(IDsolicitud As Integer, cveEmpresa As Integer, fechaInicio As String, fechaFin As String, TipoNomina As Integer) As Boolean
+ Public Function SATSolicitudTimbreNominaGral(IDsolicitud As Integer, CveEmpresa As Integer, FechaInicio As Date, FechaFin As Date, TipoNomina As Integer, RegimenContratacion As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("[PA_SAT_SolicitudTimbreNominaGral]", CommandType.StoredProcedure)
addParameters("@IDsolicitud", SqlDbType.Int, IDsolicitud)
addParameters("@TipoNomina", SqlDbType.Int, TipoNomina)
- addParameters("@CveEmpresa", SqlDbType.Int, cveEmpresa)
- addParameters("@FechaInicio", SqlDbType.VarChar, fechaInicio)
- addParameters("@FechaFin", SqlDbType.VarChar, fechaFin)
+ addParameters("@CveEmpresa", SqlDbType.Int, CveEmpresa)
+ addParameters("@FechaInicio", SqlDbType.Date, FechaInicio)
+ addParameters("@FechaFin", SqlDbType.Date, FechaFin)
+ addParameters("@RegimenContratacion", SqlDbType.Int, RegimenContratacion)
retorno = RunQuery("Ocurrió un error al obtener el Calculo ISR anual.")
Return retorno
End Function
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index f1f164ec2..4757d6158 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -3519,6 +3519,33 @@ Public Class ClsPaginas
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
+
+ Public Shared Property GlobalDTContaCuentasContables(CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Afectable As Integer = -1, Optional CvePadre As Integer = -1) As DataTable
+ Get
+ Dim AppNombre As String = $"GlobalDTContaCuentasContables-{CveEmpresa}"
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Using ObjContabilidad As New ClsContabilidad
+ If ObjContabilidad.GetCuentas(-1, "-1", -1, CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjContabilidad.DtResultados Else HttpContext.Current.Application(AppNombre) = Nothing
+ End Using
+ End If
+ Dim filtros As New List(Of String)
+ If Codigo <> "-1" Then filtros.Add($"Codigo = '{Codigo}'")
+ If Afectable <> -1 Then filtros.Add($"Afectable = {Afectable}")
+ If CvePadre <> -1 Then filtros.Add($"CvePadre = {CvePadre}")
+ If filtros.Count > 0 Then
+ Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
+ GlobalDTContaCuentasContables = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTContaCuentasContables = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = $"GlobalDTContaCuentasContables-{CveEmpresa}"
+ HttpContext.Current.Application(AppNombre) = value
+ End Set
+ End Property
+
#End Region
#Region "**********************************************************************GLOBAL DT RH (RECURSOS HUMANOS)********************************************************************"
Property GlobalDTAsistenciaDetalle() As DataTable
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 776206141..d198effdb 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -1343,7 +1343,7 @@ Public Class ClsVentas
CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1,
Optional CveContratoDetalle As Integer = -1, Optional PorcentajeIVA As Decimal = 0, Optional IEPS As Double = -1, Optional PorcentajeIEPS As Double = 0, Optional CvePromocionDetalle As Integer = -1,
Optional CveMovimientoDetallePedido As Integer = -1, Optional ImporteRetIVA As Double = 0, Optional PorcentajeRetIVA As Double = 0,
- Optional ImporteRetISR As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean
+ Optional ImporteRetISR As Double = 0, Optional PorcentajeRetISR As Double = 0, Optional CuentaPredial As String = "", Optional CvePrecioLista As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional NumTurnos As Decimal = 0D) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_VentasDetalleAdd")
@@ -1375,6 +1375,7 @@ Public Class ClsVentas
.Add("@CuentaPredial", SqlDbType.VarChar).Value = CuentaPredial
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
+ .Add("@NumTurnos", SqlDbType.Decimal).Value = NumTurnos
End With
Try
diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb
index 50079a832..baed693a2 100644
--- a/App_Code/LogicNominas.vb
+++ b/App_Code/LogicNominas.vb
@@ -190,7 +190,7 @@ Public Class LogicNominas
If continuar AndAlso objPersonal.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa) AndAlso objPersonal.DtResultados.Rows.Count > 0 Then
RFC = objPersonal.RFC
cfdi.Emisor.RegistroPatronal = objPersonal.DtResultados.Rows(0)("RegistroPatronal").ToString()
- NombreCompleto = String.Format("{0} {1} {2}", objPersonal.Nombres, objPersonal.APaterno, objPersonal.AMaterno)
+ NombreCompleto = String.Format("{0} {1} {2}", objPersonal.Nombres, objPersonal.APaterno, objPersonal.AMaterno).Trim()
CodigoPostal = objPersonal.CP
Sindicalizado = objPersonal.DtResultados.Rows(0)("Sindicalizado").ToString().ToUpper().Contiene("TRUE", "1")
CURP = objPersonal.CURP
diff --git a/Bancos/FluctuacionCambiaria.aspx b/Bancos/FluctuacionCambiaria.aspx
index d222aa756..583d93be8 100644
--- a/Bancos/FluctuacionCambiaria.aspx
+++ b/Bancos/FluctuacionCambiaria.aspx
@@ -730,7 +730,7 @@
-
@@ -1773,11 +1739,23 @@
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
function ValidarCantidad(t, c) {
var Ot = 0.00;
+ debugger;
// considera importe de OT ingresos, para que se peuda exceder
if ($get('TxtOtrosIngresosEgresos')) { Ot = ToDouble($get('TxtOtrosIngresosEgresos').value); }
t.value = (ToDouble(t.value) > ToDouble(c) + Ot ? c : t.value)
}
+ function ValidarCantidadDev(s) {
+ var Ot = 0.00;
+ var Dev = 0.00;
+ debugger; //valida importe
+ if ($get('TxtDevolución') && (ToDouble($get('TxtDevolución').value) > s)) $get('TxtDevolución').value = s;
+
+ // considera importe de OT ingresos, para que se peuda exceder
+ if ($get('TxtOtrosIngresosEgresos')) { Ot = ToDouble($get('TxtOtrosIngresosEgresos').value); }
+ if ($get('TxtImporte')) $get('TxtImporte').value = ToDouble($get('TxtDevolución').value) + Ot;
+ }
+
var TipoCambioActual = 0.0;
function CambiaTC(txt) {
let TipoCambioTxt = ToDouble(txt.value)
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index d944e15da..f41eb8d18 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -1504,6 +1504,8 @@ Partial Class Bancos_IE
DdlCliente.SelectedText = ObjCliente.NombreComercial
DdlCliente.SelectedValue = ObjCliente.CveCliente.ToString
DivOtrosIngresosEgresos.Visible = True
+ 'TxtImporte.ReadOnly = True
+ TxtImporte.Attributes.Add(“readonly”, “readonly”)
End If
'If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
@@ -3009,7 +3011,8 @@ Partial Class Bancos_IE
If TxtOtrosIngresosEgresos.Text.ToDecimal <> 0 Then
Dim TipoMovtoIE As Boolean = False
Dim CveConcIE As Integer = 78
- If Impo > 0 Then
+ Dim tCveSub As Integer = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto").ToEntero
+ If Impo < 0 Then
TipoMovtoIE = True
Impo = Math.Abs(Impo)
CveConcIE = 78
@@ -3021,7 +3024,7 @@ Partial Class Bancos_IE
IdCtaContableAplicar = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
End If
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=Impo, ImporteME:=0) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=Impo, ImporteME:=0, CveSubProyecto:=tCveSub) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
Exit Select
End If
@@ -3029,7 +3032,7 @@ Partial Class Bancos_IE
'CANCELA NC
IdCtaContableAplicar = IDCtaBeneficiario
- ImporteAplicar = ImporteAplicar + Impo
+ ImporteAplicar = ImporteAplicar - Impo
ImporteAplicarMN = (ImporteAplicar * If(tCveMoneda = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 12, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=-(ImporteAplicarMN), ImporteME:=ImporteAplicarME) Then
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
@@ -3658,7 +3661,7 @@ Partial Class Bancos_IE
End If
If CveConceptoCompra.Contiene(10, 338, 48, 345) Then
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, If(CveConceptoCompra = 10, 266, 340), Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, If(CveConceptoCompra = 10, 266, If(CveConceptoCompra = 345, 347, 340)), Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
End If
End If
@@ -5806,7 +5809,10 @@ Partial Class Bancos_IE
CvePrePolizaDevDin = UrlParametros("CVEPREPOLIZA").ToString.ToEntero
ImporteOriginalDevDin = UrlParametros("ORIGINAL").ToString.ToDecimal.RoundSQL(6)
TxtImporte.Text = UrlParametros("SALDO").ToString.FormatoNumero()
- TxtImporte.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidad(this,{UrlParametros("SALDO").ToString});")
+ TxtDevolución.Text = UrlParametros("SALDO").ToString.FormatoNumero()
+ 'TxtImporte.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidad(this,{UrlParametros("SALDO").ToString});")
+ TxtDevolución.Attributes.Add("onkeyup", $"FormatoMoneda(this);ValidarCantidadDev( {UrlParametros("SALDO").ToString});")
+ TxtOtrosIngresosEgresos.Attributes.Add("onkeyup", $"ValidarCantidadDev();")
TxtImporteLetra.Text = UrlParametros("SALDO").ToString.ToDouble.Texto2Letras(UrlParametros("CVEMONEDA").ToString.ToEntero)
CargaCliente(CveCliente)
'BuscarCliente()
@@ -6322,26 +6328,26 @@ Partial Class Bancos_IE
End Sub
- Private Sub LnkAjustarMovimiento_Click(sender As Object, e As EventArgs) Handles LnkAjustarMovimiento.Click
- RegistraScript("$('#ModalAjustarMovimiento').modal('show');")
- End Sub
+ 'Private Sub LnkAjustarMovimiento_Click(sender As Object, e As EventArgs) Handles LnkAjustarMovimiento.Click
+ ' RegistraScript("$('#ModalAjustarMovimiento').modal('show');")
+ 'End Sub
- Private Sub BtnAjustarMovimiento_Click(sender As Object, e As EventArgs) Handles BtnAjustarMovimiento.Click
+ 'Private Sub BtnAjustarMovimiento_Click(sender As Object, e As EventArgs) Handles BtnAjustarMovimiento.Click
- Dim ObjBanco As New ClsBancos
- ObjBanco.IniciaTransacSQL()
+ ' Dim ObjBanco As New ClsBancos
+ ' ObjBanco.IniciaTransacSQL()
- If ObjBanco.UpdateAjustarMovimiento(CveIE, TxtAjustarMovimiento.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
- ObjBanco.Commit()
- RegistraScript("$('#ModalAjustarMovimiento').modal('hide');", "ALTR")
- Alert("El ajuste se realizo correctamente.", TipoMensaje.MsgInformacion, $" document.location.href = ""./IE.aspx?CveIE={CveIE}"";")
- Else
- ObjBanco.RollBack()
- End If
+ ' If ObjBanco.UpdateAjustarMovimiento(CveIE, TxtAjustarMovimiento.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
+ ' ObjBanco.Commit()
+ ' RegistraScript("$('#ModalAjustarMovimiento').modal('hide');", "ALTR")
+ ' Alert("El ajuste se realizo correctamente.", TipoMensaje.MsgInformacion, $" document.location.href = ""./IE.aspx?CveIE={CveIE}"";")
+ ' Else
+ ' ObjBanco.RollBack()
+ ' End If
- ObjBanco.Dispose()
+ ' ObjBanco.Dispose()
- End Sub
+ 'End Sub
diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx
index 7fd632990..5c3e6548a 100644
--- a/Compras/Compras.aspx
+++ b/Compras/Compras.aspx
@@ -2407,7 +2407,7 @@
-
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 226448db9..35a212363 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1953,8 +1953,6 @@ Partial Class Compras_Compras
End If
Dim Msg As String = ""
-
-
If Version = "3.3" Or Version = "4.0" Then
If Not TmpDT.Columns.Contains("Amortizacion") Then
@@ -5204,10 +5202,6 @@ Partial Class Compras_Compras
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
- If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
- AutoConta = False
- End If
-
If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaAC.IniciaTransacSQL()
@@ -7358,35 +7352,35 @@ Partial Class Compras_Compras
End If
End If
- 'Simplificacion de PrePolizas
- If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
- If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
- ErrorPrepolizaDescuadre = True
- End If
- End If
+ ''Simplificacion de PrePolizas
+ 'If Not ErrorPrepoliza AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
+ ' If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ ' ErrorPrepolizaDescuadre = True
+ ' End If
+ 'End If
- If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
- If ObjConta.ValorPolizaDescuadre > 0 Then
- GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
- ErrorPrepolizaDescuadre = True
- End If
- End If
+ 'If Not ErrorPrepoliza AndAlso ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
+ ' If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ ' End If
+ 'End If
- 'Conta ContPAQ
- If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
- If idCuentaContabilizacion > 0 Then
- If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
- ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
- IdPoliza = ObjConta.ContaIdPoliza
- Else
- ErrorPrepoliza = True
- Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
- End If
- Else
- Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
- ErrorPrepoliza = True
- End If
- End If
+ ''Conta ContPAQ
+ 'If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
+ ' If idCuentaContabilizacion > 0 Then
+ ' If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
+ ' ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
+ ' IdPoliza = ObjConta.ContaIdPoliza
+ ' Else
+ ' ErrorPrepoliza = True
+ ' Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
+ ' End If
+ ' Else
+ ' Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
+ ' ErrorPrepoliza = True
+ ' End If
+ 'End If
End If
'' A N T I C I P O S
@@ -7698,12 +7692,17 @@ Partial Class Compras_Compras
Msg.AppendFormat($"Recibir mercancía de entrega directa.")
End If
+ Dim AutoConta As Boolean = True
+ If (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0 Or DdlTipoComprobante.SelectedValue = "Ant") Then
+ AutoConta = False
+ End If
- If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
- If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
- TieneError = True
- Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
- End If
+ If Not ErrorPrepoliza AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=4, AutoConta:=AutoConta) Then
+ TieneError = True
+ 'If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ 'End If
End If
If Not TieneError Then
@@ -16669,16 +16668,9 @@ Partial Class Compras_Compras
DdlIVA.SelectedValue = "1.08"
End Select
-
-
- 'TxtIVAModal.Text = FormatoNumero(GvRow.DataKey("IVAPorcentaje").ToDouble * 100, 0)
-
-
-
TxtRetIVAModal.Text = FormatoNumero(GvRow.DataKey("RetIVAPorcentaje").ToDouble * 100, 6)
TxtRetISRModal.Text = FormatoNumero(GvRow.DataKey("RetISRPorcentaje").ToDouble * 100, 6)
TxtIEPSModal.Text = FormatoNumero(GvRow.DataKey("IEPSPSPorcentaje").ToDouble * 100, 6)
-
ViewState("RetIVA") = GvRow.DataKey("RetIVAPorcentaje").ToDouble
ViewState("RetISR") = GvRow.DataKey("RetISRPorcentaje").ToDouble
diff --git a/Compras/eFacturas.aspx.vb b/Compras/eFacturas.aspx.vb
index 6540170f5..5464021b3 100644
--- a/Compras/eFacturas.aspx.vb
+++ b/Compras/eFacturas.aspx.vb
@@ -4866,7 +4866,36 @@ Partial Class Compras_eFacturas
End Sub
+ Protected Sub GvTraslados_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvTraslados.RowCommand
+ Dim ImgBtn As LinkButton = DirectCast(e.CommandSource, LinkButton)
+ Dim GvRow As GridViewRow = DirectCast(ImgBtn.BindingContainer, GridViewRow)
+ Dim ObjDatos As New ClsCompras
+ Dim Correcto As Boolean = False
+ Select Case e.CommandName
+ Case "ValidarCFDi"
+ Dim ObjValidacion As New ClsValidaCFDi(GvRow.DataKey("UUID"), GvRow.DataKey("RFCDe"), GvRow.DataKey("RFCPara"), 0)
+ If ObjValidacion.EsValida > 0 Then
+ If ObjValidacion.EsValida = 2 Then
+ Alert("La factura está cancelada ante el SAT.", TipoMensaje.MsgInformacion)
+ End If
+ Correcto = ObjDatos.UpdateEstatus(ObjValidacion.EsValida, GvRow.DataKey("CveFactura").ToEntero, UsuarioActual.CveEmpresa)
+ Else
+ Alert("La Factura no se pudo validar.", TipoMensaje.MsgAdvertencia)
+ End If
+ ObjValidacion.Dispose()
+ Case "ValidarCFD"
+ Correcto = ObjDatos.UpdateEstatus(1, GvRow.DataKey("CveFactura").ToEntero, UsuarioActual.CveEmpresa)
+
+ Case "Omitir"
+ Correcto = ObjDatos.UpdateEstatus(3, GvRow.DataKey("CveFactura").ToEntero, UsuarioActual.CveEmpresa)
+ End Select
+
+ ObjDatos.Dispose()
+ If Correcto Then
+ CargaDatos()
+ End If
+ End Sub
Protected Sub LnkAgregarTraslado_Click(sender As Object, e As EventArgs)
diff --git a/Contabilidad/ContabilizacionCompras.aspx.cs b/Contabilidad/ContabilizacionCompras.aspx.cs
index ce1fe858d..aed42c95a 100644
--- a/Contabilidad/ContabilizacionCompras.aspx.cs
+++ b/Contabilidad/ContabilizacionCompras.aspx.cs
@@ -106,7 +106,7 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
ClsContabilidad contP = new ClsContabilidad();
- if (contP.GetContabilizacionDiarioDetalle(CvePrePoliza))
+ if (contP.GetContabilizacionDiarioDetalle(CvePrePoliza, UsuarioActual.CveEmpresa))
{
if (contP.DtResultados.Rows.Count > 0)
{
diff --git a/Contabilidad/ContabilizacionVentas.aspx.cs b/Contabilidad/ContabilizacionVentas.aspx.cs
index d971144cb..42f262ef1 100644
--- a/Contabilidad/ContabilizacionVentas.aspx.cs
+++ b/Contabilidad/ContabilizacionVentas.aspx.cs
@@ -93,7 +93,7 @@ public partial class Contabilidad_ContabilizacionVentas : ClsPaginas
ClsContabilidad contP = new ClsContabilidad();
- if (contP.GetContabilizacionDiarioDetalle(CvePrePoliza))
+ if (contP.GetContabilizacionDiarioDetalle(CvePrePoliza,UsuarioActual.CveEmpresa))
{
if (contP.DtResultados.Rows.Count > 0)
{
diff --git a/Contabilidad/FiltraPolizas.aspx.vb b/Contabilidad/FiltraPolizas.aspx.vb
index 12c2765c1..9c0cd5495 100644
--- a/Contabilidad/FiltraPolizas.aspx.vb
+++ b/Contabilidad/FiltraPolizas.aspx.vb
@@ -308,7 +308,7 @@ Partial Class Contabilidad_FiltraPolizas
If TempPolizas.FCCheckBox("ChkPoliza").Checked Then
contador += 1
CvePrePoliza = TempPolizas.DataKey("CvePrePoliza").ToString.ToEntero
- ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
+ ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza, UsuarioActual.CveEmpresa)
TieneComprobante = VerificarComprobante(ObjContabilidad.DtResultados)
If TieneComprobante = "" And Not SinComprobante Then
diff --git a/Contabilidad/RegPrePoliza.aspx.vb b/Contabilidad/RegPrePoliza.aspx.vb
index a60d0febb..7ccb3487a 100644
--- a/Contabilidad/RegPrePoliza.aspx.vb
+++ b/Contabilidad/RegPrePoliza.aspx.vb
@@ -483,7 +483,7 @@ Partial Class ContabilidadC_RegPrePoliza
BtnEliminar.ToolTip = "No se puede eliminar al prepóliza, eliminarlos desde el módulo"
End If
- ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
+ ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza, UsuarioActual.CveEmpresa)
DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
GvPrePoliza.DataSource = DtMovimientos
diff --git a/Contabilidad/RegPrePoliza1.aspx b/Contabilidad/RegPrePoliza1.aspx
deleted file mode 100644
index 9455bf6e8..000000000
--- a/Contabilidad/RegPrePoliza1.aspx
+++ /dev/null
@@ -1,883 +0,0 @@
-<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RegPrePoliza1.aspx.vb" Inherits="ContabilidadC_RegPrePoliza" %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bancos
- Caja Chica
- F y E
- Deudores
- Acreedores
- Créditos
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Concepto:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cuenta:
-
-
-
-
-
-
-
-
Referencia:
-
-
-
-
-
-
-
Descripción:
-
-
-
-
-
-
-
- SubProyecto:
-
-
-
-
-
-
-
-
-
Tipo Gasto:
-
-
-
-
-
-
-
-
- Cargo:
-
-
-
-
-
-
-
- Abono:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Contabilidad/RegPrePoliza1.aspx.vb b/Contabilidad/RegPrePoliza1.aspx.vb
deleted file mode 100644
index 44afac00d..000000000
--- a/Contabilidad/RegPrePoliza1.aspx.vb
+++ /dev/null
@@ -1,1724 +0,0 @@
-
-
-Imports System.Data
-Imports Extensiones
-Imports System.Linq
-Imports System.Web.Services
-
-Partial Class ContabilidadC_RegPrePoliza
- Inherits ClsPaginas
-
-
-#Region "Propiedades"
- Public Property ArregloMovs As ArrayList
- Get
- Return CType(ViewState("ArregloMovs"), ArrayList)
- End Get
- Set(value As ArrayList)
- ViewState("ArregloMovs") = value
- End Set
- End Property
- Public Property DtMovimientos As DataTable
- Get
- Return CType(ViewState("DtMovimientos"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DtMovimientos") = value
- End Set
- End Property
- Public Property DtCuentasContables As DataTable
- Get
- Return CType(ViewState("DtCuentasContables"), DataTable)
- End Get
- Set(value As DataTable)
- ViewState("DtCuentasContables") = value
- End Set
- End Property
- Public Property TipoPlantilla As Integer
- Get
- Return CType(ViewState("TipoPlantilla"), Integer)
- End Get
- Set(value As Integer)
- ViewState("TipoPlantilla") = value
- End Set
- End Property
- Public Property CveMoneda As Integer
- Get
- Return CType(ViewState("CveMoneda"), Integer)
- End Get
- Set(value As Integer)
- ViewState("CveMoneda") = value
- End Set
- End Property
- Private ReadOnly Property CvePrePoliza As Integer
- Get
- Return ViewState("CvePrePoliza").ToString.ToEntero
- End Get
- End Property
-
- 'PARA CREAR IE
- Private Property CveConcepto As Integer
- Get
- Return ViewState("CveConcepto").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("CveConcepto") = value
- End Set
- End Property
- Private Property CveTipoTransaccion As Integer
- Get
- Return ViewState("CveTipoTransaccion").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("CveTipoTransaccion") = value
- End Set
- End Property
- Private Property CveCuenta As Integer
- Get
- Return ViewState("CveCuenta").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("CveCuenta") = value
- End Set
- End Property
- Private Property Folio As String
- Get
- Return ViewState("Folio").ToString
- End Get
- Set(value As String)
- ViewState("Folio") = value
- End Set
- End Property
- Private Property ImporteDocumento As Decimal
- Get
- Return ViewState("ImporteDocumento").ToString.ToDecimal
- End Get
- Set(value As Decimal)
- ViewState("ImporteDocumento") = value
- End Set
- End Property
- Private Property Observaciones As String
- Get
- Return ViewState("Observaciones").ToString
- End Get
- Set(value As String)
- ViewState("Observaciones") = value
- End Set
- End Property
- Private Property Beneficiario As String
- Get
- Return ViewState("Beneficiario").ToString
- End Get
- Set(value As String)
- ViewState("Beneficiario") = value
- End Set
- End Property
- Private Property RowIndex As Integer
- Get
- Return ViewState("RowIndex").ToString.ToEntero
- End Get
- Set(value As Integer)
- ViewState("RowIndex") = value
- End Set
- End Property
- Private Property Actualizar As Boolean
- Get
- Return CBool(ViewState("Actualizar").ToString)
- End Get
- Set(value As Boolean)
- ViewState("Actualizar") = value
- End Set
- End Property
-
- Private ReadOnly Property CvePeriodo As Integer
- Get
- Return CType(ViewState("CvePeriodo"), Integer)
- End Get
- End Property
- Private ReadOnly Property CveProyecto As Integer
- Get
- Return CType(ViewState("CveProyecto"), Integer)
- End Get
- End Property
- Private ReadOnly Property CveSubProyecto As Integer
- Get
- Return CType(ViewState("CveSubProyecto"), Integer)
- End Get
- End Property
- Private ReadOnly Property CveTurno As Integer
- Get
- Return CType(ViewState("CveTurno"), Integer)
- End Get
- End Property
- Public Property IndiceGrid As Integer
- Get
- Return CType(ViewState("IndiceGrid"), Integer)
- End Get
- Set(value As Integer)
- ViewState("IndiceGrid") = value
- End Set
- End Property
- Public Property IdPoliza As Integer
- Get
- Return CType(ViewState("IdPoliza"), Integer)
- End Get
- Set(value As Integer)
- ViewState("IdPoliza") = value
- End Set
- End Property
-
-#End Region
-
- Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
-
- If Not Page.IsPostBack Then
- CveMoneda = 1
- ViewState("CvePrePoliza") = 0
- ViewState("CvePeriodo") = "0"
- CveConcepto = -1
- CveTipoTransaccion = -1
- CveCuenta = -1
- Folio = "-1"
- ImporteDocumento = -1
- Observaciones = "-1"
- Beneficiario = "-1"
- Actualizar = False
- IdPoliza = -1
-
- If IfNull(Request("Tipo"), "").ToString = "NOMPROV" Then
- DivTipoGasto.Visible = True
- ThTipoGasto.Visible = True
- CargaTiposGasto()
- End If
-
- If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then
- ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero
- CreaDT()
- CargaPrePoliza()
- If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then
- GvPrePoliza.Columns(5).Visible = False
- DivTG.Visible = False
- GvMov.Columns(5).Visible = False
- End If
- Exit Sub
- Else
- CreaDT()
- BtnEliminar.Visible = False
- End If
-
-
- TipoPlantilla = 0
- If IfNull(Request("Tipo"), "").ToString = "Ing" Then
- TipoPlantilla = 1
- LblEncabezado.Text = "Otros Ingresos"
- End If
-
- CargaPlantillas(TipoPlantilla)
-
- If UsuarioActual.CveRol = 1 Then trNotificar.Visible = True
-
- CargaConceptos()
- CargaSubProyectos()
- CargaCuentasContables()
-
- 'crea tabla temporal
- ArregloMovs = New ArrayList
-
- CargaCuentas()
-
- If Request("CvePeriodo") IsNot Nothing AndAlso IsNumeric(Request("CvePeriodo")) AndAlso Request("CvePeriodo").ToEntero > 0 Then
- ViewState("CvePeriodo") = Request("CvePeriodo").ToEntero
- ViewState("CveProyecto") = Request("CveProyecto").ToEntero
- ViewState("CveSubProyecto") = Request("CveSubProyecto").ToEntero
- ViewState("CveTurno") = Request("CveTurno").ToEntero
-
- DdlPlantilla.Items.Add(New ListItem("Pago Nomina", "61"))
- DdlPlantilla.SelectedValue = "61"
- DdlPlantilla.Enabled = False
- DivAgregarConceptos.Visible = False
-
- CargaNomina()
-
- RegistraScript("$(document).ready(function () { calculateCargo(); Sys.Application.add_load(function (s, e) { calculateCargo(); }); } );", 1)
- RegistraScript("$(document).ready(function () { calculateAbono(); Sys.Application.add_load(function (s, e) { calculateAbono(); }); } );", 2)
- RegistraScript("$(document).ready(function () { comparar(); Sys.Application.add_load(function (s, e) { comparar(); }); } );", 3)
- End If
-
- If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then
- GvPrePoliza.Columns(4).Visible = False
- GvMov.Columns(4).Visible = False
- End If
-
-
-
- End If
-
- End Sub
-
- Private Sub CreaDT()
- DtMovimientos = New DataTable("Movimientos")
- Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True
- With DtMovimientos.Columns
- .Add("IdCuenta", Type.GetType("System.Int32"))
- .Add("CodigoCuenta", Type.GetType("System.String"))
- .Add("Cuenta", Type.GetType("System.String"))
- .Add("Referencia", Type.GetType("System.String"))
- .Add("Concepto", Type.GetType("System.String"))
- .Add("Cargo", Type.GetType("System.Double"))
- .Add("Abono", Type.GetType("System.Double"))
- .Add("TipoMovto", Type.GetType("System.Int32"))
- .Add("EsComodin", Type.GetType("System.Int32"))
- .Add("CveConcepto", Type.GetType("System.Int32"))
- .Add("CveSubProyecto", Type.GetType("System.Int32"))
- .Add("Descripcion", Type.GetType("System.String"))
- .Add("CveProveedor", Type.GetType("System.Int32"))
- .Add("CvePersonal", Type.GetType("System.Int32"))
- .Add("CveCompra", Type.GetType("System.Int32"))
- .Add("CveCliente", Type.GetType("System.Int32"))
- .Add("CveVenta", Type.GetType("System.Int32"))
- .Add("CveClasificacion", Type.GetType("System.Int32"))
- .Add("MultipleSubProyecto", Type.GetType("System.Boolean"))
- .Add("CveTipoGasto", Type.GetType("System.Int32"))
- .Add("CvePrePolizaDetalle", Type.GetType("System.Int32"))
- .Add("CveConceptoContable", Type.GetType("System.Int32"))
- .Add("IdCtaContable", Type.GetType("System.Int32"))
- .Add("ConceptoContable", Type.GetType("System.String"))
- End With
- End Sub
-
- Private Sub CargaNomina()
- Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero
- Dim ObjNomina As New ClsNominas
- Dim ObjConta As New ClsContabilidad
-
- Dim Dt As DataTable = Nothing
- Dim Cuenta As String = ""
- Dim Concepto As String = ""
- Dim IdCuenta As Integer = 0
- Dim TipoMovto As Integer
- Dim CveConcepto As Integer
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
- Dim Referencia As String = ""
- Dim EsComodin As Integer = 0
- DtMovimientos.Clear()
-
- If ObjNomina.GetProvisionNomina(CveProyecto, CveSubProyecto, CveTurno, CvePeriodo, UsuarioActual.CveEmpresa) Then
- Dt = ObjNomina.DtResultados
-
- For Each drt As DataRow In Dt.Rows
- Dim dr As DataRow = DtMovimientos.NewRow
-
- If drt("NombreCompleto").ToString = "" AndAlso ObjConta.GetRetCuenta(31, UsuarioActual.CveEmpresa) Then
- CveConcepto = 98
- Cuenta = "Nominas por Pagar"
- IdCuenta = ObjConta.DtResultados(0)("IdCtaContable").ToString.ToEntero
- Concepto = "Pago Nomina"
- Referencia = "Pago Nomina"
- Else
- Concepto = drt("NombreCompleto")
- Referencia = ""
- CveConcepto = drt("CveConceptoContable").ToString.ToEntero
- Cuenta = drt("ConceptoContable").ToString
- IdCuenta = drt("IdCtaContable").ToString.ToEntero
- End If
-
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero($"Id={IdCuenta}")
- CodigoCuenta = If(drr IsNot Nothing, drr("CuentaFormato").ToString(), "")
- NombreCuenta = If(drr IsNot Nothing, drr("Nombre").ToString(), "")
-
- TipoMovto = drt("TipoMovto")
-
- If TipoMovto = 0 Then
- dr("Cargo") = Math.Abs(drt("Importe").ToString.ToDecimal)
- dr("Abono") = 0
- Else
- dr("Cargo") = 0
- dr("Abono") = Math.Abs(drt("Importe").ToString.ToDecimal)
- End If
-
- dr("IdCuenta") = IdCuenta
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = Cuenta
- dr("Concepto") = Concepto
- dr("Descripcion") = Concepto
- dr("Referencia") = Referencia
- dr("TipoMovto") = TipoMovto
- dr("EsComodin") = EsComodin
- dr("CveConcepto") = CveConcepto
- dr("CveProveedor") = "-1"
- dr("CveSubProyecto") = drt("CveSubProyecto")
- dr("CvePersonal") = drt("CvePersonal")
- dr("CveClasificacion") = drt("CveClasificacion")
- dr("CveTipoGasto") = drt("CveTipoGasto")
-
- DtMovimientos.Rows.Add(dr)
- Next
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
- End If
-
- End Sub
-
- Private Sub CargaPrePoliza()
- BtnEliminar.Visible = True
- LblEncabezado.Text = "Edición de Póliza"
-
- Dim ObjContabilidad As New ClsContabilidad
- If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then
- Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("")
- If dr IsNot Nothing Then
- DivAgregarConceptos.Visible = False
- DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza")
- TxtFechaDocumento.Text = dr("Fecha")
- TxtConcepto.Text = dr("Concepto")
- DivDatosPoliza.Visible = True
-
- If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
- 'DivAgregarConceptos.Visible = True
- LnkAddConcepto.Visible = True
- CargaConceptos()
- CargaSubProyectos()
- CargaCuentasContables()
- End If
-
- ObjContabilidad.GetContabilizacionDiarioDetalle(CvePrePoliza)
-
- DtMovimientos = ObjContabilidad.DtResultados.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
- GvPrePoliza.DataSource = DtMovimientos
- GvPrePoliza.DataBind()
-
- If UsuarioActual.CveRol = 1 AndAlso DtMovimientos.COUNT("TC", "TC > 1") > 0 Then
- GvPrePoliza.Columns(7).Visible = True
- End If
-
- If DtMovimientos.FiltraParametros("CveConceptoContable IN (2,17)").Rows.Count > 0 Then
- LnkComplementoPago.Visible = True
- End If
-
- IdPoliza = dr("IdPoliza").ToString.ToEntero
- If dr("IdPoliza").ToString.ToEntero > 0 Then
- HplContabilizada.NavigateUrl = String.Format("RegPoliza.aspx?IdPoliza={0}", dr("IdPoliza"))
- divContabilziada.Visible = True
- BtnEliminar.Visible = False
- If UsuarioActual.CveUsuario = 100 Then
- BtnContabilizar.Visible = True
- BtnContabilizar.Text = "Actualizar Poliza"
- End If
- ElseIf TxtTotalCargos.Text.ToDouble = TxtTotalAbonos.Text.ToDouble Then
- 'sino está contabilizada, se activa el botón
- BtnContabilizar.Visible = True
- End If
-
- divDatosPrincipales.Visible = False
- divObservaciones.Visible = False
- UPMovs.Visible = False
- UPMovs.Update()
- UPPDocumento.Update()
- UpPrePoliza.Update()
-
- RegistraScript("comparar();")
-
- If Request("Tipo") IsNot Nothing AndAlso IsNumeric(Request("Tipo")) AndAlso Request("Tipo").ToEntero = 1 AndAlso UsuarioActual.CveUsuario <> 100 Then
- 'For Each row As GridViewRow In GvPrePoliza.Rows
- ' row.FCTextBox("TxtCargo").Enabled = False
- ' row.FCTextBox("TxtAbono").Enabled = False
- 'Next
- End If
-
- Else
- Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
- BtnEliminar.Visible = False
- End If
-
- End If
-
- ObjContabilidad.Dispose()
- UpPoliza.Update()
- End Sub
-
- Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound
-
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- ''Asignamos los Subproyectos
- 'e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- 'e.Row.FCDropDownList("DdlSubProyecto").DataBind()
- 'e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
- 'e.Row.FCDropDownList("DdlSubProyecto").SelectedValueExist(e.Row.DataKey("CveSubProyecto"))
-
- 'Asignamos los Tipos de Gasto
- 'e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- 'e.Row.FCDropDownList("DdlTipoGasto").DataBind()
- 'e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
- 'e.Row.FCDropDownList("DdlTipoGasto").SelectedValueExist(e.Row.DataKey("CveTipoGasto"))
-
- 'ASignamos las CuentasContables
- 'e.Row.FCDropDownList("DdlCtaContable").DataSource = Session("DtCuentas")
- 'e.Row.FCDropDownList("DdlCtaContable").DataBind()
- 'e.Row.FCDropDownList("DdlCtaContable").Items.Insert(0, New ListItem("Sin Asignar", "0"))
- 'e.Row.FCDropDownList("DdlCtaContable").SelectedValueExist(e.Row.DataKey("IdCtaContable"))
-
- If e.Row.DataKey("IdCtaContable") > 0 Then
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", e.Row.DataKey("IdCtaContable")))
- If drr IsNot Nothing Then
- e.Row.FCLiteral("DdlCtaContable").Text = drr("CuentaFormato").ToString() + " - " + drr("Nombre").ToString()
- End If
- End If
-
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + e.Row.FCLiteral("TxtCargo").Text.ToDouble).ToString.FormatoNumero
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + e.Row.FCLiteral("TxtAbono").Text.ToDouble).ToString.FormatoNumero
-
- Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
-
- If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
- If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 234, 235, 240) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
- If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
- If CveConceptoContable.Contiene(30, 204) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
-
- 'e.Row.FCHyperLink("HlReferencia").NavigateUrl = CveConceptoContable
-
- End If
-
- If e.Row.RowType = DataControlRowType.Header Then
- 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- 'e.Row.FCDropDownList("DdlSubProyectoFiltro").DataBind()
- 'e.Row.FCDropDownList("DdlSubProyectoFiltro").Items.Insert(0, New ListItem("Todos", "-1"))
- End If
-
- End Sub
-
- Private Sub CargaPlantillas(TipoPlantilla As Integer)
-
- 'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
- 'GvPlantillas.DataBind()
-
- DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
- DdlPlantilla.DataBind()
- DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53"))
- End Sub
-
- Private Sub CargaConceptos()
- DdlConceptosContables.DataSource = GlobalDTContaConceptosContables(-1)
- DdlConceptosContables.DataBind()
- End Sub
-
- Private Sub DdlConceptosContables_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContables.SelectedIndexChanged
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then
- CargaProveedores()
- DdlProveedores.Visible = True
- DdlCompras.Visible = True
- Else
- DdlProveedores.Visible = False
- DdlCompras.Visible = False
- End If
-
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(28, 29) Then
- CargaPersonal()
- DdlPersonal.Visible = True
- Else
- DdlPersonal.Visible = False
- End If
- If DdlConceptosContables.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then
- CargaClientes()
- DdlClientes.Visible = True
- DdlVentas.Visible = True
- Else
- DdlClientes.Visible = False
- DdlVentas.Visible = False
- End If
- End Sub
-
- Private Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedores.SelectedIndexChanged
- CargaCompras(DdlProveedores.SelectedValue.ToEntero)
- End Sub
-
- Private Sub DdlClientes_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientes.selectedindexchange
- CargaVentas(DdlClientes.SelectedValue.ToEntero)
- End Sub
-
- Private Sub CargaSubProyectos()
- DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- DdlSubProyecto.DataBind()
- DdlSubProyecto.Items.Insert(0, New ListItem(" - ", "-1"))
- DdlSubProyectoFiltroMov.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- DdlSubProyectoFiltroMov.DataBind()
- DdlSubProyectoFiltroMov.Items.Insert(0, New ListItem("Todos", "-1"))
- End Sub
-
- Private Sub CargaCuentasContables()
- DdlCtaContable.DataSource = Session("DtCuentas")
- DdlCtaContable.DataBind()
- DdlCtaContable.Items.Insert(0, New ListItem("Sin Asignar", "0"))
- End Sub
-
- Private Sub CargaTiposGasto()
- DdlTipoGasto.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- DdlTipoGasto.DataBind()
- DdlTipoGasto.Items.Insert(0, New ListItem("Sin Asignar", "0"))
- End Sub
-
- Private Sub CargaProveedores()
- DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
- DdlProveedores.DataBind()
- DdlProveedores.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
-
- Private Sub CargaCompras(CveProveedor As Integer)
- If Not DdlConceptosContables.SelectedValue.ToEntero.Contiene(21) Then
- Dim ObjCompras As New ClsCompras
-
- DdlCompras.ClearSelection()
- If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then
- DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0")
- DdlCompras.DataBind()
- DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
- Else
- DdlCompras.DataSource = Nothing
- DdlCompras.DataBind()
- DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
- End If
- ObjCompras.Dispose()
- End If
- End Sub
-
- Private Sub CargaClientes()
- DdlClientes.setEsWebService(True)
- DdlClientes.Attributes.Add("data-metodo", "getcliente")
- DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
- DdlClientes.DataBind()
- ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
-
- Private Sub CargaVentas(CveCliente As Integer)
- Dim ObjVentas As New ClsVentas
-
- DdlVentas.ClearSelection()
- If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
- DdlVentas.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0")
- DdlVentas.DataBind()
- DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
- Else
- DdlVentas.DataSource = Nothing
- DdlVentas.DataBind()
- DdlVentas.Items.Insert(0, New ListItem(" - ", "-1"))
- End If
- ObjVentas.Dispose()
- End Sub
-
- Private Sub CargaPersonal()
- DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
- DdlPersonal.DataBind()
- DdlPersonal.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
-
-
- Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged
-
- TxtTotalAbonos.Text = ""
- TxtTotalCargos.Text = ""
-
- If DdlPlantilla.SelectedValue.ToEntero <= 0 Then
- Alert("Seleccione un Movimiento Válido", TipoMensaje.MsgAdvertencia)
- DdlPlantilla.SelectedValue = "-1"
- Exit Sub
- End If
-
- If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada
- DivAgregarConceptos.Visible = True
- Else
- DivAgregarConceptos.Visible = False
- End If
-
-
-
- Dim CvePlantilla As Integer = DdlPlantilla.SelectedValue.ToEntero
-
- Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(UsuarioActual.CveEmpresa, CvePlantilla).FiltraParametros("", "Orden")
- Dim Cuenta As String = ""
- Dim IdCuenta As Integer = 0
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
- Dim EsComodin As Integer = 0
- DtMovimientos.Clear()
-
- For Each drt As DataRow In Dt.Rows
-
- Cuenta = drt("ConceptoContable").ToString
- IdCuenta = 0
- CodigoCuenta = ""
- NombreCuenta = ""
- If drt("IdCtaContable").ToString.ToEntero > 0 Then 'DtCuentasContables
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", drt("IdCtaContable").ToString))
- If drr IsNot Nothing Then
- IdCuenta = drt("IdCtaContable").ToString.ToEntero
- CodigoCuenta = drr("CuentaFormato").ToString()
- NombreCuenta = drr("Nombre").ToString()
- 'Cuenta = drr("Nombre").ToString()
- End If
- EsComodin = 0
- End If
-
- Dim dr As DataRow = DtMovimientos.NewRow
- dr("IdCuenta") = IdCuenta
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
- dr("Referencia") = If(drt("CveConcepto").ToString.Contiene("29", "130"), drt("Personal"), drt("RazonSocial"))
- dr("Concepto") = TxtObservaciones.Text
- dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
- dr("EsComodin") = EsComodin
- dr("CveConcepto") = drt("CveConcepto")
- dr("CveSubProyecto") = drt("CveSubProyectoNegativo")
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("CveProveedor") = drt("CveProveedor")
- dr("CvePersonal") = drt("CvePersonal")
- dr("CveClasificacion") = -1
- dr("MultipleSubProyecto") = drt("MultipleSubProyecto")
- DtMovimientos.Rows.Add(dr)
- Next
-
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
-
- End Sub
-
- Protected Sub GvMov_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvMov.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
-
- e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
- e.Row.Height = Unit.Pixel(1)
- e.Row.Cells(0).ToolTip = e.Row.DBCampo("IdCuenta")
-
- If e.Row.DBCampo("TipoMovto") = "1" Then
- e.Row.FCTextBox("TxtAbono").Visible = True
- Else
- e.Row.FCTextBox("TxtCargo").Visible = True
- End If
-
- e.Row.FCTextBox("TxtAbono").Text = If(e.Row.DBCampo("Abono") = 0, "", e.Row.DBCampo("Abono"))
- e.Row.FCTextBox("TxtCargo").Text = If(e.Row.DBCampo("Cargo") = 0, "", e.Row.DBCampo("Cargo"))
- e.Row.FCTextBox("TxtConcepto").Text = e.Row.DBCampo("Descripcion")
-
- If CvePeriodo > 0 Then
- e.Row.FCTextBox("TxtCargo").Enabled = False
- e.Row.FCTextBox("TxtAbono").Enabled = False
- End If
-
- e.Row.FCDropDownList("DdlSubProyecto").DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlSubProyecto").DataBind()
- e.Row.FCDropDownList("DdlSubProyecto").Items.Insert(0, New ListItem(" - ", "-1"))
- e.Row.FCDropDownList("DdlSubProyecto").SelectedValue = e.Row.DBCampo("CveSubProyecto")
-
- 'Asignamos los Tipos de Gasto
- e.Row.FCDropDownList("DdlTipoGasto").DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- e.Row.FCDropDownList("DdlTipoGasto").DataBind()
- e.Row.FCDropDownList("DdlTipoGasto").Items.Insert(0, New ListItem("Sin Asignar", "-1"))
- e.Row.FCDropDownList("DdlTipoGasto").SelectedValue = e.Row.DBCampo("CveTipoGasto")
-
- If DdlPlantilla.SelectedValue.ToEntero = 53 Then 'Plantilla Personalizada
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
- e.Row.FCImageButton("imgD").Visible = True
- Else
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
- End If
-
- If e.Row.DBCampo("MultipleSubProyecto") = "True" Then
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = True
- End If
-
- 'Agregamos la opcion para vincular los movimientos bancarios
- If e.Row.DataKey("CveConcepto").ToEntero.Contiene(41) Then
- Dim ObjMovimientos As New ClsMovimientos
- Dim DdlSaldos As DropDownList = e.Row.FCDropDownList("DdlSaldos")
-
- Select Case e.Row.DataKey("CveConcepto").ToEntero
-
- 'Acreedores
- Case 41
- If (ObjMovimientos.GetAcreedoresSaldosDetalles(-1, CveMoneda, UsuarioActual.CveEmpresa)) Then
- DdlSaldos.Visible = True
- DdlSaldos.DataSource = ObjMovimientos.DtResultados.FiltraParametros($"CveIE > 0 AND CveProveedor = {e.Row.DataKey("CveProveedor").ToEntero}")
- DdlSaldos.DataBind()
- DdlSaldos.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End If
-
- End Select
-
- ObjMovimientos.Dispose()
- End If
-
- If e.Row.DataKey("CveConcepto").ToEntero.Contiene(30) Then
- e.Row.FCLinkButton("ImgBancos").Visible = True
-
-
- If CveTipoTransaccion > 0 And CveCuenta > 0 And Folio.Length > 0 And ImporteDocumento > 0 And Beneficiario.Length > 0 Then
- e.Row.FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
- End If
- End If
- End If
- End Sub
-
- Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
- Dim TotalCargos, TotalAbonos As Decimal
-
- If CvePrePoliza > 0 Then
- TotalCargos = TxtTotalCargos.Text.ToDecimal
- TotalAbonos = TxtTotalAbonos.Text.ToDecimal
- Else
- For Each Gvr As GridViewRow In GvMov.Rows
- TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
- TotalAbonos += Gvr.FCTextBox("TxtAbono").Text.ToDecimal
- Next
- End If
-
- If Not (TotalCargos = TotalAbonos AndAlso (GvPrePoliza.Rows.Count > 0 Or GvMov.Rows.Count > 0)) Then
- Alert($"La suma de los movimientos no son iguales ({TotalCargos}-{TotalAbonos})", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
- If CvePrePoliza > 0 Then
- 'Nuevo Modulo Charlie
- ActualizarPrePoliza()
- Else
- Dim MensajeAlert = New StringBuilder
- Dim ObjIE As New ClsBancos()
- Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
- Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL)
- Dim Conta As ClsContPAQi = Nothing
- Dim IDPoliza As Integer = 0
- Dim MsgError As String = ""
- Dim CveIE As Integer
- Dim FolioIE As String = ""
-
- Try
- Dim CvePrePoliza As Integer
- Dim ConceptoPoliza As String = TxtObservaciones.Text
- CvePrePoliza = ObjMov.AddPrePolizas("Contabilidad/RegPrePoliza", DdlPlantilla.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero)
-
- If CvePrePoliza > 0 Then
- Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:
"
- Dim idCuentaContabilizacion As Long = 1
- Dim Importe As Double = 0
- Dim TipoMovto As Boolean = False
- Dim IdCtaContable As Integer = 0
-
- 'Registra movimieno bancario
- If CveConcepto = 30 Then
- CveIE = ObjIE.AddBancos_IE(CveCuenta, CveTipoTransaccion, TxtFecha.Text, Folio, Beneficiario, ImporteDocumento, CveMoneda, 0, Observaciones, "", False, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If CveIE < 0 Then MsgError = "No se pudo registrar movimiento bancario"
- If ObjIE.GetBancosIE(CveIE, -1, -1, "-1", -1, "-1", "-1", -1, -1, -1, -1, -1, MinFecha, MaxFecha, MinFecha, MaxFecha, MinFecha, MaxFecha, -1, -1, UsuarioActual.CveEmpresa) Then
- FolioIE = ObjIE.Folio
- End If
- End If
-
-
-
- 'inserto las compras que voy a pagarDdlSaldos
- For Each gvr As GridViewRow In GvMov.Rows
- If gvr.DataKey("IDCuenta").ToEntero > 0 Then
- IdCtaContable = gvr.DataKey("IDCuenta")
- End If
-
- If gvr.DataKey("TipoMovto").ToDouble > 0 Then
- Importe = gvr.FCTextBox("TxtAbono").Text.ToDouble
- TipoMovto = True
- Else
- Importe = gvr.FCTextBox("TxtCargo").Text.ToDouble
- TipoMovto = False
- End If
-
- If CveConcepto = 41 Then
- CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
- Else
- CveIE = -1
- End If
-
-
- If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
- idCuentaContabilizacion = 0
- End If
- If Importe > 0 Then
- If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.DataKey("CveConcepto").ToEntero, gvr.FCTextBox("TxtConcepto").Text,
- TxtFecha.Text.ToDate, IdCtaContable, -1, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CveIE:=CveIE,
- CveProveedor:=gvr.DataKey("CveProveedor").ToEntero, CveCompra:=gvr.DataKey("CveCompra").ToEntero,
- CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, CveClasificacion:=gvr.DataKey("CveClasificacion").ToEntero,
- ImporteMX:=Importe, CveTipoGasto:=gvr.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero,
- CveCliente:=gvr.DataKey("CveCliente").ToEntero, CveVenta:=gvr.DataKey("CveVenta").ToEntero) Then
- Else
- MsgError = "No se pudo insertar el detalle de la póliza2"
- Exit For
- End If
- End If
- Next
-
- If CvePeriodo > 0 Then
- 'If Not ObjNom.UpdateProvisionNomina(CvePeriodo, CvePrePoliza, UsuarioActual.CveEmpresa) Then
- ' MsgError = "No se pudo actualizar el periodo de la nómina"
- 'End If
- End If
-
- If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 1) Then
- If ObjMov.ValorPolizaDescuadre > 0 Then
- GuardaLogAD($"Contabilidad/RegPrePolizas | Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
- MsgError = ObjMov.MensajePolizaDescuadre
- End If
- End If
-
-
- 'El movimiento 2 es el de Pago
- If ChkAutoConta.Checked AndAlso UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
- If idCuentaContabilizacion > 0 Then
- If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
-
- 'MENSAJE PRINCIPAL
- MensajeAlert.AppendFormat("
Folio de Salida: {1}", ObjMov.ContaIdPoliza, ObjMov.ContaFolio)
- 'Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion)
- Else
- Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
- End If
- Else
- Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas")
- End If
- End If
-
- Else
- MsgError = "No se pudo insertar la póliza"
- End If
- Catch ex As Exception
- MsgError = "Error"
- End Try
-
- If MsgError = "" Then
- 'MENSAJE IE
- If CveIE Then
- MensajeAlert.AppendFormat("
Folio Bancario: {1}", CveIE, FolioIE)
- Alert(MensajeAlert.ToString, ModExtensiones.TipoMensaje.MsgInformacion, "window.location.reload()")
- Else
- Alert(If(MensajeAlert.ToString = "", "Se registro con exito.", MensajeAlert.ToString), TipoMensaje.MsgInformacion, "window.location.reload()")
- End If
-
- ObjIE.Commit()
- If Conta IsNot Nothing Then Conta.Commit()
-
- UPPDocumento.Update()
-
- TxtObservaciones.Text = ""
- GvMov.DataBind()
- TxtFecha.Text = ""
- TxtObservaciones.Text = ""
- Else
- ObjIE.RollBack()
- If Conta IsNot Nothing Then Conta.RollBack()
- End If
-
- ObjIE.Dispose()
- ObjMov.Dispose()
- If Conta IsNot Nothing Then Conta.Dispose()
- End If
- End Sub
-
- Private Sub ActualizarPrePoliza()
-
- Dim OcurrioError As Boolean = False
- Dim ObjContabilidad As New ClsContabilidad
- ObjContabilidad.IniciaTransacSQL()
-
- ObjContabilidad.UpdatePrePoliza(MinFecha, -1, DdlTipoPoliza.SelectedValue.ToEntero, -1, CvePrePoliza, UsuarioActual.CveEmpresa, Concepto:=TxtConcepto.Text, FechaPoliza:=TxtFechaDocumento.Text.ToDate, CveUsuarioModifico:=UsuarioActual.CveUsuario)
-
- For Each row As GridViewRow In GvPrePoliza.Rows
- If row.DataKey("CvePrePolizaDetalle").ToEntero > 0 Then
- If Not ObjContabilidad.UpdatePrepolizasDetalle(row.DataKey("CvePrePolizaDetalle").ToEntero, row.FCLiteral("TxtConcepto").Text, row.DataKey("CveSubProyecto").ToEntero,
- row.DataKey("IdCtaContable").ToEntero, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0,
- row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero),
- CveConceptoContable:=row.DataKey("CveConceptoContable").ToEntero, CveProveedor:=row.DataKey("CveProveedor").ToEntero, CveCompra:=row.DataKey("CveCompra").ToEntero,
- CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero, CvePersonal:=row.DataKey("CvePersonal").ToEntero, Referencia:=row.FCLiteral("TxtRef").Text, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
- OcurrioError = True
- Exit For
- End If
- Else
- If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0, False, True), If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0,
- row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), row.DataKey("Referencia").ToString,
- row.DataKey("CveConceptoContable").ToEntero, row.FCLiteral("TxtConcepto").Text, Now,
- row.DataKey("IdCtaContable").ToEntero, 0, CveSubProyecto:=row.DataKey("CveSubProyecto").ToEntero,
- CveTipoGasto:=If(DdlTipoGasto.Visible, row.DataKey("CveTipoGasto").ToEntero, row.DataKey("CveTipoGasto").ToEntero),
- ImporteMX:=If(row.FCLiteral("TxtCargo").Text.ToDecimal <> 0,
- row.FCLiteral("TxtCargo").Text.ToDecimal, row.FCLiteral("TxtAbono").Text.ToDecimal), CveProveedor:=row.DataKey("CveProveedor").ToEntero,
- CveCompra:=row.DataKey("CveCompra").ToEntero, CveCliente:=row.DataKey("CveCliente").ToEntero, CveVenta:=row.DataKey("CveVenta").ToEntero,
- CvePersonal:=row.DataKey("CvePersonal").ToEntero) Then
- OcurrioError = True
- Exit For
- End If
- End If
-
- Next
-
- If Not OcurrioError Then
- ObjContabilidad.Commit()
- Alert("La PrePoliza se actualizó correctamente.", TipoMensaje.MsgInformacion)
- Else
- ObjContabilidad.RollBack()
- Alert("Ocurrio un error al actualizar la PrePoliza.", TipoMensaje.MsgError)
- End If
-
- ObjContabilidad.Dispose()
- CargaPrePoliza()
- End Sub
- Protected Sub LnkAddConcepto_Click(sender As Object, e As EventArgs)
- RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto"))
- LtlTitulo.Text = "Agregar Concepto"
- BtnAceptar.Text = "Agregar"
- LimpiaCampos()
-
- CargaConceptosContablesE()
- CargaSubProyectoE()
- CargaTipoGastoE()
- CargaCtaContableE()
-
-
- UpdatePanel1.Update()
- End Sub
- Protected Sub GvPrePoliza_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles GvPrePoliza.RowUpdating
- RegistraScript(String.Format("$('#{0}').modal();", "DivEditConcepto"))
- LtlTitulo.Text = "Editar Concepto"
- BtnAceptar.Text = "Aceptar"
- LimpiaCampos()
- IndiceGrid = e.RowIndex
-
- Dim CveConceptoContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveConceptoContable").ToEntero
- Dim CveProveedor As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveProveedor").ToEntero
- Dim CveCompra As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCompra").ToEntero
- Dim CvePersonal As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CvePersonal").ToEntero
- Dim CveCliente As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveCliente").ToEntero
- Dim CveVenta As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveVenta").ToEntero
- 'Dim FolioFactura As String = GvPrePoliza.Rows(IndiceGrid).FCHyperLink("HlReferencia").Text
- Dim Concepto As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtConcepto").Text
- Dim Referencia As String = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtRef").Text
- Dim CveSubProyecto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveSubProyecto").ToString.ToEntero
- Dim CveTipoGasto As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("CveTipoGasto").ToString.ToEntero
- Dim IdCtaContable As Integer = GvPrePoliza.Rows(IndiceGrid).DataKey("IdCtaContable").ToString.ToEntero
- Dim Cargo As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtCargo").Text.ToDouble
- Dim Abono As Double = GvPrePoliza.Rows(IndiceGrid).FCLiteral("TxtAbono").Text.ToDouble
-
- CargaConceptosContablesE()
- DdlConceptosContablesE.SelectedValueExist(CveConceptoContable)
- DdlConceptosContablesE_SelectedIndexChanged(DdlConceptosContablesE, e)
-
- DdlProveedoresE.SelectedValueExist(CveProveedor)
- DdlProveedoresE_SelectedIndexChanged(DdlProveedoresE, e)
- DdlComprasE.SelectedValueExist(CveCompra)
-
- DdlPersonalE.SelectedValueExist(CvePersonal)
-
- DdlClientesE.SelectedValue = CveCliente
- DdlClientesE.SelectedText = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("NombreComercial", $"CveCliente={CveCliente}")
- DdlClientesE_SelectedIndexChanged(DdlClientesE, e)
- DdlVentasE.SelectedValueExist(CveVenta)
-
- TxtConceptoE.Text = Concepto
- TxtReferenciaE.Text = Referencia
-
- CargaSubProyectoE()
- DdlSubProyectoE.SelectedValueExist(CveSubProyecto)
- CargaTipoGastoE()
- DdlTipoGastoE.SelectedValueExist(CveTipoGasto)
- CargaCtaContableE()
- DdlCtaContableE.SelectedValueExist(IdCtaContable)
-
- If Cargo <> 0 Then
- TxtCargoE.Text = Cargo
- End If
-
- If Abono <> 0 Then
- TxtAbonoE.Text = Abono
- End If
-
- UpdatePanel1.Update()
-
- End Sub
- Private Sub LimpiaCampos()
- IndiceGrid = -1
- TxtConceptoE.Text = ""
- TxtCargoE.Text = ""
- TxtAbonoE.Text = ""
- TxtReferenciaE.Text = ""
- End Sub
- Private Sub CargaConceptosContablesE()
- DdlConceptosContablesE.DataSource = GlobalDTContaConceptosContables(-1)
- DdlConceptosContablesE.DataBind()
- End Sub
- Private Sub CargaSubProyectoE()
- DdlSubProyectoE.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
- DdlSubProyectoE.DataBind()
- DdlSubProyectoE.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
- Private Sub CargaTipoGastoE()
- DdlTipoGastoE.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
- DdlTipoGastoE.DataBind()
- DdlTipoGastoE.Items.Insert(0, New ListItem("Sin Asignar", "0"))
- End Sub
- Private Sub CargaCtaContableE()
- DdlCtaContableE.DataSource = Session("DtCuentas")
- DdlCtaContableE.DataBind()
- DdlCtaContableE.Items.Insert(0, New ListItem("Sin Asignar", "0"))
- End Sub
- Private Sub DdlConceptosContablesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlConceptosContablesE.SelectedIndexChanged
- If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(5, 17, 201, 206, 14, 15, 16, 19, 25, 26, 21) Then
- CargaProveedoresE()
- DdlProveedoresE.Visible = True
- DdlComprasE.Visible = True
- Else
- DdlProveedoresE.Visible = False
- DdlComprasE.Visible = False
- End If
-
- If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(28, 29) Then
- CargaPersonalE()
- DdlPersonalE.Visible = True
- Else
- DdlPersonalE.Visible = False
- End If
- If DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(1, 2, 203, 207, 13, 61, 8, 9, 62, 63, 38, 39) Then
- CargaClientesE()
- DdlClientesE.Visible = True
- DdlVentasE.Visible = True
- Else
- DdlClientesE.Visible = False
- DdlVentasE.Visible = False
- End If
- End Sub
- Private Sub CargaProveedoresE()
- DdlProveedoresE.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
- DdlProveedoresE.DataBind()
- DdlProveedoresE.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
- Private Sub CargaComprasE(CveProveedor As Integer)
- If Not DdlConceptosContablesE.SelectedValue.ToEntero.Contiene(21) Then
- Dim ObjCompras As New ClsCompras
-
- DdlComprasE.ClearSelection()
- If ObjCompras.GetCompras(-1, "-1", "-1", CveProveedor, -1, UsuarioActual.CveEmpresa) Then
- DdlComprasE.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0")
- DdlComprasE.DataBind()
- DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1"))
- Else
- DdlComprasE.DataSource = Nothing
- DdlComprasE.DataBind()
- DdlComprasE.Items.Insert(0, New ListItem(" - ", "-1"))
- End If
- ObjCompras.Dispose()
- End If
- End Sub
- Private Sub CargaClientesE()
- DdlClientesE.setEsWebService(True)
- DdlClientesE.Attributes.Add("data-metodo", "getcliente")
- DdlClientesE.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
- DdlClientesE.DataBind()
- ' DdlClientes.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
- Private Sub CargaVentasE(CveCliente As Integer)
- Dim ObjVentas As New ClsVentas
-
- DdlVentasE.ClearSelection()
- If ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1", CveCliente, -1, -1, -1, "-1", "-1", "-1", CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
- DdlVentasE.DataSource = ObjVentas.DtResultados '.FiltraParametros("Saldo > 0")
- DdlVentasE.DataBind()
- DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1"))
- Else
- DdlVentasE.DataSource = Nothing
- DdlVentasE.DataBind()
- DdlVentasE.Items.Insert(0, New ListItem(" - ", "-1"))
- End If
- ObjVentas.Dispose()
- End Sub
- Private Sub CargaPersonalE()
- DdlPersonalE.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
- DdlPersonalE.DataBind()
- DdlPersonalE.Items.Insert(0, New ListItem(" - ", "-1"))
- End Sub
- Private Sub DdlProveedoresE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlProveedoresE.SelectedIndexChanged
- CargaComprasE(DdlProveedoresE.SelectedValue.ToEntero)
- End Sub
- Private Sub DdlClientesE_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlClientesE.selectedindexchange
- CargaVentasE(DdlClientesE.SelectedValue.ToEntero)
- End Sub
- Protected Sub BtnAceptar_Click(sender As Object, e As EventArgs) Handles BtnAceptar.Click
-
- If IndiceGrid = -1 Then
- If DtMovimientos Is Nothing Then CreaDT()
- If CvePrePoliza > 0 Then
- Dim dr As DataRow = DtMovimientos.NewRow
- dr("IdCtaContable") = DdlCtaContableE.SelectedValue
- dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
- dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue
- dr("Concepto") = TxtConceptoE.Text
- dr("Referencia") = TxtReferenciaE.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1)
- dr("Cargo") = TxtCargoE.Text.ToDouble
- dr("Abono") = TxtAbonoE.Text.ToDouble
- dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble)
- dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue
- dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text
- dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero
- dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero
- dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero
- dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, ""))
-
-
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero
- DtMovimientos.Rows.Add(dr)
- DtMovimientos.AcceptChanges()
-
- If CvePrePoliza > 0 Then
- GvPrePoliza.DataSource = DtMovimientos
- GvPrePoliza.DataBind()
- UpPrePoliza.Update()
- End If
- Else
- 'Dim dr As DataRow = DtMovimientos.NewRow
- 'Dim CodigoCuenta As String = ""
- 'Dim NombreCuenta As String = ""
-
- 'dr("IdCuenta") = DdlCtaContableE.SelectedValue
-
- 'If DdlCtaContableE.SelectedValue.ToEntero > 0 Then
- ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContableE.SelectedValue))
- ' If drr IsNot Nothing Then
- ' CodigoCuenta = drr("CuentaFormato").ToString()
- ' NombreCuenta = drr("Nombre").ToString()
- ' End If
- 'End If
-
- 'dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- 'dr("Cuenta") = DdlConceptosContablesE.SelectedItem.Text
- 'dr("Referencia") = TxtReferenciaE.Text
- 'dr("Concepto") = TxtConceptoE.Text
- 'dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1)
- 'dr("EsComodin") = 0
- 'dr("CveConcepto") = DdlConceptosContablesE.SelectedValue
- 'dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue
- 'dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
- 'dr("Cargo") = TxtCargoE.Text.ToDouble
- 'dr("Abono") = TxtAbonoE.Text.ToDouble
- ''dr("Descripcion") = TxtDescripcionE.Text
- 'dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue
- 'dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero
- 'dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero
- 'dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero
- 'dr("CveClasificacion") = -1
- 'dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero
- 'dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero
-
- 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero
- 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero
- 'DtMovimientos.Rows.Add(dr)
- 'DtMovimientos.AcceptChanges()
-
- 'GvMov.DataSource = DtMovimientos
- 'GvMov.DataBind()
- 'UPMovs.Update()
- 'Actualizar = False
-
- End If
- Else
- Dim CvePrePolizaDetalle As Integer = GvPrePoliza.DataKeys(IndiceGrid).Value.ToString.ToEntero
- Dim Rows As DataRow() = DtMovimientos.Select("CvePrePolizaDetalle = " & CvePrePolizaDetalle)
-
- If Rows.Count > 0 Then
- Dim dr As DataRow = Rows(0)
- dr("IdCtaContable") = DdlCtaContableE.SelectedValue
- dr("ConceptoContable") = DdlConceptosContablesE.SelectedItem.Text
- dr("CveConceptoContable") = DdlConceptosContablesE.SelectedValue
- dr("Concepto") = TxtConceptoE.Text
- dr("Referencia") = TxtReferenciaE.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, 0, 1)
- dr("ImporteMN") = If(Math.Abs(TxtCargoE.Text.ToDouble) > 0, TxtCargoE.Text.ToDouble, TxtAbonoE.Text.ToDouble)
- dr("CveSubProyecto") = DdlSubProyectoE.SelectedValue
- dr("SubProyecto") = DdlSubProyectoE.SelectedItem.Text
- dr("CveProveedor") = DdlProveedoresE.SelectedValue.ToEntero
- dr("CveCompra") = DdlComprasE.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonalE.SelectedValue.ToEntero
- dr("CveCliente") = DdlClientesE.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentasE.SelectedValue.ToEntero
- dr("FolioFactura") = If(DdlComprasE.Visible = True, DdlComprasE.SelectedItem.ToString, If(DdlVentasE.Visible = True, DdlVentasE.SelectedItem.ToString, ""))
-
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnConceptoContable").Value = DdlConceptosContablesE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnProveedor").Value = DdlProveedoresE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCompra").Value = DdlComprasE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnPersonal").Value = DdlPersonalE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCliente").Value = DdlClientesE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnVenta").Value = DdlVentasE.SelectedValue.ToEntero
-
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnSubProyecto").Value = DdlSubProyectoE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnTipoGasto").Value = DdlTipoGastoE.SelectedValue.ToEntero
- 'GvPrePoliza.Rows(IndiceGrid).FCHiddenField("HdnCtaContable").Value = DdlCtaContableE.SelectedValue.ToEntero
-
- If TxtCargoE.Text <> "" Then
- dr("Cargo") = TxtCargoE.Text.ToDouble
- dr("Abono") = "".ToDouble
- Else
- dr("Abono") = TxtAbonoE.Text.ToDouble
- dr("Cargo") = "".ToDouble
- End If
-
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbonoE.Text.ToDouble).ToString.FormatoNumero
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargoE.Text.ToDouble).ToString.FormatoNumero
- DtMovimientos.AcceptChanges()
- GvPrePoliza.EditIndex = -1
-
- If CvePrePoliza > 0 Then
- GvPrePoliza.DataSource = DtMovimientos
- GvPrePoliza.DataBind()
- UpPrePoliza.Update()
- End If
-
- End If
- End If
-
- UpPrePoliza.Update()
- RegistraScript("$('#DivEditConcepto').modal('hide')", "hidemodal")
- End Sub
- Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting
-
- Dim idMov As Integer = GvMov.DataKeys(e.RowIndex).Value.ToString.ToEntero
-
- Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & idMov)
- If Rows.Count > 0 Then
- DtMovimientos.Rows.Remove(Rows(0))
- DtMovimientos.AcceptChanges()
- End If
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
-
- TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero
- TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero
-
- 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria
-
- End Sub
-
- Private Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
-
- If DtMovimientos Is Nothing Then CreaDT()
-
- If Actualizar Then
-
- Dim Rows As DataRow() = DtMovimientos.Select("IDMov = " & HdnCve.Value)
-
- If Rows.Count > 0 Then
- Dim dr As DataRow = Rows(0)
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
- dr("IdCuenta") = DdlCtaContable.SelectedValue
-
- If DdlCtaContable.SelectedValue.ToEntero > 0 Then
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
- If drr IsNot Nothing Then
- CodigoCuenta = drr("CuentaFormato").ToString()
- NombreCuenta = drr("Nombre").ToString()
- End If
- End If
-
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = DdlConceptosContables.SelectedItem
- dr("Referencia") = TxtReferencia.Text
- dr("Concepto") = TxtObservaciones.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- dr("EsComodin") = 0
- dr("CveConcepto") = DdlConceptosContables.SelectedValue
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("Descripcion") = TxtDescripcion.Text
- dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- dr("CveClasificacion") = -1
- dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
- End If
- LbCancelarEdicion.Visible = False
- LbAgregar.Text = "Agregar"
-
- Else
-
- If CvePrePoliza > 0 Then
- Dim dr As DataRow = DtMovimientos.NewRow
- dr("IdCtaContable") = DdlCtaContable.SelectedValue
- dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
- dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
- dr("Concepto") = TxtDescripcion.Text
- dr("Referencia") = TxtReferencia.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("ImporteMN") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, TxtCargo.Text.ToDouble, TxtAbono.Text.ToDouble)
- dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- dr("SubProyecto") = DdlSubProyecto.SelectedItem.Text
- dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
-
-
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
- DtMovimientos.Rows.Add(dr)
- DtMovimientos.AcceptChanges()
-
- If CvePrePoliza > 0 Then
- GvPrePoliza.DataSource = DtMovimientos
- GvPrePoliza.DataBind()
- UpPrePoliza.Update()
- End If
- Else
- Dim dr As DataRow = DtMovimientos.NewRow
- Dim CodigoCuenta As String = ""
- Dim NombreCuenta As String = ""
-
- dr("IdCuenta") = DdlCtaContable.SelectedValue
-
- If DdlCtaContable.SelectedValue.ToEntero > 0 Then
- Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
- If drr IsNot Nothing Then
- CodigoCuenta = drr("CuentaFormato").ToString()
- NombreCuenta = drr("Nombre").ToString()
- End If
- End If
-
- dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- dr("Cuenta") = DdlConceptosContables.SelectedItem.Text
- dr("Referencia") = TxtReferencia.Text
- dr("Concepto") = TxtObservaciones.Text
- dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- dr("EsComodin") = 0
- dr("CveConcepto") = DdlConceptosContables.SelectedValue
- dr("CveConceptoContable") = DdlConceptosContables.SelectedValue
- dr("ConceptoContable") = DdlConceptosContables.SelectedItem.Text
- dr("Cargo") = TxtCargo.Text.ToDouble
- dr("Abono") = TxtAbono.Text.ToDouble
- dr("Descripcion") = TxtDescripcion.Text
- dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- dr("CveClasificacion") = -1
- dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
-
- TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
- TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
- DtMovimientos.Rows.Add(dr)
- DtMovimientos.AcceptChanges()
-
- 'If CvePrePoliza > 0 Then
- ' GvPrePoliza.DataSource = DtMovimientos
- ' GvPrePoliza.DataBind()
- ' UpPrePoliza.Update()
- 'End If
-
- GvMov.DataSource = DtMovimientos
- GvMov.DataBind()
- UPMovs.Update()
- Actualizar = False
-
- End If
-
- End If
-
- TxtCargo.Text = ""
- TxtAbono.Text = ""
- TxtReferencia.Text = ""
- TxtDescripcion.Text = ""
- End Sub
-
-#Region "PESTAÑA INFORMACION GENERAL DE BANCO IE"
- Public Sub Bancos_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- RowIndex = GvRow.RowIndex
-
- If GvRow.FCTextBox("TxtAbono").Text = "" Then
- CargaTipoTransaccion("Ing")
- Else
- CargaTipoTransaccion("Egs")
- End If
-
-
- TxtDocumentoImporte.Text = If(GvRow.FCTextBox("TxtAbono").Text = "", GvRow.FCTextBox("TxtCargo").Text.FormatoNumero, GvRow.FCTextBox("TxtAbono").Text.FormatoNumero)
- UpBancos.Update()
- RegistraScript(String.Format("$('#{0}').modal();", "DivContadoModal"))
- End Sub
- Private Sub CargaTipoTransaccion(Tipo As String)
- DdlTipoTransaccion.Items.Clear()
- DdlTipoTransaccion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo = '{Tipo}'")
- DdlTipoTransaccion.DataBind()
- DdlTipoTransaccion.Items.Insert(0, New ListItem("Seleccione Tipo Movimiento", "-1"))
- End Sub
- Private Sub CargaCuentas()
- DdlCuenta.Items.Clear()
- DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa) '.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", DdlMoneda.SelectedValue))
- DdlCuenta.DataBind()
- DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
- End Sub
- Private Sub BtnContado_Click(sender As Object, e As EventArgs) Handles BtnContado.Click
- CveConcepto = 30
- CveTipoTransaccion = DdlTipoTransaccion.SelectedValue.ToEntero
- CveCuenta = DdlCuenta.SelectedValue.ToEntero
- Folio = TxtDocumentoFolio.Text
- ImporteDocumento = TxtDocumentoImporte.Text.ToDecimal
- Observaciones = TxtDocumentoObservaciones.Text
- Beneficiario = TxtDocumentoBeneficiario.Text
- RegistraScript(String.Format("$('#{0}').modal('hide');", "DivContadoModal"))
- GvMov.Rows(RowIndex).FCLinkButton("ImgBancos").CssClass = "btn btn-circle btn-sm green"
- UPMovs.Update()
- End Sub
-
- Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles BtnEliminar.Click
- Dim ObjContabilidad As New ClsContabilidad
-
- If ObjContabilidad.RemovePrePolizas(CvePrePoliza, UsuarioActual.CveEmpresa) Then
- Alert("La Prepóliza ha sido eliminada", TipoMensaje.MsgInformacion)
- Else
- Alert("La Prepóliza ha podido ser eliminada", TipoMensaje.MsgError)
- End If
-
- ObjContabilidad.Dispose()
- End Sub
-#End Region
-
- Protected Sub DdlTipoGasto_SelectedIndexChanged(sender As Object, e As EventArgs)
- If UpPrePoliza.Visible Then
- For Each Gvr As GridViewRow In GvPrePoliza.Rows
- Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue)
- Next
- UpPrePoliza.Update()
- End If
- If UPMovs.Visible Then
- For Each Gvr As GridViewRow In GvMov.Rows
- Gvr.FCDropDownList("DdlTipoGasto").SelectedValueExist(DdlTipoGasto.SelectedValue)
- Next
- UPMovs.Update()
- End If
- End Sub
- Protected Sub DdlSubProyectoFiltro_SelectedIndexChanged(sender As Object, e As EventArgs)
- Dim Ddl As DropDownList = CType(sender, DropDownList)
- For Each Gvr As GridViewRow In GvPrePoliza.Rows
- If Ddl.SelectedValue.ToEntero > 0 Then
- If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = Ddl.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then
- Gvr.Visible = True
- Else
- Gvr.Visible = False
- End If
- Else
- Gvr.Visible = True
- End If
- Next
- UpPrePoliza.Update()
- RegistraScript("calculateAbono()", "cargo")
- RegistraScript("calculateCargo()", "abono")
- RegistraScript("comparar()", "compara")
- End Sub
- Protected Sub DdlSubProyectoFiltroMov_SelectedIndexChanged(sender As Object, e As EventArgs)
- For Each Gvr As GridViewRow In GvMov.Rows
- If DdlSubProyectoFiltroMov.SelectedValue.ToEntero > 0 Then
- If Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero = DdlSubProyectoFiltroMov.SelectedValue.ToEntero Or Not Gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero > 0 Then
- Gvr.Visible = True
- Else
- Gvr.Visible = False
- End If
- Else
- Gvr.Visible = True
- End If
- Next
- UpPrePoliza.Update()
- RegistraScript("calculateAbono()", "cargo")
- RegistraScript("calculateCargo()", "abono")
- RegistraScript("comparar()", "compara")
- End Sub
-
- Private Sub GvMov_RowEditing(sender As Object, e As GridViewEditEventArgs) Handles GvMov.RowEditing
- Actualizar = True
- GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero
- Dim idMov As Integer = GvMov.DataKeys(e.NewEditIndex).Value.ToString.ToEntero
-
- Dim DrM As DataRow = DtMovimientos.Rows(e.NewEditIndex)
-
- If DrM IsNot Nothing Then
- HdnCve.Value = idMov.ToString
-
- DdlCtaContable.SelectedValue = DrM("IdCuenta")
- TxtReferencia.Text = DrM("Referencia")
- TxtObservaciones.Text = DrM("Concepto")
- ' (Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1) = dr("TipoMovto")
- DrM("EsComodin") = 0
- DdlConceptosContables.SelectedValue = DrM("CveConcepto").ToString
- TxtCargo.Text = DrM("Cargo").ToString
- TxtAbono.Text = DrM("Abono").ToString
- TxtDescripcion.Text = DrM("Descripcion")
- DdlSubProyecto.SelectedValue = DrM("CveSubProyecto")
- DdlProveedores.SelectedValue = DrM("CveProveedor")
- DdlCompras.SelectedValue = DrM("CveCompra")
- DdlPersonal.SelectedValue = DrM("CvePersonal")
- ' DrM("CveClasificacion") = -1
- DdlClientes.SelectedValue = DrM("CveCliente")
- DdlVentas.SelectedValue = DrM("CveVenta")
- LbCancelarEdicion.Visible = True
- LbAgregar.Text = "Actualizar"
-
- End If
-
- UPPDocumento.Update()
- DivAgregarConceptos.Visible = True
-
- 'If DtMovimientos Is Nothing Then CreaDT()
-
- 'Dim dr As DataRow = DtMovimientos.NewRow
- 'Dim CodigoCuenta As String = ""
- 'Dim NombreCuenta As String = ""
-
- 'dr("IdCuenta") = DdlCtaContable.SelectedValue
-
- 'If DdlCtaContable.SelectedValue.ToEntero > 0 Then
- ' Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("Id={0}", DdlCtaContable.SelectedValue))
- ' If drr IsNot Nothing Then
- ' CodigoCuenta = drr("CuentaFormato").ToString()
- ' NombreCuenta = drr("Nombre").ToString()
- ' End If
- 'End If
-
- 'dr("CodigoCuenta") = CodigoCuenta & " " & NombreCuenta
- 'dr("Cuenta") = DdlConceptosContables.SelectedItem
- 'dr("Referencia") = TxtReferencia.Text
- 'dr("Concepto") = TxtObservaciones.Text
- 'dr("TipoMovto") = If(Math.Abs(TxtCargo.Text.ToDouble) > 0, 0, 1)
- 'dr("EsComodin") = 0
- 'dr("CveConcepto") = DdlConceptosContables.SelectedValue
- 'dr("Cargo") = TxtCargo.Text.ToDouble
- 'dr("Abono") = TxtAbono.Text.ToDouble
- 'dr("Descripcion") = TxtDescripcion.Text
- 'dr("CveSubProyecto") = DdlSubProyecto.SelectedValue
- 'dr("CveProveedor") = DdlProveedores.SelectedValue.ToEntero
- 'dr("CveCompra") = DdlCompras.SelectedValue.ToEntero
- 'dr("CvePersonal") = DdlPersonal.SelectedValue.ToEntero
- 'dr("CveClasificacion") = -1
- 'dr("CveCliente") = DdlClientes.SelectedValue.ToEntero
- 'dr("CveVenta") = DdlVentas.SelectedValue.ToEntero
-
- 'TxtTotalAbonos.Text = (TxtTotalAbonos.Text.ToDouble + TxtAbono.Text.ToDouble).ToString.FormatoNumero
- 'TxtTotalCargos.Text = (TxtTotalCargos.Text.ToDouble + TxtCargo.Text.ToDouble).ToString.FormatoNumero
- 'DtMovimientos.Rows.Add(dr)
-
- 'If CvePrePoliza > 0 Then
- ' GvPrePoliza.DataSource = DtMovimientos
- ' GvPrePoliza.DataBind()
- 'End If
-
-
- 'GvMov.DataSource = DtMovimientos
- 'GvMov.DataBind()
- 'UPMovs.Update()
-
-
- End Sub
-
- Private Sub LbCancelarEdicion_Click(sender As Object, e As EventArgs) Handles LbCancelarEdicion.Click
- LbCancelarEdicion.Visible = False
- TxtObservaciones.Text = ""
- Actualizar = False
- LbAgregar.Text = "Agregar"
- End Sub
-
- Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
-
- Dim ObjConta As New ClsContabilidad
-
- If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
- ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
- End If
-
- If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime) Then
- Alert(String.Format("Prepóliza contabilizada.
Folio:Ver Póliza", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
- Else
-
- Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
- End If
-
- ObjConta.Dispose()
-
-
- End Sub
-
-
-#Region "COMPLEMENTO DE PAGO"
-
- Private Sub GeneraTimbre(CvePrePoliza As Integer)
- Dim Str As New StringBuilder
- Dim Banco As New ClsBancos
- Banco.IniciaTransacSQL()
- If Banco.GeneraTimbrePago(-1, -1, UsuarioActual, CvePrePoliza:=CvePrePoliza) Then
- If Banco.Mensaje = "" Then
- Banco.Commit()
- PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
- Str.AppendFormat("Folio: {0} ", Banco.ComplementoSerieFolio)
- Str.AppendFormat("XML ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- Str.AppendFormat("PDF ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- MandaCorreo(Banco.ComplementoSerieFolio, Banco.CobranzaCorreo)
- End If
- Else
- Banco.RollBack()
- Str.AppendFormat("No se genero complemento por el siguiente motivo: {0}", Banco.Mensaje)
- End If
- Banco.Dispose()
- Alert(Str.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
- End Sub
-
- Private Sub MandaCorreo(NombreArchivo As String, Correo As String, Optional ConAlerta As Boolean = True)
- Try
- Dim Msg As String = ""
- If NombreArchivo <> "-1" Then '
- Dim ObjMail As New ClsSisMail()
- Dim RutaXML As String = String.Format("{0}\XML\Pag\{1}.xml", UsuarioActual.Empresa.Ruta, NombreArchivo)
- Dim RutaPDF As String = String.Format("{0}\PDF\Pag\{1}.pdf", UsuarioActual.Empresa.Ruta, NombreArchivo)
- Dim Cuerpo As String = "Se hace entrega del comprobante de pago"
- Dim Asunto As String = "Entrega de comprobante de pago"
- If IO.File.Exists(RutaPDF) AndAlso IO.File.Exists(RutaXML) Then
- Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaPDF})
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = RutaXML})
- If ObjMail.SendMail(UsuarioActual.Empresa, Correo, Asunto, Cuerpo, "", LSRutasMail) Then
- If ConAlerta Then
- 'RegistraScript("$('#ModalDivMail').modal('hide');")
- Alert("El correo se envió correctamente", TipoMensaje.MsgInformacion)
- End If
- Else
- Msg = "No se pudo enviar el correo electrónico."
- End If
- Else
- Msg = "No se pudo adjuntar el correo electrónico."
- End If
- End If
- If ConAlerta AndAlso Msg <> "" Then
- Alert(Msg, TipoMensaje.MsgError)
- End If
- Catch ex As Exception
- OnError("Ocurrió error al mandar MAIL", ex)
- End Try
- End Sub
-
- Protected Sub LnkComplementoPago_Click(sender As Object, e As EventArgs)
- GeneraTimbre(CvePrePoliza)
- End Sub
-#End Region
-
-
-
-End Class
-
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 141c03289..8b913b6c3 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -1953,15 +1953,27 @@ Partial Class Inventarios_EntradasSalidas
OpcionPrePoliza = 11
End If
- If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, OpcionPrePoliza) Then
- If ObjConta.ValorPolizaDescuadre > 0 Then
- ErrorMovInv = True
- GuardaLogAD($"Inv/ES | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
- Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia)
- End If
- Else
- Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia)
+ Dim AutoConta As Boolean = True
+ If (UsuarioActual.CveEmpresa = 119 And EsConsumoInterno) Then
+ AutoConta = False
End If
+ If Not ErrorMovInv AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=OpcionPrePoliza, AutoConta:=AutoConta) Then
+ ErrorMovInv = True
+ 'If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ 'End If
+ End If
+
+ 'If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, OpcionPrePoliza) Then
+ ' If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' ErrorMovInv = True
+ ' GuardaLogAD($"Inv/ES | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia)
+ ' End If
+ 'Else
+ ' Alert("No se pudo validar la prepoliza de cuadre.", TipoMensaje.MsgAdvertencia)
+ 'End If
End If
'------------------------------------------------
@@ -4503,9 +4515,6 @@ Partial Class Inventarios_EntradasSalidas
End If
Next
-
-
-
If Prorratear Then
If Not ErrorMovInv AndAlso CveMovimientoSalida > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
@@ -4527,8 +4536,6 @@ Partial Class Inventarios_EntradasSalidas
End If
End If
-
-
If Not ErrorMovInv Then
For Each Dr As DataRow In DtMovimientosEntradaInvFisico.Rows
ImporteConcepto = If(Prorratear, ProPU, Dr("PU").ToString.ToDecimal)
@@ -4635,17 +4642,28 @@ Partial Class Inventarios_EntradasSalidas
End If
End If
-
- End If
+ End If
If Not ErrorMovInv Then
- If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
- ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa)
- If ObjConta.ValorPolizaDescuadre > 0 Then
- ErrorMovInv = True
- Mensaje = "Ocurrió un error al validar los movimientos contables"
- End If
+ Dim AutoConta As Boolean = True
+ If (UsuarioActual.CveEmpresa = 119) Then
+ AutoConta = False
End If
+ If Not ErrorMovInv AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, AutoConta:=AutoConta) Then
+ ErrorMovInv = True
+ 'If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ 'End If
+ End If
+
+ 'If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
+ ' ObjConta.GetPrePolizasDetalle(CvePrePoliza, UsuarioActual.CveEmpresa)
+ ' If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' ErrorMovInv = True
+ ' Mensaje = "Ocurrió un error al validar los movimientos contables"
+ ' End If
+ 'End If
End If
Dim RetornoVirtual As MMovimientoVirtual = Nothing
@@ -4695,8 +4713,6 @@ Partial Class Inventarios_EntradasSalidas
End Sub
Private Sub BtnGuardarCambiosVigencia_Click(sender As Object, e As EventArgs) Handles BtnGuardarCambiosVigencia.Click
-
-
If GvSalidasCambioVigencia.Rows.Count = 0 Then
Alert("No hay ningun registro para generar el movimiento. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
diff --git a/Inventarios/PrestamosdeProveedor.aspx.vb b/Inventarios/PrestamosdeProveedor.aspx.vb
index 3913420b9..8f4b45ce7 100644
--- a/Inventarios/PrestamosdeProveedor.aspx.vb
+++ b/Inventarios/PrestamosdeProveedor.aspx.vb
@@ -237,6 +237,18 @@ Partial Class Inventarios_PrestamosdeProveedor
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoAlmacen, -tValorInventario, TxtObservacionesEntrega.Text.Trim, CveConceptoContable, TxtObservacionesEntrega.Text.Trim, Fecha, IdCtaContableOtro, -1, CveMovimientoAlmacen:=CveMovimientoSalida, CveClasificacion:=CveClasifCosto, ImporteMX:=-tValorInventario, CveSubProyecto:=CveSubProyecto) Then
ErrorMovInv = True
End If
+ End If
+
+ Dim AutoConta As Boolean = True
+ If (UsuarioActual.CveEmpresa = 119) Then
+ AutoConta = False
+ End If
+ If Not ErrorMovInv AndAlso Not ObjConta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, AutoConta:=AutoConta) Then
+ ErrorMovInv = True
+ 'If ObjConta.ValorPolizaDescuadre > 0 Then
+ ' GuardaLogAD($"Compras/Compras-Guardar | Error{ObjConta.MensajePolizaDescuadre} Diferencia{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
+ ' ErrorPrepolizaDescuadre = True
+ 'End If
End If
Else
ErrorMovInv = True
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index 6e24b8f56..cc9d42df5 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -1652,7 +1652,7 @@ Partial Class Inventarios_TraspasoAlmacen
'DEBE CONSIDERAR SOLO LAS FILAS QUE TENGA PRODUCTOS, NO EL TOTALIZADOR
If CvePS > 0 Then
CveMovimientoDetalleSalida = GvRow.DataKey("CveMovimientoDetalle").ToEntero
- Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
+ Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal() 'GvRow.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
'If ChkRealizarDevolucion.Checked Then Cantidad = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal
diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs
index ed0531880..99b856a6a 100644
--- a/Nomina/Nomina.aspx.cs
+++ b/Nomina/Nomina.aspx.cs
@@ -1370,9 +1370,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, versionTimbre: (UsuarioActual.CveEmpresa == 119 ? VersionTimbradoEnum.PorDefectoEmpresa : VersionTimbradoEnum.Version3_3));
if (Msg != null && Msg.Length > 0)
- {
- Msg = msgCorregidoSat(Msg, CvePersonal, RFC, CURP);
- msggral = string.Format("{0}
", msggral, Msg, gvRow.DataKey("Nombre"), gvRow.DataKey("Codigo"), msgCorregidoSat(Msg, CvePersonal, RFC, CURP));
}
else
{
@@ -1550,7 +1549,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
Alert(string.Format("se envio el correo a '{0}'.", Correo), TipoMensaje.MsgInformacion);
-
}
else
{
@@ -1559,7 +1557,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
else
{
-
Alert("No se tiene un correo registrado.", TipoMensaje.MsgAdvertencia);
}
}
@@ -1628,6 +1625,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
DataRow drow;
string Correo = string.Empty;
string NombreCompleto = string.Empty;
+ string RFC = string.Empty;
+ string CURP = string.Empty;
using (ClsRH objrh = new ClsRH())
{
objrh.GetPersonal(CvePersonal, UsuarioActual.CveEmpresa);
@@ -1637,12 +1636,14 @@ public partial class Nomina_Nomina2 : ClsPaginas
{
Correo = drow["Correo"].ToString();
NombreCompleto = drow["NombreCompleto"].ToString();
+ //RFC = drow["RFC"].ToString();
+ //CURP = drow["CURP"].ToString();
}
string Msg = "";// lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, (UsuarioActual.CveUsuario == 100 ? 4 : 4));
Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual, versionTimbre: (UsuarioActual.CveEmpresa == 119 ? VersionTimbradoEnum.PorDefectoEmpresa : VersionTimbradoEnum.Version3_3));
- if (Msg != null && Msg.Length > 0)
- { Alert(string.Format("El empleado no se pudo timbrar, el sat nos devolvio el siguiente mensaje: {0}", Msg), TipoMensaje.MsgAdvertencia); }
+ if (Msg != null && Msg.Length > 0)//
{4}
{1}
+ { Alert(string.Format("El empleado no se pudo timbrar, el sat nos devolvio el siguiente mensaje: {1}", Msg, msgCorregidoSat(Msg, CvePersonal, RFC, CURP)), TipoMensaje.MsgAdvertencia); }
else
{
ClsNominas ObjPeriodo = new ClsNominas();
diff --git a/SAT/SolicitudesNominaSat.aspx b/SAT/SolicitudesNominaSat.aspx
index 928f5dce3..ca8adaec8 100644
--- a/SAT/SolicitudesNominaSat.aspx
+++ b/SAT/SolicitudesNominaSat.aspx
@@ -307,6 +307,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/SAT/SolicitudesNominaSat.aspx.cs b/SAT/SolicitudesNominaSat.aspx.cs
index 1056435d8..cff8d344a 100644
--- a/SAT/SolicitudesNominaSat.aspx.cs
+++ b/SAT/SolicitudesNominaSat.aspx.cs
@@ -26,21 +26,21 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
set { ViewState["clasegrid"] = value; }
}
- public string fechaInicio
+ public DateTime fechaInicio
{
get
{
- if (ViewState["fechaInicio"] == null) { return ""; }
- else { return ViewState["fechaInicio"].ToString(); }
+ if (ViewState["fechaInicio"] == null) { return ModExtensiones.MinFecha; }
+ else { return ViewState["fechaInicio"].ToString().ToDate(); }
}
set { ViewState["fechaInicio"] = value; }
}
- public string fechaFin
+ public DateTime fechaFin
{
get
{
- if (ViewState["fechaFin"] == null) { return ""; }
- else { return ViewState["fechaFin"].ToString(); }
+ if (ViewState["fechaFin"] == null) { return ModExtensiones.MaxFecha; }
+ else { return ViewState["fechaFin"].ToString().ToDate(); }
}
set { ViewState["fechaFin"] = value; }
}
@@ -60,7 +60,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
using (ClsNominas nom = new ClsNominas())
{
- nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero());
+ nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero());
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
var libro = wb.AddWorksheet(nom.DtResultados , "Nomina");
@@ -137,10 +137,10 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
{
using (ClsNominas nom = new ClsNominas())
{
- fechaInicio = TxtRpdFechaInicio.Text.ToDateTime().ToString("yyyy/MM/dd");
- fechaFin = TxtRpdFechaFin.Text.ToDateTime().ToString("yyyy/MM/dd");
+ fechaInicio = TxtRpdFechaInicio.Text.ToDateTime();
+ fechaFin = TxtRpdFechaFin.Text.ToDateTime();
- nom.SATSolicitudTimbreNominaGral(0, UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero());
+ nom.SATSolicitudTimbreNominaGral(0, UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero(),DdlRegimenContratacion.SelectedValue.ToEntero());
if (nom.DtResultados.Rows.Count > 0)
{
DataRow drow = nom.DtResultados.Rows[0];
@@ -156,7 +156,7 @@ public partial class SAT_SolicitudesNominaSat : ClsPaginas
}
- nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero());
+ nom.SATSolicitudTimbreNominaGral(DdlReporte.SelectedValue.ToString().ToEntero(), UsuarioActual.CveEmpresa, fechaInicio, fechaFin, DdlTipoNomina.SelectedValue.ToEntero(), DdlRegimenContratacion.SelectedValue.ToEntero());
GVSolicitudTimbreNominaGral.DataSource = nom.DtResultados;
GVSolicitudTimbreNominaGral.DataBind();
clasegrid = string.Format("reporte{0}", DdlReporte.SelectedValue);
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index d72745756..fa1f6c881 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -1699,7 +1699,7 @@
-
+
@@ -1898,15 +1898,15 @@
Estado de Cuenta
+
-
-
+
@@ -1919,7 +1919,7 @@
-
+
@@ -1934,7 +1934,7 @@
-
+
@@ -1947,7 +1947,7 @@
-
+
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 43a0427be..0b80dafe3 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -2638,31 +2638,31 @@ Partial Class Clientes
Dim CtaCliente As Integer = DdlCtaContableClientes.SelectedValue.ToEntero()
' si tiene la funcionalidad de la cuenta contable padre
- If UsuarioActual.Empresa.Funcionalidad(114) <> "" Then
+ 'If UsuarioActual.Empresa.Funcionalidad(114) <> "" Then
- Dim ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
+ ' Dim ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
- ObjContaAC.IniciaTransacSQL()
- 'se registra la cuenta contable automaticamente
+ ' ObjContaAC.IniciaTransacSQL()
+ ' 'se registra la cuenta contable automaticamente
- CtaCliente = ObjContaAC.AddSiguienteCuentaHijo(UsuarioActual.Empresa.Funcionalidad(114).ToEntero(), TxtNombreComercial.Text.Trim, "A", 2)
+ ' CtaCliente = ObjContaAC.AddSiguienteCuentaHijo(UsuarioActual.Empresa.Funcionalidad(114).ToEntero(), TxtNombreComercial.Text.Trim, "A", 2)
- If CtaCliente > 0 Then
- ObjContaAC.Commit()
- DdlCtaContableClientes.Items.Add(New ListItem(TxtNombreComercial.Text.Trim, CtaCliente.ToString()))
- DdlCtaContableClientes.SelectedValue = CtaCliente.ToString()
- 'MsgCuentaContable = String.Format(" Con la cuenta contable: {0}", NewCuenta)
+ ' If CtaCliente > 0 Then
+ ' ObjContaAC.Commit()
+ ' DdlCtaContableClientes.Items.Add(New ListItem(TxtNombreComercial.Text.Trim, CtaCliente.ToString()))
+ ' DdlCtaContableClientes.SelectedValue = CtaCliente.ToString()
+ ' 'MsgCuentaContable = String.Format(" Con la cuenta contable: {0}", NewCuenta)
- Else
+ ' Else
- ObjContaAC.RollBack()
- ObjContaAC.Dispose()
- Alert("Error al guardar la cuenta contable ", TipoMensaje.MsgError)
- ObjClientes.Dispose()
- Exit Sub
- End If
- ObjContaAC.Dispose()
- End If
+ ' ObjContaAC.RollBack()
+ ' ObjContaAC.Dispose()
+ ' Alert("Error al guardar la cuenta contable ", TipoMensaje.MsgError)
+ ' ObjClientes.Dispose()
+ ' Exit Sub
+ ' End If
+ ' ObjContaAC.Dispose()
+ 'End If
Dim CodigoCuentaAltaCompaq As String = ""
@@ -2750,11 +2750,15 @@ Partial Class Clientes
End If
End If
- If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 1, ObjClientes.IniciaTransacSQL) Then
- ErrorProceso = True
+
+ If IdCuentaAltaCompaq > 0 Then
+ If Not AltaCuentaContabilidadSIG(CodigoCuentaAltaCompaq, NombreCuentaCuentaAltaCompaq, IdCuentaAltaCompaq, 1, ObjClientes.IniciaTransacSQL) Then
+ ErrorProceso = True
+ End If
End If
+
If ErrorProceso Then
ObjClientes.RollBack()
Else
@@ -4119,11 +4123,11 @@ Partial Class Clientes
Dim FechaCorte As Date = ("9999/01/01").ToDate()
Dim TipoDocto As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM)
Dim TipoDocto2 As String = If(DdlTipoDocto.GetSelectedValuesM = "", "-1", DdlTipoDocto.GetSelectedValuesM(True))
- Dim FechaVencimientoI As String = If(TxtFechaVICxP.Text = "", "-1", TxtFechaVICxP.Text).ToString()
- Dim FechaVencimientoF As String = If(TxtFechaVFCxP.Text = "", "-1", TxtFechaVFCxP.Text).ToString()
+ Dim FechaVencimientoI As DateTime = If(TxtFechaVICxP.Text = "", MinFecha, TxtFechaVICxP.Text.ToDate())
+ Dim FechaVencimientoF As DateTime = If(TxtFechaVFCxP.Text = "", MaxFecha, TxtFechaVFCxP.Text.ToDate())
Dim ObjMovtos As New ClsMovimientos()
- If ObjMovtos.GetCxCClienteDetalle(CveCliente, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero()) Then
+ If ObjMovtos.GetCxCClienteDetalle(CveCliente, FI, FF, -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero(), FechaVencimientoI:=FechaVencimientoI, FechaVencimientoF:=FechaVencimientoF) Then
DtCxCFact = If(DdlTipoCuentasCxC.SelectedValue = "-1", ObjMovtos.DtResultados.FiltraParametros("", "TipoDocto").Copy, ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "TipoDocto"))
'cargo los anticipos NC
DtCxCFact.Columns.Add("SaldoAnticipo", GetType(Decimal))
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index 82c7b04da..ec9df92c6 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -1235,33 +1235,34 @@ Partial Class Ventas_ClientesAbonar
End If
- If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
- If Not ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
- MsgError = "No se pudo simplificar los movimientos"
- Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
- End If
+ 'If MsgError = "" AndAlso UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
+ ' If Not ObjMov.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
+ ' MsgError = "No se pudo simplificar los movimientos"
+ ' Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
+ ' End If
+ 'End If
+
+ If MsgError = "" AndAlso Not ObjMov.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual, Opcion:=3) Then
+ MsgError = ObjMov.MensajePolizaDescuadre & " La diferencia es de: " & ObjMov.ValorDiferencia
+ 'If ObjMov.ValorPolizaDescuadre > 0 Then
+ ' MsgError = ObjMov.MensajePolizaDescuadre & " La diferencia es de: " & ObjMov.ValorDiferencia
+ 'End If
End If
- If MsgError = "" AndAlso ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 3) Then
- If ObjMov.ValorPolizaDescuadre > 0 Then
- MsgError = ObjMov.MensajePolizaDescuadre & " La diferencia es de: " & ObjMov.ValorDiferencia
- End If
- End If
-
- 'Conta ContPAQ
- If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
- If idCuentaContabilizacion > 0 Then
- If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
- IDPoliza = ObjMov.ContaIdPoliza
- FolioPoliza = ObjMov.ContaFolio
- Else
- Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
- MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico"
- End If
- Else
- Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas))
- End If
- End If
+ ''Conta ContPAQ
+ 'If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso MsgError = "" Then
+ ' If idCuentaContabilizacion > 0 Then
+ ' If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
+ ' IDPoliza = ObjMov.ContaIdPoliza
+ ' FolioPoliza = ObjMov.ContaFolio
+ ' Else
+ ' Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
+ ' MsgError = "Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico"
+ ' End If
+ ' Else
+ ' Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas))
+ ' End If
+ 'End If
Else
MsgError = "No se pudo insertar la póliza"
End If
@@ -2677,8 +2678,8 @@ Partial Class Ventas_ClientesAbonar
CambiaTipoMoneda()
End Sub
Private Sub CambiaTipoMoneda()
- Dim dia As Integer = If(UsuarioActual.CveEmpresa = 13, TxtFechaDocumento.Text.ToDate.Day - 1, TxtFechaDocumento.Text.ToDate.Day)
- Fecha = (dia.ToString + "/" + TxtFechaDocumento.Text.ToDate.Month.ToString + "/" + TxtFechaDocumento.Text.ToDate.Year.ToString).ToDate
+
+ Fecha = If(UsuarioActual.CveEmpresa = 13, TxtFechaDocumento.Text.ToDate.AddDays(-1), TxtFechaDocumento.Text.ToDate).ToDate
If TxtTC.Visible Then
TxtTC.Text = GlobalTipoCambio(Fecha).FormatoNumero(4)
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 8beaa4a38..fc6e5ad78 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -2009,8 +2009,8 @@ Partial Class PV
End If
If TmpDTRecepcionUsados IsNot Nothing Then
- If TmpDTRecepcionUsados.Select($"CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then
- Dim rowInv As DataRow = TmpDTRecepcionUsados.Select($"CvePS={Row("CvePS").ToString.ToEntero}")(0)
+ If TmpDTRecepcionUsados.Select($"ConsecUsado={Row("Consec").ToString.ToEntero} AND CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then
+ Dim rowInv As DataRow = TmpDTRecepcionUsados.Select($"ConsecUsado={Row("Consec").ToString.ToEntero} AND CvePS={Row("CvePS").ToString.ToEntero}")(0)
rowInv("CveVentaDetalle") = CveVentaDetalle
End If
End If
@@ -7858,11 +7858,15 @@ Partial Class PV
If TmpDTRecepcionUsados.Rows.Count > 0 Then
Dim Elimino As Boolean = False
For Each Row As DataRow In TmpDTRecepcionUsados.Rows
- If Row("CvePSRelacionado").ToString().ToEntero() = CvePS Then
+ If Row("CvePSRelacionado").ToString().ToEntero() = CvePS AndAlso
+ Row("ConsecUsado").ToString().ToEntero() = ListaPSCargo.FirstOrDefault().ConsecutivoUsado AndAlso
+ Row("ConsecRelacionado").ToString().ToEntero() = ListaPSCargo.FirstOrDefault().Consecutivo Then
+
Row.Delete()
Elimino = True
End If
Next
+
If Elimino Then
TmpDTRecepcionUsados.AcceptChanges()
End If
@@ -8179,7 +8183,7 @@ Partial Class PV
'ELIMINAR LOS USADOS QUE SE MANDAN A RECEPCION
For Each drow As DataRow In TmpDT.Select($"Consec ={Consec}")
For Each RowRecepcionUsados As DataRow In TmpDTRecepcionUsados.Rows
- If (RowRecepcionUsados("CvePSRelacionado").ToString() = drow("CvePS").ToString()) Then
+ If (RowRecepcionUsados("CvePSRelacionado").ToString() = drow("CvePS").ToString()) AndAlso RowRecepcionUsados("ConsecRelacionado").ToString() = drow("Consec").ToString() Then
RowRecepcionUsados.Delete()
End If
Next
diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx
index a01c06afc..a081975c8 100644
--- a/Ventas/ProductosServicios.aspx
+++ b/Ventas/ProductosServicios.aspx
@@ -551,7 +551,7 @@
-
+
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb
index 5caced717..dbe7810c4 100644
--- a/Ventas/ProductosServicios.aspx.vb
+++ b/Ventas/ProductosServicios.aspx.vb
@@ -360,10 +360,11 @@ Partial Class ProductosyServicios
divCodigo2.Visible = True
divLitraje.Visible = True
DivClasificacion2.Visible = True
-
CargaPSAdicionalesVigencias()
End If
+ divPrecio.Visible = UsuarioActual.Empresa.Funcionalidad(404) = "" ' si tiene lista de precio, se oculta el precio por ps
+
If UsuarioActual.Empresa.Funcionalidad(713) = "1" Then '' empresa deduce IEPS
divIEPS.Visible = True
End If
diff --git a/Ventas/RepProductosServiciosDetalle.aspx b/Ventas/RepProductosServiciosDetalle.aspx
index ee33c53cb..e7aac2a0a 100644
--- a/Ventas/RepProductosServiciosDetalle.aspx
+++ b/Ventas/RepProductosServiciosDetalle.aspx
@@ -427,7 +427,8 @@
<%--18--%>
-
+ <%--19--%>
+
@@ -475,7 +476,7 @@
-
+
diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb
index 19dc8e898..cab107edb 100644
--- a/Ventas/RepProductosServiciosDetalle.aspx.vb
+++ b/Ventas/RepProductosServiciosDetalle.aspx.vb
@@ -85,6 +85,10 @@ Partial Class Ventas_RepProductosServiciosDetalle
End If
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ ChkNumTurnos.Visible = True
+ End If
+
End If
End Sub
@@ -568,6 +572,7 @@ Partial Class Ventas_RepProductosServiciosDetalle
GvDatos.Columns(16).Visible = ChkMetodoPago.Checked
GvDatos.Columns(17).Visible = ChkFormaPago.Checked
GvDatos.Columns(18).Visible = ChkFechaHoraEmision.Checked
+ GvDatos.Columns(19).Visible = ChkNumTurnos.Checked
CargaDatos()
UPDatos.Update()
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 0d08fa083..f72859039 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -948,7 +948,8 @@
<%--width="100%"--%>
#
-
Cant
+
+
Unidad
@@ -992,13 +993,24 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<%-- --%>
@@ -1124,17 +1136,38 @@
<%--1--%>
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<%--2--%>
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index cb546ea45..9b7a3efa4 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2748,6 +2748,8 @@ Partial Class Ventas
TmpDT.Columns.Add("CveActivoFijo", GetType(Integer))
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
+ TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
+ TmpDT.Columns("NumTurnos").DefaultValue = 0D
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
@@ -2778,6 +2780,8 @@ Partial Class Ventas
TmpDT.Columns.Add("CveActivoFijo", GetType(Integer))
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
+ TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
+ TmpDT.Columns("NumTurnos").DefaultValue = 0D
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
@@ -3151,6 +3155,11 @@ Partial Class Ventas
CargaListasPrecios()
End If
+ If CveVenta <= 0 AndAlso UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ TxtCantidad.Width = New Unit("100%")
+ DivNumTurnos.Visible = True
+ End If
+
'SELECCIONA VENDEDOR DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE
'If UsuarioActual.CveVendedor > 0 Then
' If CveVenta = -1 AndAlso Not DdlVendedor.SelectedValue.ToEntero() > 0 Then DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
@@ -8067,6 +8076,12 @@ Partial Class Ventas
e.Row.FCLinkButton("imgD").Visible = False
End If
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ e.Row.FCTextBox("TxtCantidad").Width = New Unit("100%")
+ e.Row.FCLabel("LblTurnoEditar").Visible = True
+ e.Row.FCTextBox("TxtNumTurnosEditar").Visible = True
+ End If
+
'If UsuarioActual.CveEmpresa = 119 Then
' e.Row.FCTextBox("TxtDescuento").Enabled = False
'End If
@@ -8150,6 +8165,10 @@ Partial Class Ventas
e.Row.FCLiteral("LtlPrecioLista").Visible = True
End If
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) AndAlso e.Row.DBCampo("NumTurnos").ToDecimal() > 0 Then
+ e.Row.FCLiteral("LtlNumTurnos").Visible = True
+ End If
+
'CANTIDAD FACTURADA
Select Case e.Row.DBCampo("TipoDocto")
Case "Cot"
@@ -8456,6 +8475,11 @@ Partial Class Ventas
ObjDescuento = CalcularDescuentos(GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero(), Cantidad, PU)
End If
+ Dim NumTurnos As Decimal = 0
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ NumTurnos = GvPS.Rows(e.RowIndex).FCTextBox("TxtNumTurnosEditar").Text.ToDecimal()
+ End If
+
TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex))
CalculaUsados()
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text,
@@ -8463,7 +8487,8 @@ Partial Class Ventas
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
- CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, ObjDescuento:=ObjDescuento)
+ CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
+ ObjDescuento:=ObjDescuento, NumTurnos:=NumTurnos)
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
@@ -8532,8 +8557,11 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
TmpDT.Rows(e.RowIndex)("CuentaPredial") = CuentaPredial
-
-
+ Dim NumTurnos As Decimal = 0
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ NumTurnos = GvPS.Rows(e.RowIndex).FCTextBox("TxtNumTurnosEditar").Text.ToDecimal()
+ End If
+ TmpDT.Rows(e.RowIndex)("NumTurnos") = NumTurnos
If ObjDescuento IsNot Nothing Then
TmpDT.Rows(e.RowIndex)("CvePromocionDetalle") = ObjDescuento.CvePromocionDetalle
@@ -13428,7 +13456,7 @@ Partial Class Ventas
Row("PU").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(factura.ConvertirPesos, factura.TipoCambio, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), TiempoEntrega:=Row("TiempoEntrega").ToString(), CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(),
CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=Row("CvePromocionDetalle").ToString().ToEntero(), IEPS:=Row("ImporteIEPS").ToString().ToDouble, CveMovimientoDetallePedido:=Row("CveMovimientoDetallePedido").ToString().ToEntero(), ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble,
- PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero()) Then
+ PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar un Producto o Servicio a la Factura. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For
Else
@@ -18815,11 +18843,16 @@ Partial Class Ventas
End If
End If
+ Dim NumTurnos As Decimal = 0
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ NumTurnos = TxtNumTurnos.Text.ToDecimal()
+ End If
+
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text,
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
- ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS)
+ ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS, NumTurnos:=NumTurnos)
CalculaUsados()
@@ -18941,6 +18974,7 @@ Partial Class Ventas
End Sub
Private Sub LimpiaAgregar()
TxtCantidad.Text = ""
+ TxtNumTurnos.Text = ""
HdnPS.Value = "-1"
HdnCodigoPS.Value = "-1"
HdnTipoPS.Value = "-1"
@@ -19011,7 +19045,7 @@ Partial Class Ventas
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "",
- Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D) As Boolean
+ Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D) As Boolean
Dim Retorno As Boolean = False
Try
@@ -19274,6 +19308,7 @@ Partial Class Ventas
Row("AFDepreciacion") = AFDepreciacion
Row("AFValorInicial") = AFValorInicial
+ Row("NumTurnos") = NumTurnos
If UsuarioActual.CveEmpresa.Contiene(119, 13, 83) Then
If Not RemisionesLista.Count > 0 Then 'SI VIENE DE REMISION NO SE CONSIDERA
@@ -19519,6 +19554,9 @@ Partial Class Ventas
TmpDT.Columns("TieneProntoPago").DefaultValue = "No"
TmpDT.Columns("ImporteProntoPago").DefaultValue = 0
+ TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
+ TmpDT.Columns("NumTurnos").DefaultValue = 0
+
End Sub
Private Sub CreaDTmpC()
DTmpC = New DataTable
@@ -22249,7 +22287,7 @@ Partial Class Ventas
Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
CveVentaDetallePadre:=Row("CveVentaDetalle").ToString().ToEntero(), CveContratoDetalle:=Row("CveContratoDetalle").ToString().ToEntero(), CvePromocionDetalle:=If(DtPromociones IsNot Nothing, DtPromociones.FiltroPrimeroValor("CvePromocionDetalle", $"CvePS={Row("CvePS").ToString()}").ToEntero(), -1),
- ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero()) Then
+ ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDouble, ImporteRetISR:=Row("ImporteRetISR").ToString().ToDouble, PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDouble, PorcentajeRetISR:=Row("PorcentajeRetISR").ToString().ToDouble, CuentaPredial:=Row("CuentaPredial").ToString(), CvePrecioLista:=Row("CvePrecioLista").ToString().ToEntero(), CveActivoFijo:=Row("CveActivoFijo").ToString().ToEntero(), NumTurnos:=Row("NumTurnos").ToString().ToDecimal()) Then
OcurrioError = True
Exit For
Else
@@ -33054,11 +33092,25 @@ Partial Class Ventas
'REMOVER EVENTO PARA RECARGAR ALMACEN
'spanAlmacen.Attributes.Remove("onclick")
+ If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
+ TxtCantidad.Width = New Unit("100%")
+ DivNumTurnos.Visible = True
+ End If
If UsuarioActual.Empresa.Funcionalidad(360) = "1" Then
CargaListasPrecios()
End If
+ BtnEditar.Visible = False
+ BtnEmitir.Visible = False
+ BtnPermisoEditarCotizacion.Visible = False
+ BtnEditarCotizacion.Visible = False
+ BtnPermisoEditarRemision.Visible = False
+ BtnEditarRemision.Visible = False
+
+ BtnGenerarRemision.Visible = False
+ BtnGeneraAutorizacion.Visible = False
+
HdnCargarInventario.Value = "False"
UpParametros.Update()
@@ -35400,6 +35452,8 @@ Partial Class Ventas
TmpDT.Columns.Add("CveActivoFijo", GetType(Integer))
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
+ TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
+ TmpDT.Columns("NumTurnos").DefaultValue = 0D
Return TmpDT
End Function