Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -3786,6 +3786,7 @@ Public Class ClsPaginas
|
||||
|
||||
PaginaDict.Add("/Prospectos/PopUpBuscarProspectos.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/PopUpCambiaUsuario.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/PopUpCambiaUsuarioEmpresa.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/CatDistribuidores.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/CatPlataformas.aspx".ToUpper(), -1)
|
||||
PaginaDict.Add("/Sistemas/PopUpAddUsuario.aspx".ToUpper(), -1)
|
||||
|
||||
@@ -1620,7 +1620,7 @@ Public Class ClsVentas
|
||||
|
||||
Public Function GetRepPSEcono(CveSubProyecto As Integer, CvePS As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional GPO As Integer = -1,
|
||||
Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, Optional TCEspecifico As Double = 0,
|
||||
Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1") As Boolean
|
||||
Optional Clasificacion As String = "-1", Optional Linea As String = "-1", Optional Marca As String = "-1", Optional orden As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_RepPSEconoGet")
|
||||
|
||||
@@ -1638,6 +1638,7 @@ Public Class ClsVentas
|
||||
.Add("@Clasificacion", SqlDbType.VarChar).Value = Clasificacion
|
||||
.Add("@Linea", SqlDbType.VarChar).Value = Linea
|
||||
.Add("@Marca", SqlDbType.VarChar).Value = Marca
|
||||
.Add("@Orden", SqlDbType.VarChar).Value = orden
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -71,6 +71,16 @@ Public Class Usuario
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
Private _modoSimulacionXEmpresa As Boolean = False
|
||||
Public Property ModoSimulacionXEmpresa As Boolean
|
||||
Get
|
||||
Return Not ModoSimulacion AndAlso (_modoSimulacionXEmpresa OrElse TienePermisoProceso(308))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
|
||||
_modoSimulacionXEmpresa = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Sesion(Campo As String) As String
|
||||
Get
|
||||
|
||||
@@ -145,9 +145,18 @@
|
||||
<div class="col-md-1">
|
||||
<h5>TC:<asp:Literal runat="server" ID="LtTipoCambioActual"></asp:Literal></h5>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox ID="TxtConceptoFluctuacion" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" style="width: 80px;" runat="server" id="LiSubProyectoLbl">
|
||||
<asp:Label runat="server" ID="LblSubProyecto"></asp:Label>
|
||||
</div>
|
||||
<div class="col-md-1 " runat="server" id="LiSubProyectoDdl">
|
||||
<asp:DropDownList ID="DdlSubproyecto" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" Style="max-width: 200px !important;">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
|
||||
@@ -19,6 +19,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
CargarCentrosDeCosto(Nothing, DdlSubproyecto, Nothing, LblSubProyecto)
|
||||
CargaUltimaFluctuacion()
|
||||
End If
|
||||
End Sub
|
||||
@@ -218,13 +219,19 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
End If
|
||||
ObjBancos.Dispose()
|
||||
GvFiliales.DataBind()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION COMPRAS"
|
||||
|
||||
|
||||
Protected Sub BtnGeneraCompras_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
|
||||
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
@@ -245,7 +252,6 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
IdCtaGanancia = UsuarioActual.Empresa.IdCuentaGananciaCambiaria '1230
|
||||
Dim TC As Decimal = 2 ' se pone 2, para que cumpla con el check constrains de complementarias
|
||||
|
||||
|
||||
Total = LblTotal.ToDecimal
|
||||
If Total > 0 Then
|
||||
CveConceptoContable = 64
|
||||
@@ -257,8 +263,11 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
CveCuenta = CveCuentaPerdida
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
@@ -284,13 +293,20 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Conta.RollBack()
|
||||
End If
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION VENTAS"
|
||||
|
||||
|
||||
Protected Sub BtnGeneraVentas_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
|
||||
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
@@ -323,7 +339,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
@@ -354,13 +370,20 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Conta.RollBack()
|
||||
End If
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION BANCOS"
|
||||
|
||||
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
|
||||
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Protected Sub BtnGeneraBancos_Click(sender As Object, e As EventArgs)
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Conta.IniciaTransacSQL()
|
||||
@@ -417,7 +440,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
End If
|
||||
@@ -446,13 +469,20 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
ObjContPaq.Dispose()
|
||||
End If
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION DEUDOR"
|
||||
|
||||
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
|
||||
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Protected Sub BtnGeneraDedudores_Click(sender As Object, e As EventArgs)
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
Dim Banco As New ClsBancos(Conta.IniciaTransacSQL())
|
||||
@@ -493,7 +523,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
@@ -519,13 +549,18 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
End If
|
||||
Conta.Dispose()
|
||||
Banco.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION FILIALES"
|
||||
|
||||
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Protected Sub BtnGeneraFiliales_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
|
||||
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
@@ -571,7 +606,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, ConceptoFluctuacion, Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
@@ -614,13 +649,19 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Conta.Dispose()
|
||||
Banco.Dispose()
|
||||
ObjContPaq.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION ACREEDORES"
|
||||
|
||||
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Protected Sub BtnGeneraAcreedores_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
If DdlSubproyecto.SelectedValue.ToEntero < 0 Then
|
||||
Alert($"Debe de seleccionar un {LblSubProyecto.Text}", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim Total As Decimal = 0
|
||||
Dim Conta As New ClsContabilidad
|
||||
@@ -655,7 +696,7 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
idCta = idCtaPerdida
|
||||
TipoMovto = False
|
||||
End If
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta) Then
|
||||
If Not Conta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Math.Abs(Total), " ", CveConceptoContable, "Fluctuación", Now, idCta, 0, ImporteMX:=Math.Abs(Total), CveCuenta:=CveCuenta, CveSubProyecto:=DdlSubproyecto.SelectedValue.ToEntero) Then
|
||||
ErrorRegistrar = True
|
||||
End If
|
||||
|
||||
@@ -680,162 +721,162 @@ Partial Class Bancos_FluctuacionCambiaria
|
||||
Conta.RollBack()
|
||||
End If
|
||||
Conta.Dispose()
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "FLUCTUACION GENERAL"
|
||||
|
||||
' Protected Sub BtnGenerar_Click(sender As Object, e As EventArgs)
|
||||
' Dim AcumuladoGananciaCompras = 0.0, AcumuladoPerdidaCompras = 0.0, AcumuladoGananciaBancos = 0.0, AcumuladoPerdidaBancos = 0.0
|
||||
' Dim IDPoliza = -1
|
||||
|
||||
' 'Valida datos de Compras
|
||||
' For Each gvr As GridViewRow In GvCompras.Rows
|
||||
' If gvr.DataKey("SinTipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Compras")
|
||||
' 'Exit Sub
|
||||
' Else
|
||||
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
|
||||
' AcumuladoGananciaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' Else
|
||||
' AcumuladoPerdidaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'Valida datos de Bancos
|
||||
' For Each gvr As GridViewRow In GvCuentas.Rows
|
||||
' If Not gvr.DataKey("TipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Cuentas Bancarias")
|
||||
' 'Exit Sub
|
||||
' Else
|
||||
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
|
||||
' AcumuladoGananciaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' Else
|
||||
' AcumuladoPerdidaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
' ObjConta.IniciaTransacSQL()
|
||||
' Dim ObjBancos As New ClsBancos
|
||||
' ObjBancos.IniciaTransacSQL()
|
||||
' Dim ErrorGenerar = False
|
||||
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||
|
||||
' IDPoliza = ObjConta.AddPoliza(3, "Fluctuación Cambiaria", (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, UsuarioActual.CveUsuario, Fecha)
|
||||
|
||||
' If IDPoliza > 0 Then
|
||||
|
||||
' 'COMIENZA: AGREGA CUENTAS BANCARIAS
|
||||
' If AcumuladoGananciaBancos > 0 Or AcumuladoPerdidaBancos > 0 Then
|
||||
' 'Agrega movimientos
|
||||
' Dim Fluc As Double
|
||||
' For Each gvr As GridViewRow In GvCuentas.Rows
|
||||
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Cuentas Bancarias", If(Fluc > 0, "Ganancia", "Perdida")), 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'Agrega acumulados
|
||||
' If Not ErrorGenerar AndAlso AcumuladoGananciaBancos > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, 2195, AcumuladoGananciaBancos > 0, AcumuladoGananciaBancos, "", "Acumulado Ganancia Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' If Not ErrorGenerar AndAlso AcumuladoPerdidaBancos > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, 4695, AcumuladoPerdidaBancos > 0, AcumuladoPerdidaBancos, "", "Acumulado Pérdida Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' 'TERMINA: AGREGA CUENTAS BANCARIAS
|
||||
|
||||
|
||||
' 'COMIENZA: AGREGA COMPRAS
|
||||
' If AcumuladoGananciaCompras > 0 Or AcumuladoPerdidaCompras > 0 Then
|
||||
' 'Agrega movimientos
|
||||
' Dim Fluc As Double
|
||||
' For Each gvr As GridViewRow In GvCompras.Rows
|
||||
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Compras", If(Fluc > 0, "Ganancia", "Pérdida")), 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'Agrega acumulados
|
||||
' If Not ErrorGenerar AndAlso AcumuladoGananciaCompras > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, Not AcumuladoGananciaCompras > 0, AcumuladoGananciaCompras, "", "Acumulado Ganancia Cambiaria de Compras", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' If Not ErrorGenerar AndAlso AcumuladoPerdidaCompras > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, Not AcumuladoPerdidaCompras > 0, AcumuladoPerdidaCompras, "", "Acumulado Pérdida Cambiaria de Compras", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' 'TERMINA: AGREGA COMPRAS
|
||||
|
||||
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
|
||||
|
||||
' 'Agrega en Bitacoras
|
||||
' If Not ErrorGenerar Then
|
||||
' If ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' If Not ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
' If Not ErrorGenerar Then
|
||||
|
||||
' ObjConta.AjustaPoliza(IDPoliza)
|
||||
|
||||
' ObjConta.Commit()
|
||||
' ObjBancos.Commit()
|
||||
' Alert(String.Format("Fluctuación realizada con exito.<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza))
|
||||
' Else
|
||||
' ObjConta.RollBack()
|
||||
' ObjBancos.RollBack()
|
||||
' Alert("Ocurrio un error al generar la poliza", TipoMensaje.MsgAdvertencia)
|
||||
' End If
|
||||
|
||||
' ObjConta.Dispose()
|
||||
' ObjBancos.Dispose()
|
||||
' End Sub
|
||||
|
||||
|
||||
|
||||
' Protected Sub BtnGenerar_Click(sender As Object, e As EventArgs)
|
||||
' Dim AcumuladoGananciaCompras = 0.0, AcumuladoPerdidaCompras = 0.0, AcumuladoGananciaBancos = 0.0, AcumuladoPerdidaBancos = 0.0
|
||||
' Dim IDPoliza = -1
|
||||
|
||||
' 'Valida datos de Compras
|
||||
' For Each gvr As GridViewRow In GvCompras.Rows
|
||||
' If gvr.DataKey("SinTipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Compras")
|
||||
' 'Exit Sub
|
||||
' Else
|
||||
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
|
||||
' AcumuladoGananciaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' Else
|
||||
' AcumuladoPerdidaCompras += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'Valida datos de Bancos
|
||||
' For Each gvr As GridViewRow In GvCuentas.Rows
|
||||
' If Not gvr.DataKey("TipoCambio").ToString.ToEntero > 0 AndAlso Not gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' Alert("No se puede Generar la Fluctuación ya que faltan datos en Cuentas Bancarias")
|
||||
' 'Exit Sub
|
||||
' Else
|
||||
' If gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If gvr.DataKey("Fluctuacion").ToString.ToDouble > 0 Then
|
||||
' AcumuladoGananciaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' Else
|
||||
' AcumuladoPerdidaBancos += gvr.DataKey("Fluctuacion").ToString.ToDouble * -1
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||
' ObjConta.IniciaTransacSQL()
|
||||
' Dim ObjBancos As New ClsBancos
|
||||
' ObjBancos.IniciaTransacSQL()
|
||||
' Dim ErrorGenerar = False
|
||||
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||
|
||||
' IDPoliza = ObjConta.AddPoliza(3, "Fluctuación Cambiaria", (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, (AcumuladoGananciaCompras + AcumuladoPerdidaCompras) * 2, UsuarioActual.CveUsuario, Fecha)
|
||||
|
||||
' If IDPoliza > 0 Then
|
||||
|
||||
' 'COMIENZA: AGREGA CUENTAS BANCARIAS
|
||||
' If AcumuladoGananciaBancos > 0 Or AcumuladoPerdidaBancos > 0 Then
|
||||
' 'Agrega movimientos
|
||||
' Dim Fluc As Double
|
||||
' For Each gvr As GridViewRow In GvCuentas.Rows
|
||||
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Cuentas Bancarias", If(Fluc > 0, "Ganancia", "Perdida")), 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'Agrega acumulados
|
||||
' If Not ErrorGenerar AndAlso AcumuladoGananciaBancos > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, 2195, AcumuladoGananciaBancos > 0, AcumuladoGananciaBancos, "", "Acumulado Ganancia Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' If Not ErrorGenerar AndAlso AcumuladoPerdidaBancos > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, 4695, AcumuladoPerdidaBancos > 0, AcumuladoPerdidaBancos, "", "Acumulado Pérdida Cambiaria de Cuentas Bancarias", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' 'TERMINA: AGREGA CUENTAS BANCARIAS
|
||||
|
||||
|
||||
' 'COMIENZA: AGREGA COMPRAS
|
||||
' If AcumuladoGananciaCompras > 0 Or AcumuladoPerdidaCompras > 0 Then
|
||||
' 'Agrega movimientos
|
||||
' Dim Fluc As Double
|
||||
' For Each gvr As GridViewRow In GvCompras.Rows
|
||||
' Fluc = gvr.DataKey("Fluctuacion").ToString.ToDouble
|
||||
' If Math.Abs(Fluc) > 0 AndAlso gvr.DataKey("IdCtaAfectable").ToString.ToEntero > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, gvr.DataKey("IdCtaAfectable").ToString.ToEntero, Not Fluc > 0, Math.Abs(Fluc), "", String.Format("{0} Cambiaria de Compras", If(Fluc > 0, "Ganancia", "Pérdida")), 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'Agrega acumulados
|
||||
' If Not ErrorGenerar AndAlso AcumuladoGananciaCompras > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaGananciaCambiaria, Not AcumuladoGananciaCompras > 0, AcumuladoGananciaCompras, "", "Acumulado Ganancia Cambiaria de Compras", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' If Not ErrorGenerar AndAlso AcumuladoPerdidaCompras > 0 Then
|
||||
' If Not ObjConta.AddMovimiento(IDPoliza, UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, Not AcumuladoPerdidaCompras > 0, AcumuladoPerdidaCompras, "", "Acumulado Pérdida Cambiaria de Compras", 0, Fecha, "") Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' 'TERMINA: AGREGA COMPRAS
|
||||
|
||||
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
|
||||
|
||||
' 'Agrega en Bitacoras
|
||||
' If Not ErrorGenerar Then
|
||||
' If ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' If Not ObjBancos.AddFluctuacionesBitacora(IDPoliza, Fecha, 2, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorGenerar = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
' If Not ErrorGenerar Then
|
||||
|
||||
' ObjConta.AjustaPoliza(IDPoliza)
|
||||
|
||||
' ObjConta.Commit()
|
||||
' ObjBancos.Commit()
|
||||
' Alert(String.Format("Fluctuación realizada con exito.<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza))
|
||||
' Else
|
||||
' ObjConta.RollBack()
|
||||
' ObjBancos.RollBack()
|
||||
' Alert("Ocurrio un error al generar la poliza", TipoMensaje.MsgAdvertencia)
|
||||
' End If
|
||||
|
||||
' ObjConta.Dispose()
|
||||
' ObjBancos.Dispose()
|
||||
' End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "GRIDVIEWS"
|
||||
|
||||
|
||||
Protected Sub GvCompras_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvCompras.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'TipoCambio = e.Row.DBCampo("TipoCambio").ToString.ToDouble
|
||||
|
||||
@@ -451,6 +451,23 @@ Partial Class Bancos_PopIECompras
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property CveSubProyecto As Integer
|
||||
Get
|
||||
|
||||
If ViewState("CveSubProyecto") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return ViewState("CveSubProyecto").ToString.ToEntero
|
||||
End If
|
||||
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveSubProyecto") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
@@ -668,6 +685,8 @@ Partial Class Bancos_PopIECompras
|
||||
TipoCambioOriginal = dr("TipoCambio").ToString.ToDecimal
|
||||
NombreProveedor = GlobalDTCompProveedores(UsuarioActual.CveEmpresa).FiltroPrimeroValor("RazonSocial", String.Format("CveProveedor = {0}", CveProveedor))
|
||||
|
||||
CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
LtlTitulo.Text = "Cuentas por Pagar"
|
||||
LtlTipo2.Text = "Folio de la Compra"
|
||||
LtlTipo3.Text = "Fecha de la Compra"
|
||||
@@ -1473,8 +1492,9 @@ Partial Class Bancos_PopIECompras
|
||||
Dim CveTipoPoliza As Integer = ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)
|
||||
If RBLContado.SelectedValue = "6" Then CveTipoPoliza = 3
|
||||
|
||||
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/PopIECompras", CvePlantillaPoliza, ImportePagado, ImportePagado, CveMoneda, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
|
||||
|
||||
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/PopIECompras", CvePlantillaPoliza, ImportePagado, ImportePagado, CveMoneda, Fecha, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=CveTipoPoliza)
|
||||
|
||||
|
||||
If Inserta Then
|
||||
If CvePrePoliza > 0 Then
|
||||
'SE AGREGA DETALLE DE UNA COMPRA
|
||||
@@ -1534,6 +1554,9 @@ Partial Class Bancos_PopIECompras
|
||||
'inserto las compras que voy a pagar
|
||||
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then
|
||||
For Each Row As DataRow In ObjMov.DtResultados.Rows
|
||||
|
||||
|
||||
Dim CveSubProyectoInsertar As Integer = -1
|
||||
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
|
||||
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
Dim ImporteMovimiento As Decimal = 0
|
||||
@@ -2173,187 +2196,187 @@ Partial Class Bancos_PopIECompras
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
'Case 16 'Ret ISR X Acreditar
|
||||
' If MovimientoPagar.ConceptoRetISR = 1 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = tipoCambioCompra
|
||||
|
||||
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISR > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISR
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Case 23 'Ret ISR Acreditable
|
||||
' If MovimientoPagar.ConceptoRetISR = 1 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISRAcreditable > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISRAcreditable
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento
|
||||
' If MovimientoPagar.ConceptoRetISR = 2 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISR > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISR
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
|
||||
' If MovimientoPagar.ConceptoRetISR = 2 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISRAcreditable > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISRAcreditable
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
End If
|
||||
'Case 16 'Ret ISR X Acreditar
|
||||
' If MovimientoPagar.ConceptoRetISR = 1 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = tipoCambioCompra
|
||||
|
||||
' If tipoCambioCompra > 1 Then ConceptoMovimiento += $" TC:{tipoCambioCompra} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISR > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISR
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(315).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(315).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Case 23 'Ret ISR Acreditable
|
||||
' If MovimientoPagar.ConceptoRetISR = 1 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISRAcreditable > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISRAcreditable
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(316).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(316).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Case 243 'Ret ISR X Acreditar Terceros y Arrendamiento
|
||||
' If MovimientoPagar.ConceptoRetISR = 2 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISR > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISR
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(317).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(317).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
'Case 244 'Ret ISR Acreditable Terceros y Arrendamiento
|
||||
' If MovimientoPagar.ConceptoRetISR = 2 Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.RetISR * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.RetISR * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioCompra, tipoCambioPago)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
|
||||
' 'Conta ContPAQ
|
||||
' If IdCtaContRetISRAcreditable > 0 Then
|
||||
' IdCtaContable = IdCtaContRetISRAcreditable
|
||||
' ElseIf UsuarioActual.Empresa.Funcionalidad(318).ToEntero > 0 Then
|
||||
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(318).ToEntero
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacion").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' 'Conta SIG
|
||||
' If CveCuentaRetISR <> 0 Then
|
||||
' CveCuenta = CveCuentaRetISR
|
||||
' Else
|
||||
' If ImporteMovimiento <> 0 AndAlso ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaRetISRCirculacionSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
Case 14 'Iva por Acreditar
|
||||
If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
|
||||
'funcionalidad que toma el 100% del pago para acreditamiento de iva
|
||||
@@ -2577,84 +2600,84 @@ Partial Class Bancos_PopIECompras
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), 280, ConceptoMovimiento, Fecha, IdCtaContableNoIVA, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMXNoDeducible, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
End If
|
||||
|
||||
'Case 280 'Iva Acreditable No Deducible
|
||||
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
|
||||
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
|
||||
' Dim TotalImporte As Decimal
|
||||
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' TotalImporte = ImportePagado.ToString.ToDecimal
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' TotalImporte = ImportePagado.ToString.ToDecimal
|
||||
' End If
|
||||
|
||||
' If TotalImporte = CompraSaldo Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
' Else
|
||||
' ImporteMovimiento = 0
|
||||
' ImporteMX = 0
|
||||
' End If
|
||||
' Else
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
' End If
|
||||
|
||||
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
|
||||
' Dim IdCtaIVAXAcreditar As Integer = 0
|
||||
' Dim IdCtaIVAAcreditable As Integer = 0
|
||||
|
||||
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
|
||||
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
|
||||
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
|
||||
' End If
|
||||
|
||||
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
|
||||
|
||||
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
End If
|
||||
|
||||
'Case 280 'Iva Acreditable No Deducible
|
||||
' If UsuarioActual.Empresa.Funcionalidad(521) = "1" Then
|
||||
' 'funcionalidad que toma el 100% del pago para acreditamiento de iva
|
||||
' Dim TotalImporte As Decimal
|
||||
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' TotalImporte = ImportePagado.ToString.ToDecimal
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal / tipoCambioPago, 2)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' TotalImporte = Math.Round(ImportePagado.ToString.ToDecimal * tipoCambioPago, 2)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' TotalImporte = ImportePagado.ToString.ToDecimal
|
||||
' End If
|
||||
|
||||
' If TotalImporte = CompraSaldo Then
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.IVANoDeducible
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
' Else
|
||||
' ImporteMovimiento = 0
|
||||
' ImporteMX = 0
|
||||
' End If
|
||||
' Else
|
||||
' If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = MovimientoPagar.IVANoDeducible * PorcentajePago
|
||||
' ImporteMX = ImporteMovimiento
|
||||
' ElseIf CveMoneda = 1 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 1 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * tipoCambioCompra
|
||||
' ElseIf CveMoneda = 2 AndAlso CveMonedaCompra = 2 Then
|
||||
' ImporteMovimiento = (MovimientoPagar.IVANoDeducible * PorcentajePago)
|
||||
' ImporteMX = ImporteMovimiento * If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
' End If
|
||||
' ImporteMovimiento = Math.Round(ImporteMovimiento, 2)
|
||||
' ImporteMX = Math.Round(ImporteMX, 2)
|
||||
' TimpocambioGeneral = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioCompra)
|
||||
|
||||
' If tipoCambioPago > 1 Then ConceptoMovimiento += $" TC:{tipoCambioPago} ${ImporteMovimiento.FormatoNumero(2)}"
|
||||
' End If
|
||||
|
||||
' PorcentajeImpuesto = MovimientoPagar.PorcentajeIVA
|
||||
' Dim IdCtaIVAXAcreditar As Integer = 0
|
||||
' Dim IdCtaIVAAcreditable As Integer = 0
|
||||
|
||||
' If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
|
||||
' IdCtaIVAXAcreditar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
|
||||
' IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
|
||||
' End If
|
||||
|
||||
' IdCtaContable = If(IdCtaIVAAcreditable > 0, IdCtaIVAAcreditable, 0)
|
||||
|
||||
' If ObjMov.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
|
||||
' If ObjMov.DtResultados.Rows.Count > 0 Then
|
||||
' IdCtaContable = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditable").ToString.ToEntero
|
||||
' CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIVAAcreditableSIG").ToString.ToEntero
|
||||
' End If
|
||||
' End If
|
||||
Case 25 'IEPS por Acreditar
|
||||
If CveMoneda = 1 AndAlso CveMonedaCompra = 1 Then
|
||||
ImporteMovimiento = MovimientoPagar.IEPS * PorcentajePago
|
||||
@@ -2703,7 +2726,15 @@ Partial Class Bancos_PopIECompras
|
||||
CveCuenta = ObjMov.DtResultados.Rows(0)("IdCuentaIEPSAcreditableSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
Case 64 'Ganancia
|
||||
Case 64 'Ganancia
|
||||
|
||||
CveSubProyectoInsertar = CveSubProyecto
|
||||
|
||||
If CveSubProyectoInsertar <= 0 Then
|
||||
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
|
||||
End If
|
||||
|
||||
|
||||
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
@@ -2723,6 +2754,13 @@ Partial Class Bancos_PopIECompras
|
||||
ImporteMovimiento = 0
|
||||
End If
|
||||
Case 65 'Perdida
|
||||
|
||||
CveSubProyectoInsertar = CveSubProyecto
|
||||
|
||||
If CveSubProyectoInsertar <= 0 Then
|
||||
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
|
||||
End If
|
||||
|
||||
If CveMoneda <> 1 OrElse CveMonedaCompra <> 1 Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
@@ -3323,15 +3361,19 @@ Partial Class Bancos_PopIECompras
|
||||
If IdCtaContable = 0 Then
|
||||
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
''Conta SIG
|
||||
'If CveCuenta = 0 Then
|
||||
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
' CveCuentaContabilizacion = 0
|
||||
'End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, -1, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
End If
|
||||
|
||||
''Conta SIG
|
||||
'If CveCuenta = 0 Then
|
||||
' CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
|
||||
' CveCuentaContabilizacion = 0
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteMovimiento, If(ConceptoContable = 30, TxtFolio.Text.Trim, TxtObservaciones.Text), ConceptoContable, ConceptoMovimiento, Fecha, IdCtaContable, -1, CveIE, -1, CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedor2, ImporteMX:=ImporteMX, CveCuenta:=CveCuenta, TipoCambio:=TimpocambioGeneral, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
MsgError = "No se pudo insertar la póliza"
|
||||
End If
|
||||
|
||||
|
||||
@@ -3146,6 +3146,7 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
If gr.DataKey("CveTipoConcepto").ToEntero = 2 Then CveConceptoContableComplementaria = 310 'cuando es acreedor
|
||||
|
||||
Dim ConceptoPartida As String = String.Format("Saldar compra {0}", gr.DataKey("SerieFolio").ToString)
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/ProveedoresAbonar/Saldar", 98, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, TxtFechaIncobrable.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If CveMoneda > 1 AndAlso (IdCtaContComplementaria > 0 Or UsuarioActual.CveEmpresa = 119) Then
|
||||
@@ -3223,15 +3224,23 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
If CveMoneda > 1 Then
|
||||
Dim ImporteFluctuacion As Decimal = 0
|
||||
ImporteFluctuacion = Saldo * (TCPago - TCCompra)
|
||||
|
||||
If CveSubProyecto <= 0 Then
|
||||
MsgError = "No se pudo obtener el sub proyecto o centro de costo"
|
||||
End If
|
||||
|
||||
|
||||
If TCCompra > TCPago Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveSubProyecto:=CveSubProyecto, CveProveedor:=gr.DataKey("CveProveedor").ToEntero, CveCompra:=gr.DataKey("CveCompra").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCCompra, TipoCambioPago:=TCPago) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -3896,6 +3896,7 @@ Partial Class Compras_Compras
|
||||
|
||||
'------------------INICIA VALIDACIONES------------------
|
||||
Dim EstatusCredito As Integer = 0
|
||||
Dim CveSubProyecto As Integer = 0
|
||||
'Credito Multiple
|
||||
If RBLPago.SelectedValue.ToEntero = 4 Then
|
||||
|
||||
@@ -4062,11 +4063,14 @@ Partial Class Compras_Compras
|
||||
' Dim NotHas117 As Boolean = Not UsuarioActual.TienePermisoProceso(117)
|
||||
' 'verifica que tenga proyecto y clasificacion
|
||||
For Each Row As DataRow In TmpDT.Rows
|
||||
|
||||
If Row("CveSubProyecto").ToString.ToEntero <= 0 Then
|
||||
Alert("No se ha completado la asignacion de proyectos en la compra. ", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
CveSubProyecto = Row("CveSubProyecto").ToString.ToEntero
|
||||
|
||||
If Row("CveClasificacionActualizar").ToString.ToEntero <= 0 Then 'If NotHas117 AndAlso Row("CveClasificacionActualizar").ToString.ToEntero <= 0 Then
|
||||
Alert("Hay productos que no tienen clasificación asignada.<br> Favor de asignarle una y darle guardar.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
@@ -5690,6 +5694,8 @@ Partial Class Compras_Compras
|
||||
|
||||
For Each Row As DataRow In DTPlatilla.Rows
|
||||
|
||||
Dim CveSubProyectoInsertar As Integer = -1
|
||||
|
||||
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
|
||||
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
|
||||
Dim importeMovimiento As Decimal = 0
|
||||
@@ -6291,6 +6297,15 @@ Partial Class Compras_Compras
|
||||
' End If
|
||||
' End If
|
||||
Case 64 'Ganancia
|
||||
|
||||
|
||||
CveSubProyectoInsertar = CveSubProyecto
|
||||
If CveSubProyectoInsertar <= 0 Then
|
||||
ErrorPrepoliza = True
|
||||
Alert("Concepto ganancia cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria
|
||||
@@ -6307,6 +6322,12 @@ Partial Class Compras_Compras
|
||||
|
||||
Case 65 'Perdida
|
||||
|
||||
CveSubProyectoInsertar = CveSubProyecto
|
||||
If CveSubProyectoInsertar <= 0 Then
|
||||
ErrorPrepoliza = True
|
||||
Alert("Concepto perdida cambiaria sin sub proyecto", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
If TCPago > 0 AndAlso TCPago <> 1 AndAlso TxtFechaPago.Text <> TxtFecha.Text Then
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria
|
||||
CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria
|
||||
@@ -6597,11 +6618,17 @@ Partial Class Compras_Compras
|
||||
'SumatoriaOCINV = -SumatoriaOCINV
|
||||
|
||||
Dim CveClasificacionCostoOC = TmpDT.FiltroPrimeroValor("CveClasificacion", "ISNULL(TipoAF, 0) <> 2 And ISNULL(CveAlmacen, 0) = 0 And ISNULL(AplicaCostoIndirecto, 0) <> 1 And ISNULL(CveTipoPS, 0) = 2").ToEntero
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
Dim CveSubProyecto69 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
|
||||
If CveSubProyecto69 <= 0 Then
|
||||
Alert("Debe de asignar un sub proyecto o centro de constos", TipoMensaje.MsgAdvertencia)
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {CveClasificacionCostoOC}").ToString.ToEntero
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, SumatoriaOCINV, Referencia, 69, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveClasificacion:=CveClasificacionCostoOC, ImporteMX:=SumatoriaOCINV, CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto69) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -6717,10 +6744,10 @@ Partial Class Compras_Compras
|
||||
Dim IdCtaContableDescCompra As Integer = UsuarioActual.Empresa.Funcionalidad(405).ToEntero
|
||||
|
||||
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
Dim CveSubProyecto259 As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
|
||||
If ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -importeMovimiento, Referencia, 259, Concepto, FechaMovimiento, IdCtaContableDescCompra, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=-importeMN, ImporteME:=If(tipoCambioActual = 1, 0, -importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto259) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
Else
|
||||
@@ -7528,7 +7555,8 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveSubProyecto:=CveSubProyectoInsertar, CveProveedor:=CveProveedorConcepto, CveAcreedor:=CveAcreedor, CveIE:=CveIE, CvePersonal:=CvePersonal, CveColectiva:=CveColectiva, CveCreditoDetalle:=CveCreditoDetalle, ImporteMX:=Math.Round(importeMN, 2, MidpointRounding.AwayFromZero), ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, PorcentajeImpuesto:=PorcentajeImpuesto, Contabilizable:=SeContabiliza) Then
|
||||
ErrorPrepoliza = True
|
||||
Exit For
|
||||
End If
|
||||
@@ -19658,7 +19686,18 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim CveSubProyecto As Integer = TmpDT.MAX("CveSubProyecto").ToEntero
|
||||
|
||||
|
||||
|
||||
If DiferenciaInvOC.RoundSQL() <> 0 Then
|
||||
|
||||
|
||||
|
||||
If CveSubProyecto <= 0 Then
|
||||
Alert("Debe de asignar un sub proyecto o centro de constos.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Compras/OC-(OCAlmacen)", 74, DiferenciaInvOC, DiferenciaInvOC, 1, Fecha, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
|
||||
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto">
|
||||
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
|
||||
@@ -637,6 +637,9 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
|
||||
'inserto las compras que voy a pagar
|
||||
For Each gvr As GridViewRow In GvCxP.Rows
|
||||
|
||||
|
||||
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
ConceptoMovimiento = $"{gvr.DataKey("Proveedor")} F:{gvr.DataKey("SerieFolio")} {If(DdlPersonal.Visible, DdlPersonal.SelectedItem.Text, DdlCajaChica.SelectedItem.Text)}"
|
||||
Referencia = gvr.DataKey("SerieFolio").ToString
|
||||
@@ -675,14 +678,19 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
CveIEPago = CveIERegistrado
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'Otros Ingresos
|
||||
If (ChkAjusteOI.Checked Or ChkOtrosIngresosCheque.Checked) AndAlso gvr.FCTextBox("TxtComision").Text.ToDecimal > 0 Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
|
||||
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
|
||||
End If
|
||||
If CveCajaChica > 0 AndAlso Not HdnCheque.Value.ToEntero > 0 Then
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
|
||||
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -98,8 +98,7 @@
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Notas de Crédito" OnRowDataBound="GvDatos_RowDataBound"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" Style="text-align: center;" GridLines="None"
|
||||
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,IdCtaContProveedores,
|
||||
IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio">
|
||||
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,IdCtaContProveedores,IdCtaContExtranjera,IdCtaContComplementaria,TipoCambio,CveSubProyecto">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="7%">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -145,6 +145,7 @@ Partial Class Compras_RepNotasCredito
|
||||
|
||||
CvePrePoliza = ObjConta.AddPrePolizas("Compras/RepNotasCredito", 103, gr.DataKey("Saldo").ToDecimal, gr.DataKey("Saldo").ToDecimal, gr.DataKey("CveMoneda").ToEntero, Now, "Saldado manual", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
If CveMoneda > 1 Then
|
||||
IdCtaContable = gr.DataKey("IdCtaContExtranjera").ToEntero
|
||||
ImporteMN = (gr.DataKey("Saldo").ToDecimal * TCCompra).RoundSQL
|
||||
@@ -165,7 +166,7 @@ Partial Class Compras_RepNotasCredito
|
||||
End If
|
||||
|
||||
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(266).ToString.ToEntero
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Importe, "", 211, Concepto, TxtFechaSaldar.Text.ToDate, IdCtaContable, -1, gr.DataKey("CveIE").ToEntero, ImporteMX:=If(CveMoneda > 1, (Importe * TC), Importe).RoundSQL, CveCuenta:=-1, CveCompra:=gr.DataKey("CveCompra").ToEntero, CveSubProyecto:=gr.DataKey("CveSubProyecto").ToEntero, CveProveedor:=gr.DataKey("CveProveedor").ToEntero) Then
|
||||
MsgError = "Ocurrio un Error al saldar el movimiento"
|
||||
End If
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<asp:LinkButton ID="LnkBitacotaFacturas" runat="server" OnClick="LnkBitacotaFacturas_Click"><i class="fa fa-book" ></i> Bitácora Facturas</asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="true" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkVinculacionMasivaComplementos" runat="server" OnClick="LnkVinculacionMasivaComplementos_Click" Visible ="false" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea realizar la vinculación masiva de complementos?" data-btn-ok-label="si"><i class="fa fa-tasks" ></i> Vinculación Masiva Complementos</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
|
||||
@@ -816,13 +816,17 @@ Partial Class ContabilidadC_RegPrePolizaS
|
||||
TipoMovto = False
|
||||
End If
|
||||
|
||||
If CveConcepto = 41 Then
|
||||
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
|
||||
Else
|
||||
CveIE = -1
|
||||
End If
|
||||
|
||||
|
||||
If CveConcepto <> 30 Then
|
||||
|
||||
If CveConcepto = 41 Then
|
||||
CveIE = gvr.FCDropDownList("DdlSaldos").SelectedValue.ToEntero
|
||||
Else
|
||||
CveIE = -1
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If idCuentaContabilizacion = 1 AndAlso (IdCtaContable = 0) Then
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
@@ -130,11 +130,11 @@ Partial Class Conta_RepMovimientosAuxiliaresCatalogo
|
||||
TxtFechaDel.Text = FechaInicio.ToShortDateString
|
||||
End If
|
||||
|
||||
'If Request("CveSubProyecto") IsNot Nothing Then
|
||||
' If IsNumeric(Request("CveSubProyecto")) Then
|
||||
' CveSubProyecto = Request("CveSubProyecto").ToString
|
||||
' End If
|
||||
'End If
|
||||
If Request("CveSubProyecto") IsNot Nothing Then
|
||||
If IsNumeric(Request("CveSubProyecto")) Then
|
||||
DdlSubproyecto.SelectedValueExist(Request("CveSubProyecto").ToString)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
ErrorParametros = False
|
||||
|
||||
@@ -705,9 +705,12 @@ Partial Class Contratos_Default
|
||||
End If
|
||||
|
||||
TipoContrato = DdlTipoContrato.SelectedValue.ToEntero
|
||||
TxtDescripcionTipoContrato.Text = GlobalDTContratosTipos(UsuarioActual.CveEmpresa).FiltraParametros("CveContratoTipo = " & DdlTipoContrato.SelectedValue)(0)("Descripcion").ToString()
|
||||
TxtDescripcionTipoContrato.Visible = True
|
||||
|
||||
If GlobalDTContratosTipos(UsuarioActual.CveEmpresa).FiltraParametros("CveContratoTipo = " & DdlTipoContrato.SelectedValue).Rows.Count > 0 Then
|
||||
TxtDescripcionTipoContrato.Text = GlobalDTContratosTipos(UsuarioActual.CveEmpresa).FiltraParametros("CveContratoTipo = " & DdlTipoContrato.SelectedValue)(0)("Descripcion").ToString()
|
||||
TxtDescripcionTipoContrato.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
CargaContratoPadre()
|
||||
UpProyecto.Update()
|
||||
End Sub
|
||||
@@ -725,6 +728,15 @@ Partial Class Contratos_Default
|
||||
TableDatosCabecera.Visible = True
|
||||
End If
|
||||
|
||||
If CveTipoContrato = 25 Then
|
||||
DvMax.Visible = False
|
||||
DvMin.Visible = False
|
||||
DvTotal.Visible = False
|
||||
|
||||
DivFianzas.Visible = False
|
||||
DivImpuestosLocales.Visible = False
|
||||
End If
|
||||
|
||||
ElseIf modalidadDetalleInt = 2 Then
|
||||
ModalidadDetalle = 2
|
||||
|
||||
@@ -735,6 +747,15 @@ Partial Class Contratos_Default
|
||||
|
||||
If CveContrato > 0 AndAlso CveTipoContrato <> 25 Then
|
||||
TableDatosCabecera.Visible = True
|
||||
End If
|
||||
|
||||
If CveTipoContrato = 25 Then
|
||||
DvMax.Visible = False
|
||||
DvMin.Visible = False
|
||||
DvTotal.Visible = False
|
||||
|
||||
DivFianzas.Visible = False
|
||||
DivImpuestosLocales.Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -755,11 +776,13 @@ Partial Class Contratos_Default
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Me.CveTipoContrato = DdlTipoContrato.SelectedValue.ToEntero
|
||||
|
||||
'Dim TipoMov = GlobalDTContratosTipos.FiltroPrimeroValor("TipoMovimiento", $"CveContratoTipo='{CveTipoContrato}'").ToEntero
|
||||
|
||||
If rpCompra.Checked Then
|
||||
Dim CveContratoTipo = DdlTipoContrato.SelectedValue.ToEntero
|
||||
Response.Redirect($"/Contratos/Presupuestos.aspx?CveContrato=-1&CveContratoTipo={CveContratoTipo}")
|
||||
If rpCompra.Checked Then
|
||||
|
||||
Response.Redirect($"/Contratos/Presupuestos.aspx?CveContrato=-1&CveContratoTipo={Me.CveTipoContrato}")
|
||||
'RegistraScript("window.location='/Contratos/Presupuestos.aspx")
|
||||
Else
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvCiclosComerciales" runat="server" DataKeyNames="CveCicloComercial, NumeroContrato, CveSubProyecto" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron pendientes por facturar" GridLines="none" ToolTip="Listado de Pendientes" CssClass="table table-striped table-hover Widthall">
|
||||
<asp:GridView ID="GvCiclosComerciales" runat="server" DataKeyNames="CveCicloComercial, NumeroContrato, CveSubProyecto, FechaVenc" AutoGenerateColumns="False" ShowHeader="True" EmptyDataText="No se encontraron pendientes por facturar" GridLines="none" ToolTip="Listado de Pendientes" CssClass="table table-striped table-hover Widthall">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" headertext="" ItemStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -166,350 +166,279 @@ Partial Class Contratos_FacturacionMasiva
|
||||
End Sub
|
||||
|
||||
Protected Sub ImgFacturarTodos_Click(sender As Object, e As EventArgs) Handles BtnFacturar.Click
|
||||
Dim FacturadoCorrecto = True
|
||||
EjecutarFacturacion()
|
||||
End Sub
|
||||
|
||||
Private Sub EjecutarFacturacion()
|
||||
Dim FacturadoCorrecto = True
|
||||
Dim sb As New StringBuilder()
|
||||
|
||||
For Each row As GridViewRow In GvCiclosComerciales.Rows
|
||||
If row.FCCheckBox("chkDis").Checked Then
|
||||
FacturadoCorrecto = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero)
|
||||
Dim fecha As DateTime = DateTime.Now ', row.DataKey("FechaVenc").ToString.ToDateTime()
|
||||
Dim formatoFecha = Globalization.CultureInfo.CurrentCulture.DateTimeFormat
|
||||
Dim nombreMes = formatoFecha.GetMonthName(fecha.Month).ToUpper()
|
||||
|
||||
Dim Etiqueta As String = String.Format("{0} - {1}", nombreMes, fecha.Year)
|
||||
|
||||
Dim Resp = EmitirImprimir(row.DataKey("CveCicloComercial").ToString.ToEntero, Etiqueta)
|
||||
|
||||
For Each Msg In Resp.Mensajes
|
||||
sb.AppendFormat("{0}</br></br>", Msg)
|
||||
Next
|
||||
|
||||
If Not FacturadoCorrecto Then
|
||||
If Mensaje = "" Then
|
||||
Alert("Ocurrió un error al facturar masivamente, por favor contacte a soporte técnico", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
Alert($"{Mensaje} en el contrato {row.DataKey("NumeroContrato").ToString}", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If FacturadoCorrecto Then
|
||||
Alert("Los periodos se facturaron correctamente")
|
||||
TxtObservaciones.Text = ""
|
||||
End If
|
||||
|
||||
If sb.ToString().Length > 0 Then
|
||||
Alert($"Se generaron las siguientes facturas: </br></br> {sb.ToString()}")
|
||||
Else
|
||||
Alert("No se generaron facturas", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
RegistraScript("$('#divAgregar').modal('hide')")
|
||||
UpBodyEstatus.Update()
|
||||
UpBodyEstatus.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs)
|
||||
CveCicloComercial = CType(sender, LinkButton).CommandArgument.ToEntero
|
||||
CreaObjetosVenta()
|
||||
|
||||
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||
ObjFactura = Nothing
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If DTDetalle.Rows.Count > 0 Then
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
ErrorList = New List(Of String)
|
||||
MensajeAlert = New StringBuilder
|
||||
|
||||
|
||||
'CONTABILIDAD AUTOMATICA Y AC
|
||||
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
End If
|
||||
|
||||
|
||||
'GUARDA VENTA
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
|
||||
|
||||
If CveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
If Not ObjContr.CicloComercialUpdate(CveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("No se pudo actualizar ")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
|
||||
ObjVentas.Commit()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
|
||||
Dim SeTimbro As Boolean = False
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
|
||||
|
||||
Dim sw As New Diagnostics.Stopwatch
|
||||
sw.Start()
|
||||
|
||||
'FACTURA INGRESO/EGRESO
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
|
||||
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
|
||||
sw.Stop()
|
||||
GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
|
||||
End If
|
||||
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
|
||||
|
||||
If SeTimbro Then
|
||||
'XML
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
|
||||
'IMPRESION
|
||||
GeneraPDFFactura(False)
|
||||
Else
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
|
||||
End If
|
||||
|
||||
'MUESTA ALERT OK
|
||||
Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
|
||||
Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
ObjFactura = Nothing
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
CargaDatos(DdlContrato.SelectedValue.ToEntero, DdlCliente.SelectedValue.ToEntero)
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
'ObjFolios.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
|
||||
End If
|
||||
Else
|
||||
Mensaje = "Las facturas del contrato"
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Protected Sub btnFacturarAqui_Click(sender As Object, e As EventArgs)
|
||||
EjecutarFacturacion()
|
||||
End Sub
|
||||
|
||||
Private Function EmitirImprimir(pCveCicloComercial As Integer) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
Private Function EmitirImprimir(pCveCicloComercial As Integer, Etiqueta As String) As Modelos.Factura.MMensajeFactura
|
||||
Dim Resp As New Modelos.Factura.MMensajeFactura
|
||||
ViewState("CveCicloComercial") = pCveCicloComercial
|
||||
CreaObjetosVenta()
|
||||
CreaObjetosVenta(Etiqueta)
|
||||
If ObjFactura Is Nothing Or ObjFactura.Cliente Is Nothing Then
|
||||
Alert("Ocurrió un error al procesar los datos de la Venta.", TipoMensaje.MsgError)
|
||||
ObjFactura = Nothing
|
||||
Return False
|
||||
Return Resp
|
||||
End If
|
||||
|
||||
|
||||
If ObjFactura.CveCliente > 0 Then
|
||||
If DTDetalle.Rows.Count > 0 Then
|
||||
If DTDetalle.Rows.Count > 0 Then
|
||||
|
||||
Resp = ObjFactura.EmitirFactura()
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
|
||||
Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
'Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
ErrorList = New List(Of String)
|
||||
MensajeAlert = New StringBuilder
|
||||
'Dim ObjVentas As New ClsVentas()
|
||||
'Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjInventario As New ClsInventarios(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjContr As New ClsContratos(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjOS As New ClsOS(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjBancos As New ClsBancos(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjClientes As New ClsClientes(ObjVentas.IniciaTransacSQL())
|
||||
'Dim ObjContPaq As ClsContPAQi = Nothing
|
||||
''Dim ObjFolios As New ClsGralFolios(ObjVentas.IniciaTransacSQL())
|
||||
'ErrorList = New List(Of String)
|
||||
'MensajeAlert = New StringBuilder
|
||||
|
||||
|
||||
'CONTABILIDAD AUTOMATICA Y AC
|
||||
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
End If
|
||||
''CONTABILIDAD AUTOMATICA Y AC
|
||||
'If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
' ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
'End If
|
||||
|
||||
|
||||
'GUARDA VENTA
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
|
||||
''GUARDA VENTA
|
||||
'GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS)
|
||||
|
||||
If pCveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
If Not ObjContr.CicloComercialUpdate(pCveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
ErrorList.Add("No se pudo actualizar ")
|
||||
End If
|
||||
End If
|
||||
'If pCveCicloComercial > 0 AndAlso ErrorList.Count = 0 Then
|
||||
' If Not ObjContr.CicloComercialUpdate(pCveCicloComercial, True, UsuarioActual.CveEmpresa) Then
|
||||
' ErrorList.Add("No se pudo actualizar ")
|
||||
' End If
|
||||
'End If
|
||||
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
|
||||
ObjVentas.Commit()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
'If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot")) Then
|
||||
' ObjVentas.Commit()
|
||||
' If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
|
||||
' ViewState("CveVenta") = ObjFactura.CveVenta
|
||||
|
||||
|
||||
Dim SeTimbro As Boolean = False
|
||||
'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
' Dim SeTimbro As Boolean = False
|
||||
' 'TIMBRADO Y CASO ESPECIAL NOTA DE CREDITO
|
||||
|
||||
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
||||
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
|
||||
' If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "Ant") Then
|
||||
' If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso UsuarioActual.Empresa.FacturaProduccion Then
|
||||
|
||||
Dim sw As New Diagnostics.Stopwatch
|
||||
sw.Start()
|
||||
' Dim sw As New Diagnostics.Stopwatch
|
||||
' sw.Start()
|
||||
|
||||
'FACTURA INGRESO/EGRESO
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
' 'FACTURA INGRESO/EGRESO
|
||||
' Dim ObjTimbrado As New Timbrado
|
||||
|
||||
|
||||
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
|
||||
sw.Stop()
|
||||
GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
|
||||
End If
|
||||
' sw.Stop()
|
||||
' GuardaLogTimbrado(sw.ElapsedMilliseconds.ToString, UsuarioActual.Empresa.CvePAC)
|
||||
' End If
|
||||
|
||||
|
||||
'MENSAJE PRINCIPAL
|
||||
MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
' 'MENSAJE PRINCIPAL
|
||||
' MensajeAlert.AppendFormat(String.Format("<br/>La {0}: <b>{1}</b> se generó correctamente.<br/><br/>", ObjFactura.TipoDocumento, ObjFactura.SerieFolio))
|
||||
|
||||
|
||||
If SeTimbro Then
|
||||
'XML
|
||||
Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
If File.Exists(ArchivoXML) Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
End If
|
||||
' If SeTimbro Then
|
||||
' 'XML
|
||||
' Dim ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto, ObjFactura.SerieFolio)
|
||||
' If File.Exists(ArchivoXML) Then
|
||||
' MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar XML</a></li></ul>", Encripta(String.Format("OP=FactVta&CVEVENTA={0}&EXT={1}&SERIEFOLIO={2}&TIPODOCTO={3}", ObjFactura.CveVenta, "XML", ObjFactura.SerieFolio, ObjFactura.TipoDocto)))
|
||||
' End If
|
||||
|
||||
'IMPRESION
|
||||
GeneraPDFFactura(False)
|
||||
Else
|
||||
MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
|
||||
End If
|
||||
' 'IMPRESION
|
||||
' GeneraPDFFactura(False)
|
||||
' Else
|
||||
' MensajeAlert.AppendFormat("La factura no se pudo timbrar.</b> Por favor intentelo de nuevo a traves del boton Emitir o póngase en contacto con soporte técnico.")
|
||||
' End If
|
||||
|
||||
'MUESTA ALERT OK
|
||||
Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
|
||||
retorno = True
|
||||
ObjFactura = Nothing
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
' 'MUESTA ALERT OK
|
||||
' Dim Liga = If(UsuarioActual.CveRol = 1165, "document.location.href=""/Ventas/Ventas.aspx?CveVenta=-1"";", $"document.location.href=""/Ventas/Clientes.aspx?CveCliente={ObjFactura.CveCliente}&Opt=3"";")
|
||||
' retorno = True
|
||||
' ObjFactura = Nothing
|
||||
' Else
|
||||
' ObjVentas.RollBack()
|
||||
' If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
' For Each ErrorItem In ErrorList
|
||||
' Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
' Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
End If
|
||||
' 'MUESTA ALERT ERROR
|
||||
' Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
Else
|
||||
ObjVentas.RollBack()
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
' ObjVentas.Dispose()
|
||||
' ObjConta.Dispose()
|
||||
' ObjInventario.Dispose()
|
||||
' ObjContr.Dispose()
|
||||
' ErrorList = Nothing
|
||||
' MensajeAlert = Nothing
|
||||
' If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
'Else
|
||||
' ObjVentas.RollBack()
|
||||
' If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
|
||||
|
||||
For Each ErrorItem In ErrorList
|
||||
Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
Next
|
||||
' For Each ErrorItem In ErrorList
|
||||
' Alert(ErrorItem, TipoMensaje.MsgAdvertencia)
|
||||
' Next
|
||||
|
||||
'MUESTA ALERT ERROR
|
||||
Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
ObjVentas.Dispose()
|
||||
ObjConta.Dispose()
|
||||
ObjInventario.Dispose()
|
||||
ObjContr.Dispose()
|
||||
'ObjFolios.Dispose()
|
||||
ErrorList = Nothing
|
||||
MensajeAlert = Nothing
|
||||
If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
End If
|
||||
' 'MUESTA ALERT ERROR
|
||||
' Alert("Ocurrió un error al procesar los datos. Por favor rectifique y vuelta a intentar.", TipoMensaje.MsgError)
|
||||
' ObjVentas.Dispose()
|
||||
' ObjConta.Dispose()
|
||||
' ObjInventario.Dispose()
|
||||
' ObjContr.Dispose()
|
||||
' 'ObjFolios.Dispose()
|
||||
' ErrorList = Nothing
|
||||
' MensajeAlert = Nothing
|
||||
' If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
|
||||
'End If
|
||||
Else
|
||||
Mensaje = "No se pudo completar facturación por que no se encontraron partidas "
|
||||
End If
|
||||
End If
|
||||
TmpDT.Clear()
|
||||
Return retorno
|
||||
Return Resp
|
||||
End Function
|
||||
|
||||
|
||||
Private Sub CreaDTVentas()
|
||||
Private Sub CreaDTVentas()
|
||||
TmpDT = New DataTable
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Double))
|
||||
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("SerieLote", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
TmpDT.Columns.Add("PU", GetType(Double))
|
||||
TmpDT.Columns.Add("IVA", GetType(Double))
|
||||
TmpDT.Columns.Add("IEPS", GetType(Double))
|
||||
TmpDT.Columns.Add("Descuento", GetType(Double))
|
||||
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||
TmpDT.Columns.Add("Total", GetType(Double))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("Observacion", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveUM", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Double))
|
||||
TmpDT.Columns.Add("PorcentajeIVA", GetType(Double))
|
||||
TmpDT.Columns.Add("ImporteIVA", GetType(Double))
|
||||
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Double))
|
||||
TmpDT.Columns.Add("ImporteIEPS", GetType(Double))
|
||||
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Double))
|
||||
TmpDT.Columns.Add("ImporteRetIVA", GetType(Double))
|
||||
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Double))
|
||||
TmpDT.Columns.Add("ImporteRetISR", GetType(Double))
|
||||
|
||||
TmpDT.Columns.Add("CveVenta", GetType(Integer))
|
||||
TmpDT.Columns.Add("Consec", GetType(Integer))
|
||||
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Codigo", GetType(String))
|
||||
TmpDT.Columns.Add("CveUM", GetType(Integer))
|
||||
TmpDT.Columns.Add("UM", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveUM", GetType(String))
|
||||
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
|
||||
TmpDT.Columns.Add("Clasificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CvePS", GetType(Integer))
|
||||
TmpDT.Columns.Add("PS", GetType(String))
|
||||
TmpDT.Columns.Add("CodigoPS", GetType(String))
|
||||
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
|
||||
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
|
||||
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
|
||||
TmpDT.Columns.Add("Serie", GetType(String))
|
||||
TmpDT.Columns.Add("CuentaPredial", GetType(String))
|
||||
TmpDT.Columns.Add("Obs", GetType(String))
|
||||
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
|
||||
TmpDT.Columns.Add("PU", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
|
||||
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("IEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Descuento", GetType(Decimal))
|
||||
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
|
||||
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
|
||||
TmpDT.Columns.Add("Total", GetType(Decimal))
|
||||
'Para uso del módulo contable
|
||||
TmpDT.Columns.Add("AsientoContableVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("IdCtaContVentas", GetType(Integer))
|
||||
TmpDT.Columns.Add("AplicaParaConcepto", GetType(Boolean))
|
||||
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("Proyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
|
||||
TmpDT.Columns.Add("SubProyecto", GetType(String))
|
||||
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
|
||||
|
||||
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
|
||||
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
|
||||
'Contratos
|
||||
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
|
||||
'Remisiones a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
|
||||
|
||||
'Pedido2 a Facturas
|
||||
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("Origen", GetType(Integer))
|
||||
'Ordenes Servicio
|
||||
TmpDT.Columns.Add("CveOS", GetType(Integer))
|
||||
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
|
||||
TmpDT.Columns.Add("Folio", GetType(Integer))
|
||||
TmpDT.Columns.Add("Estatus", GetType(String))
|
||||
'Ordenamiento
|
||||
TmpDT.Columns.Add("Orden", GetType(Integer))
|
||||
TmpDT.Columns.Add("TipoDocto", GetType(String))
|
||||
'OC
|
||||
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
|
||||
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
|
||||
|
||||
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
|
||||
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
|
||||
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
|
||||
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
|
||||
|
||||
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
|
||||
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
|
||||
End Sub
|
||||
Private Sub CreaObjetosVenta(Optional VistaPrevia As Boolean = False)
|
||||
Private Sub CreaObjetosVenta(Etiqueta As String, Optional VistaPrevia As Boolean = False)
|
||||
Dim ObjFolios As New ClsGralFolios()
|
||||
Dim Folio As String = ""
|
||||
Dim Serie As String = ""
|
||||
@@ -518,10 +447,9 @@ Partial Class Contratos_FacturacionMasiva
|
||||
Dim Proyecto As String = ""
|
||||
Dim SubProyecto As String = ""
|
||||
|
||||
|
||||
|
||||
ObjFactura = New Modelos.Factura
|
||||
Dim objContratos As New ClsContratos
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual)
|
||||
ObjFactura.DirectorioServidor = Server.MapPath("/")
|
||||
ObjFactura.CveCicloComercial = CveCicloComercial
|
||||
Dim DR As DataRow = DTCicloComercial.FiltroPrimero($"CveCicloComercial = {CveCicloComercial}")
|
||||
|
||||
ObjFactura.Version = "3.3"
|
||||
@@ -544,7 +472,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
ObjFactura.MetodoPago = "Efectivo"
|
||||
ObjFactura.FechaPago = DateTime.Today
|
||||
ObjFactura.MotivoDescuento = ""
|
||||
ObjFactura.Observaciones = DR("Observaciones").ToString
|
||||
ObjFactura.Observaciones = Etiqueta + " " + TxtObservaciones.Text + " " + DR("Observaciones").ToString
|
||||
ObjFactura.FechaEjecucion = DateTime.Today
|
||||
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {1}")
|
||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||
@@ -587,15 +515,16 @@ Partial Class Contratos_FacturacionMasiva
|
||||
End If
|
||||
DT.Dispose()
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
|
||||
ObjFolios.Dispose()
|
||||
|
||||
Dim objContratos As New ClsContratos
|
||||
If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then
|
||||
DTDetalle = objContratos.DtResultados
|
||||
Else
|
||||
DTDetalle = Nothing
|
||||
End If
|
||||
|
||||
objContratos.Dispose()
|
||||
objContratos.Dispose()
|
||||
|
||||
Dim DtR As DataRow
|
||||
ObjFactura.SubTotal = SUM(DTDetalle, "Total").ToDecimal
|
||||
ObjFactura.IVA = SUM(DTDetalle, "ImporteIVA").ToDecimal
|
||||
@@ -607,34 +536,27 @@ Partial Class Contratos_FacturacionMasiva
|
||||
ObjFactura.Folio = Folio.ToEntero
|
||||
|
||||
For Each row As DataRow In DTDetalle.Rows
|
||||
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row("CvePS").ToString().ToEntero()).FiltroPrimero("")
|
||||
|
||||
DtR = TmpDT.NewRow
|
||||
DtR("CveVenta") = -1
|
||||
DtR("Codigo") = row("Codigo")
|
||||
DtR("Consec") = TmpDT.Rows.Count + 1
|
||||
DtR("Cantidad") = row("CantidadContratada")
|
||||
DtR("CveUM") = row("CveUM")
|
||||
DtR("UM") = row("UM")
|
||||
DtR("UM") = row("UM")
|
||||
DtR("SATClaveUM") = row("SATClaveUM")
|
||||
DtR("CveClasificacion") = row("CveClasificacion")
|
||||
DtR("Clasificacion") = row("Clasificacion")
|
||||
DtR("CvePS") = row("CvePS")
|
||||
DtR("PS") = row("PS")
|
||||
DtR("CodigoPS") = row("CodigoPS")
|
||||
DtR("Obs") = ""
|
||||
DtR("PU") = row("PU")
|
||||
DtR("Descuento") = 0
|
||||
DtR("TipoDescuento") = 0
|
||||
DtR("CveProyecto") = CveProyecto
|
||||
DtR("Proyecto") = Proyecto
|
||||
DtR("CveSubProyecto") = CveSubProyecto
|
||||
DtR("SubProyecto") = SubProyecto
|
||||
DtR("CveVentaDetalle") = 0
|
||||
DtR("CveContratoDetalle") = row("CveContratoDetalle")
|
||||
DtR("Observacion") = row("Observacion")
|
||||
DtR("SATClaveUM") = row("SATClaveUM")
|
||||
DtR("CodigoPS") = row("CodigoPS")
|
||||
DtR("SATClaveProdServ") = row("SATClaveProdServ")
|
||||
DtR("CuentaPredial") = row("CuentaPredial")
|
||||
DtR("NoIdentificacion") = row("NoIdentificacion")
|
||||
DtR("TotalImporte") = row("Total")
|
||||
DtR("NoIdentificacion") = row("NoIdentificacion")
|
||||
DtR("CveTipoPS") = DrPS("CveTipoPS")
|
||||
DtR("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
|
||||
DtR("Obs") = Etiqueta + " " + TxtObservaciones.Text + " " + row("Observacion").ToString
|
||||
DtR("PU") = row("PU")
|
||||
DtR("IVA") = row("PorcentajeIVA")
|
||||
DtR("PorcentajeIVA") = row("PorcentajeIVA")
|
||||
DtR("ImporteIVA") = row("ImporteIVA")
|
||||
@@ -644,6 +566,17 @@ Partial Class Contratos_FacturacionMasiva
|
||||
DtR("ImporteRetIVA") = row("ImporteRetIVA")
|
||||
DtR("PorcentajeRetISR") = row("PorcentajeRetISR")
|
||||
DtR("ImporteRetISR") = row("ImporteRetISR")
|
||||
DtR("Descuento") = 0
|
||||
DtR("TipoDescuento") = 0
|
||||
DtR("CveProyecto") = CveProyecto
|
||||
DtR("Proyecto") = Proyecto
|
||||
DtR("CveSubProyecto") = CveSubProyecto
|
||||
DtR("SubProyecto") = SubProyecto
|
||||
DtR("CveVentaDetalle") = 0
|
||||
DtR("CveContratoDetalle") = row("CveContratoDetalle")
|
||||
DtR("CuentaPredial") = row("CuentaPredial")
|
||||
DtR("TotalImporte") = row("Total")
|
||||
|
||||
TmpDT.Rows.Add(DtR)
|
||||
Next
|
||||
|
||||
@@ -952,7 +885,9 @@ Partial Class Contratos_FacturacionMasiva
|
||||
IdCtaContable = 0
|
||||
CveCuenta = 0
|
||||
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "")
|
||||
Concepto = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, ObjFactura.Cliente.Nombre, $"{ObjFactura.Serie}-{ObjFactura.Folio}", "")
|
||||
|
||||
Dim PorcentajeImpuesto As Decimal = 0
|
||||
|
||||
Select Case ConceptoContable
|
||||
Case 1 'Cliente
|
||||
@@ -1077,6 +1012,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
FechaMovimiento = ObjFactura.FechaPago
|
||||
IdCtaContable = UsuarioActual.Empresa.IdCuentaIVAxTrasladar
|
||||
If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}"
|
||||
PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIVA").ToDecimal
|
||||
|
||||
Case 38 'IEPS por Trasladar
|
||||
If Not ObjFactura.TipoDocto.Contiene("Rem") Then
|
||||
@@ -1089,7 +1025,8 @@ Partial Class Contratos_FacturacionMasiva
|
||||
IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladar").ToString.ToEntero
|
||||
CveCuenta = ObjConta.DtResultados.Rows(0)("IdCuentaIEPSxTrasladarSIG").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
PorcentajeImpuesto = TmpDTDetalle.MAX("PorcentajeIEPS").ToDecimal
|
||||
End If
|
||||
|
||||
End Select
|
||||
@@ -1101,7 +1038,7 @@ Partial Class Contratos_FacturacionMasiva
|
||||
idCuentaContabilizacion = 0
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento)) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIE, ImporteMX:=importeMX, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), PorcentajeImpuesto:=PorcentajeImpuesto) Then
|
||||
ErrorPrepoliza = True
|
||||
Else
|
||||
ViewState("SeGuardoPrePoliza") = True
|
||||
|
||||
@@ -199,7 +199,10 @@ Partial Class Inventarios_PrestamosdeProveedor
|
||||
CveSubProyecto = ObjInventario.DtResultados.FiltraParametros($"CveAlmacen = {DdlAlmacenOrigen.SelectedValue.ToEntero } ").FiltroPrimeroValor("CveSubProyecto").ToString.ToEntero
|
||||
End If
|
||||
|
||||
|
||||
If CveSubProyecto <= 0 Then
|
||||
Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
Dim CveClasifCosto As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveClasificacion", String.Format("CvePS ={0} ", CvePS))
|
||||
IdCtaContableOtro = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {CveClasifCosto}").ToEntero
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -360,6 +360,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%--ADVERTENCIA--%>
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="vertical-align: middle;" align="center">
|
||||
<div style="z-index: 5; position: relative;">
|
||||
<div id="DivTraspasoDevolucion" visible="false" clientidmode="Static" runat="server" class="alert alert-warning" style="padding: 5px; margin-bottom: 5px; padding-right: 25px;">
|
||||
<button type="button" class="close" data-dismiss="alert" style="margin-top: 5px;" aria-hidden="true"></button>
|
||||
<strong style="font-size: 20px; margin-right: 25px;">Información: </strong>
|
||||
<asp:Literal Text="La mercancía sera trasladada desde el almacen seleccionado al almacén de devolución" ID="LtlTextoDevolucion" runat="server"></asp:Literal>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -418,7 +430,7 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:GridView ID="GvInv" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
|
||||
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote,AplicaSeccion,AplicaLote,AplicaCaducidad,AplicaSerie,CveAlmacenDevolucionProveedor" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
DataKeyNames="EntregaDirecta,Consec,CodigoBarras,CvePS,CveUM,PU,CantidadC,CantidadF,UM,PS,CveCompraDetalle,CveOrdenCompraDetalle,PUExtranjero,AplicaSerieLote,CveClasificacion,Codigo,CveVentaDetalle,CostoIndirecto,CveTamaño,Lote,AplicaSeccion,AplicaLote,AplicaCaducidad,AplicaSerie" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
<HeaderStyle Height="58px" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
@@ -1005,6 +1017,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#DivTraspasoDevolucion')) {
|
||||
$("#DivTraspasoDevolucion").pulsate("destroy");
|
||||
jQuery('#DivTraspasoDevolucion').pulsate({
|
||||
color: "#faebcc"
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
ViewState("CveVendedor") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property RealizarTraspasoAlmacenDevolucion() As Boolean
|
||||
Private Property RealizarTraspasoAlmacenDevolucion As Boolean
|
||||
Get
|
||||
Return If(IsNothing(ViewState("RealizarTraspasoAlmacenDevolucion")), False, CBool(ViewState("RealizarTraspasoAlmacenDevolucion")))
|
||||
End Get
|
||||
@@ -926,11 +926,16 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
DtRecepcion = ObjInventario.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
If TipoMovimiento = 2 AndAlso GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=21).Rows.Count > 0 Then
|
||||
CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero
|
||||
|
||||
If TipoMovimiento = 2 AndAlso CveAlmacenDevolucionProveedor > 0 Then
|
||||
RealizarTraspasoAlmacenDevolucion = True
|
||||
CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero
|
||||
'CreaDTAlmacenDevolucion()
|
||||
'CargaAlmacenes(-1, "21", CveTipoCompra)
|
||||
|
||||
DivTraspasoDevolucion.Visible = True
|
||||
LtlTextoDevolucion.Text = "La mercancía sera trasladada desde el almacen seleccionado al almacén de devolución"
|
||||
ElseIf TipoMovimiento = 2 AndAlso GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=21).Rows.Count = 0 Then
|
||||
LtlTextoDevolucion.Text = "La mercancía sera devuelta ha el almacen seleccionado."
|
||||
DivTraspasoDevolucion.Visible = True
|
||||
End If
|
||||
|
||||
DtDatosDetalle = Nothing
|
||||
@@ -3262,7 +3267,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Msg.AppendFormat("Movimiento de Salida: Folio: <b>{0}</b>", String.Format("<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a>", CveMovimientoSalidaTraspaso, FolioSalidaTraspaso))
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalidaTraspaso)))
|
||||
|
||||
Msg.AppendFormat("<br/>Movimiento de Entrada: Folio: <b>{0}</b>", link)
|
||||
Msg.AppendFormat("<br/><br/>Movimiento de control: Folio: <b>{0}</b>", link)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
End If
|
||||
|
||||
|
||||
@@ -346,6 +346,11 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
ThSerie.Visible = True
|
||||
TrSerie.Visible = True
|
||||
TxtnSerie.Visible = True
|
||||
Else
|
||||
ThSerie.Visible = False
|
||||
TrSerie.Visible = False
|
||||
TxtnSerie.Visible = False
|
||||
TxtnSerie.Text = ""
|
||||
End If
|
||||
|
||||
'activa seccion
|
||||
@@ -368,13 +373,19 @@ Partial Class Inventarios_ResguardoMaterial
|
||||
If CBool(drp("AplicaLote")) Then
|
||||
ThLote.Visible = True
|
||||
TrLote.Visible = True
|
||||
'TxtLote.Visible = True
|
||||
Else
|
||||
ThLote.Visible = False
|
||||
TrLote.Visible = False
|
||||
TxtLote.Text = ""
|
||||
End If
|
||||
'activa caducidad
|
||||
If CBool(drp("AplicaCaducidad")) Then
|
||||
ThCaducidad.Visible = True
|
||||
TrCaducidad.Visible = True
|
||||
'TxtCaducidad.Visible = True
|
||||
Else
|
||||
ThCaducidad.Visible = False
|
||||
TrCaducidad.Visible = False
|
||||
TxtCaducidad.Text = ""
|
||||
End If
|
||||
|
||||
Else
|
||||
|
||||
@@ -259,8 +259,7 @@
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar autorización?" data-btn-ok-label="Si" OnClick="LnkAceptarTraslado_Click"></asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-6" style="text-align:center!important">
|
||||
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" Text ="Rechazar" ID="LnkRechazarTraslado" CssClass="btn btn-danger" OnClick="LnkRechazarTraslado_Click" ></asp:LinkButton>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -500,6 +499,51 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="ModalRechazarTraslado" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 450px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalRechazo" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal3" runat="server">Rechazar solicitud</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-10 form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtMotivoRechazo" CssClass="form-control marginFixRow" runat="server" MaxLength="200" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtMotivoRechazo.ClientID.ToString()%>">Motivo de rechazo:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtMotivoRechazo" runat="server" ControlToValidate="TxtMotivoRechazo" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Motivo de rechazo''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRechazo"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<asp:Button ID="BtnModalRechazo" runat="server" class="btn btn-danger" Text="Rechazar" Style="margin-left: -100px;" ValidationGroup="GrpRechazo"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Confirmar rechazo?" data-btn-ok-label="Si" OnClick="BtnModalRechazo_Click" />
|
||||
<button id="btnModalRechazoCerrar" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -36,19 +36,19 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
ViewState("CveDireccionEnvio") = value
|
||||
End Set
|
||||
End Property
|
||||
'Private Property CveUsuarioAutoriza As Integer
|
||||
' Get
|
||||
' If ViewState("CveUsuarioAutoriza") Is Nothing Then
|
||||
' Return -1
|
||||
' Else
|
||||
' Return CType(ViewState("CveUsuarioAutoriza"), Integer)
|
||||
' End If
|
||||
Private Property CveUsuarioSolicita As Integer
|
||||
Get
|
||||
If ViewState("CveUsuarioSolicita") Is Nothing Then
|
||||
Return -1
|
||||
Else
|
||||
Return CType(ViewState("CveUsuarioSolicita"), Integer)
|
||||
End If
|
||||
|
||||
' End Get
|
||||
' Set(value As Integer)
|
||||
' ViewState("CveUsuarioAutoriza") = value
|
||||
' End Set
|
||||
'End Property
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
ViewState("CveUsuarioSolicita") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -178,6 +178,8 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
HplContrato.Text = ObjInventarios.DtResultados.Rows(0)("DescripcionContrato").ToString
|
||||
HplContrato.NavigateUrl = $"/Contratos/Contrato.aspx?CveContrato={ObjInventarios.DtResultados.Rows(0)("CveContrato").ToString.ToEntero}"
|
||||
|
||||
CveUsuarioSolicita = ObjInventarios.DtResultados.Rows(0)("CveUsuario").ToString.ToEntero
|
||||
|
||||
'25/04/2018
|
||||
CveDireccionEnvio = ObjInventarios.DtResultados.Rows(0)("CveDireccionEnvio").ToString.ToEntero
|
||||
If CveDireccionEnvio > 0 And ObjClientes.DireccionEnvioGet(CveDireccionEnvio, -1, -1) Then
|
||||
@@ -994,15 +996,85 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
CargaDatos()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkRechazarTraslado_Click(sender As Object, e As EventArgs)
|
||||
|
||||
TxtMotivoRechazo.Text = ""
|
||||
UpModalRechazo.Update()
|
||||
RegistraScript("$('#ModalRechazarTraslado').modal();")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnModalRechazo_Click(sender As Object, e As EventArgs)
|
||||
RechazarTraslado()
|
||||
End Sub
|
||||
|
||||
Private Sub RechazarTraslado()
|
||||
|
||||
Dim ErrorProceso As Boolean = False
|
||||
|
||||
If TxtMotivoRechazo.Text.Trim.Length.ToEntero = 0 Then
|
||||
Alert("El motivo de rechazo es necesario", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
Dim ObjInven As New ClsInventarios
|
||||
|
||||
If ObjInven.UpdateTrasladoAutorizar(CveTraspasoSolicitud, UsuarioActual.CveEmpresa, 3, UsuarioActual.CveUsuario, Now) Then
|
||||
Alert("Rechazado correctamente.")
|
||||
ErrorProceso = False
|
||||
Else
|
||||
ErrorProceso = True
|
||||
End If
|
||||
|
||||
ObjInven.Dispose()
|
||||
|
||||
CargaDatos()
|
||||
If Not ErrorProceso Then
|
||||
MandaCorreoRechazo(LbFolio.Text.ToEntero, CveTraspasoSolicitud, CveUsuarioSolicita, TxtMotivoRechazo.Text)
|
||||
CargaDatos()
|
||||
RegistraScript("$('#ModalRechazarTraslado').modal('hide');")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub MandaCorreoRechazo(Folio As Integer, CveTraspasoSolicitud As Integer, CveUsuarioSolicita As Integer, MotivoRechazo As String)
|
||||
|
||||
Dim SB As New StringBuilder
|
||||
|
||||
Dim CorreoDestino As String = GlobalDTUsuarios(CveUsuarioSolicita)(0)("Correo").ToString.Trim
|
||||
|
||||
|
||||
If CorreoDestino.Length > 0 Then
|
||||
|
||||
|
||||
SB.AppendLine($"<p>Se ha rechazado la solicitud de traspaso con folio {Folio}, el traspaso fue rechazado por el usuario {UsuarioActual.Nombre }, el traspaso fue rechazado por el motivo: {MotivoRechazo} </p>")
|
||||
|
||||
|
||||
|
||||
SB.AppendLine("<br>")
|
||||
SB.AppendLine("<table border = '0'>")
|
||||
SB.AppendLine("<tr style='color:white;background-color:#808080;' ><th>Cantidad</th> <th>U.M.</th> <th>Producto</th> <th>Observaciones</th> </tr>")
|
||||
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
SB.AppendLine($"<tr style='background-color:#F2F2F0;'> <td>{GvRow.DataKey("Cantidad")}</td> <td>{GvRow.DataKey("UnidadMedida")}</td> <td>{GvRow.DataKey("CodigoPS")}</td> <td>{GvRow.DataKey("Observaciones")}</td> </tr>")
|
||||
End If
|
||||
|
||||
Next
|
||||
SB.AppendLine("</table>")
|
||||
SB.AppendLine("<br>")
|
||||
|
||||
SB.AppendLine($"<strong> <a href='{Request.Url.GetLeftPart(UriPartial.Authority)}/Inventarios/TrasladoSolicitud.aspx?CveTraspasoSolicitud={CveTraspasoSolicitud}'>Ir a solicitud de traspaso folio {Folio}</a></strong>")
|
||||
|
||||
|
||||
|
||||
Dim MandaCorre As New ClsSisMail
|
||||
MandaCorre.SendMail(ClsPaginas.EmpresaNotificaciones, CorreoDestino, $"Rechazo de Autorización de traspaso #{Folio}", SB.ToString, Displayname:="SIG Notificaciones: Rechazo de Traspaso")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1057,5 +1129,6 @@ Partial Class Inventarios_TrasladoSolicitud
|
||||
Next
|
||||
GvDatos.Columns(5).Visible = Mostrar
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -253,19 +253,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="FiltrarTabla('#TxtBusqueda','.GvNominas')" style="display: inline-block; margin-right: -20px; width: 150px;">
|
||||
<a href="javascript:;" onclick="FiltrarTabla('#TxtBusqueda','.GvNominas')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold yellow-gold"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
|
||||
<asp:TextBox CssClass="TxtBusqueda form-control input-sm" runat="server" onkeyup="FiltrarTablaFreezcol('.TxtBusqueda','.GvNominas')" Style="display: inline-block; margin-right: -20px; width: 150px;"></asp:TextBox>
|
||||
<a href="javascript:;" onclick="FiltrarTablaFreezcol('.TxtBusqueda','.GvNominas')" style="margin-top: -3px;" class="btn btn-circle btn-sm font-bold yellow-gold"><i class="icon-magnifier" style="font-weight: bold;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body nomarginleftright form-horizontal form-row-sepe formnombottom ">
|
||||
<asp:GridView ID="GvNominas" runat="server" DataKeyNames="CvePeriodo,CvePersonal,CveNomina,SeTimbro,SerieFolio,Nombre,Correo,Codigo,Turno,SubProyecto,NomAutorizado" AutoGenerateColumns="False" OnRowDataBound="GvNominas_RowDataBound"
|
||||
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvNominas" Style="text-align: center;" GridLines="None" data-cols="2" data-rows="2">
|
||||
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvNominas" Style="text-align: center;" GridLines="None" data-cols="2" data-rows="2" data-heighterror="360">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate></HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkSobreRecibo" OnClick="LnkSobreRecibo_Click" runat="server"><i class='fa fa-list-alt'></i></asp:LinkButton>
|
||||
<asp:LinkButton ID="LnkSobreRecibo" OnClick="LnkSobreRecibo_Click" runat="server"><i class='fa fa-list-alt'></i></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="20px" HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
@@ -1558,7 +1558,7 @@
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
<script>
|
||||
|
||||
|
||||
function shownew() {
|
||||
|
||||
setTimeout(function () {
|
||||
@@ -1626,6 +1626,7 @@
|
||||
<%= String.Format("$('#{0}').click();", btnasis.ClientID) %>
|
||||
}
|
||||
function ADSBegin() {
|
||||
debugger;
|
||||
if ($('.GvConceptos .thTituloConcepto').length == 0) {
|
||||
$('.GvConceptos').prepend("<tr class=\"thTituloConcepto\"> <th scope=\"col\" colspan=\"3\">Percepciones</th><th scope=\"col\" colspan=\"3\">Deducciones</th> </tr>");
|
||||
}
|
||||
@@ -1635,12 +1636,11 @@
|
||||
//$('.GvConceptossimulador').append($('#Totalesperdeduccion'));
|
||||
$('.GvConceptossimulador').append($('#trnetoapagar'));
|
||||
}
|
||||
function FiltrarTabla(idtxt, idtable, idcontador) {
|
||||
if ($('' + idtxt).val() == '') { $('table' + idtable + ' tr').css('display', ''); }
|
||||
else { $('table' + idtable + ' tr:not(.ADtr):not(.SearchADHeader):not(.Titulos)').css('display', 'none'); $('table' + idtable + ' tr:contains("' + $('' + idtxt).val() + '")').css('display', ''); }
|
||||
if ($('' + idcontador).length > 0) {
|
||||
$('' + idcontador).html('(' + $('' + idtable + ' tr:not(.ADtr):not(.SearchADHeader):visible').length + '/' + $('' + idtable + ' tr:not(.ADtr):not(.SearchADHeader)').length + ')');
|
||||
}
|
||||
|
||||
function ADSReady() {
|
||||
|
||||
setTimeout(function () { FiltrarTablaFreezcol('.TxtBusqueda', '.GvNominas');}, 250);
|
||||
|
||||
}
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
@@ -2819,6 +2819,12 @@ Partial Class OC
|
||||
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
If DdlSubProyecto.SelectedValue <= 0 Then
|
||||
Alert("Debe de asignar un sub proyecto o centro de costos.", TipoMensaje.MsgAdvertencia)
|
||||
TieneError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero <> 1 And UsuarioActual.CveEmpresa.Contiene(119) Then
|
||||
ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL()
|
||||
ImporteMEComp = (DiferenciaInvOC - ImporteME).RoundSQL()
|
||||
@@ -2834,8 +2840,6 @@ Partial Class OC
|
||||
' Exit For
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, -DiferenciaInvOC, SerieFolio, 177, SerieFolio, Fecha, IdCtaContableRecepcionOCER, -1, CveProveedor:=CveProveedor, CveMovimientoAlmacen:=CveMovimientoAlmacen, CveOC:=CveOrdenCompra, ImporteMX:=-DiferenciaInvOC, CveOCDetalle:=CveOCDetalle, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero) Then
|
||||
TieneError = True
|
||||
Exit For
|
||||
|
||||
@@ -76,6 +76,30 @@ function FiltrarTabla(idtxt, idtable, idcontador) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function FiltrarTablaFreezcol(idtxt, idtable, idcontador) {
|
||||
if ($('' + idtxt).val() == '') { $('div.ADSCroll:not(.RHeader) table' + idtable + ' tr').css('display', ''); }
|
||||
else {
|
||||
let idxlist = [];
|
||||
$('div.ADSCroll:not(.RHeader) table' + idtable + ' tr:contains("' + $('' + idtxt).val() + '")').each(function () { let idx = $(this).index(); idxlist.push(idx) });
|
||||
|
||||
idxlist = idxlist.filter((x, i, a) => a.indexOf(x) == i)
|
||||
$('div.ADSCroll:not(.RHeader) table' + idtable + ' tr:not(.ADtr):not(.SearchADHeader):not(.ADSRow):not(.Titulos)').each(function () {
|
||||
let _tthis = $(this);
|
||||
let idx = _tthis.index();
|
||||
if (idxlist.includes(idx)) {
|
||||
_tthis.css('display', '');
|
||||
} else {
|
||||
_tthis.css('display', 'none');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($('' + idcontador).length > 0) {
|
||||
$('' + idcontador).html('(' + $('div.ADSCroll:not(.RHeader) ' + idtable + ' tr:not(.ADtr):not(.ADSRow):not(.SearchADHeader):visible').length + '/' + $('div.ADSCroll:not(.RHeader) ' + idtable + ' tr:not(.ADtr):not(.ADSRow):not(.SearchADHeader)').length + ')');
|
||||
}
|
||||
}
|
||||
|
||||
function clonsbuttons() {
|
||||
var copiasdelete = $('.clonehbutton_copy');
|
||||
if (copiasdelete) {
|
||||
@@ -321,8 +345,8 @@ function ADScroller2() {
|
||||
var widthGral = $(document).width() - WidthMenos;
|
||||
var heightGral = $(window).height() - HeightMenos;
|
||||
if (Heightfijo > 0) { heightGral = Heightfijo; }
|
||||
if (widthGral < 100) { widthGral = 100; }
|
||||
if (heightGral < 100) { heightGral = 100; }
|
||||
if (widthGral < 300) { widthGral = 300; }
|
||||
if (heightGral < 300) { heightGral =300; }
|
||||
|
||||
widthGral = Tthis.parent().parent().width();
|
||||
Tthis.removeClass('ADSCROLLER2');
|
||||
@@ -420,7 +444,7 @@ function ADScroller2() {
|
||||
|
||||
var anchoc1 = divheader1.outerWidth();
|
||||
var altoc1 = divheader1.outerHeight() + 15;
|
||||
divheaderScroll = $('<div class="ADSCroll" style="width:' + (widthGral - anchoc1) + 'px;"></div>').append(THeader2);
|
||||
divheaderScroll = $('<div class="ADSCroll RHeader" style="width:' + (widthGral - anchoc1) + 'px;"></div>').append(THeader2);
|
||||
divheader2.append(divheaderScroll);
|
||||
|
||||
contenedor.append(divcenter);
|
||||
@@ -459,24 +483,29 @@ function ADScroller2() {
|
||||
contenedor.css('width', sizetable + altoc1);
|
||||
}
|
||||
};
|
||||
$(window).resize(function () {
|
||||
let resizefncscroller = function () {
|
||||
|
||||
var widthGral = $(window).width() - WidthMenos;
|
||||
/*console.log(widthGral);*/
|
||||
contenedor.css('width', 1);
|
||||
widthGral = Tthis.parent().parent().parent().parent().parent().width();
|
||||
/* console.log(widthGral);*/
|
||||
var heightGral = $(window).height() - HeightMenos;
|
||||
//console.log(heightGral);
|
||||
if (Heightfijo > 0) { heightGral = Heightfijo; }
|
||||
if (widthGral < 100) { widthGral = 100; }
|
||||
if (heightGral < 100) { heightGral = 100; }
|
||||
if (widthGral < 300) { widthGral = 300; }
|
||||
if (heightGral < 300) { heightGral = 300; }
|
||||
contenedor.css('width', widthGral);
|
||||
divheader.css('width', widthGral);
|
||||
divcenter.css('width', widthGral);
|
||||
divheaderScroll.css('width', (widthGral - anchoc1));
|
||||
divcolsScroll.css('height', (heightGral - altoc1+20));
|
||||
divcolsScroll.css('height', (heightGral - altoc1 + 20));
|
||||
divbodyScroll.css('width', (widthGral - anchoc1));
|
||||
divbodyScroll.css('height', (heightGral - altoc1 + 20));
|
||||
setTimeout(sizeoftablefunc, 100);
|
||||
};
|
||||
$(window).resize(function () {
|
||||
setTimeout(resizefncscroller, 50);
|
||||
setTimeout(sizeoftablefunc, 150);
|
||||
});
|
||||
|
||||
$('table#ADCol' + Tid + ' tr').hover(
|
||||
@@ -731,12 +760,13 @@ function loadadscroll() {
|
||||
if (height < 200) {
|
||||
height = 200;
|
||||
}
|
||||
TThis.data('height', height)
|
||||
TThis.data('height', height);
|
||||
}
|
||||
//ADSCROLLER2
|
||||
|
||||
var colVisibles = isNaN(Number(TThis.data('cols'))) ? 0 : Number(TThis.data('cols'));
|
||||
if (colVisibles > 0) {
|
||||
if ((Number(TThis.data('heighterror'))) && !(Number(TThis.data('heightmenos')))) { TThis.data('heightmenos', TThis.data('heighterror'));}
|
||||
TThis.removeClass("ScrollAD");
|
||||
TThis.addClass("ADSCROLLER2");
|
||||
} else {
|
||||
@@ -1913,7 +1943,6 @@ jQuery(document).ready(function () {
|
||||
}
|
||||
});
|
||||
ADSReady();
|
||||
|
||||
}
|
||||
if (("Notification" in window)) {
|
||||
if (Notification.permission !== 'denied') {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<asp:DropDownList ID="DdlEmpresa" runat="server" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" style="width:100%;" Class="form-control select2me"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="has-info col-sm-6">
|
||||
<asp:TextBox id="TxtBusqueda" CssClass="form-control input-sm" placeholder="" style="width:100%" runat="server" ClientIDMode="Static"/></label>
|
||||
<asp:TextBox id="TxtBusqueda" CssClass="form-control input-sm" placeholder="" style="width:100%" runat="server" ClientIDMode="Static"/>
|
||||
<asp:Button ID="BtnFiltrar" runat="server" Text="Filtrar" class="btn btn-primary" style="display: none;"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
85
Sistemas/PopUpCambiaUsuarioEmpresa.aspx
Normal file
85
Sistemas/PopUpCambiaUsuarioEmpresa.aspx
Normal file
@@ -0,0 +1,85 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PopUpCambiaUsuarioEmpresa.aspx.vb" Inherits="Sistemas_PopUpCambiaUsuarioEmpresa" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<link href="/Metronic/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" />
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
Cambio de Usuario
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:Panel ID="PnlGral" runat="server">
|
||||
<asp:UpdatePanel ID="UPPGral" runat="server">
|
||||
<ContentTemplate>
|
||||
<h4> Usuario Actual: <asp:Label ID="LblUsuario" runat="server" Text="" Font-Bold="True"></asp:Label><br />
|
||||
</h4>
|
||||
<div class="row">
|
||||
<%-- <div class="col-sm-6">
|
||||
<asp:Label AssociatedControlID="DdlEmpresa" runat="server" Text="Empresa:"></asp:Label></div>--%>
|
||||
<div class="col-sm-6">Nombre de Usuario:</div>
|
||||
</div>
|
||||
<%--<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<asp:DropDownList ID="DdlEmpresa" runat="server" AutoPostBack="true" DataTextField="Empresa" DataValueField="CveEmpresa" style="width:100%;" Class="form-control select2me"></asp:DropDownList>
|
||||
</div>
|
||||
<div class="has-info col-sm-6">
|
||||
</div>
|
||||
</div>--%>
|
||||
<asp:TextBox ID="TxtBusqueda" CssClass="form-control input-sm" placeholder="" Style="width: 100%" runat="server" ClientIDMode="Static" />
|
||||
<asp:Button ID="BtnFiltrar" runat="server" Text="Filtrar" class="btn btn-primary" Style="display: none;" />
|
||||
|
||||
<div>
|
||||
<asp:GridView ID="gvUsuarios" runat="server" data-sort="true" CssClass="table table-striped table-advance table-hover Widthall ScrollAD " AutoGenerateColumns="False" ClientIDMode="Static" DataKeyNames="Usuario,Contraseña,CveEmpresa" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Nombre">
|
||||
<ItemTemplate>
|
||||
|
||||
<asp:LinkButton ID="LnkNombre" runat="server" CssClass="Texto"
|
||||
Text='<%#String.Format("{0}({1})", Eval("Nombre"), Eval("Usuario")) %>' ToolTip='<%# Eval("CveUsuario") %>' CommandName="Usuarios" CommandArgument='<%# eval("CveUsuario") %>'></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<%-- <ItemStyle Width="250px" />
|
||||
<HeaderStyle CssClass="Titulo" HorizontalAlign="Center" />--%>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="Rol" HeaderText="Rol" DataFormatString=" {0}">
|
||||
<ItemStyle HorizontalAlign="Left" Width="150px" />
|
||||
</asp:BoundField>
|
||||
</Columns>
|
||||
<%-- <RowStyle CssClass="Texto" Height="19px" />
|
||||
<HeaderStyle CssClass="Titulo" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />--%>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Panel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
buscarDT();
|
||||
Sys.Application.add_load(function (s, e) {
|
||||
buscarDT();
|
||||
});
|
||||
});
|
||||
function buscarDT() {
|
||||
$('#TxtBusqueda').on('keyup', function () {
|
||||
if (this.value == '') {
|
||||
$('table#' + $(this).attr('data-table') + ' tr').css('display', 'table-row');
|
||||
} else {
|
||||
$('table#' + $(this).attr('data-table') + ' tr').css('display', 'none');
|
||||
$('table#' + $(this).attr('data-table') + ' tr:contains("' + this.value + '")').css('display', 'table-row');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
187
Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb
Normal file
187
Sistemas/PopUpCambiaUsuarioEmpresa.aspx.vb
Normal file
@@ -0,0 +1,187 @@
|
||||
Imports ADSSession
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
Partial Class Sistemas_PopUpCambiaUsuarioEmpresa
|
||||
Inherits ClsPaginas
|
||||
|
||||
Property DTUsuarios() As Data.DataTable
|
||||
Get
|
||||
Return CType(ViewState("DTUsuarios"), DataTable)
|
||||
End Get
|
||||
Set(value As Data.DataTable)
|
||||
ViewState("DTUsuarios") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
|
||||
ViewState("Orden") = ""
|
||||
|
||||
If Not (UsuarioActual.CveRol = 1 OrElse UsuarioActual.ModoSimulacionXEmpresa) Then
|
||||
PnlGral.Visible = False
|
||||
RegistraScript("window.close();")
|
||||
End If
|
||||
|
||||
'Dim DtEmp As DataTable = GlobalDTEmpresas.Copy
|
||||
Dim NombreEmp As String = UsuarioActual.Empresa.Empresa
|
||||
'''condición para ocultar los nombres de las empresas y ponerles "mi empresa de venta (xxx)"
|
||||
''If UsuarioActual.CveUsuario = 100 Then
|
||||
|
||||
'' Dim customerRow() As Data.DataRow
|
||||
'' customerRow = DtEmp.Select("")
|
||||
|
||||
'' For Each drt As DataRow In customerRow
|
||||
'' drt("Empresa") = "Mi Empresa de ventas (" & drt("CveEmpresa") & ")"
|
||||
'' Next
|
||||
|
||||
|
||||
''End If
|
||||
|
||||
CType(Me.Master, BaseMasterPage).EsPopup = True
|
||||
LblUsuario.Text = String.Format("{0} - {1}", UsuarioActual.Nombre, UsuarioActual.Empresa.Empresa)
|
||||
|
||||
|
||||
'DdlEmpresa.DataSource = DtEmp '.FiltraParametros(If(UsuarioActual.CveRol = 1, "CvePlataforma IN (1,2)", $"CvePlataforma={UsuarioActual.Empresa.CvePlataforma}"))
|
||||
Dim CveEmpresa As String = UsuarioActual.CveEmpresa.ToString()
|
||||
|
||||
Dim splitedtext As String() = Request.Url.AbsoluteUri.Replace("http://", "").Replace("https://", "").Split("."c)
|
||||
If Request.Url.AbsoluteUri.Contains("sig.agrojam.com.mx") Then
|
||||
CveEmpresa = 119
|
||||
End If
|
||||
|
||||
If splitedtext.Length > 0 Then
|
||||
Select Case splitedtext(0).ToUpper()
|
||||
Case "VSH" : CveEmpresa = "7"
|
||||
Case "JAM" : CveEmpresa = "119"
|
||||
Case "COMPUPROVEEDORES" : CveEmpresa = "72"
|
||||
Case "DNDIFUSA" : CveEmpresa = "80"
|
||||
Case "SOGO" : CveEmpresa = "8"
|
||||
Case "BDH" : CveEmpresa = "140"
|
||||
Case "ECONOLLANTAS" : CveEmpresa = "141"
|
||||
End Select
|
||||
End If
|
||||
'DdlEmpresa.DataBind()
|
||||
'DdlEmpresa.SelectedValue = CveEmpresa
|
||||
|
||||
'DdlRol.DataSource = GlobalDTRoles(DdlEmpresa.SelectedValue.ToEntero)
|
||||
'DdlRol.DataBind()
|
||||
'DdlRol.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
TxtBusqueda.Attributes.Add("data-table", gvUsuarios.ClientID)
|
||||
|
||||
CargaUsuarios()
|
||||
'LblUsuario.Text = usuarioactual.
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub gvUsuarios_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles gvUsuarios.RowCommand
|
||||
If e.CommandName = "Usuarios" Then
|
||||
Dim gvr As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).BindingContainer, GridViewRow)
|
||||
'Dim Dt As DataTable = GlobalDTUsuarios(e.CommandArgument.ToString.ToEntero)
|
||||
Dim multiempresa As Boolean = ADSSessionConfig.sessionUser.MultipleEmpresa
|
||||
Dim objempresa As Empresa = ADSSessionConfig.sessionUser.Empresa
|
||||
If gvr IsNot Nothing Then
|
||||
|
||||
Dim tUsuario, tContraseña As String
|
||||
Dim tCveEmpresa As Integer
|
||||
tUsuario = gvr.DataKey("Usuario").ToString
|
||||
tContraseña = gvr.DataKey("Contraseña").ToString
|
||||
tCveEmpresa = gvr.DataKey("CveEmpresa").ToString.ToEntero
|
||||
|
||||
Dim ObjUsuario As New ClsSisUsuarios
|
||||
Dim Usuario As Usuario
|
||||
'Dim UsuarioAsignaciones As Usuario
|
||||
|
||||
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
|
||||
'UsuarioAsignaciones = ObjUsuario.ValidaUsuarioAsignacion(Usuario.CveUsuario, Usuario.CveEmpresa)
|
||||
ObjUsuario.Dispose()
|
||||
|
||||
If Usuario IsNot Nothing Then
|
||||
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||
ADSSessionConfig.sessionUser = Usuario
|
||||
ADSSessionConfig.sessionUser.CvePlataforma = 1
|
||||
If Usuario.CveRol = 1200 Then
|
||||
ADSSessionConfig.sessionUser.CvePlataforma = 3
|
||||
End If
|
||||
ADSSessionConfig.sessionDpage = False
|
||||
ADSSessionConfig.sessionUser.MultipleEmpresa = multiempresa
|
||||
ADSSessionConfig.sessionUser.ModoSimulacion = False
|
||||
ADSSessionConfig.sessionUser.ModoSimulacionXEmpresa = True
|
||||
|
||||
UsuarioActual.Empresa = objempresa
|
||||
dt.Dispose()
|
||||
|
||||
If UsuarioActual.CveCliente > 0 Then
|
||||
CargaZonasHorarias(UsuarioActual)
|
||||
End If
|
||||
End If
|
||||
|
||||
RegistraScript("gotourl();")
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaZonasHorarias(ByRef UsuarioActual As Usuario)
|
||||
Dim ObjClientes As New ClsClientes
|
||||
Try
|
||||
If ObjClientes.GetClientes(UsuarioActual.CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, -1, Estatus:=1) Then
|
||||
If ObjClientes.DtResultados.Rows.Count = 1 Then
|
||||
UsuarioActual.UTCOffset = ObjClientes.DtResultados(0)("UTCOffset").ToString().ToEntero()
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener la zona horaria.", ex)
|
||||
Finally
|
||||
ObjClientes.Dispose()
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnFiltrar_Click(sender As Object, e As EventArgs) Handles BtnFiltrar.Click
|
||||
CargaUsuarios()
|
||||
End Sub
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(",", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaUsuarios(Orden)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaUsuarios(Optional Orden As String = "Nombre")
|
||||
Dim dtt As DataTable = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("CveRol <> 1")
|
||||
dtt = dtt.FiltraParametros("Estatus = 1", Orden, {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"})
|
||||
gvUsuarios.DataSource = dtt
|
||||
gvUsuarios.DataBind()
|
||||
|
||||
If (gvUsuarios.Rows.Count > 0) Then
|
||||
gvUsuarios.UseAccessibleHeader = True
|
||||
gvUsuarios.HeaderRow.TableSection = TableRowSection.TableHeader
|
||||
End If
|
||||
TxtBusqueda.Focus()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
@@ -267,6 +267,7 @@
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-default">
|
||||
<li runat="server" id="DivCambiarUsuarioEmpresa" visible="false"><a runat="server" id="BtnCambiarUsuarioEmpresa" style="cursor: pointer;"><i class="fa fa-exchange"></i>Cambiar Usuario</a></li>
|
||||
<li runat="server" id="DivCambiarUsuario" visible="false"><a runat="server" id="BtnCambiarUsuario" style="cursor: pointer;"><i class="fa fa-exchange"></i>Cambiar Usuario</a></li>
|
||||
<li runat="server" id="DivCambiarEmpresa" visible="false"><a runat="server" id="BtnCambiarEmpresa" style="cursor: pointer;"><i class="fa fa-exchange"></i>Cambiar Empresa</a></li>
|
||||
<li class="divider"></li>
|
||||
|
||||
@@ -168,6 +168,10 @@ Partial Class Site
|
||||
DivCambiarUsuario.Visible = True
|
||||
BtnCambiarUsuario.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpCambiaUsuario.aspx');")
|
||||
End If
|
||||
If UsuarioActual.ModoSimulacionXEmpresa Then '.TienePermisoProceso(ADSSession.ADSSessionConfig.procesomodosimulacion) Then
|
||||
DivCambiarUsuarioEmpresa.Visible = True
|
||||
BtnCambiarUsuarioEmpresa.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpCambiaUsuarioEmpresa.aspx');")
|
||||
End If
|
||||
If UsuarioActual.MultipleEmpresa Then
|
||||
BtnCambiarEmpresa.Attributes.Add("onclick", "javascript:AbrirVentana('/Sistemas/PopUpSeleccionarEmpresa.aspx');")
|
||||
DivCambiarEmpresa.Visible = True
|
||||
|
||||
@@ -2662,12 +2662,17 @@ Partial Class Ventas_ClientesAbonar
|
||||
If tCveMoneda = 2 Then
|
||||
Dim ImporteFluctuacion As Decimal = 0
|
||||
ImporteFluctuacion = Saldo * (TCPago - TCVenta)
|
||||
|
||||
If CveSubProyecto <= 0 Then
|
||||
MsgError = $"No se pudo obtener el sub proyecto de la venta {gr.DataKey("SerieFolio").ToString}"
|
||||
End If
|
||||
|
||||
If TCPago > TCVenta Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 64, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaGananciaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
Else
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Math.Abs(ImporteFluctuacion), gr.DataKey("SerieFolio").ToString, 65, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=UsuarioActual.Empresa.IdCuentaPerdidaCambiaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=Math.Abs(ImporteFluctuacion), CveCuenta:=CveCuenta, TipoCambio:=TCVenta, TipoCambioPago:=TCPago, CveSubProyecto:=CveSubProyecto) Then
|
||||
MsgError = "Ocurrio un error al saldar el movimiento"
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -277,7 +277,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
||||
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false)
|
||||
{
|
||||
Modelos.Factura.MCancelacionVentaMensaje retorno = null;
|
||||
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa);
|
||||
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:true);
|
||||
if (EsRefacturacion)
|
||||
{
|
||||
retorno = factura.CancelarPorRefacturacion();
|
||||
|
||||
@@ -159,6 +159,28 @@
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<asp:Panel ID="pnlOrden" Visible="false" runat="server" CssClass="row">
|
||||
<label class="col-md-1 truncate">Orden:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%">
|
||||
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
|
||||
<asp:ListItem Text="Marca,Modelo,Rin,Medida de Barrenación" Value="1" />
|
||||
<asp:ListItem Text="Familia,Marca,Rin,Medida de Barrenación" Value="2" />
|
||||
<asp:ListItem Text="Familia,Linea,Rin,Medida de Barrenación" Value="3" />
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
<%--<div class="col-md-3">
|
||||
<div class="row">
|
||||
<label class="col-md-3 truncate">Marca:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height:50px !important;">
|
||||
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
|
||||
</asp:ListBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>--%>
|
||||
</asp:Panel>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
|
||||
@@ -21,6 +21,20 @@ Partial Class Ventas_RepPS
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
pnlOrden.Visible = False
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
pnlOrden.Visible = True
|
||||
DdlOrden.SelectedValue = "2"
|
||||
'Using ObjPS As New ClsProductosServicios
|
||||
' If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||
' DdlMarca.DataSource = ObjPS.DtResultados.Copy()
|
||||
' End If
|
||||
'End Using
|
||||
'DdlMarca.DataBind()
|
||||
'DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
End If
|
||||
|
||||
|
||||
CargaDatosIniciales()
|
||||
CargaCombos()
|
||||
CargaDatos()
|
||||
@@ -69,6 +83,7 @@ Partial Class Ventas_RepPS
|
||||
End Sub
|
||||
|
||||
Private Sub CargaTipoCentroCosto()
|
||||
Dim index As Integer = 17
|
||||
|
||||
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Then
|
||||
DdlSubProyecto.Items.Clear()
|
||||
@@ -88,13 +103,19 @@ Partial Class Ventas_RepPS
|
||||
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 3 Then
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
|
||||
DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2"))
|
||||
DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19"))
|
||||
If DdlGrupo.Items.Count < 17 Then
|
||||
index = DdlGrupo.Items.Count
|
||||
End If
|
||||
DdlGrupo.Items.Insert(index, New ListItem("SubProyecto Ejec.", "19"))
|
||||
DdlGrupo.DataBind()
|
||||
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 4 Then
|
||||
LblSubProyecto.InnerText = "Proyecto:"
|
||||
DdlGrupo.Items.Insert(0, New ListItem("Proyecto", "1"))
|
||||
DdlGrupo.Items.Insert(1, New ListItem("SubProyecto", "2"))
|
||||
DdlGrupo.Items.Insert(17, New ListItem("SubProyecto Ejec.", "19"))
|
||||
If DdlGrupo.Items.Count < 17 Then
|
||||
index = DdlGrupo.Items.Count
|
||||
End If
|
||||
DdlGrupo.Items.Insert(index, New ListItem("SubProyecto Ejec.", "19"))
|
||||
DdlGrupo.DataBind()
|
||||
ElseIf UsuarioActual.Empresa.Tipo_CentroCosto = 5 Then
|
||||
LblSubProyecto.InnerText = "Sucursal:"
|
||||
@@ -117,7 +138,7 @@ Partial Class Ventas_RepPS
|
||||
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.ToDate, MaxFecha)
|
||||
|
||||
Dim ObjVentas As New ClsVentas()
|
||||
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca) Then
|
||||
If ObjVentas.GetRepPSEcono(CveSubProyecto, CvePS, FechaI, FechaF, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, GPO:=Grupo, CveMoneda:=CveMoneda, TipoCambio:=TC, TCEspecifico:=TCEspecifico, Clasificacion:=Clasificacion, Linea:=Linea, Marca:=Marca, orden:=DdlOrden.SelectedValue.ToEntero()) Then
|
||||
DtReporte = ObjVentas.DtResultados.Copy()
|
||||
GvDatos.DataSource = DtReporte
|
||||
Else
|
||||
|
||||
@@ -108,6 +108,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user