diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index ae2a6e5ca..e5ff86535 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -549,25 +549,34 @@ Public Class ClsPaginas Application("GlobalDTEmpresas") = value End Set End Property - Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1) As DataTable - Get + Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable + Get + Dim AppNombre As String = String.Format("GlobalDTClasificaciones{0}", CveEmpresa) + 'sino existe, recarga los datos + If Application(AppNombre) Is Nothing Then + Dim ObjClasificaciones As New ClsClasificaciones + If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then Application(AppNombre) = ObjClasificaciones.DtResultados + ObjClasificaciones.Dispose() + End If If CveEmpresa <> -1 Then Dim Str As New StringBuilder Str.AppendFormat("CveEmpresa = {0}", CveEmpresa) If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria) - If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) - Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificaciones"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) + If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion) + If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion) + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows) GlobalDTClasificaciones = Dv.ToTable Dv.Dispose() Else - GlobalDTClasificaciones = DirectCast(Application("GlobalDTClasificaciones"), DataTable) + GlobalDTClasificaciones = DirectCast(Application(AppNombre), DataTable) End If End Get - Set(value As DataTable) - Application("GlobalDTClasificaciones") = value + Set(value As DataTable) + Dim AppNombre As String = String.Format("GlobalDTClasificaciones{0}", CveEmpresa) + Application(AppNombre) = value End Set End Property Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable @@ -1507,7 +1516,7 @@ Public Class ClsPaginas 'Fin Ruta 'Cliente - Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1) As DataTable + Property GlobalDTCliente(CveEmpresa As Integer, Optional Estatus As Integer = 1, Optional CveCliente As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTCliente{0}", CveEmpresa) 'sino existe, recarga los datos @@ -1523,10 +1532,11 @@ Public Class ClsPaginas Dim StrSQL As New StringBuilder StrSQL.AppendFormat("CveEmpresa = {0}", CveEmpresa) If Estatus >= 0 Then StrSQL.AppendFormat(" AND EstatusBool = {0} ", Estatus) + If CveCliente >= 0 Then StrSQL.AppendFormat(" AND CveCliente = {0} ", CveCliente) - Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) - GlobalDTCliente = Dv.ToTable - Dv.Dispose() + Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), StrSQL.ToString, "", DataViewRowState.CurrentRows) + GlobalDTCliente = Dv.ToTable + Dv.Dispose() Else GlobalDTCliente = DirectCast(Application(AppNombre), DataTable) diff --git a/App_Code/ClsSisEmpresas.vb b/App_Code/ClsSisEmpresas.vb index cfcca38dd..12fb16ca2 100644 --- a/App_Code/ClsSisEmpresas.vb +++ b/App_Code/ClsSisEmpresas.vb @@ -463,7 +463,7 @@ Public Class ClsSisEmpresas _Empresa.CveDistribuidor = Data.Rows(0)("CveDistribuidor").ToString.ToEntero _Empresa.DiasPermitidos = Data.Rows(0)("DiasPermitidos").ToString.ToEntero _Empresa.AsientoContableComprasContado = If(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString = "", False, CBool(Data.Rows(0)("Conta_AsientoContableComprasContado").ToString)) - _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero + _Empresa.TipoContabilizacion = Data.Rows(0)("Conta_TipoContabilizacion").ToString.ToEntero '0 - Sin Conta, 1- Contabilidad SIG, 2- Contabilidad Contpaq _Empresa.DefaultAsistencias = If(Data.Rows(0)("RH_DefaultAsistencias").ToString = "", False, CBool(Data.Rows(0)("RH_DefaultAsistencias").ToString)) _Empresa.CIEC = Data.Rows(0)("CIEC").ToString _Empresa.Localidad = Data.Rows(0)("Localidad").ToString diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 96498dc75..955f487b8 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -1469,7 +1469,7 @@ Public Class ClsVentas FechaI As Date, FechaF As Date, Mes As Integer, FechaIEjec As Date, FechaFEjec As Date, MesEjec As Integer, CveCliente As Integer, CveSubProyectoEjecucion As Integer, CveVendedor As Integer, CveUsuario As Integer, CveEstatus As Integer, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional TipoDocto As String = "-1", Optional GPO As Integer = -1, Optional CveMoneda As Integer = -1, Optional TipoCambio As Integer = -1, - Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1) As Boolean + Optional TCEspecifico As Double = 0, Optional CveClienteClasificacion As Integer = -1, Optional CveProveedorCompra As Integer = -1, Optional CveMarca As Integer = -1, Optional CveClasificacionDetalle As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_GetRepPSDetalle") @@ -1500,6 +1500,7 @@ Public Class ClsVentas .Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion .Add("@CveProveedorCompra", SqlDbType.Int).Value = CveProveedorCompra .Add("@CveMarca", SqlDbType.Int).Value = CveMarca + .Add("@CveClasificacionDetalle", SqlDbType.Int).Value = CveClasificacionDetalle End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 52038c7cd..a85b009e2 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -1257,7 +1257,7 @@ Namespace Modelos End If - If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta, ObjVentas) Then + If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta, ObjVentas, factura.TipoDocto) Then ErrorList.Add("Error al guardar usados") End If @@ -1785,10 +1785,10 @@ Namespace Modelos DtVentasNC.Rows.Add(Dr) End If End Sub - Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas) As Boolean + Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean Dim Resultado As Boolean = True - If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 Then + If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant") Then Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) diff --git a/Contratos/Contrato.aspx.vb b/Contratos/Contrato.aspx.vb index d4594f75c..175b3bfb4 100644 --- a/Contratos/Contrato.aspx.vb +++ b/Contratos/Contrato.aspx.vb @@ -2046,7 +2046,7 @@ Partial Class Contratos_Default Row("LimitarCantidad") = If(ChkLimitar.Checked, 1, 0) Dim ObjContratos As New ClsContratos - If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Row("LimitarCantidad").ToString.ToEntero = 1, "") Then + If ObjContratos.AddContratosDetalle(CveContrato, Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, UsuarioActual.CveUsuario, Row("CveTipoPresupuesto").ToString.ToEntero, Row("NoIdentificacion").ToString, Convert.ToBoolean(Row("LimitarCantidad")), "") Then If Autorizado Then Dim msj As String = String.Format("Se agregaron {0} {1} del producto {2} con un precio ${3}.", Row("Cantidad"), Row("UM"), Row("PS"), Row("PU")) guardarBitacora(msj) diff --git a/Inventarios/InventarioFisicoDetalle.aspx.vb b/Inventarios/InventarioFisicoDetalle.aspx.vb index c07b9ca77..83cf75375 100644 --- a/Inventarios/InventarioFisicoDetalle.aspx.vb +++ b/Inventarios/InventarioFisicoDetalle.aspx.vb @@ -71,7 +71,7 @@ Partial Class Inventarios_InventarioFisicoDetalle EsUsuarioActual = True End If - GvIFD.Columns(6).Visible = EsUsuarioActual + GvIFD.Columns(6).Visible = EsUsuarioActual OrElse UsuarioActual.TienePermisoProceso(283) ' si el usuario lo registro o si tiene permisos especial GvIFD.DataBind() If (GvIFD.Rows.Count > 0) Then diff --git a/Inventarios/KardexAlmacenHorizontal.aspx b/Inventarios/KardexAlmacenHorizontal.aspx index df303871d..397af66ab 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx +++ b/Inventarios/KardexAlmacenHorizontal.aspx @@ -146,7 +146,12 @@
- + + + + + + <%----%>
diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index 229a2ddb1..b8c30dfb3 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -128,7 +128,7 @@ Partial Class Inventarios_KardexAlmacen Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1) - If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), If(ChkIncluyeTransitorios.Checked, 1, 0), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then + If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue) Then If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then dt = ObjMovimientos.DtResultados Dim ListaBorrar As New List(Of DataColumn) diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 635ed529a..71ed5c269 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -57,21 +57,12 @@ Recepción/Entrega de Usados - +
  • Imprimir
  • -
  • - Traspaso Almacen -
  • - <%--
  • - -
  • --%> -
  • - Ver PrePóliza -
  • +
  • @@ -757,7 +748,7 @@ diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index e7aca56de..a22ed7047 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1003,6 +1003,12 @@ Partial Class Inventarios_RecepcionUsados Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click + If DdlClientes.SelectedValue.ToEntero <= 0 Then + Alert("No se ha especificado el cliente", TipoMensaje.MsgError) + Exit Sub + End If + + 'SI ES DISTRIBUIDOR Y NO VIENE DE REMISION, GENERA UNA REMISION DE NOTA DE CREDITO If EsDistribuidor AndAlso Me.CveRemisionRecibida <= 0 Then Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero() @@ -1107,7 +1113,7 @@ Partial Class Inventarios_RecepcionUsados 'si es selectedvalue = 42, es entrada ,3 -salida Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2) - If RBLOpcion.SelectedValue.ToEntero = 42 AndAlso EsDistribuidor Then + If RBLOpcion.SelectedValue.ToEntero = 42 AndAlso EsDistribuidor AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then @@ -2067,6 +2073,8 @@ Partial Class Inventarios_RecepcionUsados 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 @@ -2112,7 +2120,11 @@ Partial Class Inventarios_RecepcionUsados End If ObjVentas.Dispose() - Me.ObjRemisionNC.Observaciones = "" + If RblUsadosAjuste.SelectedValue = "1" Then + Me.ObjRemisionNC.Observaciones = "Descuento por garantía" + Else + Me.ObjRemisionNC.Observaciones = "Devolución por usado" + End If Me.ObjRemisionNC.OrdenCompra = "" Me.ObjRemisionNC.PedidoContrato = "" Me.ObjRemisionNC.ObservacionesAlmacen = "" @@ -2125,7 +2137,7 @@ Partial Class Inventarios_RecepcionUsados Optional SerieLote 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) As Boolean + 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 @@ -2238,8 +2250,9 @@ Partial Class Inventarios_RecepcionUsados Row("CveVentaDetallePedido2") = CveVentaDetallePedido2 Row("CuentaPredial") = CuentaPredial Row("EsCargo") = EsCargo - - 'RECARGAR GV + Row("CveTamaño") = CveTamaño + + 'RECARGAR GV TmpDT.Rows.Add(Row) TmpDT.AcceptChanges() Retorno = True @@ -2344,6 +2357,7 @@ Partial Class Inventarios_RecepcionUsados Dim CvePS As Integer = Row.DataKey("CvePS").ToEntero() Dim Cantidad As Decimal = Row.DataKey("Cantidad").ToDecimal() Dim PU As Decimal = Row.DataKey("PU").ToDecimal() + Dim CveTamaño As Integer = Row.DataKey("CveTamaño").ToEntero() Dim SubTotal As Decimal = Cantidad * PU Dim CveUnidadMedida As Integer = 0 @@ -2368,11 +2382,32 @@ Partial Class Inventarios_RecepcionUsados End If End If - AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "Inv/RecepcionUsados", PU, 0, -1, "", - ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) + AddPSRNC(ObjRemisionNC.DtDetalle, Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePS, PS, "", PU, 0, -1, "", + ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA, CveTamaño:=CveTamaño) End If Next + If RblUsadosAjuste.SelectedValue = "1" Then + 'agrego un registro extra del importe de ajuste + Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal + Dim CveSATNC As String = "84111506" + Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("") + + If Dr IsNot Nothing Then + Dim CveUnidadMedida, CveClasificacion, CvePS As Integer + CveUnidadMedida = Dr("CveUnidadMedida").ToString.ToEntero + CveClasificacion = Dr("CveClasificacion").ToString.ToEntero + CvePS = Dr("CvePS").ToString.ToEntero + Dim PorcentajeIVA As Decimal = 0.16D + Dim Obs As String = "Descuento por garantía" + + AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "", + ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) + Else + + End If + End If + 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() @@ -2405,12 +2440,23 @@ Partial Class Inventarios_RecepcionUsados #Region "Ajustes" Public Sub OnRblUsadosAjuste_Change(sender As Object, e As EventArgs) + DdlAlmacen.Items.Clear() If RblUsadosAjuste.SelectedValue = "1" Then CargaAjuste() DivAjuste.Visible = True + 'Llenar el dropdownlist de almacén + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6) + LnkAgregarUsado.Visible = False + UppAcciones.Update() + Else DivAjuste.Visible = False + 'Llenar el dropdownlist de almacén + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 22) + LnkAgregarUsado.Visible = True + UppAcciones.Update() End If + DdlAlmacen.DataBind() End Sub Private Sub CargaAjuste() @@ -2496,6 +2542,7 @@ Partial Class Inventarios_RecepcionUsados End Sub Private Sub CargaBCIAjuste() + DdlBCIAjuste.Items.Clear() Dim ObjGral As New ClsGenerales If ObjGral.BCIUsadoGet(UsuarioActual.CveEmpresa) Then DdlBCIAjuste.DataSource = ObjGral.DtResultados @@ -2506,6 +2553,7 @@ Partial Class Inventarios_RecepcionUsados End Sub Private Sub CargaFolioAjuste() + DdlFolioGarantia.Items.Clear() Dim ObjAcum As New ClsAcumuladores If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa) Then DdlFolioGarantia.DataSource = ObjAcum.DtResultados @@ -2519,16 +2567,17 @@ Partial Class Inventarios_RecepcionUsados Dim ObjAcumuladores As New ClsAcumuladores If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo") - TxtConsecutivoAjuste.Text = resultado + TxtConsecutivoAjuste.Text = (resultado.ToEntero + 1).ToString UpAjuste.Update() End If ObjAcumuladores.Dispose() End Sub Protected Sub CargaTipoDeUso() + DdlTipoUso.Items.Clear() DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") DdlTipoUso.Items.Insert(0, New ListItem("Seleccione", "-1")) - DdlTipoUso.DataBind + DdlTipoUso.DataBind() End Sub Protected Sub DdlTipoUso_SelectedIndexChanged(sender As Object, e As EventArgs) @@ -2637,14 +2686,22 @@ Partial Class Inventarios_RecepcionUsados If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then CveTamaño = ObjPS.DtResultados.FiltroPrimeroValor("CveTamaño").ToEntero End If - Dim Datos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa)) + Dim drDatos As DataRow = GlobalDTAcumTamaños().FiltroPrimero(String.Format("CveTamaño = {0} AND CveEmpresa = {1}", CveTamaño, UsuarioActual.CveEmpresa)) - Dim TamañoPS As DataRow - If ObjPS.GetPS(Datos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then - TamañoPS = ObjPS.DtResultados.FiltroPrimero("") + If drDatos IsNot Nothing Then + Dim Importe As Decimal = drDatos("Cargo").ToString.ToDecimal + Dim drTamañoPS As DataRow = Nothing + + DtMovimientos.Rows.Clear() + + If ObjPS.GetPS(drDatos.Item("CvePSCargo").ToString.ToEntero, -1, UsuarioActual.CveEmpresa) Then + drTamañoPS = ObjPS.DtResultados.FiltroPrimero("") + 'CveTamaño = -1 'limpio esta variable para que no se registre dos veces en la clase Modelos + AddNew(drTamañoPS.Item("CvePS").ToString.ToEntero, drTamañoPS.Item("PSCodigo").ToString, drTamañoPS.Item("CveUM").ToString.ToEntero, drTamañoPS.Item("UnidadMedida").ToString, 1.0, Importe, + "", "-1", "-1", "-1", "", "", "", -1, "", "", CveTamaño) + + End If End If - AddNew(TamañoPS.Item("CvePS").ToString.ToEntero, TamañoPS.Item("PSCodigo").ToString, TamañoPS.Item("CveUM").ToString.ToEntero, TamañoPS.Item("UnidadMedida").ToString, 1.0, TxtPUFactura.Text.ToDouble, - "", "-1", "-1", "-1", "", "", "", -1, "", "", -1) ObjPS.Dispose() End Sub #End Region diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index 968a7bc62..4f6b6aaae 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -7299,6 +7299,7 @@ Partial Class OC Dim ObjPS As New ClsProductosServicios If ObjPS.AddPSSimplificado(PS) > 0 Then RecargaGlobalEquivalencias() + RecargaPSGlobal() Alert("El P/S fue agregado correctamente.") End If ObjPS.Dispose() @@ -7312,10 +7313,10 @@ Partial Class OC UpAgregarPS.Update() RegistraScript("$('#DivAgregarPS').modal('hide');") - RecargaPSGlobal() + End Sub Private Sub RecargaPSGlobal() - 'GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing + GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) = Nothing 'Dim ObjPS As New ClsProductosServicios 'If ObjPS.GetPSSimplificado(UsuarioActual.CveEmpresa) Then Application(String.Format("GlobalDTPSSimplificado{0}", UsuarioActual.CveEmpresa)) = ObjPS.DtResultados.AsEnumerable() @@ -7325,10 +7326,12 @@ Partial Class OC Private Sub RecargaGlobalEquivalencias() - Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias) - Hilo.Start() + GeneraGlobalEquivalencias() + 'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalEquivalencias) + 'Hilo.Start() End Sub Private Sub GeneraGlobalEquivalencias() + GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) = Nothing 'Dim dtt As DataTable = GlobalDTProductosServiciosEquivalencias(-1, -1, UsuarioActual.CveEmpresa) 'Dim ObjPS = New ClsProductosServicios 'If ObjPS.GetPSEquivalencias(-1, UsuarioActual.CveEmpresa) Then diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index 005ba0817..566773a6b 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -75,31 +75,30 @@ Partial Class Ventas_ActualizarPrecios Public Sub CargaPreciosLista() - DdlPrecioLista.ITEMS.Clear - Dim ObjVta As New ClsVentas - Dim primerItem As String = "" - If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then - DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy() - DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy() - primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista") - End If - ObjVta.Dispose() + DdlPrecioLista.Items.Clear() + + If UsuarioActual.Empresa.Funcionalidad(404).ToString = "1" Then 'si manneja precios de lista + Dim ObjVta As New ClsVentas + Dim primerItem As String = "" + If ObjVta.GetPrecioListas(UsuarioActual.CveEmpresa) Then + DdlPrecioLista.DataSource = ObjVta.DtResultados.Copy() + DdlPrecioListaCarga.DataSource = ObjVta.DtResultados.Copy() + primerItem = ObjVta.DtResultados.FiltroPrimeroValor("CvePrecioLista") + End If + ObjVta.Dispose() - DdlPrecioLista.DataBind() - DdlPrecioListaCarga.DataBind() + DdlPrecioLista.DataBind() + DdlPrecioListaCarga.DataBind() - If (DdlPrecioLista.Items.Count = 1) Then - DdlPrecioLista.Items.FindByValue(primerItem).Selected = True - End If - - DdlPrecioLista.Items.Insert(0, New ListItem("Seleccione", "-1")) - If UsuarioActual.CveEmpresa.Contiene(1, 140) Then + If (DdlPrecioLista.Items.Count = 1) Then + DdlPrecioLista.Items.FindByValue(primerItem).Selected = True + End If + Else DdlPrecioLista.Items.Insert(0, New ListItem("Sin Precio Lista", "-2")) - DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2")) + DdlPrecioListaCarga.Items.Insert(0, New ListItem("Sin Precio Lista", "-2")) End If - - + End Sub Public Sub CargaPS() diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx index 3da0febd7..e697d1f14 100644 --- a/Ventas/ClientesAbonar.aspx +++ b/Ventas/ClientesAbonar.aspx @@ -261,7 +261,7 @@ @@ -338,6 +338,12 @@ + + Descuento Pronto Pago + +   + + Auxiliar diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb index 1692af294..25766dd80 100644 --- a/Ventas/ClientesAbonar.aspx.vb +++ b/Ventas/ClientesAbonar.aspx.vb @@ -445,16 +445,22 @@ Partial Class Ventas_ClientesAbonar Dim FechaCorte As Date = IIf(CveIESustitucion > 0, (FechaCorteIE.ToDate).ToShortDateString, DateTime.Now.AddYears(1).ToShortDateString).ToString.ToDate + Dim SumDescuentoProntoPago As Double = 0.0 If Mov.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, FechaI, FechaF, pCveMoneda, CveSubProyecto, UsuarioActual.CveEmpresa, CveClienteSucursal, FechaCorte:=FechaCorte, CveIESustitucion:=CveIESustitucion) Then + Dim TmpCxCAux As DataTable + TmpCxCAux = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") + SumDescuentoProntoPago = TmpCxCAux.SUM("DescuentoProntoPago") GvCxC.DataSource = Mov.DtResultados.FiltraParametros("Saldo > 0", "Fecha,SerieFolio") GvCxC.DataBind() CveMoneda = pCveMoneda - End If + End If TxtImporte.Text = "" TxtObservaciones.Text = "" - + If SumDescuentoProntoPago > 0.0 Then + GvCxC.Columns("DescuentoProntoPago").Visible = True + End If Mov.Dispose() UPVentas.Update() @@ -608,8 +614,7 @@ Partial Class Ventas_ClientesAbonar e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("FnSuma(this,{0},{1}); FnCambia({2},this,{1},0,{3},{4});", e.Row.FCTextBox("TxtAbonar").ClientID, e.Row.DBCampo("Saldo"), e.Row.FCCheckBox("Chk").ClientID, CveMonedaFiltro, moneda)) If Not UsuarioActual.Empresa.Funcionalidad(536) = "1" Then - 'si es remisión y factura no timbrada - If e.Row.DBCampo("TipoDocto") = "Rem" OrElse (e.Row.DBCampo("TipoDocto") = "Ing" AndAlso e.Row.DBCampo("FolioFiscal") = "") Then + If e.Row.DBCampo("TipoDocto") = "Rem" Then e.Row.FCCheckBox("Chk").Visible = False ' que no se pueda pagar si es remisión e.Row.Cells(0).ToolTip = "El documento es remisión y no se puede realizar el pago" End If @@ -872,6 +877,7 @@ Partial Class Ventas_ClientesAbonar CveVentasPago.Add(gvr.DataKey("CveVenta").ToEntero) SeriesPago.Add(gvr.DataKey("SerieFolio")) + Dim tipoCambioVentaDiferenciaCambiaria As Double = 1 Dim EsAnticipoEspecial As Boolean = False If gvr.DataKey("TipoDocto") = "Ant" AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then EsAnticipoEspecial = True @@ -1243,7 +1249,7 @@ Partial Class Ventas_ClientesAbonar If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaGananciaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaGananciaCambiaria - + tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) @@ -1281,7 +1287,7 @@ Partial Class Ventas_ClientesAbonar If CveMoneda <> 1 OrElse gvr.DataKey("CveMoneda").ToEntero <> 1 Then IdCtaContable = UsuarioActual.Empresa.IdCuentaPerdidaCambiaria CveCuenta = UsuarioActual.Empresa.CveCuentaPerdidaCambiaria - + tipoCambioVentaDiferenciaCambiaria = If(gvr.DataKey("Fecha").ToDate < FechaUltimaFluctuacion, TipoCambioFluctuacion, gvr.DataKey("TipoCambio").ToDecimal) Dim TCImpuestos As Decimal = If(FuncionalidadFluctuacionImpuestos, tipoCambioPago, tipoCambioVenta) Dim Diferencia As Decimal = ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioVentaValuacion) - ((gvr.FCTextBox("TxtAbonar").Text.ToDecimal) * tipoCambioPago) 'Añadimos la diferencia de perdida en la venta diff --git a/Ventas/RepConciliacionSat.aspx b/Ventas/RepConciliacionSat.aspx new file mode 100644 index 000000000..234fbe0c8 --- /dev/null +++ b/Ventas/RepConciliacionSat.aspx @@ -0,0 +1,15 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RepConciliacionSat.aspx.cs" Inherits="Ventas_RepConciliacionSat" %> + + + + + + + + +
    +
    +
    +
    + + diff --git a/Ventas/RepConciliacionSat.aspx.cs b/Ventas/RepConciliacionSat.aspx.cs new file mode 100644 index 000000000..d0acae9eb --- /dev/null +++ b/Ventas/RepConciliacionSat.aspx.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +public partial class Ventas_RepConciliacionSat : System.Web.UI.Page +{ + protected void Page_Load(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/Ventas/RepProductosServicios.aspx b/Ventas/RepProductosServicios.aspx index ad68f5723..09b1bb7d9 100644 --- a/Ventas/RepProductosServicios.aspx +++ b/Ventas/RepProductosServicios.aspx @@ -5,11 +5,19 @@ -<%-- + <%--
    @@ -60,7 +60,7 @@
  • Personalizar
  • -
  • +
  • Ver Dlls en pesos
  • @@ -80,7 +80,7 @@ - +
    @@ -100,7 +100,7 @@ - + <%-- @@ -150,7 +150,7 @@
    -<%-- + <%-- @@ -191,12 +191,11 @@
    - - +
    - +
    @@ -210,7 +209,7 @@
    - +
    @@ -254,13 +253,13 @@
    - +
    - +
    @@ -270,17 +269,23 @@
    - +
    - +
    - +
    - +
    - + +
    + +
    + + +
    @@ -289,7 +294,7 @@
    - + @@ -306,7 +311,7 @@ - + @@ -336,9 +341,9 @@ - + - + @@ -433,7 +438,7 @@
    - + diff --git a/Ventas/RepProductosServiciosDetalle.aspx.vb b/Ventas/RepProductosServiciosDetalle.aspx.vb index 43a270058..5e60d1ee1 100644 --- a/Ventas/RepProductosServiciosDetalle.aspx.vb +++ b/Ventas/RepProductosServiciosDetalle.aspx.vb @@ -235,6 +235,17 @@ Partial Class Ventas_RepProductosServiciosDetalle DdlClienteClasificacion.DataBind() DdlClienteClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) + + + If UsuarioActual.CveEmpresa.Contiene(141) Then + DivDdlTipo.Visible = True + lblDdlTipoPSDes.Visible = True + End If + DdlTipoPSDes.Items.Clear() + DdlTipoPSDes.DataSource = GlobalDTClasificacionesDetalle(UsuarioActual.CveEmpresa) + DdlTipoPSDes.Items.Insert(0, New ListItem("Seleccione", "-1")) + DdlTipoPSDes.DataBind() + CargaGrupo() CargaTipoCentroCosto() CreaDataTableColor() @@ -250,6 +261,7 @@ Partial Class Ventas_RepProductosServiciosDetalle Dim CveProveedorCompra As Integer = -1 Dim CveVendedor As Integer Dim CveMarca As Integer = -1 + Dim CveClasificacionDetalle As Integer = -1 GPO = If(Request("Grupo") IsNot Nothing AndAlso Request("Grupo").ToEntero() > 0, Request("Grupo").ToEntero(), -1).ToString CveProyecto = If(Request("CveProyecto") IsNot Nothing AndAlso Request("CveProyecto").ToEntero() > 0, Request("CveProyecto").ToEntero(), -1).ToString @@ -283,6 +295,7 @@ Partial Class Ventas_RepProductosServiciosDetalle CveClienteClasificacion = If(Request("CveClienteClasificacion") IsNot Nothing AndAlso Request("CveClienteClasificacion").ToEntero() > 0, Request("CveClienteClasificacion").ToEntero(), -1).ToString CveProveedorCompra = If(Request("CveProveedorCompra") IsNot Nothing AndAlso Request("CveProveedorCompra").ToEntero() > 0, Request("CveProveedorCompra").ToEntero(), -1).ToString.ToEntero CveMarca = If(Request("CveMarca") IsNot Nothing AndAlso Request("CveMarca").ToEntero() > 0, Request("CveMarca").ToEntero(), -1).ToString.ToEntero + CveClasificacionDetalle = If(Request("CveClasificacionDetalle") IsNot Nothing AndAlso Request("CveClasificacionDetalle").ToEntero() > 0, Request("CveClasificacionDetalle").ToEntero(), -1).ToString.ToEntero If Fecha <> "-1" Then txtFechaI.Text = Fecha @@ -366,7 +379,7 @@ Partial Class Ventas_RepProductosServiciosDetalle CargaProvedores(CveProveedorCompra) 'If CveProveedorCompra.ToEntero > 0 Then DdlProveedor.SelectedValue = CveProveedorCompra - + DdlTipoPSDes.SelectedValueExist(CveClasificacionDetalle) CargaDatos(CveProyecto, CveSubProyecto, CveCategoria, CveClasificacion, CvePS, Mes, MesEjec, CveCliente, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatus, GPO.ToEntero, TipoDocto, CveMarca) CargarMarcas(CveMarca) End Sub @@ -395,7 +408,7 @@ Partial Class Ventas_RepProductosServiciosDetalle DdlPS.SelectedValue.ToEntero, FechaI, FechaF, -1, FechaIEjec, FechaFEjec, -1, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, DdlUsuario.SelectedValue.ToEntero, DdlEstatus.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, TipoDocto:=TipoComprobante, GPO:=DdlGrupo.SelectedValue.ToEntero, CveMoneda:=CveMoneda, - TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveProveedorCompra:=CveProveedorCompra, CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero) Then + TipoCambio:=TipoCambio, TCEspecifico:=TCEspecifico, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveProveedorCompra:=CveProveedorCompra, CveMarca:=DdlMarcaPSDes.SelectedValue.ToEntero, CveClasificacionDetalle:=DdlTipoPSDes.SelectedValue.ToEntero()) Then GvDatos.DataSource = ObjVentas.DtResultados TmpDT = ObjVentas.DtResultados Else diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index 01639bdf5..92bbd2874 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -5965,7 +5965,7 @@ <%--APLICAR REMISIONES DE NC--%>