diff --git a/Acarreos/CatChoferes.aspx b/Acarreos/CatChoferes.aspx index 8636c7b8b..0e2fa0119 100644 --- a/Acarreos/CatChoferes.aspx +++ b/Acarreos/CatChoferes.aspx @@ -37,7 +37,7 @@ - > + > diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 5f93e3f9f..086af8b9c 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1704,6 +1704,28 @@ Public Class ClsInventarios End Function + Public Function UpdateAlmacenTraspasoOrigen(CveAlmacenTraspasoOrigen As Integer, CveVenta As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_Vta_AlmacenTraspasoOrigenUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveAlmacenTraspasoOrigen", SqlDbType.Int).Value = CveAlmacenTraspasoOrigen + .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualiza almacen origen.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + + End Function + Public Function GetExistenciasSucursales(PSRequest As String, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 2d1764be0..1b9fa869b 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -2640,7 +2640,7 @@ Public Class ClsNominas Try DTSet = New DataSet() - DataAdapter("PA_RH_PersonalChecadorASistencia", CommandType.StoredProcedure) + DataAdapter("PA_RH_PersonalChecadorAsistencia", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters .Add("@FechaInicio", SqlDbType.DateTime).Value = FechaInicio .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 795d73da8..45c401eb8 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -156,7 +156,7 @@ Public Class ClsVentas SqlAdapter.Fill(Data) Retorno = True Catch ex As Exception - OnError("Ocurrió un error al guardar los dataos del timbre.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + OnError("Ocurrió un error al guardar los datos del timbre.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try Return Retorno @@ -1976,7 +1976,7 @@ Public Class ClsVentas Return Retorno End Function - Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Porcentaje As Double) As Integer + Public Function AddPrecioLista(CveUsuario As Integer, CveEmpresa As Integer, PrecioLista As String, Predeterminada As Boolean, Porcentaje As Double) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_Vta_PrecioListaAdd") @@ -1986,6 +1986,7 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@PrecioLista", SqlDbType.VarChar).Value = PrecioLista .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje + .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada .Add("@CvePrecioLista", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -2005,7 +2006,8 @@ Public Class ClsVentas Return Retorno End Function - Public Function UpdatePrecioLista(PrecioLista As String, Estatus As Boolean, CveUsuario As Integer, Porcentaje As Double, CvePrecioLista As Integer) As Boolean + Public Function UpdatePrecioLista(PrecioLista As String, Estatus As Boolean, CveUsuario As Integer, Porcentaje As Double, + Predeterminada As Boolean, CvePrecioLista As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PrecioListaUpdate") @@ -2015,6 +2017,7 @@ Public Class ClsVentas .Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@Porcentaje", SqlDbType.SmallMoney).Value = Porcentaje + .Add("@Predeterminada", SqlDbType.Bit).Value = Predeterminada .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista End With diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 1eb41ee06..3d2cc4adc 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -4542,14 +4542,18 @@ Namespace Modelos If MovimientoPrePoliza AndAlso CveMovimientoInventario > 0 Then If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then Dim DtCostos As DataTable = ObjInventario.DtResultados.Copy - Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) + Dim tCveSubProyecto As Integer = Me.CveSubProyecto Dim ValorInventario As Decimal + Dim GroupBycostos As String() = {"CveClasificacion", "CveSubProyecto", "SubProyecto"} + Dim tmpCostos As DataTable = DtCostos.GroupByDT("", "", {GroupBycostos}, SumColumns:={"Total"}).FiltraParametros("GroupADSType = 1") - For Each RowInv As DataRow In DtCostosDistinct.Rows - ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))) + For Each RowInv As DataRow In tmpCostos.Rows + 'ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))) + ValorInventario = RowInv("Total").ToString.ToDecimal + If UsuarioActual.CveEmpresa <> 119 Then tCveSubProyecto = RowInv("CveSubProyecto").ToString.ToEntero() Try If ValorInventario <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, ValorInventario, 69, Me.SerieFolio, Me.SerieFolio, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=Me.CveSubProyecto) Then + If Not ObjConta.AddPrePolizasDetalle(Me.CvePrePoliza, False, ValorInventario, ValorInventario, 69, Me.SerieFolio, Me.SerieFolio, CveVenta:=CveVenta, CveCliente:=Me.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=tCveSubProyecto) Then OcurrioError = True Exit For End If diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index e19e1185a..98d85746d 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -309,19 +309,18 @@ -
-
+
- +
-
+
- +
diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index b9abdc86f..cf37794d5 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -184,15 +184,14 @@ Partial Class ProductosyServicios InicializaValores() If Request("CvePS") IsNot Nothing AndAlso IsNumeric(Request("CvePS")) AndAlso Request("CvePS").ToEntero > 0 Then ViewState("CvePS") = Request("CvePS") - CargarMarcas() - - CargaDatos() - 'Configuración de Modalidad Update - BtnGuardar.Text = "Guardar Cambios" - - CargarAlias() - CargaExistencias() + If CargaDatos() Then + CargarMarcas() + 'Configuración de Modalidad Update + BtnGuardar.Text = "Guardar Cambios" + CargarAlias() + CargaExistencias() + End If Else 'Configuración de Modalidad Insert RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") @@ -850,11 +849,12 @@ Partial Class ProductosyServicios 'DdlCtaContableInventarios.DataBind() 'ObjContabilidad.Dispose() End Sub - Private Sub CargaDatos() + Private Function CargaDatos() As Boolean + Dim Retorno As Boolean = False Dim ObjProductosServicios As New ClsProductosServicios() If ObjProductosServicios.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then If ObjProductosServicios.DtResultados.Rows.Count > 0 Then - + Retorno = True 'SI NO TIENE VALOR Y NO TIENE EL PROCESO MUESTRA SIN CLASIFICACION If ObjProductosServicios.CveClasificacion.ToString.Equals("-1") And Not UsuarioActual.TienePermisoProceso(147) And UsuarioActual.Empresa.Funcionalidad(121) = "1" Then DdlClasificacion.SelectedValueExist("0") @@ -1106,7 +1106,8 @@ Partial Class ProductosyServicios End If ObjProductosServicios.Dispose() gvPaqueteDetalle.DataBind() - End Sub + Return Retorno + End Function Protected Sub CargarAlias() Dim ObjAlias As New ClsProductosServicios ObjAlias.GetPSAlias(CvePS, UsuarioActual.CveEmpresa) diff --git a/Ventas/RepEntregasEcommerce.aspx b/Ventas/RepEntregasEcommerce.aspx index b8a4c8fc7..2d593214d 100644 --- a/Ventas/RepEntregasEcommerce.aspx +++ b/Ventas/RepEntregasEcommerce.aspx @@ -88,20 +88,62 @@ - - + <%-- --%> + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + diff --git a/Ventas/RepEntregasEcommerce.aspx.vb b/Ventas/RepEntregasEcommerce.aspx.vb index 9c38e88de..c8fd441cc 100644 --- a/Ventas/RepEntregasEcommerce.aspx.vb +++ b/Ventas/RepEntregasEcommerce.aspx.vb @@ -1,6 +1,5 @@ Imports System.Data Imports Extensiones -Imports iText.Barcodes.Dmcode Imports Microsoft.Reporting.WebForms Partial Class Ventas_RepEntregasEcommerce @@ -10,12 +9,11 @@ Partial Class Ventas_RepEntregasEcommerce If Not Page.IsPostBack Then CargaCombos() CargaDatos() - End If End Sub Private Sub CargaCombos() - txtFechaI.Text = NowADS.AddDays(-3).ToShortDateString + txtFechaI.Text = NowADS.AddDays(-5).ToShortDateString txtFechaF.Text = NowADS.ToShortDateString End Sub @@ -25,11 +23,20 @@ Partial Class Ventas_RepEntregasEcommerce If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text.Trim.ToDate Else FechaI = MinFecha If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text.Trim.ToDate Else FechaF = MaxFecha Dim Obj As New ClsVentas - If Obj.GetEntregasEcommerce(FechaI, FechaF, 1, UsuarioActual.CveEmpresa) Then - GvD.DataSource = Obj.DtResultados + If Obj.GetEntregasEcommerce(FechaI, FechaF, RBL.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then + If RBL.SelectedValue = "1" Then + GvD.DataSource = Obj.DtResultados + GvD.Visible = True : GvR.Visible = False + Else + GvR.DataSource = Obj.DtResultados + GvR.Visible = True : GvD.Visible = False + End If + End If Obj.Dispose() GvD.DataBind() + GvR.DataBind() + UPDatos.Update() End Sub @@ -127,13 +134,38 @@ Partial Class Ventas_RepEntregasEcommerce Private Sub GvD_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvD.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then - If e.Row.DBCampo("CvePS") = "" Then e.Row.CssClass = "SubTotales" + If e.Row.DBCampo("CvePS") = "" Then + e.Row.CssClass = "SubTotales" + If e.Row.DBCampo("HMO").ToDecimal >= e.Row.DBCampo("Cantidad").ToDecimal Then e.Row.FCButton("BtnHMO").Visible = True + If e.Row.DBCampo("CUL").ToDecimal >= e.Row.DBCampo("Cantidad").ToDecimal Then e.Row.FCButton("BtnCUL").Visible = True + If e.Row.DBCampo("Mex").ToDecimal >= e.Row.DBCampo("Cantidad").ToDecimal Then e.Row.FCButton("BtnMex").Visible = True + If e.Row.DBCampo("LP").ToDecimal >= e.Row.DBCampo("Cantidad").ToDecimal Then e.Row.FCButton("BtnLP").Visible = True + e.Row.FCLabel("LblHmo").Visible = False + e.Row.FCLabel("LblCUL").Visible = False + e.Row.FCLabel("LblMex").Visible = False + e.Row.FCLabel("LblLP").Visible = False + Else + If e.Row.DBCampo("CveAlmacenTraspasoOrigen") <> "" Then + Dim tCve As Integer = e.Row.DBCampo("CveAlmacenTraspasoOrigen").ToEntero + Dim tCol As Integer = If(tCve = 153, 4, If(tCve = 271, 5, If(tCve = 275, 6, 7))) + e.Row.Cells(tCol).BackColor = Drawing.Color.LightGreen + + End If + End If End If End Sub #End Region - - + Private Sub GvD_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvD.RowCommand + If e.CommandName <> "" Then + Dim ObjSurtir As New ClsInventarios + If ObjSurtir.UpdateAlmacenTraspasoOrigen(e.CommandName.ToEntero, e.CommandArgument.ToString.ToEntero, UsuarioActual.CveEmpresa) Then + Alert("Se asignó el almacen por surtir.") + End If + ObjSurtir.Dispose() + CargaDatos() + End If + End Sub End Class