This commit is contained in:
2021-08-23 12:39:50 -07:00
26 changed files with 214 additions and 135 deletions

View File

@@ -1905,7 +1905,7 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveEmpresa As Integer) As Boolean
Public Function RepTraspasoAlmacen(FechaI As Date, FechaF As Date, CveAlmacenOrigen As Integer, CveAlmacenDestino As Integer, Recibido As Boolean, CveTipoAlmacen As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_RepTraspasoAlmacen")
@@ -1915,6 +1915,7 @@ Public Class ClsInventarios
.Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen
.Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino
.Add("@Recibido", SqlDbType.Bit).Value = Recibido
.Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try

View File

@@ -2356,6 +2356,33 @@ Public Class ClsPaginas
End Set
End Property
Property GlobalDTGralMarcas(CveEmpresa As Integer, Optional CveMarca As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa)
'sino existe, recarga los datos
If DirectCast(Application(AppNombre), DataTable) Is Nothing Then
Dim ObjMarcas As New ClsProductosServicios
If ObjMarcas.GetMarcas(CveEmpresa) Then Application(AppNombre) = ObjMarcas.DtResultados Else Application(AppNombre) = Nothing
ObjMarcas.Dispose()
End If
Dim filtro As New StringBuilder
If CveMarca > 0 Then
filtro.AppendFormat(" CveMarca={0} ", CveMarca)
End If
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), filtro.ToString, "", DataViewRowState.CurrentRows)
GlobalDTGralMarcas = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
Dim AppNombre As String = String.Format("GlobalDTGralMarcas-{0}", CveEmpresa)
Application(AppNombre) = value
End Set
End Property
#End Region
#Region "***********************************************************************DT PROSPECTOS*************************************************************************************"

View File

@@ -1342,15 +1342,15 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function AddPSAlias(PS As String, CvePS As Integer, Optional CveUsuarioModifico As Integer = -1, Optional Flexible As Boolean = False) As Boolean
Public Function AddPSAlias(PS As String, CvePS As Integer, Flexible As Boolean, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosAliasAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@PSAlias", SqlDbType.VarChar).Value = If(PS.Length > 845, PS.Substring(0, 845), PS)
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@Flexible", SqlDbType.Bit).Value = If(Flexible, 1, 0)
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
End With
Try
@@ -1361,7 +1361,12 @@ Public Class ClsProductosServicios
If Ex1.Message.Contains("Número: 2627;") Then
OnError("El Nuevo Producto o Servicio no se guardo debido a que actualmente se encuentra registrado", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
If Ex1.Message.Contains("Número: 5555;") Then
Dim Str As String = Ex1.Message.Substring(14) 'toma el valor posterior
OnError("No se puede registrar un alias porque ya existe la siguiente:" + Str, Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar el nuevo Producto o Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)

View File

@@ -2826,7 +2826,7 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
Public Function GetReporteVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUtilidadGet")
@@ -2839,6 +2839,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try
@@ -2853,7 +2854,7 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
Public Function GetReporteVentasUtilidadDetalle(CveVendedor As String, CveVenta As Integer, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasUtilidadDetalleGet")
With SqlAdapter.SelectCommand.Parameters
@@ -2866,6 +2867,7 @@ Public Class ClsVentas
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try
@@ -2883,7 +2885,7 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Double) As Boolean
Public Function GetReportePadreVentasUtilidad(CveVendedor As String, CveCliente As Integer, CveSubProyecto As String, FechaInicio As Date, FechaFin As Date, CveEmpresa As Integer, Gpo As Integer, CvePS As Integer, CveClasificacion As Integer, CveMarca As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_RepVentasUtilidadGet")
@@ -2897,6 +2899,7 @@ Public Class ClsVentas
.Add("@Gpo", SqlDbType.Int).Value = Gpo
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -4587,8 +4587,11 @@
</div>
<div class="row">
<label class="col-md-2">U.M.:</label>
<div class="col-md-10">
<div class="col-md-4">
<asp:DropDownList ID="DdlUnidadAlias" runat="server" Class="table-group-action-input form-control input-inline input-sm" Style="width: 125px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"></asp:DropDownList>
</div>
<div class="col-md-4">
<asp:CheckBox ID="ChkAliasFlexible" Text="Alias Flexible:" runat="server" TextAlign="Left" AutoPostBack ="true" Visible="false" />
</div>
</div>
</div>

View File

@@ -1617,6 +1617,11 @@ Partial Class Compras_Compras
DdlTipoGastoAsignar.DataSource = GlobalDTTiposGastos(UsuarioActual.CveEmpresa)
DdlTipoGastoAsignar.DataBind()
UpParametros.Update()
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa = 119 Then
ChkAliasFlexible.Visible = True
End If
End Sub
Private Sub CargaGvAcarreos(tCveProveedor As Integer)
@@ -5962,10 +5967,6 @@ Partial Class Compras_Compras
End If
End If
End If
If TipoCambioCompra > 1 AndAlso DdlMoneda.SelectedValue.ToEntero <> 1 Then Concepto += $" TC{TipoCambioCompra} ${importeMovimiento.FormatoNumero(2)}"
@@ -6062,7 +6063,7 @@ Partial Class Compras_Compras
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
Case 14 'IVA X Acreditar
importeMovimiento = importeIVAxAcreditar
importeMN = Math.Round(importeMovimiento, 2) * tipoCambioActual * Multiplicador
importeMN = (importeMovimiento * tipoCambioActual * Multiplicador).RoundSQL
If tipoCambioActual > 1 Then Concepto += $" TC{tipoCambioActual} ${importeMovimiento.FormatoNumero(2)}"
PorcentajeImpuesto = PorcentajeIVA
IdCtaContable = If(IdCtaIVAXAcreditar > 0, IdCtaIVAXAcreditar, 0)
@@ -6382,30 +6383,30 @@ Partial Class Compras_Compras
Else
importeMovimiento = 0
End If
Case 285 'Ret IVA 6% Servicios
'Case 285 'Ret IVA 6% Servicios
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
' IdCtaContable = UsuarioActual.Empresa.Funcionalidad(578).ToEntero
'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' If ObjConta.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
' End If
'End If
' 'If ObjConta.GetRetCuenta(ConceptoContable, UsuarioActual.CveEmpresa) And Not IdCtaContable > 0 Then
' ' If ObjConta.DtResultados.Rows.Count > 0 Then
' ' IdCtaContable = ObjConta.DtResultados.Rows(0)("IdCuentaRetIVACirculacion").ToString.ToEntero
' ' End If
' 'End If
If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
' If DdlRetIVAConcepto.SelectedValue.ToEntero = 5 Then
If CveMoneda = 2 Then
importeMN = TxtRetIVA.Text.ToDecimal * TxtTC.Text.ToDecimal
Else
importeMN = TxtRetIVA.Text.ToDecimal
importeMovimiento = TxtRetIVA.Text.ToDecimal
' If CveMoneda = 2 Then
' importeMN = TxtRetIVA.Text.ToDecimal * TxtTC.Text.ToDecimal
' Else
' importeMN = TxtRetIVA.Text.ToDecimal
' importeMovimiento = TxtRetIVA.Text.ToDecimal
End If
' End If
Else
importeMovimiento = 0
End If
' Else
' importeMovimiento = 0
' End If
Case 6 'Compra
Dim AgregaMercanciaInventario As Boolean = UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 140, 141, 152, 153, 154, 159, 160, 161, 162, 163) AndAlso UsuarioActual.Empresa.UsaInventarios AndAlso Not UsuarioActual.Empresa.Funcionalidad(126) = "1"
@@ -8446,7 +8447,7 @@ Partial Class Compras_Compras
Dim Respuesta As Boolean = False
Dim IVADetalles As Decimal = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
Dim IVADetalles As Decimal = TmpDT.SUMD("IVA", " IVA > 0 ")
Dim DiferenciaIVas As Decimal = TxtIVA.Text.ToDecimal - IVADetalles
@@ -8459,8 +8460,9 @@ Partial Class Compras_Compras
End If
For Each dRow As DataRow In TmpDT.Rows
If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dRow("CvePS").ToString.ToEntero).Rows.Count > 0 Then
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dRow("CvePS").ToString.ToEntero).Rows(0)
Dim DttPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dRow("CvePS").ToString.ToEntero)
If DttPS.Rows.Count > 0 Then
Dim DrPS As DataRow = DttPS.Rows(0)
dRow("AplicaIEPS") = Boolean.Parse(DrPS("AplicaIEPS").ToString)
dRow("IEPSGrabaIVA") = Boolean.Parse(DrPS("IEPSGrabaIVA").ToString)
Else
@@ -8486,7 +8488,7 @@ Partial Class Compras_Compras
IndiceContador = IndiceContador + 1
Next
IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
IVADetalles = TmpDT.SUMD("IVA", " IVA > 0 ")
DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles
If Math.Abs(DiferenciaIVas) > 0.01D Then
@@ -8506,21 +8508,16 @@ Partial Class Compras_Compras
TmpDT.Rows(IndiceUltimo)("IVA") = TmpDT.Rows(IndiceUltimo)("IVA").ToString.ToDecimal + DiferenciaIVas
End If
TmpDT.AcceptChanges()
End If
End If
'Revalidacion de ajuste
IVADetalles = TmpDT.SUM("IVA", " IVA > 0 ").ToDecimal
IVADetalles = TmpDT.SUMD("IVA", " IVA > 0 ")
DiferenciaIVas = TxtIVA.Text.ToDecimal - IVADetalles
If Math.Abs(DiferenciaIVas) > 0.01D Then
Respuesta = False
If IVADetalles > 0 Then
@@ -8542,8 +8539,6 @@ Partial Class Compras_Compras
Respuesta = True
End If
If Respuesta Then
Dim IEPSPSDetalles As Decimal = TmpDT.SUMD("IEPSPS", " IEPSPS > 0 ")
@@ -8552,11 +8547,9 @@ Partial Class Compras_Compras
Dim DTConsultaIEPSPS As New DataTable
DTConsultaIEPSPS = TmpDT.FiltraParametros(" AplicaIEPS = 'True'")
Dim IndiceContador As Integer = 0
Dim IndicePrimero As Integer = 0
For Each dRow As DataRow In TmpDT.Rows
If Boolean.Parse(dRow("AplicaIEPS").ToString) Then
IndicePrimero = IndiceContador
@@ -8590,12 +8583,6 @@ Partial Class Compras_Compras
End If
Return Respuesta
End Function
@@ -15471,7 +15458,7 @@ Partial Class Compras_Compras
Dim Cont As Integer = 0
For Each gvr As GridViewRow In GvOC1.Rows
RegistraScript($"CalculaTotalOCEdit('{gvr.DataKey("PS").Replace("'", "")}', {gvr.DataKey("CantidadPendienteVincular").ToString.ToDouble}, {gvr.FCTextBox("TxtCantidad").ClientID}, {gvr.FCTextBox("TxtPU").ClientID}, {gvr.FCTextBox("TxtTotalOC1").ClientID}, {gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {gvr.DataKey("IVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IVA").ClientID},{gvr.DataKey("RetIVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetIVA").ClientID},{gvr.DataKey("RetISR").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetISR").ClientID},{gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSIVA").ClientID},{gvr.DataKey("Descuento")},{gvr.FCHiddenField("HdnOC1Descuento").ClientID},{gvr.DataKey("IVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetIVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetISRPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSIVAPorcentaje").ToString.ToDouble});", $"Gv{Cont}")
RegistraScript($"CalculaTotalOCEdit('{gvr.DataKey("PS").Replace("'", "")}', {gvr.DataKey("Cantidad").ToString.ToDouble}, {gvr.FCTextBox("TxtCantidad").ClientID}, {gvr.FCTextBox("TxtPU").ClientID}, {gvr.FCTextBox("TxtTotalOC1").ClientID}, {gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {gvr.DataKey("IVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IVA").ClientID},{gvr.DataKey("RetIVA").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetIVA").ClientID},{gvr.DataKey("RetISR").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1RetISR").ClientID},{gvr.DataKey("IEPSPS").ToString.ToDouble},{gvr.FCHiddenField("HdnOC1IEPSIVA").ClientID},{gvr.DataKey("Descuento")},{gvr.FCHiddenField("HdnOC1Descuento").ClientID},{gvr.DataKey("IVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetIVAPorcentaje").ToString.ToDouble},{gvr.DataKey("RetISRPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSPorcentaje").ToString.ToDouble},{gvr.DataKey("IEPSPSIVAPorcentaje").ToString.ToDouble});", $"Gv{Cont}")
Cont += 1
Next
@@ -15487,7 +15474,7 @@ Partial Class Compras_Compras
Protected Sub GvOC1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvOC1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim JSCambiaScript = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "")}', {e.Row.DBCampo("CantidadPendienteVincular").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
Dim JSCambiaScript = $"CalculaTotalOCEdit('{e.Row.DBCampo("PS").Replace("'", "")}', {e.Row.DBCampo("Cantidad").ToString.ToDouble}, {e.Row.FCTextBox("TxtCantidad").ClientID}, {e.Row.FCTextBox("TxtPU").ClientID}, {e.Row.FCTextBox("TxtTotalOC1").ClientID}, {e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSImporte").ClientID}, {e.Row.DBCampo("IVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IVA").ClientID},{e.Row.DBCampo("RetIVA").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetIVA").ClientID},{e.Row.DBCampo("RetISR").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1RetISR").ClientID},{e.Row.DBCampo("IEPSPS").ToString.ToDouble},{e.Row.FCHiddenField("HdnOC1IEPSIVA").ClientID},{e.Row.DBCampo("Descuento")},{e.Row.FCHiddenField("HdnOC1Descuento").ClientID},{e.Row.DBCampo("IVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetIVAPorcentaje").ToString.ToDouble},{e.Row.DBCampo("RetISRPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSPorcentaje").ToString.ToDouble},{e.Row.DBCampo("IEPSPSIVAPorcentaje").ToString.ToDouble});"
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", $"LimitaCantidadOC({e.Row.DBCampo("CantidadPendienteVincular")}, this);{JSCambiaScript}")
e.Row.FCTextBox("TxtPU").Attributes.Add("onkeyup", JSCambiaScript)
@@ -18666,12 +18653,18 @@ Partial Class Compras_Compras
UpPSAlias.Update()
End Sub
Protected Sub BtnAddPSAlias_Click(sender As Object, e As EventArgs) Handles BtnAddPSAlias.Click
Dim PS As New ClsProductosServicios
Dim CvePS = -1
Dim tPS = ""
Dim CveSubProyecto As Integer = TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CveSubProyecto").ToString.ToEntero
Dim CvePS As Integer = -1
Dim tPS As String = ""
CvePS = DdlPSAlias2.SelectedValue.ToEntero
tPS = DdlPSAlias2.SelectedText
If CvePS <= 0 Then
Alert("No se ha seleccionado el producto.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CveSubProyecto As Integer = TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CveSubProyecto").ToString.ToEntero
Dim DtpsTemp As DataTable = Nothing
Dim CveContrato As Integer = GlobalDTContratos(UsuarioActual.CveEmpresa, -1, CveSubProyecto).FiltroPrimeroValor("CveContrato").ToEntero
If CveContrato > 0 Then
@@ -18685,9 +18678,9 @@ Partial Class Compras_Compras
DtpsTemp = GetPSContratoDetalle(CveContrato, dttemp)
End If
If PS.AddPSAlias(System.Web.HttpUtility.HtmlDecode(TxtPSAlias.Text.Trim), CvePS, UsuarioActual.CveUsuario) Then
GlobalDTProductosServiciosAlias(-1) = PS.DtResultados
Dim PS As New ClsProductosServicios
If PS.AddPSAlias(System.Web.HttpUtility.HtmlDecode(TxtPSAlias.Text.Trim), CvePS, ChkAliasFlexible.Checked, UsuarioActual.CveUsuario) Then
GlobalDTProductosServiciosAlias(UsuarioActual.CveEmpresa) = PS.DtResultados
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("CvePS") = CvePS
TmpDT.Rows(HdnAliasInd.Value.ToEntero)("PS") = tPS
@@ -20954,6 +20947,10 @@ Partial Class Compras_Compras
UpFacturaNC.Update()
UpMostrarTodos.Update()
End Sub
Private Sub ChkAliasFlexible_CheckedChanged(sender As Object, e As EventArgs) Handles ChkAliasFlexible.CheckedChanged
TxtPSAlias.Enabled = ChkAliasFlexible.Checked
End Sub
End Class
Public Class MMensajeDevolucion

View File

@@ -59,7 +59,7 @@ Partial Class RepContratosObraAvancesPartida
CveContrato = If(Request("CveContrato") IsNot Nothing AndAlso Request("CveContrato").ToString.ToEntero > 0, Request("CveContrato").ToString.ToEntero, -1)
NumeroContrato = If(Request("NumeroContrato") IsNot Nothing AndAlso Request("NumeroContrato").ToString.Length > 0, $"{Request("NumeroContrato").ToString}", "")
LblEstimacion.Text = If(Request("NumeroEstimacion") IsNot Nothing AndAlso Request("NumeroEstimacion").ToString.Length > 0, $"Contgrato { NumeroContrato } Estimacion {Request("NumeroEstimacion").ToString}", "")
LblEstimacion.Text = If(Request("NumeroEstimacion") IsNot Nothing AndAlso Request("NumeroEstimacion").ToString.Length > 0, $"Contrato { NumeroContrato } Estimación {Request("NumeroEstimacion").ToString}", "")
If CveEstimacion > 0 Then

View File

@@ -68,12 +68,14 @@ Partial Class General_CatMarcas
End If
ObjPS.Dispose()
CargaDatos()
End Sub
Protected Sub LnkAgregarMarca_Click(sender As Object, e As EventArgs)
LimpiaModal()
Modalidad = "A"
BtnGuardar.Text = "Agregar"
DivEstatus.Visible = False
UpModal.Update()
RegistraScript("$('#DModalMarca').modal()")
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)

View File

@@ -3861,7 +3861,7 @@ Partial Class Inventarios_EntradasSalidas
Dim Lote As String = If(TxtLoteSalida.Text = "", "", TxtLoteSalida.Text)
Dim FechaCaducidad As Date = If(TxtCaducidadSalida.Text = "", MinFecha.ToShortDateString, TxtCaducidadSalida.Text).ToDate
If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
If ObjInventario.GetExistenciasPS(DdlPSSalida.SelectedValue.ToEntero, CveUM, UsuarioActual.CveEmpresa, DdlAlmacenInventarioFisico.SelectedValue.ToEntero, PendientePorSurtir:=1, Lote:=Lote, FechaCaducidad:=FechaCaducidad) >= TxtCantidadSalidaInv.Text.ToDouble Then
If Not DdlPSSalida.SelectedValue.ToEntero > 0 Then
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
Alert("Es necesario especificar el producto.", TipoMensaje.MsgAdvertencia)

View File

@@ -98,9 +98,15 @@ Partial Class Inventarios_Default
Private Sub CargaDatos(CvePS As Integer, Tipo As Integer)
If ValidarFiltrosSeleccionados() OrElse CvePS > 0 Then
Dim RestringirAlmacenes As Integer = -1
If UsuarioActual.CveEmpresa = 119 Then
RestringirAlmacenes = 1 'restringue los almacenes:Consignación,Productos Financieros Asignados,,roductos Financieros,Consumo Interno,Activo Fijo,Merma,Consignación de Contrato,Devolucion proveedor,
End If
Dim ObjInventarios As New ClsInventarios()
If ObjInventarios.GetExistenciasProducto(CvePS, -1, UsuarioActual.CveEmpresa, -1, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"),
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero, ExcluyeTransitorios:=1, TopSelect:=100) Then
ExcluyeApartados:=-1, ExcluyeAdelantado:=1, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero,
ExcluyeTransitorios:=1, RestringirAlmacenes:=RestringirAlmacenes, TopSelect:=100) Then
Dim dr As Data.DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If dr IsNot Nothing Then

View File

@@ -187,6 +187,11 @@
<div class="col-md-2">
<asp:CheckBox ID="ChkRecibido" runat="server" CssClass="make-switchsd" data-size="small" Text=" " />
</div>
<div class="col-md-1 truncate v-center" style="text-align: right!important">Tipo Almacen:</div>
<div class="col-md-2 v-center">
<asp:DropDownList ID="DdlTipoAlmacen" CssClass="form-control ddlFiltros input-sm select2me Widthall" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Style="width: 100%;" runat="server"></asp:DropDownList>
</div>
</div>
</div>
</div>

View File

@@ -74,7 +74,7 @@ Partial Class RepTraspasoAlmacen
'Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString
If ObjInventarios.RepTraspasoAlmacen(FechaI.ToDate, FechaF.ToDate, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, UsuarioActual.CveEmpresa) Then
If ObjInventarios.RepTraspasoAlmacen(FechaI.ToDate, FechaF.ToDate, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero, ChkRecibido.Checked, DdlTipoAlmacen.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjInventarios.DtResultados
DtInventarios = ObjInventarios.DtResultados
GvDatos.Columns(5).Visible = DtInventarios.MAX("Serie") <> ""
@@ -119,6 +119,12 @@ Partial Class RepTraspasoAlmacen
DdlAlmacenOrigen.SelectedValue = "-1"
DdlAlmacenOrigen.DataBind()
DdlAlmacenOrigen.SelectedValueExist(UsuarioActual.CveAlmacen)
DdlTipoAlmacen.DataSource = GlobalDTTipoAlmacen(1).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)")
DdlTipoAlmacen.DataBind()
DdlTipoAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaAlmacenDestino()
DdlAlmacenDestino.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros("CveTipoAlmacen NOT IN (3,4,9,10,11,21)")

View File

@@ -1722,12 +1722,6 @@ Partial Class Inventarios_TraspasoAlmacen
End If
'FUNCIONALIDAD PISTOLA DE CODIGOS
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
e.Row.FCTextBox("TxtCantidad").Enabled = False
@@ -1748,6 +1742,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim TextoError As String = ""
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim CveMovimientoVirtualEntrada As Integer = 0
Dim CveMovimientoSalidaTransitorio As Integer = 0
Dim FolioVirtualEntrada As Integer = 0
Dim ObjInventario As New ClsInventarios
@@ -1762,6 +1757,13 @@ Partial Class Inventarios_TraspasoAlmacen
ErrorMovInv = True
End If
'AGREGAMOS LA SALIDA
CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenTransitorio, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero,
CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/G12")
Dim CvePrePoliza As Integer = -1
Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Cancelación Traspaso"
@@ -1797,11 +1799,21 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, GvRow.DataKey("CveAF").ToEntero, -1, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, GvRow.DataKey("CveUM").ToEntero, CvePS, PrecioUnitario, -1, -1, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote"), FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleSalida) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
'MOV, Alm, Transito
If GvRow.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero > 0 Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaTransitorio, Cantidad, GvRow.DataKey("CveUM").ToString.ToEntero, CvePS, PrecioUnitario, CveSeccionAlmacen:=-3, Serie:=GvRow.DataKey("Serie").ToString, Lote:=GvRow.DataKey("Lote").ToString, FechaCaducidad:=GvRow.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=GvRow.DataKey("CveMovimientoDetalleTransitorio").ToString.ToEntero) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
Else
CveMovimientoSalidaTransitorio = 0
End If
importe += Cantidad * PrecioUnitario
End If
End If
@@ -1861,16 +1873,16 @@ Partial Class Inventarios_TraspasoAlmacen
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal) Then
CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al cancelar el traspaso"
End If
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
' CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImporteDecimal) Then
' ErrorMovInv = True
' TextoError = "Ocurrió un erro al cancelar el traspaso"
'End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteDecimal, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1,
CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=ImporteDecimal, Contabilizable:=False) Then
ErrorMovInv = True
TextoError = "Ocurrió un erro al cancelar el traspaso"
End If
End If
End If

View File

@@ -154,7 +154,7 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscar','{0}')", GVPrecios.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
<asp:GridView ID="GVPrecios" runat="server" GridLines="None" DataKeyNames="CvePS, CvePrecioLista,PrecioLista,PS,Codigo,Codigo2,Porcentaje,CodigoPS"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros" ToolTip="Listado de Nombres">
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" data-sort="true" EmptyDataText="No se encontraron registros" >
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="center" ItemStyle-Width="5%">
<ItemTemplate>
@@ -188,8 +188,9 @@
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="UnidadMedida" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="U.M." />
<asp:BoundField DataField="Moneda" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="Moneda" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="CostoPromedio" NullDisplayText="-" ItemStyle-Width="5%" DataFormatString="{0:N2}" Visible="false" HeaderText="C. Promedio" ItemStyle-HorizontalAlign="right" />
<asp:BoundField DataField="VentaMinima" NullDisplayText="N/A" ItemStyle-Width="10%" HeaderText="E. Mínimo" ItemStyle-HorizontalAlign="right" />
@@ -238,7 +239,7 @@
<a id="lnkAplicarPrecioSucursales" runat="server" class="btn btn-default" onclick="CambiaPrecioModal();">Aplicar</a>
</div>
</div>
<asp:GridView ID="gvSucursal" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSubProyecto" EmptyDataText="No se encontraron Sucursales" ToolTip="Listado de Sucursales habilitadas para Productos o Servicios"
<asp:GridView ID="gvSucursal" runat="server" AutoGenerateColumns="False" DataKeyNames="CveSubProyecto" EmptyDataText="No se encontraron Sucursales" ToolTip="Sucursales habilitadas para Productos o Servicios"
CssClass="table table-striped table-smallpadding table-advance table-hover Widthall" OnRowDataBound="gvSucursal_RowDataBound" Style="text-align: center;" GridLines="None">
<Columns>
<asp:TemplateField>

View File

@@ -179,9 +179,12 @@ Partial Class Ventas_ActualizarPrecios
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then 'Empresa Acumuladores
GVPrecios.Columns(2).Visible = True
End If
If UsuarioActual.CveEmpresa = 153 Then 'Empresa servec
GVPrecios.Columns(11).Visible = True
End If
dvDatos.Visible = True
GVPrecios.DataBind()

View File

@@ -1403,7 +1403,7 @@
</asp:UpdatePanel>
<asp:UpdatePanel ID="UPGVAlias" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GVAlias" runat="server" ShowHeader="True" AutoGenerateColumns="False" EmptyDataText="No se encontraron Alias del Producto o Servicio." CellPadding="1" CellSpacing="1" RowStyle-VerticalAlign="Middle" RowStyle-HorizontalAlign="Center" DataKeyNames="CvePS,PSAlias" CssClass="table table-striped table-advance table-hover" Style="text-align: center;" GridLines="None">
<asp:GridView ID="GVAlias" runat="server" ShowHeader="True" AutoGenerateColumns="False" EmptyDataText="No se encontraron Alias del Producto o Servicio." CellPadding="1" CellSpacing="1" RowStyle-VerticalAlign="Middle" DataKeyNames="CvePS,PSAlias" CssClass="table table-striped table-advance table-hover" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
@@ -1411,6 +1411,12 @@
</ItemTemplate>
<ItemStyle Width="699px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Literal ID="Flex" runat="server" Text='<%#If(Eval("Flexible").ToString = "True", "Si", "No") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="50px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgD" runat="server" AlternateText="Eliminar" CausesValidation="False" CommandName="Delete" ImageUrl="/Imagenes/Btn_Delete.png" OnClientClick="javascript:return C();" />

View File

@@ -1455,7 +1455,7 @@ Partial Class ProductosyServicios
Dim ObjAliasAdd As New ClsProductosServicios
Dim TieneError = False
If ObjAliasAdd.AddPSAlias(TxtAlias.Text.ToString, CvePS, UsuarioActual.CveUsuario) Then
If ObjAliasAdd.AddPSAlias(TxtAlias.Text.ToString, CvePS, False, UsuarioActual.CveUsuario) Then
CargarAlias()
UPGVAlias.Update()
Alert("Alias " + TxtAlias.Text + " agregado.", TipoMensaje.MsgInformacion)
@@ -1801,11 +1801,8 @@ Partial Class ProductosyServicios
DivMarca.Visible = True
End If
Dim ObjMarcas As New ClsProductosServicios
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataSource = ObjMarcas.DtResultados
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
ObjMarcas.Dispose()
DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcaPSDes.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataBind()
DdlMarcaPSDes.DataBind()
End If

View File

@@ -85,11 +85,12 @@
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron comisiones con los filtros especificados" ToolTip="Listado de Comisiones" CssClass="table table-striped table-hover Widthall" GridLines="None">
<Columns>
<asp:TemplateField HeaderText="Factura" ItemStyle-Width="16%" ItemStyle-HorizontalAlign="Left">
<asp:TemplateField HeaderText="Factura" ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:HyperLink ID="HLGrupo" Target="_blank" Text='<%# Eval("Grupo") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Pago" DataField="CondicionesPagoTexto" ItemStyle-Width="4%" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" ItemStyle-Width="8%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="F. Venc" DataField="FechaVencimiento" ItemStyle-Width="8%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="F. Pago" DataField="FechaPago" ItemStyle-Width="8%" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />

View File

@@ -191,6 +191,12 @@
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
<div class="col-md-1 truncate">
Marca:
</div>
<div class="col-md-2">
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
</div>
</div>
</div>
</div>

View File

@@ -81,6 +81,10 @@ Partial Class Ventas_RepVentasUtilidad
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
Dim CveSubProyecto = If(Request("CveSubProyecto") IsNot Nothing, Request("CveSubProyecto").ToString, "-1").ToString
Dim CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor") <> "", Request("CveVendedor"), "-1").ToString
Dim CveCliente = If(Request("CveCliente") IsNot Nothing AndAlso Request("CveCliente") <> "", Request("CveCliente"), "-1").ToString
@@ -90,6 +94,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim FechaF = If(Request("FechaF") IsNot Nothing, Request("FechaF").ToString, "-1").ToString
Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing AndAlso Request("CveClasificacion") <> "", Request("CveClasificacion"), "-1").ToString
Dim CvePS = If(Request("CvePS") IsNot Nothing AndAlso Request("CvePS") <> "", Request("CvePS"), "-1").ToString
Dim CveMarca = If(Request("CveMarca") IsNot Nothing AndAlso Request("CveMarca") <> "", Request("CveMarca"), "-1").ToString
DdlSubProyecto.SelectedValuesIfExistM(CveSubProyecto)
DdlVendedor.SelectedValuesIfExistM(CveVendedor)
@@ -105,6 +110,8 @@ Partial Class Ventas_RepVentasUtilidad
DdlPS.SelectedText = "Todos"
End If
DdlMarcas.SelectedValueExist(CveMarca)
txtFechaI.Text = FechaI
txtFechaF.Text = FechaF
@@ -144,7 +151,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
DtVentas = ObjVentas.DtResultados
GvDatos.DataSource = ObjVentas.DtResultados
GvDatos.DataBind()
@@ -282,6 +289,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b> {DdlVendedor.GetSelectedText}")
Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b> {DdlPS.SelectedText}")
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificacion:</b> {DdlClasificacion.SelectedItem.Text}")
Dim Marca = If(DdlMarcas.SelectedValue = "-1", "", $"&emsp;<b>Marcas:</b> {DdlMarcas.SelectedItem.Text}")
' Dim Grupo = DdlGrupo.SelectedItem.Text
Dim FechaIn As String = $"&emsp;<b>Fecha Inicio:</b> {txtFechaI.Text}"
@@ -294,7 +302,7 @@ Partial Class Ventas_RepVentasUtilidad
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
If ObjVentas.GetReporteVentasUtilidad(Vendedores, DdlClientes.SelectedValue.ToEntero, Sucursales, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
Dim FechaInicio As String = txtFechaI.Text
Dim FechaFin As String = txtFechaF.Text

View File

@@ -210,6 +210,12 @@
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
<div class="col-md-1 truncate">
Marca:
</div>
<div class="col-md-2">
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
</div>
</div>
</div>

View File

@@ -174,7 +174,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, If(CveVenta = -1, Orden, CveVenta), DdlClientes.SelectedValue.ToEntero, Sucursales,
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
DtVentas = ObjVentas.DtResultados
GvDatos.DataSource = ObjVentas.DtResultados
GvDatos.DataBind()
@@ -286,6 +286,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Vendedor = If(DdlVendedor.GetSelectedText = "", "", $"&emsp;<b>Vendedor:</b> {DdlVendedor.GetSelectedText}")
Dim PS = If(DdlPS.SelectedValue = "-1", "", $"&emsp;<b>P.S.:</b> {DdlPS.SelectedText}")
Dim Clasificacion = If(DdlClasificacion.SelectedValue = "-1", "", $"&emsp;<b>Clasificacion:</b> {DdlClasificacion.SelectedItem.Text}")
Dim Marcas = If(DdlMarcas.SelectedValue = "-1", "", $"&emsp;<b>Marcas:</b> {DdlMarcas.SelectedItem.Text}")
Dim FechaIn As String = $"&emsp;<b>Fecha Inicio:</b> {txtFechaI.Text}"
Dim FechaFn As String = $"&emsp;<b>Fecha Fin:</b> {txtFechaF.Text}"
If txtFechaI.Text = "" Then FechaIn = ""
@@ -294,7 +295,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales,
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, ddlmarcas.selectedvalue.toentero) Then
Dim FechaInicio As String = txtFechaI.Text
Dim FechaFin As String = txtFechaF.Text
@@ -356,7 +357,7 @@ Partial Class Ventas_RepVentasUtilidadDetalle
Dim Sucursales As String = IIf(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM).ToString
Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString
If ObjVentas.GetReporteVentasUtilidadDetalle(Vendedores, CveVenta, DdlClientes.SelectedValue.ToEntero, Sucursales,
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
FechaI, FechaF, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero, DdlMarcas.SelectedValue.ToEntero) Then
Dim FechaInicio As String = txtFechaI.Text
Dim FechaFin As String = txtFechaF.Text

View File

@@ -90,6 +90,7 @@
<asp:ListItem Text="Vendedor" Value="6"></asp:ListItem>
<asp:ListItem Text="Producto/Servicio" Value="7"></asp:ListItem>
<asp:ListItem Text="Clasificación" Value="8"></asp:ListItem>
<asp:ListItem Text="Marca" Value="9"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1 truncate">
@@ -165,6 +166,12 @@
<div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
</div>
<div class="col-md-1 truncate">
Marca:
</div>
<div class="col-md-2">
<asp:Dropdownlist runat="server" ID="DdlMarcas" CssStyle="width: 100%;" CssClass="form-control input-small input-sm select2me" Width="100%" DataTextField="Marca" DataValueField="CveMarca" />
</div>
</div>
</div>
</div>
@@ -207,7 +214,7 @@
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Ventas Utilidad con los filtros especificados" ToolTip="Listado de Ventas"
CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound">
<Columns>
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}" />
<asp:HyperLinkField ItemStyle-HorizontalAlign="Left" Target="_blank" HeaderText="Grupo" DataTextField="GPO" DataNavigateUrlFields="FechaI,FechaF,CveSubProyecto,CveCliente,CveVendedor,Grupo,GPO,CvePS,CveClasificacion,CveMarca" DataNavigateUrlFormatString="RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}" />
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Ventas" DataField="Ventas" DataFormatString="{0:N2}" />
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Descuento" DataField="Descuento" DataFormatString="{0:N2}" />
<asp:BoundField ItemStyle-HorizontalAlign="Right" HeaderText="Bonificación" DataField="Bonificacion" DataFormatString="{0:N2}" />

View File

@@ -86,6 +86,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
DdlPS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
DdlMarcas.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarcas.DataBind()
DdlMarcas.Items.Insert(0, New ListItem("Todas", "-1"))
LblNeto.Text = "0"
LblPorNeto.Text = "0"
End Sub
@@ -110,7 +114,8 @@ Partial Class Ventas_RepVentasUtilidadPadre
Dim ObjVentas As New ClsVentas
If ObjVentas.GetReportePadreVentasUtilidad(If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM), DdlClientesWS.SelectedValue.ToEntero,
If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM), txtFechaI.Text.ToDate, txtFechaF.Text.ToDate,
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero) Then
UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, DdlPS.SelectedValue.ToEntero, DdlClasificacion.SelectedValue.ToEntero,
DdlMarcas.SelectedValue.ToEntero) Then
GvDatos.DataSource = ObjVentas.DtResultados
DtDatos = ObjVentas.DtResultados
End If
@@ -225,10 +230,10 @@ Partial Class Ventas_RepVentasUtilidadPadre
e.Row.CssClass = "Totales"
e.Row.Cells(0).Text = "Total"
Dim Css As String = "Texto"
Dim Liga As String = String.Format("/Ventas/RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}",
Dim Liga As String = String.Format("/Ventas/RepVentasUtilidad.aspx?FechaI={0}&FechaF={1}&CveSubProyecto={2}&CveCliente={3}&CveVendedor={4}&Gpo={5}&CveGpo={6}&CvePS={7}&CveClasificacion={8}&CveMarca={9}",
e.Row.DBCampo("FechaI"), e.Row.DBCampo("FechaF"), e.Row.DBCampo("CveSubProyecto"), e.Row.DBCampo("CveCliente"), e.Row.DBCampo("CveVendedor"),
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"))
e.Row.Cells(0).Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.Cells(0).Text & "</a>"
e.Row.DBCampo("Grupo"), e.Row.DBCampo("GPO"), e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveClasificacion"), e.Row.DBCampo("CveMarca"))
e.Row.Cells(0).Text = String.Format("<a class=""{0}"" href=""{1}"">{2}</a>", Css, Liga, e.Row.Cells(0).Text)
Else
e.Row.Cells(9).BackColor = Drawing.Color.LightGray
End If
@@ -261,6 +266,7 @@ Partial Class Ventas_RepVentasUtilidadPadre
If DdlClasificacion.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Clasificación</b>: {0}", DdlClasificacion.SelectedItem.Text)
If DdlClientesWS.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Cliente</b>: {0}", DdlClientesWS.SelectedText)
If DdlVendedor.GetSelectedText <> "" Then StrFiltro.AppendFormat("&emsp;<b>Vendedor</b>: {0}", DdlVendedor.GetSelectedText)
If DdlMarcas.SelectedValue <> "-1" Then StrFiltro.AppendFormat("&emsp;<b>Marcas</b>: {0}", DdlMarcas.SelectedItem.Text)
Dim params As List(Of ReportParameter) = New List(Of ReportParameter)()
Dim Imagen As System.IO.FileInfo = New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)

View File

@@ -6594,7 +6594,8 @@ Partial Class Ventas
End If
Dim cvesubproyecto As String = DdlSubProyectoDatos.SelectedValue
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
'cuando es empresa llantera (558) o cuando es empresa acumuladores
cvesubproyecto = "-1"
End If
@@ -19188,41 +19189,7 @@ Partial Class Ventas
Dim CveAlmacenVirtual As Integer = -1
Dim CveConceptoMovimientoVirtual As Integer = 37
Dim DtPSVirtual As DataTable = Nothing
'Dim DtTamanios As DataTable = Nothing
' Dim CveMovimientoReferencia As Integer = -1
''SI LA REMISION SE SURTIO CON USADOS UTILIZAR ESTE MOVIMIENTO
'If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
' Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND (CveTipoAlmacen = 1 AND CveConcepto IN (3,8)) AND CveVenta > 0")
' If RowMovimiento IsNot Nothing Then
' CveMovimientoReferencia = RowMovimiento("CveMovimiento").ToString().ToEntero()
' Dim tCveAlmacen = RowMovimiento("CveAlmacen").ToString().ToEntero()
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
' End If
'Else
' OcurrioError = True
'End If
''SI NO SE SURTIO LA REMSION CON USADOS, UTILIZAR EL MOVIMIENTO DE SALIDA DEL INGRESO
'If CveMovimientoReferencia <= 0 Then
' If ObjInventario.GetInv_Mov(ObjFactura.CveVenta, UsuarioActual.CveEmpresa) Then
' Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND ( (CveTipoAlmacen = 1 AND CveConcepto IN (3,8)) OR (CveTipoAlmacen = 10 AND CveConcepto = 40) ) AND CveVenta > 0")
' If RowMovimiento IsNot Nothing Then
' CveMovimientoReferencia = RowMovimiento("CveMovimiento").ToString().ToEntero()
' Dim tCveAlmacen = RowMovimiento("CveAlmacen").ToString().ToEntero()
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=tCveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
' Else
' OcurrioError = True
' End If
' Else
' OcurrioError = True
' End If
'End If
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacen).FiltroPrimeroValor("CveAlmacenVirtual").ToEntero()
'SI TIENE ALMACEN VIRTUAL ASIGNADO GENERA EL MOVIMIENTO VIRTUAL
@@ -19234,9 +19201,9 @@ Partial Class Ventas
OcurrioError = True
End If
If Not OcurrioError AndAlso DtPSVirtual.Rows.Count > 0 Then
If Not OcurrioError AndAlso DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/VV", CveMovimientoRelacionado:=CveMovimientoSalidaAlmacen)
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1, Modulo:="Vta/VV2", CveMovimientoRelacionado:=CveMovimientoSalidaAlmacen)
If CveMovimientoVirtual > 0 Then
For Each RowUsado As DataRow In DtPSVirtual.Rows
@@ -19306,6 +19273,9 @@ Partial Class Ventas
End If
End If
Else
Alert("No se tiene definido el almacen virtual.")
OcurrioError = True
End If
Catch ex As Exception