-clasif, recarga Global

This commit is contained in:
2020-01-09 11:26:14 -07:00
parent 15a48b039a
commit f483ac93a0
2 changed files with 41 additions and 27 deletions

View File

@@ -89,7 +89,6 @@ Partial Class CatClasificaciones
CargaDdlSATPS() CargaDdlSATPS()
CargaDDLs() CargaDDLs()
CargaGlobal()
DdlCategoriaFiltro.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa) DdlCategoriaFiltro.DataSource = GlobalDTGralCategorias(UsuarioActual.CveEmpresa)
DdlCategoriaFiltro.Items.Insert(0, New ListItem("Todos", "-1")) DdlCategoriaFiltro.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -152,20 +151,20 @@ Partial Class CatClasificaciones
CargaGrid() CargaGrid()
End Sub End Sub
Public Sub CargaGlobal() 'Public Sub CargaGlobal()
Dim ObjClasificaciones As New ClsClasificaciones ' Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones() Then ' If ObjClasificaciones.GetClasificaciones(UsuarioActual.CveEmpresa) Then
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)") ' ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros($"(Codigo IS NULL OR Codigo = '') AND CveEmpresa = {UsuarioActual.CveEmpresa} AND (CveCategoria = {DdlCategoriaFiltro.SelectedValue.ToEntero} OR {DdlCategoriaFiltro.SelectedValue.ToEntero} = -1) AND (UsoClasificacion = {DdlTipoClasificacion.SelectedValue.ToEntero} OR {DdlTipoClasificacion.SelectedValue.ToEntero} = -1 ) AND (Estado = {DdlEstatus.SelectedValue.ToEntero} OR {DdlEstatus.SelectedValue.ToEntero} = -1)")
GlobalDTClasificaciones = ObjClasificaciones.DtResultados ' GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
Else ' Else
Me.GvDatos.DataSource = Nothing ' Me.GvDatos.DataSource = Nothing
Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError) ' Alert("Ocurrió un error al cargar las clasificaciones. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If ' End If
ObjClasificaciones.Dispose() ' ObjClasificaciones.Dispose()
End Sub 'End Sub
Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click
@@ -212,7 +211,7 @@ Partial Class CatClasificaciones
End If End If
End If End If
CargaGlobal() GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
ObjClasificaciones.Dispose() ObjClasificaciones.Dispose()
CargaDatos() CargaDatos()
@@ -317,6 +316,7 @@ Partial Class CatClasificaciones
If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then If ObjClasificaciones.RemoveClasificacion(GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero) Then
GvDatos.EditIndex = -1 GvDatos.EditIndex = -1
ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) ViewState("DTClasificaciones") = ObjClasificaciones.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTClasificaciones(UsuarioActual.CveEmpresa) = Nothing
Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion) Alert("La Clasificación se eliminó correctamente.", TipoMensaje.MsgInformacion)
Else Else
Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al eliminar la clasificación. Por favor vuelva a intentar.", TipoMensaje.MsgError)
@@ -324,7 +324,7 @@ Partial Class CatClasificaciones
ObjClasificaciones.Dispose() ObjClasificaciones.Dispose()
CargaGrid() CargaGrid()
CargaGlobal()
End Sub End Sub
#End Region #End Region

View File

@@ -7798,21 +7798,32 @@ Partial Class Ventas
'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS REGISTRO DIRECTO SIN VENTA 'CONVERTIR REMISION - TIPO MONEDA -DOLARES A PESOS REGISTRO DIRECTO SIN VENTA
ElseIf (EditoRemision = False AndAlso ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True) Then ElseIf (EditoRemision = False AndAlso ObjFactura.CveMoneda = 2 AndAlso ObjFactura.ConvertirPesos = True) Then
Dim TotalCalculableImpuestos, TotalCalculableImpuestosIVA As Decimal
For Each Row As DataRow In TmpDT.Rows For Each Row As DataRow In TmpDT.Rows
Row("PU") = Math.Round(Row("PU").ToString.ToDouble * ObjFactura.TipoCambio, 6) Row("PU") = Math.Round(Row("PU").ToString.ToDecimal * ObjFactura.TipoCambio, 6)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
TotalCalculableImpuestos = (Row("Cantidad").ToString.ToDecimal * Row("PU").ToString.ToDecimal) - Row("Descuento").ToString.ToDecimal
TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + Row("PorcentajeIEPS").ToString.ToDecimal)
Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("PorcentajeIEPS").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
Row("IEPS") = Row("ImporteIEPS")
Row("Total") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales) Row("Total") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales)
Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales) Row("TotalImporte") = Math.Round(Row("Cantidad").ToString.ToDouble * Row("PU").ToString.ToDouble, NumeroDecimales)
Row("Descuento") = Math.Round(Row("Descuento").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteRetIVA") = Math.Round(Row("ImporteRetIVA").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteRetISR") = Math.Round(Row("ImporteRetISR").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteIVA") = Math.Round(Row("ImporteIVA").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Row("ImporteIEPS") = Math.Round(Row("ImporteIEPS").ToString.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
Next Next
Dim ImpuestosLocales As Double = 0 Dim ImpuestosLocales As Double = 0
For Each gvr As GridViewRow In GvImpuestosLocales2.Rows For Each gvr As GridViewRow In GvImpuestosLocales2.Rows
If gvr.RowType = DataControlRowType.DataRow Then If gvr.RowType = DataControlRowType.DataRow Then
gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * ObjFactura.TipoCambio).FormatoNumero gvr.FCTextBox("TxtImpuestoLocalPS").Text = (gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDecimal * ObjFactura.TipoCambio).FormatoNumero
ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * ObjFactura.TipoCambio, NumeroDecimales) ImpuestosLocales += Math.Round(gvr.FCTextBox("TxtImpuestoLocalPS").Text.ToDouble * ObjFactura.TipoCambio, NumeroDecimales)
End If End If
Next Next
@@ -23524,12 +23535,15 @@ Partial Class Ventas
End If End If
For Each drow As DataRow In TmpDT.Rows For Each drow As DataRow In TmpDT.Rows
For Each drow2 As DataRow In DTCvePSCostos.Rows If DTCvePSCostos IsNot Nothing Then
If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then For Each drow2 As DataRow In DTCvePSCostos.Rows
drow("Eliminar") = 1 If drow("CvePS").ToString.ToEntero = drow2("CvePSCargo").ToString.ToEntero Then
Exit For drow("Eliminar") = 1
End If Exit For
Next End If
Next
End If
Next Next
Dim TmpDTView As New DataView(TmpDT) Dim TmpDTView As New DataView(TmpDT)