diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index 2f7ac71dc..a52ab1a98 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -833,7 +833,7 @@ Public Class ClsAcumuladores
#Region "P O L I Z A - V I R T U A L"
Public Function AddPolizaVirtual(CveVenta As Integer, CveVentaDetalle As Integer, CvePS As Integer, Cantidad As Decimal, PU As Decimal, Descuento As Decimal, Total As Decimal,
TipoServicio As Integer, TipoPoliza As Integer, CveModeloAuto As Integer, AnioVehiculo As Integer, TieneUsado As Boolean, FechaUsado As DateTime,
- CvePSUsado As Integer, CveBCIUsado As Integer) As Boolean
+ CvePSUsado As Integer, CveBCIUsado As Integer, CveMarcaUsado As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Vta_PolizaVirtualAdd")
With SqlAdapter.SelectCommand.Parameters
@@ -852,6 +852,7 @@ Public Class ClsAcumuladores
.Add("@FechaUsado", SqlDbType.DateTime).Value = FechaUsado
.Add("@CvePSUsado", SqlDbType.Int).Value = CvePSUsado
.Add("@CveBCIUsado", SqlDbType.Int).Value = CveBCIUsado
+ .Add("@CveMarcaUsado", SqlDbType.Int).Value = CveMarcaUsado
End With
Try
SqlAdapter.Fill(Data)
diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index bde65432e..2959aba4a 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -5726,7 +5726,7 @@ Public Class ClsContabilidad
Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1,
- Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1) As Boolean
+ Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesAdd")
@@ -5743,6 +5743,7 @@ Public Class ClsContabilidad
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA
.Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina
+ .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
End With
Try
@@ -5777,7 +5778,7 @@ Public Class ClsContabilidad
Public Function UpdateCuentasAsignaciones(CveConceptoAsignacion As Integer, Optional CveConceptoContable As Integer = -1, Optional CveCuenta As Integer = -1,
Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1,
- Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1) As Boolean
+ Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1) As Boolean
Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesUpdate")
@@ -5794,6 +5795,7 @@ Public Class ClsContabilidad
.Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen
.Add("@PorcentajeIVA", SqlDbType.Decimal).Value = PorcentajeIVA
.Add("@CveConceptoNomina", SqlDbType.Decimal).Value = CveConceptoNomina
+ .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
End With
Try
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 8cc4b1e42..e21615b2c 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -3232,6 +3232,32 @@ Public Class ClsInventarios
Return Retorno
End Function
+
+ Public Function GetProductosDevolucion(CvePS As Integer, CveCliente As Integer, CveSubProyecto As Integer, FechaInicio As DateTime, FechaFin As DateTime, Serie As String, Lote As String, FechaCaducidad As DateTime, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ProductosDevolucionAlmacen")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CvePS
+ .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin
+ .Add("@Serie", SqlDbType.VarChar).Value = Serie
+ .Add("@Lote", SqlDbType.VarChar).Value = Lote
+ .Add("@FechaCaducidad", SqlDbType.DateTime).Value = FechaCaducidad
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener datos de devolución.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
Public Function GetSaldoVentaDetalle(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleSaldo")
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index 72dfecc12..b52ea6e94 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -4681,6 +4681,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Inventarios/EntregasPorRealizar.aspx".ToUpper(), 728)
PaginaDict.Add("/Inventarios/CatAlmacenClasificacionSecciones.aspx".ToUpper(), 764)
PaginaDict.Add("/Inventarios/ReconstruirCostos.aspx".ToUpper(), 764)
+ PaginaDict.Add("/Inventarios/RecepcionDevolucion.aspx".ToUpper(), 696)
#End Region
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index bc165de82..6242b9d0e 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -1450,6 +1450,22 @@ Public Class ClsProductosServicios
Return Retorno
End Function
+ Public Function GetMarcasUsados(CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Gral_MarcasUsadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el Catálogo de Marcas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+ End Function
+
Public Function AddMarcas(Marca As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index adda24263..f57554961 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -1507,10 +1507,17 @@ Namespace Modelos
Row("CveVentaDetalle") = ObjVentas.CveVentaDetalle
If DtInventario IsNot Nothing Then
- If DtInventario.Select($"CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then
- Dim rowInv As DataRow = DtInventario.Select($"CvePS={Row("CvePS").ToString.ToEntero}")(0)
- rowInv("CveVentaDetalle") = ObjVentas.CveVentaDetalle
- End If
+ 'If DtInventario.Select($"CvePS={Row("CvePS").ToString.ToEntero}").Length > 0 Then
+ ' Dim rowInv As DataRow = DtInventario.Select($"CvePS={Row("CvePS").ToString.ToEntero}")(0)
+ ' rowInv("CveVentaDetalle") = ObjVentas.CveVentaDetalle
+ 'End If
+
+ Try
+ Dim InvDr As DataRow = DtInventario.Select($"Consec = {Row("Consec").ToString()}")(0)
+ InvDr("CveVentaDetalle") = ObjVentas.CveVentaDetalle
+ Catch ex As Exception
+ End Try
+
End If
If DtRecepcionUsados IsNot Nothing Then
@@ -1738,7 +1745,7 @@ Namespace Modelos
GuardarVentaPrePolizas(factura, ObjConta, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, ObjInventario:=ObjInventario)
If ErrorList.Count = 0 Then
'inventarios
- GuardarVentaInventarios(factura, ObjInventario, ObjConta, ObjVentas, ObjAcum)
+ GuardarVentaInventarios(Resp, factura, ObjInventario, ObjConta, ObjVentas, ObjAcum)
'GuardaRecepcionUsados(factura, ObjInventario, ObjConta)
@@ -2142,7 +2149,7 @@ Namespace Modelos
For Each drow As DataRow In ObjFactura.DtPolizasVirtuales.Rows
If ObjAcum.AddPolizaVirtual(ObjFactura.CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal,
drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString),
- drow("FechaUsado").ToString().ToDateTime, drow("CvePSUsado").ToString.ToEntero, drow("CveBCIUsado").ToString.ToEntero) Then
+ drow("FechaUsado").ToString().ToDateTime, drow("CvePSUsado").ToString.ToEntero, drow("CveBCIUsado").ToString.ToEntero, drow("CveMarcaUsado").ToString.ToEntero) Then
Else
Resultado = False
Exit For
@@ -3709,7 +3716,7 @@ Namespace Modelos
Return OcurrioError
End Function
- Private Function GuardarVentaInventarios(ByRef factura As Modelos.Factura, ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, ObjVentas As ClsVentas, ObjAcum As ClsAcumuladores) As Boolean
+ Private Function GuardarVentaInventarios(ByRef Resp As MMensajeFactura, ByRef factura As Modelos.Factura, ObjInventario As ClsInventarios, ObjConta As ClsContabilidad, ObjVentas As ClsVentas, ObjAcum As ClsAcumuladores) As Boolean
Dim OcurrioError As Boolean = False
If UsuarioActual.Empresa.UsaInventarios AndAlso factura.TipoDocto.Contiene("Ing", "Egs", "Rem") Then
@@ -3751,6 +3758,24 @@ Namespace Modelos
End If
+ 'SI ES UNA RNC DE CARGO GENERA EL MOVIMIENTO DE ALMACEN AQUI
+ If factura.TipoDocto = "RNC" AndAlso factura.Num3 = 10 Then
+ Dim CveMovimiento = GenerarMovimientoAlmacenDevolucionRNC(ObjInventario, factura, DtInventario, factura.CveAlmacen, factura.CveConceptoMovimiento, factura.CveMoneda, factura.CveVenta, "Modelos/RNC1")
+ If CveMovimiento <= 0 Then
+ OcurrioError = True
+ Else
+ If Resp IsNot Nothing Then
+ Resp.CveMovimientoUsado = CveMovimiento
+
+ If CveMovimiento > 0 Then
+ If ObjInventario.GetMovimientos(CveMovimiento, -1, -1, UsuarioActual.CveEmpresa) Then
+ Resp.FolioUsado = ObjInventario.DtResultados.FiltroPrimeroValor("Folio")
+ End If
+ End If
+ End If
+ End If
+ End If
+
Return OcurrioError
End Function
Private Function CuadrarFacturaMovimientos(MovDetalle As DataTable) As DataTable
@@ -4158,6 +4183,148 @@ Namespace Modelos
Return CveMovimientoInventario
End Function
+ Private Function GenerarMovimientoAlmacenDevolucionRNC(ByRef ObjInventario As ClsInventarios, ByRef factura As Modelos.Factura, DtInventario As DataTable, CveAlmacen As Integer, CveConcepto As Integer, CveMoneda As Integer, CveVenta As Integer, Modulo As String, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1) As Integer
+ Dim OcurrioError As Boolean = False
+
+ Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConcepto, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:=Modulo, CveMovimientoRelacionado:=CveMovimientoRelacionado)
+
+ If CveMovimientoInventario <= 0 Then
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
+ Else
+ If CveMovimientoRelacionado > 0 Then
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
+
+ For Each Dr As DataRow In ObjInventario.DtResultados.Rows
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un Error al guardar los movimientos de entrada")
+ Exit For
+ End If
+ Next
+
+ End If
+ Else
+ Dim Mensaje As String = ""
+ Dim i As Integer = 0
+
+ Dim Cantidad As Decimal = 0
+ Dim PU As Decimal = 0
+ Dim CveUM As Integer = 0
+ Dim CvePS As Integer = 0
+
+ Dim AplicaSerie As Boolean
+ Dim AplicaLote As Boolean
+ Dim AplicaCaducidad As Boolean
+
+ Dim Serie As String = ""
+ Dim Lote As String = ""
+ Dim FechaCaducidad As DateTime = MinFecha
+
+ For Each Dr As DataRow In DtInventario.Rows
+
+ CvePS = Dr("CvePS").ToString.ToEntero
+ CveUM = Dr("CveUM").ToString.ToEntero
+ Cantidad = Dr("Cantidad").ToString.ToDecimal
+ PU = Dr("PU").ToString.ToDecimal
+
+ AplicaSerie = CBool(Dr("AplicaSerie"))
+ Serie = If(AplicaSerie, Dr("Serie").ToString, "")
+
+ AplicaLote = CBool(Dr("AplicaLote"))
+ Lote = If(AplicaLote, Dr("Lote").ToString, "")
+
+ AplicaCaducidad = CBool(Dr("AplicaCaducidad"))
+ FechaCaducidad = If(AplicaCaducidad, Dr("FechaCaducidad").ToString.ToDateTime, MinFecha)
+
+ If Dr("CveTipoInvPS").ToString.ToEntero = 5 AndAlso AplicaSerie AndAlso Serie = "" Then
+ OcurrioError = True
+ ErrorList.Add("Se deben especificar las Series de los productos de almacén")
+ Exit For
+ End If
+
+ If CvePS > 0 Then
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUM, CvePS, PU, CveSeccionAlmacen:=-3, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. ")
+ Exit For
+ End If
+ Else
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario. ")
+ Exit For
+ End If
+
+
+ i = i + 1
+ Next
+ End If
+
+ 'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN
+ If MovimientoPrePoliza AndAlso Not OcurrioError Then
+ Dim DtCostos As DataTable = Nothing
+ Dim ValorInventario As Decimal = 0
+ Dim TotalCosto As Decimal = 0
+
+ Dim TipoMovto68 As Boolean = True
+ Dim TipoMovto69 As Boolean = False
+
+ If CveConcepto.Contiene(18, 41) Then
+ TipoMovto68 = False
+ TipoMovto69 = True
+ End If
+
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
+ DtCostos = ObjInventario.DtResultados
+ TotalCosto = DtCostos.SUMD("Total").RoundSQL
+ Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
+ Dim IdCtaContable As Integer = 0
+ Dim CveCuenta As Integer = 0
+ If tmpCostos.Rows.Count > 0 Then
+ Dim TotalCostoAcumulado As Decimal = 0
+ Dim cont As Integer = 1
+ 'Se agrega movimiento separado por la cuenta de ventas (ER)
+ For Each RowInv As DataRow In tmpCostos.Rows
+ ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL
+ TotalCostoAcumulado += ValorInventario
+
+ 'cuando es el último movimiento y hay diferencias en los importes
+ If cont = tmpCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
+ ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
+ End If
+
+ 'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString(), Row2("SubProyecto").ToString())
+ IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
+ 'CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
+ 'If ValorInventario <> 0 Then
+
+ If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
+ OcurrioError = True
+ End If
+ 'End If
+ cont += 1
+ Next
+ End If
+ IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
+
+ 'If TotalCosto <> 0 Then
+ If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
+ OcurrioError = True
+ End If
+ 'End If
+
+ Else
+ OcurrioError = True
+ End If
+ factura.Inv_CveMovimiento = CveMovimientoInventario
+ factura.Inv_ValorInventario = ValorInventario
+ End If
+
+ End If
+
+ Return CveMovimientoInventario
+ End Function
+
Private Sub GuardarVentaEstimaciones(ByRef factura As Modelos.Factura, ObjContr As ClsContratos)
'debe de ser por contrato el movimiento
If factura.CveContratoSecciones.Length > 0 Then
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx b/Contabilidad2/CatCuentasAsignaciones.aspx
index f326424ab..2ba7351cd 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx
@@ -24,7 +24,7 @@
@@ -87,6 +87,10 @@
+
+
+
+
diff --git a/Contabilidad2/CatCuentasAsignaciones.aspx.vb b/Contabilidad2/CatCuentasAsignaciones.aspx.vb
index 323a90ca7..886765323 100644
--- a/Contabilidad2/CatCuentasAsignaciones.aspx.vb
+++ b/Contabilidad2/CatCuentasAsignaciones.aspx.vb
@@ -42,7 +42,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If ObjConta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DdlCuenta.DataSource = ObjConta.DtResultados
End If
-
+ ObjConta.Dispose()
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
DdlClientes.setEsWebService(True)
@@ -51,17 +51,25 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
- DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
-
- ObjConta.Dispose()
-
+ DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa)
+
+
+
+ Dim ObjBancos As New ClsBancos
+ If ObjBancos.GetBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) Then
+ DdlCuentaBancaria.DataSource = ObjBancos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
+ End If
+ ObjBancos.Dispose()
+
+ DdlCuentaBancaria.DataBind()
DdlCconceptosContables.DataBind()
DdlCuenta.DataBind()
DdlProveedor.DataBind()
'DdlPersonal.DataBind()
DdlClasificacion.DataBind()
- DdlAlmacen.DataBind()
-
+ DdlAlmacen.DataBind()
+
+ DdlCuentaBancaria.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlConceptoNomina.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCconceptosContables.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlCuenta.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -71,16 +79,20 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
End Sub
Protected Sub ActualizaModulo(sender As Object, e As EventArgs)
+ LimpiarDatos()
+
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveConceptoAsignacion = GvRow.DataKey("CveCuentaAsignacion").ToEntero
DdlCconceptosContables.SelectedValue = GvRow.DataKey("CveConceptoContable").ToEntero
DdlCuenta.SelectedValue = GvRow.DataKey("CveCuenta").ToEntero
- DdlConceptoNomina.SelectedValueexist(GvRow.DataKey("CveConceptoNomina").ToEntero)
+ DdlConceptoNomina.SelectedValueExist(GvRow.DataKey("CveConceptoNomina").ToEntero)
DdlProveedor.SelectedValue = GvRow.DataKey("CveProveedor").ToEntero
DdlClasificacion.SelectedValue = GvRow.DataKey("CveClasificacion").ToEntero
DdlAlmacen.SelectedValue = GvRow.DataKey("CveAlmacen").ToEntero
TxtIdCuentaContable.Text = GvRow.DataKey("IdCuenta")
TxtPorcentajeIVA.Text = GvRow.DataKey("PorcentajeIVA")
+ DdlCuentaBancaria.SelectedValueExist(GvRow.DataKey("CveBancoCuenta"))
+
Dim CveCliente As Integer = GvRow.DataKey("CveCliente").ToEntero
Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
@@ -120,14 +132,23 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
ObjConta.Dispose()
End Sub
- Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click
+ Protected Sub BtnAgregarMotivoD_Click(sender As Object, e As EventArgs) Handles BtnAgregarMotivoD.Click
+ LimpiarDatos()
+
+ LbAgregar.Text = "Agregar"
+ UpModalModulos.Update()
+ RegistraScript("$('#ModalCat').modal();")
+ End Sub
+
+ Private Sub LimpiarDatos()
CveConceptoAsignacion = -1
DdlCconceptosContables.SelectedValue = -1
DdlCuenta.SelectedValue = -1
DdlProveedor.SelectedValue = -1
DdlClasificacion.SelectedValue = -1
DdlAlmacen.SelectedValue = -1
- DdlConceptoNomina.SelectedValue = -1
+ DdlConceptoNomina.SelectedValue = -1
+ DdlCuentaBancaria.SelectedValueExist("-1")
TxtIdCuentaContable.Text = ""
TxtPorcentajeIVA.Text = ""
DdlClientes.ddl.DataSource = ""
@@ -135,10 +156,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlClientes.setEsWebService(True)
DdlPersonal.ddl.DataSource = ""
DdlPersonal.ddl.DataBind()
- DdlPersonal.setEsWebService(True)
- LbAgregar.Text = "Agregar"
- UpModalModulos.Update()
- RegistraScript("$('#ModalCat').modal();")
+ DdlPersonal.setEsWebService(True)
End Sub
Protected Sub LbAgregar_Click(sender As Object, e As EventArgs) Handles LbAgregar.Click
@@ -147,13 +165,13 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If LbAgregar.Text = "Agregar" Then
If Not ObjConta.AddCuentasAsignaciones(DdlCconceptosContables.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
- DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal) Then
+ DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then
ErrorString = "Error al agregar"
End If
ElseIf LbAgregar.Text = "Actualizar" Then
If Not ObjConta.UpdateCuentasAsignaciones(CveConceptoAsignacion, DdlCconceptosContables.SelectedValue.ToEntero, DdlCuenta.SelectedValue.ToEntero, TxtIdCuentaContable.Text.ToEntero,
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
- DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal) Then
+ DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero) Then
ErrorString = "Error al actualizar"
End If
End If
diff --git a/Empresas/152/Formatos/Factura.rdlc b/Empresas/152/Formatos/Factura.rdlc
index dd41dbdf2..248f23356 100644
--- a/Empresas/152/Formatos/Factura.rdlc
+++ b/Empresas/152/Formatos/Factura.rdlc
@@ -2869,6 +2869,21 @@
2pt
+
+ Embedded
+ ID2
+ FitProportional
+ 0.29668cm
+ 1.15361cm
+ 2.413cm
+ 2.75323cm
+ 30
+
+
+
+ 19.04565cm
@@ -3580,6 +3595,12 @@
trueReportParameter1
+
+ String
+ true
+ true
+ ReportParameter1
+
diff --git a/GPS/PuntosDeInteres.aspx.vb b/GPS/PuntosDeInteres.aspx.vb
index 7da5bfd10..0029bed99 100644
--- a/GPS/PuntosDeInteres.aspx.vb
+++ b/GPS/PuntosDeInteres.aspx.vb
@@ -39,23 +39,22 @@ Partial Class GPS_PuntosDeInteres
End Sub
Private Sub CargaDatos()
- Dim gps As New ClsGPS
- If gps.PuntoDeInteresGrupoGet(-1, 1) Then
- GvGrupos.DataSource = gps.DtResultados
- Else
- GvGrupos.DataSource = Nothing
+ Dim ObjGPS As New ClsGPS
+ If ObjGPS.PuntoDeInteresGrupoGet(UsuarioActual.CveCliente, 1) Then
+ GvGrupos.DataSource = ObjGPS.DtResultados
End If
- If gps.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
- GvPuntos.DataSource = gps.DtResultados
- GVPuntosInteres.DataSource = gps.DtResultados
- Else
- GvPuntos.DataSource = Nothing
- GVPuntosInteres.DataSource = Nothing
+
+ If ObjGPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, -1) Then
+ GvPuntos.DataSource = ObjGPS.DtResultados
+ GVPuntosInteres.DataSource = ObjGPS.DtResultados
End If
- gps.Dispose()
+
+ ObjGPS.Dispose()
+
GvGrupos.DataBind()
GvPuntos.DataBind()
GVPuntosInteres.DataBind()
+
UpEditar.Update()
End Sub
@@ -65,7 +64,6 @@ Partial Class GPS_PuntosDeInteres
End If
End Sub
-
Protected Sub BtnAgregarPunto_Click(sender As Object, e As EventArgs) Handles BtnAgregarPunto.Click
Dim GPS As New ClsGPS
GPS.IniciaTransacSQL()
@@ -110,7 +108,7 @@ Partial Class GPS_PuntosDeInteres
Alert("Es necesario seleccionar un grupo de puntos", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
- If GPS.PuntoDeInteresGet(-1, -1, 1, HdnGrupo.Value.ToEntero) AndAlso GPS.DtResultados.Rows.Count > 0 Then
+ If GPS.PuntoDeInteresGet(-1, UsuarioActual.CveCliente, 1, HdnGrupo.Value.ToEntero) AndAlso GPS.DtResultados.Rows.Count > 0 Then
Dim ruta As String = ""
For Each row As DataRow In GPS.DtResultados.Rows
ruta += row("Punto").ToString.Replace("POINT (", "").Replace(")", ",")
diff --git a/GPS/RepPuntosDeInteres.aspx b/GPS/RepPuntosDeInteres.aspx
index 393b829f2..ffbeffbf4 100644
--- a/GPS/RepPuntosDeInteres.aspx
+++ b/GPS/RepPuntosDeInteres.aspx
@@ -1,46 +1,46 @@
-<%@ Page Title="" Language="VB" MasterPageFile="~/SiteGPS.master" AutoEventWireup="false" CodeFile="RepPuntosDeInteres.aspx.vb" Inherits="GPS_RepPuntosDeInteres" %>
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
-
-
-
+
+
+
diff --git a/GPS/RepPuntosDeInteres.aspx.vb b/GPS/RepPuntosDeInteres.aspx.vb
index 3b818619e..444cad665 100644
--- a/GPS/RepPuntosDeInteres.aspx.vb
+++ b/GPS/RepPuntosDeInteres.aspx.vb
@@ -3,6 +3,7 @@
Imports Extensiones
Imports System.Data
Imports Microsoft.Reporting.WebForms
+Imports GemBox.Spreadsheet
Partial Class GPS_RepPuntosDeInteres
Inherits ClsPaginas
@@ -24,6 +25,14 @@ Partial Class GPS_RepPuntosDeInteres
ViewState("DtDatosReporte") = value
End Set
End Property
+ Private Property DtVisitas As DataTable
+ Get
+ Return If(IsNothing(ViewState("DtVisitas")), Nothing, CType(ViewState("DtVisitas"), DataTable))
+ End Get
+ Set(value As DataTable)
+ ViewState("DtVisitas") = value
+ End Set
+ End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -32,6 +41,7 @@ Partial Class GPS_RepPuntosDeInteres
End If
End Sub
Private Sub CargaDatos()
+ DtDatosReporte = Nothing
txtFechaF.Text = Now.ToString("dd/MM/yyyy")
txtFechaI.Text = Now.AddDays(-7).ToString("dd/MM/yyyy")
@@ -66,6 +76,11 @@ Partial Class GPS_RepPuntosDeInteres
End Sub
Private Sub ReportePuntos(Dispositivos As String)
+ 'LIMPIAR REPORTE
+ If DtDatosReporte IsNot Nothing Then
+ DtDatosReporte.Dispose()
+ DtDatosReporte = Nothing
+ End If
Dim FechaI, FechaF As Date
Dim SBBody As New StringBuilder
@@ -83,11 +98,15 @@ Partial Class GPS_RepPuntosDeInteres
Try
For Each row As GridViewRow In GvPuntos.Rows
SBBody.Clear()
+
If row.FCCheckBox("chkGR").Checked Then
If ObjGPS.RepPuntosGet(row.DataKey("CvePuntoDeInteres").ToEntero, Dispositivos, txtFechaI.Text.ToDateTime, txtFechaF.Text.ToDateTime, UsuarioActual.CveCliente) Then
- DtDatosReporte = ObjGPS.DtResultados.Copy()
- GvBarra.DataSource = DtDatosReporte
+ If DtDatosReporte IsNot Nothing Then
+ DtDatosReporte.Merge(ObjGPS.DtResultados)
+ Else
+ DtDatosReporte = ObjGPS.DtResultados.Copy()
+ End If
Coords = SQLToGmaps(row.DataKey("Punto").ToString, "POINT")
SBBody.Append($"
")
@@ -98,7 +117,7 @@ Partial Class GPS_RepPuntosDeInteres
SBBody.Append($"
")
For Each Cve As String In DispositivosLista
If ObjGPS.DtResultados.FiltraParametros($"CveDispositivo = {Cve} ").Rows.Count > 0 Then
- SBBody.Append($"
+
+
+
+
+
+
diff --git a/Inventarios/RecepcionDevolucion.aspx.vb b/Inventarios/RecepcionDevolucion.aspx.vb
new file mode 100644
index 000000000..6a937ce9a
--- /dev/null
+++ b/Inventarios/RecepcionDevolucion.aspx.vb
@@ -0,0 +1,879 @@
+Option Strict On
+Option Explicit On
+
+Imports System.Data
+Imports Extensiones
+
+Partial Class Inventarios_RecepcionDevolucion
+ Inherits ClsPaginas
+
+#Region "P R O P I E D A D E S"
+ Private Property ObjRemisionNC As Modelos.Factura
+ Get
+ Return CType(ViewState("ObjRemisionNC"), Modelos.Factura)
+ End Get
+ Set(value As Modelos.Factura)
+ ViewState("ObjRemisionNC") = value
+ End Set
+ End Property
+ Public Property DtMovimientos As DataTable
+ Get
+ Return CType(ViewState("DtMovimientos"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtMovimientos") = value
+ End Set
+ End Property
+#End Region
+
+ Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+ InicializaValores()
+ End If
+ End Sub
+
+ Protected Sub CreaDT()
+ Dim dt As New DataTable
+
+ Dim column As DataColumn = New DataColumn("Consec")
+ column.DataType = GetType(Integer)
+ With column
+ .AutoIncrement = True
+ .AutoIncrementSeed = 1
+ .AutoIncrementStep = 1
+ End With
+
+ dt.Columns.Add(column)
+ dt.Columns.Add("CantidadDevuelta", GetType(Decimal))
+ dt.Columns.Add("CantidadVenta", GetType(Decimal))
+ dt.Columns.Add("CveVentaDetalle", GetType(Integer))
+ dt.Columns.Add("CveVenta", GetType(Integer))
+ dt.Columns.Add("Venta", GetType(String))
+ dt.Columns.Add("CveUM", GetType(Integer))
+ dt.Columns.Add("UnidadMedida", GetType(String))
+ dt.Columns.Add("CvePS", GetType(Integer))
+ dt.Columns.Add("PS", GetType(String))
+ dt.Columns.Add("PU", GetType(Decimal))
+ dt.Columns.Add("Total", GetType(Decimal))
+ dt.Columns.Add("CveClasificacion", GetType(Integer))
+ dt.Columns.Add("CveSeccionAlmacen", GetType(Integer))
+ dt.Columns.Add("SeccionAlmacen", GetType(String))
+ dt.Columns.Add("Serie", GetType(String))
+ dt.Columns.Add("Lote", GetType(String))
+ dt.Columns.Add("FechaCaducidad", GetType(DateTime))
+ dt.Columns.Add("Observaciones", GetType(String))
+
+ DtMovimientos = dt.Clone()
+ End Sub
+
+ Private Sub InicializaValores()
+ Dim StrAlmacenes As String = "CveTipoAlmacen IN (1)"
+
+ If (UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1") Then
+ DdlCliente.setEsWebService(True)
+ DdlCliente.Attributes.Add("data-metodo", "getcliente")
+ DdlCliente.SelectedText = "Todos"
+ DdlCliente.SelectedValue = "-1"
+ Else
+ DdlCliente.setEsWebService(False)
+ DdlCliente.ddl.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
+ DdlCliente.ddl.DataBind()
+ DdlCliente.ddl.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End If
+
+ DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
+ DdlAlmacen.DataBind()
+ DdlAlmacen.Items.Insert(0, New ListItem("Seleccione ", "-1"))
+ DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
+
+
+ DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, CveEstatus:=1)
+ DdlSubProyecto.DataBind()
+ DdlSubProyecto.Items.Insert(0, New ListItem("Seleccione ", "-1"))
+
+ TxtFechaI.Text = $"01/{Now.Month}/{Now.Year}"
+ TxtFechaF.Text = Now.ToString("dd/MM/yyyy")
+
+ GvDatos.DataSource = Nothing
+ GvDatos.DataBind()
+
+ LimpiarDatos()
+
+ CargaPS(-1, DdlPS, AplicaAlmacen:=False)
+
+ CreaDT()
+
+ UpGenerales.Update()
+ End Sub
+
+ Protected Sub DdlSubProyecto_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim StrAlmacenes As String = $"CveTipoAlmacen IN (1) AND CveSubProyecto={DdlSubProyecto.SelectedValue.ToEntero()}"
+
+ DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros(StrAlmacenes) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa)
+ DdlAlmacen.DataBind()
+ DdlAlmacen.Items.Insert(0, New ListItem("Seleccione ", "-1"))
+ DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
+
+ UpGenerales.Update()
+ End Sub
+
+ Protected Sub LnkAgregarProducto_Click(sender As Object, e As EventArgs)
+ Dim CveCliente As Integer = DdlCliente.SelectedValue.ToEntero()
+ Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
+
+ If CveCliente <= 0 Then
+ Alert("Debe seleccionar un cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CveSubProyecto <= 0 Then
+ Alert("Debe seleccionar un sub proyecto", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ LimpiarDatos()
+
+ RegistraScript("$('#DivModalAgregar').modal('show');")
+ End Sub
+
+ Private Sub LimpiarDatos()
+
+ GvPSAgregar.DataSource = Nothing
+ GvPSAgregar.DataBind()
+
+ ChkAplicaSerie.Checked = False
+ ChkAplicaLote.Checked = False
+ ChkAplicaCaducidad.Checked = False
+
+ ChkAplicaSerie_CheckedChanged(ChkAplicaSerie, EventArgs.Empty)
+ ChkAplicaLote_CheckedChanged(ChkAplicaSerie, EventArgs.Empty)
+ ChkAplicaCaducidad_CheckedChanged(ChkAplicaSerie, EventArgs.Empty)
+
+ End Sub
+
+ Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True, Optional CveMarca As Integer = -1)
+ Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
+ If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
+ Objeto.ddl.Items.Clear()
+ Objeto.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion, Estatus:=1, AplicaParaVenta:=1)
+ Objeto.ddl.DataBind()
+ Objeto.ddl.Items.Insert(0, New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
+ Objeto.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
+ Else
+ Objeto.Attributes.Add("data-cvesubproyecto", "-1")
+ Objeto.ddlWS.Attributes.Add("data-cveclasificacion", "-1")
+ Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
+
+ If AplicaAlmacen Then
+ Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
+ Else
+ Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
+ End If
+ Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
+ Objeto.ddlWS.Attributes.Add("data-cvemarca", CveMarca.ToString)
+ Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
+ End If
+ End Sub
+ Protected Sub ChkAplicaSerie_CheckedChanged(sender As Object, e As EventArgs)
+ lblSerie.Visible = ChkAplicaSerie.Checked
+ DivSerie.Visible = ChkAplicaSerie.Checked
+ UpModalAgregar.Update()
+ End Sub
+ Protected Sub ChkAplicaLote_CheckedChanged(sender As Object, e As EventArgs)
+ lblLote.Visible = ChkAplicaLote.Checked
+ DivLote.Visible = ChkAplicaLote.Checked
+ UpModalAgregar.Update()
+ End Sub
+ Protected Sub ChkAplicaCaducidad_CheckedChanged(sender As Object, e As EventArgs)
+ lblCaducidad.Visible = ChkAplicaCaducidad.Checked
+ DivCaducidad.Visible = ChkAplicaCaducidad.Checked
+ UpModalAgregar.Update()
+ End Sub
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
+ Dim CvePS As Integer = DdlPS.SelectedValue.ToEntero()
+ Dim CveCliente As Integer = DdlCliente.SelectedValue.ToEntero()
+ Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
+
+ If CvePS <= 0 Then
+ Alert("Debe seleccionar un producto", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CveCliente <= 0 Then
+ Alert("Debe seleccionar un cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CveSubProyecto <= 0 Then
+ Alert("Debe seleccionar un sub proyecto", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim FechaI As DateTime = TxtFechaI.Text.ToDateTime()
+ Dim FechaF As DateTime = TxtFechaF.Text.ToDateTime()
+
+ Dim Serie As String = If(ChkAplicaSerie.Checked, TxtSerie.Text.Trim, "-1")
+ Dim Lote As String = If(ChkAplicaLote.Checked, TxtLote.Text.Trim, "-1")
+ Dim FechaCaducidad As DateTime = If(ChkAplicaCaducidad.Checked, TxtFechaCaducidad.Text.ToDateTime, MinFecha)
+
+ Dim ObjInv As New ClsInventarios
+ Try
+ If ObjInv.GetProductosDevolucion(CvePS, CveCliente, CveSubProyecto, FechaI, FechaF, Serie, Lote, FechaCaducidad, UsuarioActual.CveEmpresa) Then
+ GvPSAgregar.DataSource = ObjInv.DtResultados
+ End If
+ Catch ex As Exception
+ OnError("Ocurrio un error al obtener los datos de devolución", ex)
+ End Try
+ ObjInv.Dispose()
+
+ GvPSAgregar.DataBind()
+
+ UpModalAgregar.Update()
+ End Sub
+
+ Protected Sub GvPSAgregar_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPSAgregar.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ If e.Row.DBCampo("CvePS").ToEntero() <= 0 Then
+ e.Row.CssClass = "Totales"
+ e.Row.FCCheckBox("ChkAplicar").Visible = False
+ e.Row.FCTextBox("TxtCantidad").Visible = False
+ End If
+ End If
+ End Sub
+ Protected Sub LnkModalAgregarUsado_Click(sender As Object, e As EventArgs)
+ If DtMovimientos IsNot Nothing Then
+ For Each GvRow As GridViewRow In GvPSAgregar.Rows
+ If GvRow.RowType = DataControlRowType.DataRow Then
+ If GvRow.FCCheckBox("ChkAplicar").Checked Then
+ Dim RowDevolucion As DataRow = DtMovimientos.NewRow
+
+ RowDevolucion("CantidadDevuelta") = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal()
+ RowDevolucion("CantidadVenta") = GvRow.DataKey("Cantidad").ToDecimal()
+ RowDevolucion("CveVentaDetalle") = GvRow.DataKey("CveVentaDetalle").ToEntero()
+ RowDevolucion("CveVenta") = GvRow.DataKey("CveVenta").ToEntero()
+ RowDevolucion("Venta") = GvRow.DataKey("SerieFolio")
+ RowDevolucion("CveUM") = GvRow.DataKey("CveUM").ToEntero()
+ RowDevolucion("UnidadMedida") = GvRow.DataKey("UnidadMedida")
+ RowDevolucion("CvePS") = GvRow.DataKey("CvePS").ToEntero()
+ RowDevolucion("PS") = GvRow.DataKey("PS")
+ RowDevolucion("PU") = GvRow.DataKey("PU").ToDecimal()
+ RowDevolucion("Total") = (GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() * GvRow.DataKey("PU").ToDecimal())
+ RowDevolucion("CveClasificacion") = GvRow.DataKey("CveClasificacion").ToEntero()
+ RowDevolucion("CveSeccionAlmacen") = GvRow.DataKey("CveSeccionAlmacen").ToEntero()
+ RowDevolucion("SeccionAlmacen") = GvRow.DataKey("SeccionAlmacen")
+ RowDevolucion("Serie") = GvRow.DataKey("Serie")
+ RowDevolucion("Lote") = GvRow.DataKey("Lote")
+ RowDevolucion("FechaCaducidad") = If(String.IsNullOrEmpty(GvRow.DataKey("FechaCaducidad")), Nothing, GvRow.DataKey("FechaCaducidad").ToDateTime())
+ RowDevolucion("Observaciones") = ""
+
+ 'If GvRow.DataKey("CveAlmacen").ToEntero() > 0 AndAlso DdlAlmacen.SelectedValue.ToEntero() <= 0 Then
+ ' DdlAlmacen.SelectedValueExist(GvRow.DataKey("CveAlmacen"))
+ 'End If
+
+ DtMovimientos.Rows.Add(RowDevolucion)
+ End If
+
+ End If
+ Next
+
+ GvDatos.DataSource = DtMovimientos
+ GvDatos.DataBind()
+
+ If DtMovimientos.Rows.Count > 0 Then
+ DivFactura.Visible = True
+ DdlFactura.DataSource = DtMovimientos.FiltraParametros("", DistinctColumns:={"CveVenta", "Venta"})
+ DdlFactura.DataBind()
+ End If
+
+ End If
+
+ UpDatos.Update()
+ UpGenerales.Update()
+
+ RegistraScript("$('#DivModalAgregar').modal('hide');")
+
+
+ End Sub
+
+
+#Region "C R E A R - R N C"
+ Private Sub CreaRemisionNC(CveCliente As Integer, CveSubProyecto As Integer)
+ If ObjRemisionNC IsNot Nothing Then
+ ObjRemisionNC.Dispose()
+ ObjRemisionNC = Nothing
+ End If
+ Me.ObjRemisionNC = New Modelos.Factura(UsuarioActual)
+
+ Me.ObjRemisionNC.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
+ Me.ObjRemisionNC.Serie = "-1"
+ Me.ObjRemisionNC.Folio = -1 'Folio.ToEntero()
+ Me.ObjRemisionNC.Version = "3.3"
+ Me.ObjRemisionNC.FolioFiscal = ""
+ Me.ObjRemisionNC.CveUsuario = UsuarioActual.CveUsuario
+ Me.ObjRemisionNC.CveEmpresa = UsuarioActual.CveEmpresa
+ Me.ObjRemisionNC.ConvertirPesos = False
+ Me.ObjRemisionNC.CveVentaPadre = DdlFactura.SelectedValue.ToEntero()
+
+ Dim ObjVentasPadre As New ClsVentas
+ If ObjVentasPadre.GetVenta(Me.ObjRemisionNC.CveVentaPadre, UsuarioActual.CveEmpresa) AndAlso ObjVentasPadre.DtResultados.Rows.Count > 0 Then
+ Me.ObjRemisionNC.CveMoneda = ObjVentasPadre.DtResultados.FiltroPrimeroValor("CveMoneda").ToString().ToEntero()
+ End If
+ ObjVentasPadre.Dispose()
+
+ If Me.ObjRemisionNC.CveMoneda = 1 Then
+ Me.ObjRemisionNC.TipoCambio = 1
+ Else
+ Me.ObjRemisionNC.TipoCambio = GlobalTipoCambio(Now).ToDecimal()
+ End If
+
+ Me.ObjRemisionNC.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", Me.ObjRemisionNC.CveMoneda))
+ Me.ObjRemisionNC.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", Me.ObjRemisionNC.CveMoneda))
+ Me.ObjRemisionNC.TipoDocto = "RNC"
+ Me.ObjRemisionNC.RefDocto = ""
+ Me.ObjRemisionNC.CveMesa = -1
+ Me.ObjRemisionNC.Fecha = Now
+ Me.ObjRemisionNC.CvePrePoliza = -1
+ Me.ObjRemisionNC.FechaPago = Now
+ Me.ObjRemisionNC.MotivoDescuento = ""
+ Me.ObjRemisionNC.FechaEjecucion = Now
+ Me.ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario
+ Me.ObjRemisionNC.CveCondicionEntrega = -1
+ Me.ObjRemisionNC.CondicionEntrega = ""
+ Me.ObjRemisionNC.NumeroCuenta = ""
+ Me.ObjRemisionNC.CondicionesPago = 0
+ Me.ObjRemisionNC.FormaPago = 0
+ Me.ObjRemisionNC.PedidoContrato = ""
+ Me.ObjRemisionNC.NumeroContrato = ""
+ Me.ObjRemisionNC.DescripcionContrato = ""
+ Me.ObjRemisionNC.CveCorte = -1
+ Me.ObjRemisionNC.TipoDocumento = "Remisión"
+ 'NUM 1- CARGO 2- BONIFICACION
+ Me.ObjRemisionNC.Num1 = 0
+ 'NUM 0- USADO 1- AJUSTE/GARANTIA
+ Me.ObjRemisionNC.Num2 = 0
+ 'ES PARA GENERAR DEVOLUCION
+ Me.ObjRemisionNC.Num3 = 10
+ Me.ObjRemisionNC.Alfa1 = ""
+ Me.ObjRemisionNC.Alfa2 = ""
+ Me.ObjRemisionNC.Alfa3 = ""
+ Me.ObjRemisionNC.CveContrato = -1
+ Me.ObjRemisionNC.ConvertirPesos = False
+ Me.ObjRemisionNC.CveSubProyecto = CveSubProyecto
+ Me.ObjRemisionNC.CveSubProyectoCobranza = CveSubProyecto
+ Me.ObjRemisionNC.CveSubProyectoEjecucion = CveSubProyecto
+ Me.ObjRemisionNC.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
+ Me.ObjRemisionNC.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
+
+ 'CLIENTE
+ Me.ObjRemisionNC.CveCliente = CveCliente
+ Me.ObjRemisionNC.SetCliente()
+ Me.ObjRemisionNC.CveAlmacen = -1
+
+ Dim ObjCliente As New ClsClientes
+ If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
+ If ObjCliente.DtResultados.Rows.Count > 0 Then
+ Me.ObjRemisionNC.CveFormaPago33 = ObjCliente.CveFormaPago33
+ Me.ObjRemisionNC.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
+ Me.ObjRemisionNC.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
+
+ Me.ObjRemisionNC.CveMetodoPago33 = ObjCliente.CveMetodoPago33
+ Me.ObjRemisionNC.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
+ Me.ObjRemisionNC.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
+
+ Me.ObjRemisionNC.CveUsoCFDI = ObjCliente.CveUsoCFDI
+ Me.ObjRemisionNC.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
+ Me.ObjRemisionNC.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
+
+ Me.ObjRemisionNC.CveMetodoPago = ObjCliente.CveMetodoPago33
+
+ If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)).Rows.Count > 0 Then
+ Me.ObjRemisionNC.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33)).Rows(0)("MetodoPago").ToString
+ Else
+ Me.ObjRemisionNC.CveMetodoPago = 1
+ Me.ObjRemisionNC.MetodoPago = "Efectivo"
+ End If
+
+ If UsuarioActual.CveEmpresa = 119 Then
+ Me.ObjRemisionNC.FormaPago = 20 'POR DEFINIR AND (@CveMetodoPago33 = 3 AND @CveFormaPago33 <> 20)
+ If Me.ObjRemisionNC.CveMetodoPago33 = 3 Then
+ Me.ObjRemisionNC.CveFormaPago33 = 20
+ End If
+ End If
+ End If
+ End If
+
+ If ObjCliente.GetSucursales(CveCliente) Then
+ If ObjCliente.DtResultados.Rows.Count > 0 Then
+ Me.ObjRemisionNC.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
+ Else
+ Me.ObjRemisionNC.CveClienteSucursal = -1
+ End If
+ End If
+ ObjCliente.Dispose()
+
+ 'DETALLES
+ Me.ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
+
+ CargaDTDetalleRNC()
+
+ 'VALIDA PROMOCIONES Y EXISTENCIAS
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
+ Me.ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
+ End If
+ ObjVentas.Dispose()
+
+ Me.ObjRemisionNC.Observaciones = TxtObservaciones.Text
+ Me.ObjRemisionNC.OrdenCompra = ""
+ Me.ObjRemisionNC.PedidoContrato = ""
+ Me.ObjRemisionNC.ObservacionesAlmacen = ""
+
+
+
+ 'If TmpDTPolizaVirtual IsNot Nothing Then
+ ' Me.ObjRemisionNC.DtPolizasVirtuales = TmpDTPolizaVirtual
+ 'End If
+
+ End Sub
+
+ Private Function AddPSRNC(ByRef TmpDT As DataTable, Cantidad As Decimal, CveUM As Integer, UM As String, CveClasificacion As Integer, Clasificacion As String, CvePS As Integer, PS As String, Obs As String,
+ PU As Decimal, Descuento As Decimal,
+ CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
+ Optional Serie As String = "", Optional TiempoEntrega As String = "", Optional EntregaDirecta As Integer = 0,
+ Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
+ Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0,
+ Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional EsCargo As Boolean = False, Optional PorcentajeIVA As Decimal = 0D, Optional CveTamaño As Integer = 0) As Boolean
+
+ Dim Retorno As Boolean = False
+ If Not CvePS > 0 Then
+ Alert("Ocurrió un error al cargar la información del producto a agregar. Por favor verifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+
+ If (Obs.Length + PS.Length > 1000) Then
+ Alert(String.Format("El Nombre y observación del producto tiene longitud de {0} caracteres y excede los 1000 caracteres permitidos.", Obs.Length + PS.Length), TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+
+
+ Dim Row As DataRow = Nothing
+ Dim TotalCalculableImpuestos As Decimal = 0D, TotalCalculableImpuestosIVA = 0D
+ PU = Math.Round(PU, 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
+
+ Row = TmpDT.NewRow()
+ Row("CveProyecto") = CveProyecto
+ Row("Proyecto") = Proyecto
+ Row("CveSubProyecto") = CveSubProyecto
+ Row("SubProyecto") = SubProyecto
+ Row("Serie") = Serie
+ Row("TiempoEntrega") = TiempoEntrega
+ Row("Orden") = TmpDT.Rows.Count + 1
+ Row("Cantidad") = Cantidad
+ Row("CveUM") = CveUM
+ Row("UM") = UM
+ Row("CveClasificacion") = CveClasificacion
+ Row("Clasificacion") = Clasificacion
+ Row("CvePS") = CvePS
+ Row("Obs") = Obs
+
+ Dim DrPS As DataRow = Nothing
+
+ DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
+
+ If DrPS Is Nothing Then
+ Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+
+ 'verifica si tiene ventaminima
+ If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
+ 'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
+ If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
+ Alert(String.Format("El producto se vende solo en cantidades de {0}", DrPS("VentaMinima").ToString))
+ Return False
+ End If
+ End If
+
+ TotalCalculableImpuestos = ((Cantidad * (PU)) - Descuento)
+ TotalCalculableImpuestosIVA = TotalCalculableImpuestos * (1 + DrPS("IEPSPorcentaje").ToString().ToDecimal)
+
+ Row("PU") = PU
+ Row("Codigo") = DrPS("Codigo")
+ Row("NoIdentificacion") = DrPS("Codigo")
+ Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
+ Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
+ Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
+ Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
+ Row("Consec") = TmpDT.Rows.Count + 1
+
+ Row("PS") = DrPS("PS")
+ Row("CodigoPS") = DrPS("PSCodigo").ToString
+ Row("CveTipoPS") = DrPS("CveTipoPS")
+ Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
+ Row("CveTamaño") = DrPS("CveTamaño")
+
+ If CveClasificacion <= 0 Then Row("CveClasificacion") = DrPS("CveClasificacion")
+ If Clasificacion = "" Then Row("Clasificacion") = DrPS("Clasificacion")
+
+ If DrPS("IVA").ToString().Contiene("-1", "") Then
+ Row("PorcentajeIVA") = PorcentajeIVA
+ Else
+ Row("PorcentajeIVA") = DrPS("IVA")
+ End If
+
+ Row("IVA") = Row("PorcentajeIVA")
+ Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestosIVA, 2)
+
+
+ Row("ImporteRetIVA") = 0D
+ Row("ImporteRetISR") = 0D
+ Row("PorcentajeRetIVA") = 0D
+ Row("PorcentajeRetISR") = 0D
+ Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
+ Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, 2)
+ Row("IEPS") = Row("ImporteIEPS")
+ Row("Descuento") = Math.Round(Descuento, 2)
+ Row("TipoDescuento") = 0
+ Row("Total") = (Cantidad * PU)
+ Row("TotalImporte") = Math.Round(Cantidad * PU, 2)
+
+ Row("SATClaveProdServ") = DrPS("SATClavePS")
+ Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
+
+
+ Row("EntregaDirecta") = EntregaDirecta
+ 'Contratos
+ Row("CveContratoDetalle") = CveContratoDetalle
+ Row("CveVentaDetalle") = CveVentaDetalle
+ Row("CveMovimientoDetallePedido") = CveMovimientoDetallePedido
+ Row("CveOrdenCompraDetalle") = CveOrdenCompraDetalle
+ Row("CveVentaDetalleRemision") = CveVentaDetalleRemision
+ Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
+ Row("CveVentaDetallePedido2") = CveVentaDetallePedido2
+ Row("CuentaPredial") = CuentaPredial
+ Row("EsCargo") = EsCargo
+ Row("CveTamaño") = CveTamaño
+
+ 'RECARGAR GV
+ TmpDT.Rows.Add(Row)
+ TmpDT.AcceptChanges()
+ Retorno = True
+ Return Retorno
+
+ End Function
+ Protected Function CreaDTDetalleRNC() As DataTable
+ Dim TmpDT = New DataTable
+ 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))
+
+ Return TmpDT
+ End Function
+ Protected Sub CargaDTDetalleRNC()
+ 'CvePS = Dr("CvePS").ToString.ToEntero
+ 'CveUM = Dr("CveUM").ToString.ToEntero
+ 'Cantidad = Dr("Cantidad").ToString.ToDecimal
+ 'PU = Dr("PU").ToString.ToDecimal
+
+ 'AplicaSerie = CBool(Dr("AplicaSerie"))
+ 'Serie = If(AplicaSerie, Dr("Serie").ToString, "-1")
+
+ 'AplicaLote = CBool(Dr("AplicaLote"))
+ 'Lote = If(AplicaSerie, Dr("Lote").ToString, "-1")
+
+ 'AplicaCaducidad = CBool(Dr("AplicaCaducidad"))
+ 'FechaCaducidad = If(AplicaCaducidad, Dr("FechaCaducidad").ToString.ToDateTime, MinFecha)
+
+ 'If Dr("CveTipoInvPS").ToString.ToEntero = 5 AndAlso AplicaSerie AndAlso Serie = "" Then
+ ' OcurrioError = True
+ ' ErrorList.Add("Se deben especificar las Series de los productos de almacén")
+ ' Exit For
+ 'End If
+
+ Dim DtInventario As DataTable = New DataTable
+ Dim column As DataColumn = New DataColumn("Consec")
+ column.DataType = GetType(Integer)
+ With column
+ .AutoIncrement = True
+ .AutoIncrementSeed = 1
+ .AutoIncrementStep = 1
+ End With
+
+ DtInventario.Columns.Add(column)
+ DtInventario.Columns.Add("Cantidad", GetType(Decimal))
+ DtInventario.Columns.Add("CveVentaDetalle", GetType(Integer))
+ DtInventario.Columns.Add("CvePS", GetType(Integer))
+ DtInventario.Columns.Add("CveUM", GetType(Integer))
+ DtInventario.Columns.Add("PU", GetType(Decimal))
+ DtInventario.Columns.Add("CveTipoInvPS", GetType(Integer))
+ DtInventario.Columns.Add("AplicaSerie", GetType(Boolean))
+ DtInventario.Columns.Add("Serie", GetType(String))
+ DtInventario.Columns.Add("AplicaLote", GetType(Boolean))
+ DtInventario.Columns.Add("Lote", GetType(String))
+ DtInventario.Columns.Add("AplicaCaducidad", GetType(Boolean))
+ DtInventario.Columns.Add("FechaCaducidad", GetType(DateTime))
+
+ For Each Row As DataRow In DtMovimientos.Rows
+
+ Dim Cantidad As Decimal = Row("CantidadDevuelta").ToString().ToDecimal()
+ Dim PU As Decimal = Row("PU").ToString().ToDecimal()
+ Dim SubTotal As Decimal = Cantidad * PU
+
+ Dim CveUnidadMedida As Integer = 0
+ Dim CveClasificacion As Integer = 0
+ Dim UnidadMedida As String = ""
+ Dim Clasificacion As String = ""
+ Dim PS As String = ""
+ Dim PorcentajeIVA As Decimal = 0
+ Dim CvePS As Integer = Row("CvePS").ToString().ToEntero()
+
+ If CvePS > 0 Then
+ Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0)
+ Dim DrSubProyecto As DataRow = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveSubProyecto = {0}", ObjRemisionNC.CveSubProyecto))
+ If Dr IsNot Nothing AndAlso DrSubProyecto IsNot Nothing Then
+ CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero
+ CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
+ PS = Dr("PSCodigo").ToString
+ UnidadMedida = Dr("UnidadMedida").ToString
+ Clasificacion = Dr("Clasificacion").ToString
+ PorcentajeIVA = DrSubProyecto("IVA").ToString().ToDecimal
+
+ If AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "", ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=-1, CveVentaDetalle:=Row("CveVentaDetalle").ToString().ToEntero()) Then
+ Dim RowInventario As DataRow = DtInventario.NewRow
+
+ RowInventario("Cantidad") = Cantidad
+ RowInventario("CveVentaDetalle") = -1
+ RowInventario("CvePS") = CvePS
+ RowInventario("CveUM") = CveUnidadMedida
+ RowInventario("PU") = PU
+ RowInventario("CveTipoInvPS") = 0
+ RowInventario("AplicaSerie") = Not String.IsNullOrEmpty(Row("Serie").ToString())
+ RowInventario("Serie") = Row("Serie")
+ RowInventario("AplicaLote") = Not String.IsNullOrEmpty(Row("Lote").ToString())
+ RowInventario("Lote") = Row("Lote")
+ Dim AplicaCaducidad = If(String.IsNullOrEmpty(Row("FechaCaducidad").ToString()), False, If(Row("FechaCaducidad").ToString().ToDateTime() <= MinFecha, False, True))
+ RowInventario("AplicaCaducidad") = AplicaCaducidad
+ RowInventario("FechaCaducidad") = Row("FechaCaducidad")
+
+ DtInventario.Rows.Add(RowInventario)
+ End If
+
+ End If
+
+
+ Else
+ Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
+ End If
+ Next
+
+ Dim TotalImporte As Decimal = ObjRemisionNC.DtDetalle.SUM("TotalImporte").ToDecimal()
+ Dim ImporteIVA As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteIVA").ToDecimal()
+ Dim ImporteRetIVA As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
+ Dim ImporteRetISR As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteRetISR").ToDecimal()
+ Dim ImporteIEPS As Decimal = ObjRemisionNC.DtDetalle.SUM("ImporteIEPS").ToDecimal()
+ Dim Descuento As Decimal = ObjRemisionNC.DtDetalle.SUM("Descuento").ToDecimal()
+ Dim Amortizacion As Decimal = 0
+
+ Dim Total As Decimal = (TotalImporte + ImporteIVA + ImporteIEPS) - (ImporteRetIVA + ImporteRetISR + Descuento + Amortizacion)
+
+ 'DETALLES
+ ObjRemisionNC.SubTotal = TotalImporte
+ ObjRemisionNC.Descuento = Descuento
+ ObjRemisionNC.Amortizacion = Amortizacion
+ ObjRemisionNC.IVA = ImporteIVA
+ ObjRemisionNC.RetIVA = ImporteRetIVA
+ ObjRemisionNC.RetISR = ImporteRetISR
+ ObjRemisionNC.IEPS = ImporteIEPS
+ ObjRemisionNC.Total = Total
+ ObjRemisionNC.TotalOtrosConceptos = 0
+ ObjRemisionNC.ObservacionesMovimiento = TxtObservaciones.Text
+
+ ObjRemisionNC.DtInventario = DtInventario
+
+ 'Select Case DtMovimientos.FiltroPrimeroValor("CveConcepto").ToEntero()
+ ' Case 40
+ ' ObjRemisionNC.CveConceptoMovimiento = 41 ' DEVOLUCION DEL CLIENTE
+ ' Case 3
+ ' ObjRemisionNC.CveConceptoMovimiento = 18 ' DEVOLUCION DEL CLIENTE
+ 'End Select
+
+ ObjRemisionNC.CveAlmacen = DdlAlmacen.SelectedValue.ToEntero()
+
+ Dim CveTipoAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=ObjRemisionNC.CveAlmacen).FiltroPrimeroValor("CveTipoAlmacen").ToEntero
+
+ Select Case CveTipoAlmacen
+ Case 10
+ ObjRemisionNC.CveConceptoMovimiento = 41 ' DEVOLUCION DIRECTA DEL CLIENTE
+ Case Else
+ ObjRemisionNC.CveConceptoMovimiento = 18 ' DEVOLUCION DEL CLIENTE
+ End Select
+
+ End Sub
+#End Region
+
+ Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
+ Dim CveCliente As Integer = DdlCliente.SelectedValue.ToEntero()
+ Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.ToEntero()
+ Dim CveAlmacen As Integer = DdlAlmacen.SelectedValue.ToEntero()
+
+ If CveCliente <= 0 Then
+ Alert("Debe seleccionar un cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CveSubProyecto <= 0 Then
+ Alert("Debe seleccionar un sub proyecto", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CveAlmacen <= 0 Then
+ Alert("Debe seleccionar un almacen", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If DtMovimientos Is Nothing OrElse DtMovimientos.Rows.Count = 0 Then
+ Alert("No hay producto para devolver", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Try
+ CreaRemisionNC(CveCliente, CveSubProyecto)
+
+ If ObjRemisionNC IsNot Nothing Then
+ Dim Resp = ObjRemisionNC.EmitirFactura(False)
+
+ If Resp.Mensajes.Count > 0 AndAlso Resp.CveVenta > 0 Then
+ Dim Msg As New StringBuilder
+
+ If Resp.CveVenta > 0 Then
+ If Resp IsNot Nothing Then
+ For Each mensaje2 As String In Resp.Mensajes
+ Msg.AppendFormat(" {0}", mensaje2)
+ Next
+ End If
+ End If
+
+ Msg.AppendFormat(" El Movimiento se registro con el Folio: {0}", Resp.FolioUsado, Resp.CveMovimientoUsado)
+ Msg.AppendFormat("
Imprimir Movimiento ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", Resp.CveMovimientoUsado)))
+
+ Alert(Msg.ToString(), If(Resp.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), JSBtnAceptar:="BtnRefrescarPagina();", ShowCloseButton:=False)
+
+ ElseIf Resp.Mensajes.Count <= 0 AndAlso Resp.CveVenta <= 0 Then
+ Alert("Ocurrió un error al guardar", TipoMensaje.MsgError)
+ ElseIf Resp.Mensajes.Count >= 0 AndAlso Resp.CveVenta <= 0 Then
+ For Each Mensaje In Resp.Mensajes
+ Alert(Mensaje, If(Resp.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), If(Resp.TieneError, "", Resp.LigaPV), ShowCloseButton:=False)
+ Next
+ End If
+
+ End If
+
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar", ex)
+ End Try
+
+
+ End Sub
+
+ Protected Sub GvDatos_RowDeleting(sender As Object, e As GridViewDeleteEventArgs)
+ Dim GvRow As GridViewRow = GvDatos.Rows(e.RowIndex)
+
+ If DtMovimientos IsNot Nothing Then
+ Dim ConsecEliminar As Integer = GvRow.DataKey("Consec").ToEntero()
+ If ConsecEliminar > 0 Then
+ Dim RowEliminar = DtMovimientos.Select($"Consec={ConsecEliminar}")
+ If RowEliminar IsNot Nothing AndAlso RowEliminar.Length > 0 AndAlso RowEliminar.Length = 1 Then
+ RowEliminar(0).Delete()
+ End If
+ End If
+
+ GvDatos.DataSource = DtMovimientos
+ GvDatos.DataBind()
+ End If
+
+ UpDatos.Update()
+ End Sub
+End Class
diff --git a/Sistemas/PopUpAddUsuario.aspx.vb b/Sistemas/PopUpAddUsuario.aspx.vb
index 1ec6d9763..04d76c490 100644
--- a/Sistemas/PopUpAddUsuario.aspx.vb
+++ b/Sistemas/PopUpAddUsuario.aspx.vb
@@ -522,30 +522,13 @@ Partial Class Sistemas_PopUpAddUsuario
Alert("Ocurrió un error al agregar el usuario.", TipoMensaje.MsgInformacion)
End If
Catch ex As Exception
+ HuboError = true
OnError("Ocurrió un error al agregar el usuario.", ex)
End Try
If Not HuboError Then
ObjUsuarios.Commit()
- If UsuarioActual.Empresa.CvePlataforma = 3 Then
-
- Using ObjNotificaciones As New ClsSisNotificaciones()
- ObjNotificaciones.DeleteNotificacion(-1, CveUsuario)
- For Each row As GridViewRow In GVNotificaciones.Rows
- If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
- row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
- If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
- row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
- HuboError = True
- End If
- End If
- Next
- End Using
-
- End If
-
-
Dim JSBTN As String = ""
If UsuarioActual.Empresa.CvePlataforma = 3 AndAlso UsuarioActual.CveCliente > 0 Then
@@ -566,7 +549,24 @@ Partial Class Sistemas_PopUpAddUsuario
ObjUsuarios.RollBack()
Alert("Ocurrió un error al agregar el usuario.", TipoMensaje.MsgInformacion)
End If
- ObjUsuarios.Dispose()
+ ObjUsuarios.Dispose()
+
+ If Not HuboError AndAlso UsuarioActual.Empresa.CvePlataforma = 3 Then
+
+ Using ObjNotificaciones As New ClsSisNotificaciones()
+ ObjNotificaciones.DeleteNotificacion(-1, CveUsuario)
+ For Each row As GridViewRow In GVNotificaciones.Rows
+ If row.FCCheckBox("chkCorreo").Checked OrElse row.FCCheckBox("chkVentana").Checked OrElse row.FCCheckBox("chkSMS").Checked OrElse
+ row.FCCheckBox("chkApp").Checked OrElse row.FCCheckBox("chkCampana").Checked Then
+ If Not ObjNotificaciones.AddUsuariosNotificacion(CveUsuario, row.DataKey("CveNotificacion"), row.FCCheckBox("chkCorreo").Checked, row.FCCheckBox("chkVentana").Checked, row.FCCheckBox("chkSMS").Checked,
+ row.FCCheckBox("chkApp").Checked, row.FCCheckBox("chkCampana").Checked) Then
+ HuboError = True
+ End If
+ End If
+ Next
+ End Using
+
+ End If
RecargarGlobalUsuarios()
RecargarGlobal()
diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx
index 0ac8d7586..0fb66d53a 100644
--- a/Ventas/PV.aspx
+++ b/Ventas/PV.aspx
@@ -2746,58 +2746,81 @@
-
-
-
-
-
-
+
+
+
+
+ Datos de Usados
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -3562,37 +3585,37 @@
$get(Row).style.backgroundColor = "#82b6db";
$get(Obj).focus();
var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
- $get(Obj).value = 0;
- var suma = 0;
- $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
- var currentsaldo = parseFloat($(this).val())
- if (isNaN(currentsaldo)) { currentsaldo = 0 }
- suma = currentsaldo + suma;
- });
- var txtvalue = total - suma;
- if (txtvalue < 0) { txtvalue = 0; }
- if (txtvalue < Saldo) { Saldo = txtvalue.toFixed(2); }
- $get(Obj).value = Saldo;
- $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + parseFloat(Saldo);
- } else {
- $get(Obj).readOnly = true;
- $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - parseFloat($get(Obj).value);
- $get(Obj).value = "";
- $get(Row).style.backgroundColor = "#ffffff";
- }
- //if ($("input:checkbox:not(:checked)"))
- SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
- }
- function imprimircotizacion() {
- __doPostBack('ctl00$HB$LnkImprimir', '');
- }
- function ValidaMontoMenor(Obj, Monto) {
- debugger;
- Monto = ToDouble($('#C_Tab_TabGenerales_TxtTotal').val())
-
- var ValorTxt = Obj.value;
+ $get(Obj).value = 0;
var suma = 0;
- var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
+ $('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
+ var currentsaldo = parseFloat($(this).val())
+ if (isNaN(currentsaldo)) { currentsaldo = 0 }
+ suma = currentsaldo + suma;
+ });
+ var txtvalue = total - suma;
+ if (txtvalue < 0) { txtvalue = 0; }
+ if (txtvalue < Saldo) { Saldo = txtvalue.toFixed(2); }
+ $get(Obj).value = Saldo;
+ $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) + parseFloat(Saldo);
+ } else {
+ $get(Obj).readOnly = true;
+ $get("HdnAnticipos").value = parseFloat($get("HdnAnticipos").value) - parseFloat($get(Obj).value);
+ $get(Obj).value = "";
+ $get(Row).style.backgroundColor = "#ffffff";
+ }
+ //if ($("input:checkbox:not(:checked)"))
+ SetText2($get("LblTotalAnticipos"), formato_numero($get("HdnAnticipos").value, 2, '.', ','));
+ }
+ function imprimircotizacion() {
+ __doPostBack('ctl00$HB$LnkImprimir', '');
+ }
+ function ValidaMontoMenor(Obj, Monto) {
+ debugger;
+ Monto = ToDouble($('#C_Tab_TabGenerales_TxtTotal').val())
+
+ var ValorTxt = Obj.value;
+ var suma = 0;
+ var total = parseFloat($('#<%= LblSaldoVenta.ClientID%>').text().replace(',', ''));
$('#<%= GVAnticipos.ClientID%> input[type="text"]').each(function (index) {
var currentsaldo = parseFloat($(this).val())
if (isNaN(currentsaldo)) { currentsaldo = 0 }
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index d03fdcbe8..fafcab128 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -1271,15 +1271,22 @@ Partial Class PV
Using ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
- DdlMarcaPS.DataSource = ObjMarcas.DtResultados
- DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados
+ DdlMarcaPS.DataSource = ObjMarcas.DtResultados.Copy()
+ DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados.Copy()
+ End If
+
+ If ObjMarcas.GetMarcasUsados(UsuarioActual.CveEmpresa) Then
+ DdlMarcaUsado.DataSource = ObjMarcas.DtResultados.Copy()
End If
End Using
+
DdlMarcaPS.DataBind()
DdlMarcaPSAjuste.DataBind()
+ DdlMarcaUsado.DataBind()
DdlMarcaPS.Items.Insert(0, New ListItem("Todas", "-1"))
DdlMarcaPSAjuste.Items.Insert(0, New ListItem("Todas", "-1"))
+ DdlMarcaUsado.Items.Insert(0, New ListItem("Seleccione", "-1"))
UpModalVenta.Update()
UpAjuste.Update()
@@ -2005,7 +2012,7 @@ Partial Class PV
For Each drow As DataRow In TmpDTPolizaVirtual.Rows
If ObjAcum.AddPolizaVirtual(CveVenta, drow("CveVentaDetalle").ToString().ToEntero(), drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("Descuento").ToString.ToDecimal,
drow("Total").ToString.ToDecimal, drow("TipoServicio").ToString.ToEntero, drow("TipoPoliza").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero, drow("AnioVehiculo").ToString.ToEntero, CBool(drow("TieneUsado").ToString),
- drow("FechaUsado").ToString().ToDateTime, drow("CvePSUsado").ToString.ToEntero, drow("CveBCIUsado").ToString.ToEntero) Then
+ drow("FechaUsado").ToString().ToDateTime, drow("CvePSUsado").ToString.ToEntero, drow("CveBCIUsado").ToString.ToEntero, drow("CveMarcaUsado").ToString.ToEntero) Then
Else
OcurrioError = True
Exit For
@@ -3255,17 +3262,47 @@ Partial Class PV
If ObjFactura.CveCliente > 0 Then
If TmpDT.Rows.Count > 0 Then
- Dim Retorno = ObjFactura.EmitirFactura()
- If Retorno.CveVenta > 0 Then
- Dim SbAlert As New StringBuilder
- SbAlert.AppendFormat("{0} ", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
- SbAlert.AppendFormat("
", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta)))
+ Dim TieneError As Boolean = False
- Dim urlFactura As String = $"/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta))}"
- Dim urlAjuste As String = ""
+ Dim ObjAcum As New ClsAcumuladores
+ Dim ObjContPaq As ClsContPAQi = Nothing
+ If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
+ ObjContPaq = New ClsContPAQi(UsuarioActual.Empresa)
+ End If
+
+ Dim Retorno As Modelos.Factura.MMensajeFactura = Nothing
+ Dim urlFactura As String = ""
+ Dim urlAjuste = ""
+ Dim SbAlert As New StringBuilder
+
+ Try
+ Retorno = ObjFactura.EmitirFactura(Transac:=ObjAcum.IniciaTransacSQL(), ObjContPaqTransac:=ObjContPaq)
+
+ If Retorno IsNot Nothing AndAlso Retorno.CveVenta > 0 Then
+
+ If ObjFactura.TipoDocto = "Rem" Then
+ If ObjAcum.GetPolizasVirtuales(Retorno.CveVenta) Then
+ Dim DtPoliza As DataTable = ObjAcum.DtResultados.Copy()
+
+ For Each Row As DataRow In ObjFactura.DtPolizasVirtuales.Rows
+ Dim CvePolizaVirtual As Integer = DtPoliza.FiltroPrimeroValor("CvePolizaVirtual", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToEntero()
+
+ If Not ObjAcum.UpdatePolizaVirtual(CvePolizaVirtual, Row("CveMarcaUsado").ToString().ToEntero(), Row("FechaUsado").ToString().ToDateTime()) Then
+ SbAlert.Append("Error al guardar la póliza virtual")
+ TieneError = True
+ Exit For
+ End If
+ Next
+
+ DtPoliza.Dispose()
+ Else
+ SbAlert.Append("Error al obtener la póliza virtual")
+ TieneError = True
+ End If
+
+ End If
- Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasDetalle(Retorno.CveVenta) Then
Dim RowGarantia As DataRow = ObjAcum.DtResultados.FiltroPrimero("")
If RowGarantia IsNot Nothing Then
@@ -3274,9 +3311,33 @@ Partial Class PV
urlAjuste = $"/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=AJUSTE&CVEGARANTIADETALLE={0}", RowGarantia("CveGarantiaDetalle")))}"
End If
End If
- End Using
- Retorno.Mensajes(Retorno.Mensajes.Count - 1) = SbAlert.ToString()
+ SbAlert.AppendFormat("{0} ", Retorno.Mensajes(Retorno.Mensajes.Count - 1))
+ SbAlert.AppendFormat("
", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta)))
+
+ urlFactura = $"/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", Retorno.CveVenta))}"
+
+ Else
+ TieneError = True
+ End If
+ Catch ex As Exception
+ TieneError = True
+ OnError("Ocurrió un error al generar el documento", ex)
+ End Try
+
+ If TieneError Then
+ ObjAcum.RollBack()
+ If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
+
+ ObjAcum.Dispose()
+ If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
+
+ Else
+ ObjAcum.Commit()
+ If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
+
+ ObjAcum.Dispose()
+ If ObjContPaq IsNot Nothing Then ObjContPaq.Dispose()
RegistraScript($"descargarPDF('{urlFactura}','{urlAjuste}');", "Imprimir")
@@ -3284,12 +3345,20 @@ Partial Class PV
If DivBloqueo.Visible Then
Retorno.LigaPV = "bloquearAcceso();"
End If
+ End If
+ If Retorno IsNot Nothing AndAlso Retorno.Mensajes.Count > 0 Then
+ Retorno.Mensajes(Retorno.Mensajes.Count - 1) = SbAlert.ToString()
End If
For Each Mensaje In Retorno.Mensajes
Alert(Mensaje, If(Retorno.TieneError, TipoMensaje.MsgError, TipoMensaje.MsgInformacion), If(Retorno.TieneError, "", Retorno.LigaPV), ShowCloseButton:=False)
Next
+
+ If ObjFactura IsNot Nothing Then
+ ObjFactura.Dispose()
+ End If
+
Else
Alert("No hay partidas agregadas a la factura", TipoMensaje.MsgAdvertencia)
End If
@@ -3783,11 +3852,11 @@ Partial Class PV
'Muestra la tabla de tamaños
If drPS("CveTamaño").ToString().ToEntero() > 0 Then
DivRecepcionUsados.Visible = True
- If DdlTipoComprobante.SelectedValue <> "Rem" Then
- GvRecepcionUsados.Columns(2).Visible = False
- Else
- GvRecepcionUsados.Columns(2).Visible = True
- End If
+ 'If DdlTipoComprobante.SelectedValue <> "Rem" Then
+ ' GvRecepcionUsados.Columns(2).Visible = False
+ 'Else
+ ' GvRecepcionUsados.Columns(2).Visible = True
+ 'End If
End If
DdlUnidadMedida.Items.Clear()
@@ -4335,11 +4404,13 @@ Partial Class PV
ChkAgregar.Checked = True
- For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
- If Gvr.RowType = DataControlRowType.DataRow Then
- Gvr.FCTextBox("TxtCantidad").Text = ""
- End If
- Next
+ 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
+ ' If Gvr.RowType = DataControlRowType.DataRow Then
+ ' Gvr.FCTextBox("TxtCantidad").Text = ""
+ ' End If
+ 'Next
+
+ DdlRecepcionUsados.SelectedValueExist("-1")
DivRecepcionUsados.Visible = False
LimpiaAjuste()
@@ -4590,14 +4661,20 @@ Partial Class PV
Dim Entregado As Decimal = 0
Dim UltimoEntregado As Decimal = 0
- For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
- If Gvr.RowType = DataControlRowType.DataRow Then
- If Gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0 Then
- Entregado += (Gvr.FCTextBox("TxtCantidad").Text.ToEntero * Gvr.DataKey("Cargo").ToDecimal)
- UltimoEntregado = Gvr.DataKey("Cargo").ToDecimal
- End If
- End If
- Next
+ 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
+ ' If Gvr.RowType = DataControlRowType.DataRow Then
+ ' If Gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0 Then
+ ' Entregado += (Gvr.FCTextBox("TxtCantidad").Text.ToEntero * Gvr.DataKey("Cargo").ToDecimal)
+ ' UltimoEntregado = Gvr.DataKey("Cargo").ToDecimal
+ ' End If
+ ' End If
+ 'Next
+ If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then
+ Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
+
+ Entregado += (1D * DrTamanio("Cargo").ToString().ToDecimal)
+ UltimoEntregado += (DrTamanio("Cargo").ToString().ToDecimal)
+ End If
If Entregado > 0 Then
'Calcular Vendido
@@ -4916,13 +4993,13 @@ Partial Class PV
If CveVentaDetalle <= 0 AndAlso Not EsCargo Then
Dim ListaPSCargo = CalculaUsados(Consec)
If ListaPSCargo.Count > 0 Then
- CalculaRecepcionUsados(GvRecepcionUsados, CvePS, ListaPSCargo)
+ CalculaRecepcionUsados(CvePS, ListaPSCargo)
End If
ElseIf CveVentaDetalle > 0 AndAlso Not EsCargo Then
EliminarUsados()
Dim ListaPSCargo = CalculaUsados(Consec, LimpiarUsados:=False)
If ListaPSCargo.Count > 0 Then
- CalculaRecepcionUsados(GvRecepcionUsados, CvePS, ListaPSCargo)
+ CalculaRecepcionUsados(CvePS, ListaPSCargo)
End If
End If
@@ -6271,14 +6348,20 @@ Partial Class PV
CargaModelos()
CargaBCIAjuste()
- GvRecepcionUsados.DataSource = DtTamanios
+ DdlRecepcionUsados.DataSource = DtTamanios
GvRecepcionUsadosModal.DataSource = DtTamanios
+ TxtFechaVigencia.Text = Now.ToString("dd/MM/yyyy")
+
DdlTipoUso.DataBind()
DdlTipoDefecto.DataBind()
DdlFacturas.DataBind()
- GvRecepcionUsados.DataBind()
+ DdlRecepcionUsados.DataBind()
+
+ DdlRecepcionUsados.Items.Insert(0, New ListItem("Sin usado recibido", "-1"))
+ DdlBCIUsado.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
GvRecepcionUsadosModal.DataBind()
CreaDTmpDTAjustes()
@@ -6300,12 +6383,12 @@ Partial Class PV
DdlModeloAuto.DataBind()
End Sub
- Protected Sub GvRecepcionUsados_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvRecepcionUsados.RowDataBound
- If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.FCDropDownList("DdlBCIUsado").DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", e.Row.DataKey("CveTamaño")))
- e.Row.FCDropDownList("DdlBCIUsado").DataBind()
- End If
- End Sub
+ 'Protected Sub GvRecepcionUsados_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvRecepcionUsados.RowDataBound
+ ' If e.Row.RowType = DataControlRowType.DataRow Then
+ ' e.Row.FCDropDownList("DdlBCIUsado").DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", e.Row.DataKey("CveTamaño")))
+ ' e.Row.FCDropDownList("DdlBCIUsado").DataBind()
+ ' End If
+ 'End Sub
Private Sub CargaPSAjuste()
'DdlPSAjuste.Items.Clear()
@@ -6790,12 +6873,17 @@ Partial Class PV
Protected Sub ChkAjuste_CheckedChanged(sender As Object, e As EventArgs)
If ChkAjuste.Checked Then
- For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
- If Gvr.RowType = DataControlRowType.DataRow Then
- Gvr.FCTextBox("TxtCantidad").Text = ""
- Gvr.FCTextBox("TxtCantidad").Enabled = False
- End If
- Next
+ 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
+ ' If Gvr.RowType = DataControlRowType.DataRow Then
+ ' Gvr.FCTextBox("TxtCantidad").Text = ""
+ ' Gvr.FCTextBox("TxtCantidad").Enabled = False
+ ' End If
+ 'Next
+
+ DdlRecepcionUsados.SelectedValueExist("-1")
+ DdlRecepcionUsados.Enabled = False
+ DdlBCIUsado.SelectedValueExist("-1")
+ DdlBCIUsado.Enabled = False
DivAjuste.Visible = True
TxtCantidad.Text = "1"
@@ -6810,12 +6898,17 @@ Partial Class PV
TxtPrecio.Text = TxtPrecio.Text
TxtObsPS.Text = "Descuento por garantía"
Else
- For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
- If Gvr.RowType = DataControlRowType.DataRow Then
- Gvr.FCTextBox("TxtCantidad").Text = ""
- Gvr.FCTextBox("TxtCantidad").Enabled = True
- End If
- Next
+ 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
+ ' If Gvr.RowType = DataControlRowType.DataRow Then
+ ' Gvr.FCTextBox("TxtCantidad").Text = ""
+ ' Gvr.FCTextBox("TxtCantidad").Enabled = True
+ ' End If
+ 'Next
+
+ DdlRecepcionUsados.SelectedValueExist("-1")
+ DdlRecepcionUsados.Enabled = True
+ DdlBCIUsado.SelectedValueExist("-1")
+ DdlBCIUsado.Enabled = True
DivAjuste.Visible = False
TxtCantidad.Enabled = True
@@ -6877,6 +6970,7 @@ Partial Class PV
TmpDTPolizaVirtual.Columns.Add("FechaUsado", GetType(DateTime))
TmpDTPolizaVirtual.Columns.Add("CvePSUsado", GetType(Integer))
TmpDTPolizaVirtual.Columns.Add("CveBCIUsado", GetType(Integer))
+ TmpDTPolizaVirtual.Columns.Add("CveMarcaUsado", GetType(Integer))
End Sub
Private Function AddPolizaVirtual(CvePS As Integer) As Boolean
Dim Retorno As Boolean = True
@@ -6916,7 +7010,7 @@ Partial Class PV
Dim Total As Decimal = ((Cantidad * PU) - Descuento).RoundSQL(2)
Dim TipoServicio As Integer = DdlTipoServicio.SelectedValue.ToEntero()
- Dim FechaUsado As DateTime = If(TxtFechaAjuste.Text.ToDateTime() < MinFecha, Now, TxtFechaAjuste.Text.ToDateTime())
+ Dim FechaUsado As DateTime = If(TxtFechaVigencia.Text.ToDateTime() < MinFecha, Now, TxtFechaVigencia.Text.ToDateTime())
Dim CveModeloAuto As Integer = DdlModeloAuto.SelectedValue.ToEntero()
Dim AnioVehiculo As Integer = TxtAnioVehiculo.Text.ToEntero()
Dim TipoPoliza As Integer = 1 'VENTA
@@ -6929,21 +7023,25 @@ Partial Class PV
End If
End If
- Dim TieneUsado As Boolean = GvRecepcionUsados.Rows.Cast(Of GridViewRow).Any(Function(GvRow) GvRow.RowType = DataControlRowType.DataRow AndAlso GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0)
+ Dim TieneUsado As Boolean = (DdlRecepcionUsados.SelectedValue.ToEntero() > 0) 'GvRecepcionUsados.Rows.Cast(Of GridViewRow).Any(Function(GvRow) GvRow.RowType = DataControlRowType.DataRow AndAlso GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0)
Dim CvePSUsado As Integer = -1
Dim CveBCIUsado As Integer = -1
If TieneUsado Then
- For Each GvRow As GridViewRow In GvRecepcionUsados.Rows
- If GvRow.RowType = DataControlRowType.DataRow Then
- If GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0 Then
- CvePSUsado = GvRow.DataKey("CvePSCargo").ToEntero()
- CveBCIUsado = GvRow.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero()
+ 'For Each GvRow As GridViewRow In GvRecepcionUsados.Rows
+ ' If GvRow.RowType = DataControlRowType.DataRow Then
+ ' If GvRow.FCTextBox("TxtCantidad").Text.ToDecimal() > 0 Then
+ ' CvePSUsado = GvRow.DataKey("CvePSCargo").ToEntero()
+ ' CveBCIUsado = GvRow.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero()
+
+ ' Exit For
+ ' End If
+ ' End If
+ 'Next
+
+ CvePSUsado = DdlRecepcionUsados.SelectedValue.ToEntero()
+ CveBCIUsado = DdlBCIUsado.SelectedValue.ToEntero()
- Exit For
- End If
- End If
- Next
End If
Dim Row As DataRow = TmpDTPolizaVirtual.NewRow()
@@ -6961,6 +7059,7 @@ Partial Class PV
Row("FechaUsado") = FechaUsado
Row("CvePSUsado") = CvePSUsado
Row("CveBCIUsado") = CveBCIUsado
+ Row("CveMarcaUsado") = DdlMarcaUsado.SelectedValue.ToEntero()
TmpDTPolizaVirtual.Rows.Add(Row)
@@ -6992,7 +7091,7 @@ Partial Class PV
EmitirImprimirNew()
End Sub
- Private Sub CalculaRecepcionUsados(Gv As GridView, CvePS As Integer, ListaPSCargo As List(Of Integer))
+ Private Sub CalculaRecepcionUsados(CvePS As Integer, ListaPSCargo As List(Of Integer))
If Modalidad = "U" Then
If TmpDTRecepcionUsados.Rows.Count > 0 Then
@@ -7014,28 +7113,48 @@ Partial Class PV
Dim StrTamanios As New StringBuilder()
StrTamanios.Append("Se recibierón los siguientes usados:")
- For Each Gvr As GridViewRow In Gv.Rows
- If Gvr.RowType = DataControlRowType.DataRow Then
+ 'For Each Gvr As GridViewRow In Gv.Rows
+ ' If Gvr.RowType = DataControlRowType.DataRow Then
- If Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal > 0 Then
- TotalCargos += Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal * Gvr.DataKey("Cargo").ToDecimal
- TotalCantidad += Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
- StrTamanios.AppendFormat("{0},", Gvr.DataKey("CodigoPS"))
+ ' If Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal > 0 Then
+ ' TotalCargos += Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal * Gvr.DataKey("Cargo").ToDecimal
+ ' TotalCantidad += Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
+ ' StrTamanios.AppendFormat("{0},", Gvr.DataKey("CodigoPS"))
- Dim Row As DataRow = TmpDTRecepcionUsados.NewRow()
- Row("CvePS") = Gvr.DataKey("CvePSCargo").ToEntero
- Row("CvePSRelacionado") = CvePS
- Row("Cantidad") = Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
- Row("CveUM") = Gvr.DataKey("CveUM").ToEntero
- Row("CveVentaDetalle") = -1
- Row("PU") = Gvr.DataKey("Cargo").ToDouble
- Row("CveBCIUsado") = Gvr.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero
- Row("CveModeloAuto") = DdlModeloAuto.SelectedValue.ToEntero
- TmpDTRecepcionUsados.Rows.Add(Row)
+ ' Dim Row As DataRow = TmpDTRecepcionUsados.NewRow()
+ ' Row("CvePS") = Gvr.DataKey("CvePSCargo").ToEntero
+ ' Row("CvePSRelacionado") = CvePS
+ ' Row("Cantidad") = Gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal
+ ' Row("CveUM") = Gvr.DataKey("CveUM").ToEntero
+ ' Row("CveVentaDetalle") = -1
+ ' Row("PU") = Gvr.DataKey("Cargo").ToDouble
+ ' Row("CveBCIUsado") = Gvr.FCDropDownList("DdlBCIUsado").SelectedValue.ToEntero
+ ' Row("CveModeloAuto") = DdlModeloAuto.SelectedValue.ToEntero
+ ' TmpDTRecepcionUsados.Rows.Add(Row)
- End If
- End If
- Next
+ ' End If
+ ' End If
+ 'Next
+
+ Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
+
+ If DdlRecepcionUsados.SelectedValue.ToEntero() > 0 Then
+ TotalCargos += 1D * DrTamanio("Cargo").ToString().ToDecimal
+ TotalCantidad += 1D
+ StrTamanios.AppendFormat("{0},", DrTamanio("CodigoPS"))
+
+ Dim Row As DataRow = TmpDTRecepcionUsados.NewRow()
+ Row("CvePS") = DrTamanio("CvePSCargo").ToString().ToEntero
+ Row("CvePSRelacionado") = CvePS
+ Row("Cantidad") = 1D
+ Row("CveUM") = DrTamanio("CveUM").ToString().ToEntero
+ Row("CveVentaDetalle") = -1
+ Row("PU") = DrTamanio("Cargo").ToString().ToDecimal
+ Row("CveBCIUsado") = DdlBCIUsado.SelectedValue.ToEntero
+ Row("CveModeloAuto") = DdlModeloAuto.SelectedValue.ToEntero
+ TmpDTRecepcionUsados.Rows.Add(Row)
+
+ End If
If TotalCargos > 0 Then
StrTamanios.Remove(StrTamanios.Length - 1, 1)
@@ -7587,4 +7706,12 @@ Partial Class PV
Response.Redirect($"~/Ventas/PV.aspx")
End Sub
+ Protected Sub DdlRecepcionUsados_SelectedIndexChanged(sender As Object, e As EventArgs)
+ Dim DrTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo = {DdlRecepcionUsados.SelectedValue}")
+
+ DdlBCIUsado.DataSource = DTBCIUsados.FiltraParametros(String.Format("CveTamaño = {0}", DrTamanio("CveTamaño")))
+ DdlBCIUsado.DataBind()
+
+ UpModalVenta.Update()
+ End Sub
End Class
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index 9a9fffbe4..298cbe993 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -3635,15 +3635,17 @@