This commit is contained in:
2025-07-11 12:56:18 -07:00
22 changed files with 1827 additions and 1199 deletions

View File

@@ -351,13 +351,14 @@ Public Class ClsExportaciones
Return Retorno Return Retorno
End Function End Function
Public Function AddPartida(CvePS As Integer, CveUnidadMedida As Integer, Precio As Decimal, CveEmpresa As Integer, CveUsuario As Integer, CveExportacion As Integer, Cantidad As Decimal, Public Function AddPartida(CvePS As Integer, CveUnidadMedida As Integer, CveTipoEmpaque As Integer, Precio As Decimal, CveEmpresa As Integer, CveUsuario As Integer, CveExportacion As Integer, Cantidad As Decimal,
PesoUnitario As Decimal, CvePais As Integer) As Boolean PesoUnitario As Decimal, CvePais As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDetalleAdd") DataAdapter("PA_Exp_ExportacionesDetalleAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveTipoEmpaque", SqlDbType.Int).Value = CveTipoEmpaque
.Add("@Precio", SqlDbType.Decimal).Value = Precio .Add("@Precio", SqlDbType.Decimal).Value = Precio
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
@@ -378,7 +379,7 @@ Public Class ClsExportaciones
Return Retorno Return Retorno
End Function End Function
Public Function UpdatePartida(CveExportacionDetalle As Integer, CvePS As Integer, CveUnidadMedida As Integer, Precio As Decimal, CveUsuario As Integer, Cantidad As Decimal, Public Function UpdatePartida(CveExportacionDetalle As Integer, CvePS As Integer, CveUnidadMedida As Integer, CveTipoEmpaque As Integer, Precio As Decimal, CveUsuario As Integer, Cantidad As Decimal,
PesoUnitario As Decimal, CvePais As Integer) As Boolean PesoUnitario As Decimal, CvePais As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Exp_ExportacionesDetalleUpdate") DataAdapter("PA_Exp_ExportacionesDetalleUpdate")
@@ -386,6 +387,7 @@ Public Class ClsExportaciones
.Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle .Add("@CveExportacionDetalle", SqlDbType.Int).Value = CveExportacionDetalle
.Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
.Add("@CveTipoEmpaque", SqlDbType.Int).Value = CveTipoEmpaque
.Add("@Precio", SqlDbType.Decimal).Value = Precio .Add("@Precio", SqlDbType.Decimal).Value = Precio
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad .Add("@Cantidad", SqlDbType.Decimal).Value = Cantidad

View File

@@ -7641,6 +7641,28 @@ Public Class ClsPaginas
Return Nothing Return Nothing
End If End If
'SOLO FORMATO DE STIMULSOFT Y COMPLEMENTO DE SERVICIOS DE CONSTRUCCION
If UsuarioActual.Empresa.Funcionalidad(707) = "1" AndAlso Vta.CveComplementoTimbrado = 9 AndAlso Not String.IsNullOrEmpty(Vta.ComplementoSAT) Then
Dim settings As New JsonSerializerSettings
settings.NullValueHandling = NullValueHandling.Ignore
Dim pc As Modelos.MParcialesConstruccion = JsonConvert.DeserializeObject(Of Modelos.MParcialesConstruccion)(Vta.ComplementoSAT, settings)
If pc IsNot Nothing Then
params.Add(New ReportParameter("SC_NumPerLicoAut", pc.NumPerLicoAut))
params.Add(New ReportParameter("SC_Calle", pc.Calle))
params.Add(New ReportParameter("SC_NoExterior", pc.NoExterior))
params.Add(New ReportParameter("SC_NoInterior", pc.NoInterior))
params.Add(New ReportParameter("SC_Colonia", pc.Colonia))
params.Add(New ReportParameter("SC_Localidad", pc.Localidad))
params.Add(New ReportParameter("SC_Referencia", pc.Referencia))
params.Add(New ReportParameter("SC_Municipio", pc.Municipio))
Dim Estado = GlobalDTGralEstados("MEX").FiltroPrimeroValor("NombreEstado", $"CveEstado = {pc.CveEstado}")
params.Add(New ReportParameter("SC_Estado", Estado))
params.Add(New ReportParameter("SC_CodigoEstado", pc.Estado))
params.Add(New ReportParameter("SC_CodigoPostal", pc.CodigoPostal))
End If
End If
If NombreArchivo = "FacturaUSA" Then If NombreArchivo = "FacturaUSA" Then
Dim DtBaseTotales As DataTable = Vta.DtDeduccion.Clone() Dim DtBaseTotales As DataTable = Vta.DtDeduccion.Clone()
@@ -7868,7 +7890,7 @@ Public Class ClsPaginas
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte) RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
End If End If
Dim urlHost As String = "http://sig.adssistemas.mx:7998/" Dim urlHost As String = "http: //sig.adssistemas.mx:7998/"
'Dim urlHost As String = "http://localhost:2202/" 'Dim urlHost As String = "http://localhost:2202/"
If EsProduccion Then If EsProduccion Then
urlHost = "http://192.200.113.178:6599/" urlHost = "http://192.200.113.178:6599/"

View File

@@ -325,6 +325,26 @@ Public Class ClsProductosServicios
Return Retorno Return Retorno
End Function End Function
Public Function GetPS_APIMarcasStock(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_APIMarcasStockGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar el stock.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetPSSimplificado(CveEmpresa As Integer) As Boolean Public Function GetPSSimplificado(CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -1570,6 +1570,25 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetVentaDetallePreciosLista(CveVenta As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasDetallePreciosListaGet")
With SqlAdapter.SelectCommand.Parameters
.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 obtener los precios de lista en los productos.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddVentaDetalle(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, PU As Decimal, IVA As Decimal, Public Function AddVentaDetalle(CveVenta As Integer, CvePS As Integer, Cantidad As Decimal, CveUnidadMedida As Integer, PU As Decimal, IVA As Decimal,
Total As Decimal, Observaciones As String, Descuento As Decimal, TipoDescuento As Integer, CveSubProyecto As Integer, Total As Decimal, Observaciones As String, Descuento As Decimal, TipoDescuento As Integer, CveSubProyecto As Integer,
CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1, CvePresupuestoIngreso As Integer, Optional TiempoEntrega As String = "", Optional CveVentaDetallePadre As Integer = -1,

219
Ashx/E189.ashx Normal file
View File

@@ -0,0 +1,219 @@
<%@ WebHandler Language="VB" Class="E189" %>
Option Strict On
Option Explicit On
Imports System.Data
Imports System.IO
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Imports Extensiones
Public Class E189 : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
Private ReadOnly Property CveEmpresa As Integer = 189
Private ReadOnly Property CveUsuario As Integer = 100
Private ReadOnly Property NombreCadena As String = "Conexion"
Public ReadOnly Property EsProduccion As Boolean
Get
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
Return False
Else
Return (System.Configuration.ConfigurationManager.AppSettings("EsProduccion").ToString() = "1")
End If
End Get
End Property
#Region "V A L I D A - D A T O S"
Private Function ValidaUsuarioSistema(CveUsuario As Integer, CveEmpresa As Integer) As Usuario
Dim UsuarioActual As Usuario = Nothing
Dim NombreCadena As String = ClsPaginas.GlobalNombreCadenaConexion(CveEmpresa)
Dim ObjUsuarios As New ClsSisUsuarioAutenticacion(NombreCadena:=NombreCadena)
UsuarioActual = ObjUsuarios.GetUsuarioDetalle(100, CveEmpresa)
If UsuarioActual IsNot Nothing Then
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual
'CreaObjetoEmpresa(UsuarioActual)
End If
ObjUsuarios.Dispose()
Return UsuarioActual
End Function
'Private Sub CreaObjetoEmpresa(ByRef UsuarioActual As Usuario)
' Dim ObjEmpresa As New ClsSisEmpresas()
' If ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1") Then
' If ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa) Then
' Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
' Dim EmpresasFuncionalidades As New HybridDictionary
' For Each Row As Data.DataRow In dttmp.Rows
' EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
' Next
' ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
' End If
' UsuarioActual.Empresa = ObjEmpresa.Empresa
' End If
' ObjEmpresa.Dispose()
'End Sub
#End Region
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim retorno As String = ""
Dim MsgLog As New StringBuilder
MsgLog.AppendLine("Inicia Petición.")
Try
Dim Metodo As String = If(context.Request("Metodo") = Nothing, "", context.Request("Metodo").ToString())
MsgLog.AppendLine(Metodo)
If Metodo = "Stock" Then
context.Response.ContentType = "application/json"
retorno = ConsultaDatos(context)
End If
context.Response.Write(retorno)
Catch ex As Exception
context.Response.ContentType = "text/html"
MsgLog.AppendLine("Error de procesamiento:" & ex.Message)
Dim respuesta As New AuthMessage
respuesta.ErrorMessage = New ResponseMsgError() With {.message = "La solicitud no se pudo procesar."}
respuesta.IsSuccess = False
respuesta.StatusCode = 200
retorno = JsonConvert.SerializeObject(respuesta.ErrorMessage)
context.Response.Write(retorno)
End Try
MsgLog.ToString.GuardaLogAD("LogE119")
End Sub
Private Function ConsultaDatos(ByVal context As HttpContext) As String
Dim Usuario As Usuario = ValidaUsuarioSistema(100, CveEmpresa)
Dim Respuesta As New ResponseMsg
Dim RespuestaError As New ResponseMsgError
Dim TieneError As Boolean = False
Dim productos As JArray = Nothing
Using ObjInventario As New ClsProductosServicios()
If ObjInventario.GetPS_APIMarcasStock(CveEmpresa) AndAlso ObjInventario.DtResultados IsNot Nothing Then
productos = JArray.Parse(ObjInventario.DtResultados.DataTableToJSONIPP())
Else
RespuestaError.message = "no se pudo obtener los datos"
TieneError = True
End If
End Using
If TieneError Then
context.Response.StatusCode = 200
Return JsonConvert.SerializeObject(RespuestaError)
Else
context.Response.StatusCode = 200
Try
Return New JObject(New JProperty("productos", productos)).ToString()
Catch ex As Exception
RespuestaError.message = "Ocurrió un error al generar la petición"
Return JsonConvert.SerializeObject(RespuestaError)
End Try
End If
End Function
Private Class ResponseMsg
Sub New()
status = "success"
End Sub
Public Property status As String
Public Property data As Object
Public Property message As String
End Class
Private Class ResponseMsgError
Sub New()
status = "error"
End Sub
Public Property status As String
Public Property message As String
End Class
Private Class AuthMessage
Public Property IsSuccess As Boolean
Public Property ErrorMessage As ResponseMsgError
Public Property StatusCode As Integer
End Class
'Private Function ActualizarExistenciasJson(Todos As Boolean) As String
' Dim payload = New JObject()
' Dim CountPeticiones As Integer = 0, CountPeticionesExitosas As Integer = 0
' Dim DtPS As DataTable = Nothing
' Using ObjPS As New ClsProductosServicios
' If ObjPS.GetExistenciasEmpresa("-1", CveEmpresa) Then
' DtPS = ObjPS.DtResultados.Copy()
' End If
' End Using
' If DtPS IsNot Nothing Then
' payload.Add(New JProperty("stock", GenerarPayloadExistencias(DtPS)))
' End If
' Return payload.ToString()
'End Function
Private Function Parametros(Cadena As String) As Hashtable
Dim P1() As String = Cadena.Split("&"c)
Dim Tmp As String
Dim P2() As String
Dim URLParametros As New Hashtable
For Each Tmp In P1
P2 = Tmp.Replace("%26%", "&").Split("="c)
URLParametros.Add(P2(0).ToString.ToUpper, P2(1))
Next
Return URLParametros
End Function
Private Shared Function IsValidJson(ByVal strInput As String) As Boolean
If String.IsNullOrWhiteSpace(strInput) Then
Return False
End If
strInput = strInput.Trim()
If (strInput.StartsWith("{") AndAlso strInput.EndsWith("}")) OrElse (strInput.StartsWith("[") AndAlso strInput.EndsWith("]")) Then
Try
Dim obj As JToken = JToken.Parse(strInput)
Return True
Catch jex As JsonReaderException
Console.WriteLine(jex.Message)
Return False
Catch ex As Exception
Console.WriteLine(ex.ToString())
Return False
End Try
Else
Return False
End If
End Function
End Class

View File

@@ -138,20 +138,21 @@ Partial Class Bancos_CuentasBancariasDetalle
Using ObjContabilidad As New ClsContabilidad Using ObjContabilidad As New ClsContabilidad
'UsuarioActual.Empresa.Funcionalidad(208).ToEntero 'UsuarioActual.Empresa.Funcionalidad(208).ToEntero
If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then If ObjContabilidad.GetCuentas(-1, "-1", 1, UsuarioActual.CveEmpresa) Then
DDlCuentaContable.DataSource = ObjContabilidad.DtResultados dt = ObjContabilidad.DtResultados.Copy()
DDlCuentaContable.DataSource = dt
DDlCuentaContable.DataBind() DDlCuentaContable.DataBind()
DDlCuentaContable.Items.Insert(0, New ListItem("Selecione", "-1")) DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
DDlCuentaContable.DataTextField = "CtaCodigo" 'DDlCuentaContable.DataTextField = "CtaCodigo"
DDlCuentaContable.DataValueField = "CveCuenta" 'DDlCuentaContable.DataValueField = "CveCuenta"
End If End If
End Using End Using
DDlCuentaContable.DataSource = dt
DDlCuentaContable.DataBind()
DDlCuentaContable.Items.Insert(0, New ListItem("-", "-1"))
DdlCuentaContableComplementaria.DataSource = dt DdlCuentaContableComplementaria.DataSource = dt
DdlCuentaContableComplementaria.DataBind() DdlCuentaContableComplementaria.DataBind()
DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1")) DdlCuentaContableComplementaria.Items.Insert(0, New ListItem("-", "-1"))
If dt IsNot Nothing Then dt.Dispose() If dt IsNot Nothing Then dt.Dispose()
trCuentaContable.Visible = True trCuentaContable.Visible = True
trCuentaContableComplementaria.Visible = True trCuentaContableComplementaria.Visible = True
@@ -235,7 +236,7 @@ Partial Class Bancos_CuentasBancariasDetalle
TxtNumeroSucursal.Text = ObjCuentasBancariasDetalle.NumeroSucursal TxtNumeroSucursal.Text = ObjCuentasBancariasDetalle.NumeroSucursal
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then If UsuarioActual.Empresa.TipoContabilidad = 1 Then
DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString) DDlCuentaContable.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaConta.ToString)
DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString) DdlCuentaContableComplementaria.SelectedValueExist(ObjCuentasBancariasDetalle.CveCuentaContaComplementaria.ToString)
Else Else

View File

@@ -1518,7 +1518,7 @@ Partial Class Compras_eFacturas
If dt IsNot Nothing Then If dt IsNot Nothing Then
Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}/Logo.png") Dim Imagen As New System.IO.FileInfo($"{UsuarioActual.Empresa.Ruta}Logo.png")
Dim params As New List(Of ReportParameter) Dim params As New List(Of ReportParameter)
@@ -1529,7 +1529,7 @@ Partial Class Compras_eFacturas
params.Add(New ReportParameter("FechaImpresion", Fecha.ToDateTime.ToShortDateString)) params.Add(New ReportParameter("FechaImpresion", Fecha.ToDateTime.ToShortDateString))
If Imagen.Exists Then If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", $"file//:{Imagen.FullName}")) params.Add(New ReportParameter("LogoPath", $"file://{Imagen.FullName}"))
Else Else
params.Add(New ReportParameter("LogoPath", "")) params.Add(New ReportParameter("LogoPath", ""))
End If End If

File diff suppressed because it is too large Load Diff

View File

@@ -68,16 +68,28 @@
<asp:DropDownList ID="DdlClavePedimento" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPedimentoDescripcion" DataValueField="CvePedimento"></asp:DropDownList> <asp:DropDownList ID="DdlClavePedimento" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATPedimentoDescripcion" DataValueField="CvePedimento"></asp:DropDownList>
<label for="<%= DdlClavePedimento.ClientID.ToString()%>">Clave pedimento:</label> <label for="<%= DdlClavePedimento.ClientID.ToString()%>">Clave pedimento:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright" style="width: 150px;"> <div class="form-group form-md-line-input input-iconright" style="width: 170px;">
<asp:TextBox ID="TxtNumPed" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtNumPed" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<ajaxToolkit:MaskedEditExtender ID="meeTxtPedimento" runat="server" <ajaxToolkit:MaskedEditExtender
ClearMaskOnLostFocus="false" ID="meeTxtPedimento"
runat="server"
TargetControlID="TxtNumPed" TargetControlID="TxtNumPed"
Mask="99--99--9999--9999999" Mask="99--99--9999--9999999"
MaskType="Number" MaskType="None"
ClearMaskOnLostFocus="false"
InputDirection="LeftToRight" InputDirection="LeftToRight"
AcceptNegative="None" AcceptNegative="None"
ErrorTooltipEnabled="True" /> ErrorTooltipEnabled="True" />
<asp:CustomValidator
ID="cvNumPed"
runat="server"
ControlToValidate="TxtNumPed"
ErrorMessage="El número de pedimento está incompleto o tiene un formato incorrecto."
ForeColor="Red"
Display="Dynamic"
ValidationGroup="GrpGuardar"
ClientValidationFunction="validaPedimento" />
<label for="<%= TxtNumPed.ClientID.ToString()%>" style="margin: 0; white-space: nowrap;">Número de Pedimento:</label> <label for="<%= TxtNumPed.ClientID.ToString()%>" style="margin: 0; white-space: nowrap;">Número de Pedimento:</label>
</div> </div>
<table> <table>
@@ -132,6 +144,14 @@
<asp:TextBox ID="TxtTipoCambio" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox> <asp:TextBox ID="TxtTipoCambio" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="FTETipoCambio" runat="server" TargetControlID="TxtTipoCambio" FilterType="Custom, Numbers" ValidChars="." /> <ajax:FilteredTextBoxExtender ID="FTETipoCambio" runat="server" TargetControlID="TxtTipoCambio" FilterType="Custom, Numbers" ValidChars="." />
<label for="<%= TxtTipoCambio.ClientID.ToString()%>">Tipo de Cambio:</label> <label for="<%= TxtTipoCambio.ClientID.ToString()%>">Tipo de Cambio:</label>
<asp:RequiredFieldValidator
ID="RFVTipoCambio"
runat="server"
ControlToValidate="TxtTipoCambio"
ErrorMessage="El tipo de cambio es obligatorio."
Display="Dynamic"
ForeColor="Red"
ValidationGroup="GrpGuardar" />
</div> </div>
<div class="form-group form-md-line-input input-iconright" style="width: 150px;"> <div class="form-group form-md-line-input input-iconright" style="width: 150px;">
<asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm"></asp:DropDownList> <asp:DropDownList ID="DdlIncoterm" CssClass="form-control select2me" AppendDataBoundItems="true" Style="width: 100%;" runat="server" DataTextField="ClaveSATIncotermDescripcion" DataValueField="CveIncoterm"></asp:DropDownList>
@@ -654,6 +674,11 @@
<asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label> <asp:Label ID="lblUM" runat="server" Text='<%# Eval("UnidadMedida")%>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Tipo de Empaque" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblTE" runat="server" Text='<%# Eval("TipoEmpaque")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Right"> <asp:TemplateField HeaderText="Valor Total USD" ItemStyle-HorizontalAlign="Right">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:N2}")%>'> </asp:Label> <asp:Label ID="lblPrecio" runat="server" Text='<%# Eval("Precio", "{0:N2}")%>'> </asp:Label>
@@ -763,7 +788,7 @@
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-4">
<asp:UpdatePanel ID="UPPUM" runat="server" UpdateMode="Conditional" RenderMode="Inline"> <asp:UpdatePanel ID="UPPUM" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate> <ContentTemplate>
<div class="form-group form-md-line-input input-iconright"> <div class="form-group form-md-line-input input-iconright">
@@ -773,6 +798,16 @@
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
<div class="col-md-4">
<asp:UpdatePanel ID="UPPTE" runat="server" UpdateMode="Conditional" RenderMode="Inline">
<ContentTemplate>
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlTipoEmpaque" runat="server" CssClass=" form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" Width="100"></asp:DropDownList></td>
<label for="<%= DdlTipoEmpaque.ClientID.ToString()%>">Tipo de Empaque:</label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div> </div>
<br /> <br />
<div class="row"> <div class="row">
@@ -842,5 +877,12 @@
</div> </div>
</asp:Content> </asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
<script type="text/javascript">
function validaPedimento(sender, args) {
// Regex: 2 dígitos, --, 2 dígitos, --, 4 dígitos, --, 7 dígitos
var regex = /^\d{2}--\d{2}--\d{4}--\d{7}$/;
args.IsValid = regex.test(args.Value);
}
</script>
</asp:Content> </asp:Content>

View File

@@ -489,13 +489,14 @@ public partial class Export_ExpDetalle : ClsPaginas
{ {
int CvePS = row["CvePS"].ToEntero(); int CvePS = row["CvePS"].ToEntero();
int CveUnidadMedida = row["CveUnidadMedida"].ToEntero(); int CveUnidadMedida = row["CveUnidadMedida"].ToEntero();
int CveTipoEmpaque = row["CveTipoEmpaque"].ToEntero();
int CvePais = row["CvePais"].ToEntero(); int CvePais = row["CvePais"].ToEntero();
decimal Precio = ModExtensiones.ToDecimal(row["Precio"].ToString()); decimal Precio = ModExtensiones.ToDecimal(row["Precio"].ToString());
decimal Cantidad = ModExtensiones.ToDecimal(row["Cantidad"].ToString()); decimal Cantidad = ModExtensiones.ToDecimal(row["Cantidad"].ToString());
decimal PesoUnitario = ModExtensiones.ToDecimal(row["PesoUnitario"].ToString()); decimal PesoUnitario = ModExtensiones.ToDecimal(row["PesoUnitario"].ToString());
ClsExportaciones Partidas = new ClsExportaciones(); ClsExportaciones Partidas = new ClsExportaciones();
Partidas.AddPartida(CvePS, CveUnidadMedida, Precio, CveEmpresa, CveUsuario, ExportacionGuardada, Cantidad, PesoUnitario, CvePais); Partidas.AddPartida(CvePS, CveUnidadMedida, CveTipoEmpaque, Precio, CveEmpresa, CveUsuario, ExportacionGuardada, Cantidad, PesoUnitario, CvePais);
Partidas.Dispose(); Partidas.Dispose();
} }
} }
@@ -598,7 +599,7 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
Partidas.Dispose(); Partidas.Dispose();
} }
protected void CargarUnidadMedida(string CvePS = "-1", string CveUnidadMedida = "-1") protected void CargarUnidadMedida(string CvePS = "-1", string CveUnidadMedida = "-1", string CveTipoEmpaque = "-1")
{ {
int CveEmpresa = UsuarioActual.CveEmpresa; int CveEmpresa = UsuarioActual.CveEmpresa;
@@ -618,6 +619,23 @@ public partial class Export_ExpDetalle : ClsPaginas
DdlUM.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlUM.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlUM.SelectedValue = "-1"; DdlUM.SelectedValue = "-1";
} }
DdlTipoEmpaque.Items.Clear();
if (CvePS != "" && CvePS != "-1")
{
if (UsuarioActual.Empresa.UsaInventarios)
DdlTipoEmpaque.DataSource = get_GlobalDTProductosServiciosEquivalencias(CvePS.ToEntero(), -1, CveEmpresa);
else
DdlTipoEmpaque.DataSource = get_GlobalDTUnidadesMedida(CveEmpresa);
DdlTipoEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlTipoEmpaque.DataBind();
DdlTipoEmpaque.SelectedValueExist(CveTipoEmpaque);
}
else
{
DdlTipoEmpaque.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlTipoEmpaque.SelectedValue = "-1";
}
} }
protected void AbrirModalPartida(int GVPartidasRowIndex = -1) protected void AbrirModalPartida(int GVPartidasRowIndex = -1)
{ {
@@ -631,6 +649,7 @@ public partial class Export_ExpDetalle : ClsPaginas
DdlPS.DataBind(); DdlPS.DataBind();
DdlUM.Items.Clear(); DdlUM.Items.Clear();
DdlTipoEmpaque.Items.Clear();
DdlPaisOrigen.Items.Clear(); DdlPaisOrigen.Items.Clear();
DdlPaisOrigen.DataSource = GlobalDTGralPaises; DdlPaisOrigen.DataSource = GlobalDTGralPaises;
@@ -657,7 +676,7 @@ public partial class Export_ExpDetalle : ClsPaginas
TxtCantidad.Text = DTPartidas.FiltroPrimeroValor("Cantidad"); TxtCantidad.Text = DTPartidas.FiltroPrimeroValor("Cantidad");
TxtPesoUnitario.Text = DTPartidas.FiltroPrimeroValor("PesoUnitario"); TxtPesoUnitario.Text = DTPartidas.FiltroPrimeroValor("PesoUnitario");
CargarUnidadMedida(CvePS, DTPartidas.FiltroPrimeroValor("CveUnidadMedida")); CargarUnidadMedida(CvePS, DTPartidas.FiltroPrimeroValor("CveUnidadMedida"), DTPartidas.FiltroPrimeroValor("CveTipoEmpaque"));
} }
} }
Partidas.Dispose(); Partidas.Dispose();
@@ -681,7 +700,7 @@ public partial class Export_ExpDetalle : ClsPaginas
TxtCantidad.Text = DTTemp.Rows[GVPartidasRowIndex]["Cantidad"].ToString(); TxtCantidad.Text = DTTemp.Rows[GVPartidasRowIndex]["Cantidad"].ToString();
TxtPesoUnitario.Text = DTTemp.Rows[GVPartidasRowIndex]["PesoUnitario"].ToString(); TxtPesoUnitario.Text = DTTemp.Rows[GVPartidasRowIndex]["PesoUnitario"].ToString();
CargarUnidadMedida(CvePS, DTTemp.Rows[GVPartidasRowIndex]["CveUnidadMedida"].ToString()); CargarUnidadMedida(CvePS, DTTemp.Rows[GVPartidasRowIndex]["CveUnidadMedida"].ToString(), DTTemp.Rows[GVPartidasRowIndex]["CveTipoEmpaque"].ToString());
} }
} }
else else
@@ -807,6 +826,8 @@ public partial class Export_ExpDetalle : ClsPaginas
string PSCodigo = DdlPS.SelectedItem.Text; string PSCodigo = DdlPS.SelectedItem.Text;
int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero(); int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero();
string UnidadMedida = (CveUnidadMedida == -1) ? "" : DdlUM.SelectedItem.Text; string UnidadMedida = (CveUnidadMedida == -1) ? "" : DdlUM.SelectedItem.Text;
int CveTipoEmpaque = (DdlTipoEmpaque.Text == "") ? -1 : DdlTipoEmpaque.Text.ToEntero();
string TipoEmpaque = (CveTipoEmpaque == -1) ? "" : DdlTipoEmpaque.SelectedItem.Text;
int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero(); int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero();
string ClaveSATPais = (CvePais == -1) ? "" : DdlPaisOrigen.SelectedItem.Text; string ClaveSATPais = (CvePais == -1) ? "" : DdlPaisOrigen.SelectedItem.Text;
decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text); decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text);
@@ -854,6 +875,8 @@ public partial class Export_ExpDetalle : ClsPaginas
PartidaRow["PSCodigo"] = PSCodigo; PartidaRow["PSCodigo"] = PSCodigo;
PartidaRow["CveUnidadMedida"] = CveUnidadMedida; PartidaRow["CveUnidadMedida"] = CveUnidadMedida;
PartidaRow["UnidadMedida"] = UnidadMedida; PartidaRow["UnidadMedida"] = UnidadMedida;
PartidaRow["CveTipoEmpaque"] = CveTipoEmpaque;
PartidaRow["TipoEmpaque"] = TipoEmpaque;
PartidaRow["CvePais"] = CvePais; PartidaRow["CvePais"] = CvePais;
PartidaRow["ClaveSATPais"] = ClaveSATPais; PartidaRow["ClaveSATPais"] = ClaveSATPais;
PartidaRow["Precio"] = Precio; PartidaRow["Precio"] = Precio;
@@ -878,6 +901,8 @@ public partial class Export_ExpDetalle : ClsPaginas
PartidaRow["PSCodigo"] = PSCodigo; PartidaRow["PSCodigo"] = PSCodigo;
PartidaRow["CveUnidadMedida"] = CveUnidadMedida; PartidaRow["CveUnidadMedida"] = CveUnidadMedida;
PartidaRow["UnidadMedida"] = UnidadMedida; PartidaRow["UnidadMedida"] = UnidadMedida;
PartidaRow["CveTipoEmpaque"] = CveTipoEmpaque;
PartidaRow["TipoEmpaque"] = TipoEmpaque;
PartidaRow["CvePais"] = CvePais; PartidaRow["CvePais"] = CvePais;
PartidaRow["ClaveSATPais"] = ClaveSATPais; PartidaRow["ClaveSATPais"] = ClaveSATPais;
PartidaRow["Precio"] = Precio; PartidaRow["Precio"] = Precio;
@@ -899,6 +924,7 @@ public partial class Export_ExpDetalle : ClsPaginas
{ {
int CvePS = DdlPS.Text.ToEntero(); int CvePS = DdlPS.Text.ToEntero();
int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero(); int CveUnidadMedida = (DdlUM.Text == "") ? -1 : DdlUM.Text.ToEntero();
int CveTipoEmpaque = (DdlTipoEmpaque.Text == "") ? -1 : DdlTipoEmpaque.Text.ToEntero();
int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero(); int CvePais = (DdlPaisOrigen.Text == "") ? -1 : DdlPaisOrigen.Text.ToEntero();
decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text); decimal Precio = ModExtensiones.ToDecimal(TxtPrecio.Text);
decimal ValorTotalMXP = Precio * ModExtensiones.ToDecimal(TxtTipoCambio.Text); decimal ValorTotalMXP = Precio * ModExtensiones.ToDecimal(TxtTipoCambio.Text);
@@ -921,6 +947,8 @@ public partial class Export_ExpDetalle : ClsPaginas
DTTemp.Columns.Add("PSCodigo", typeof(string)); DTTemp.Columns.Add("PSCodigo", typeof(string));
DTTemp.Columns.Add("CveUnidadMedida", typeof(int)); DTTemp.Columns.Add("CveUnidadMedida", typeof(int));
DTTemp.Columns.Add("UnidadMedida", typeof(string)); DTTemp.Columns.Add("UnidadMedida", typeof(string));
DTTemp.Columns.Add("CveTipoEmpaque", typeof(int));
DTTemp.Columns.Add("TipoEmpaque", typeof(string));
DTTemp.Columns.Add("CvePais", typeof(int)); DTTemp.Columns.Add("CvePais", typeof(int));
DTTemp.Columns.Add("ClaveSATPais", typeof(string)); DTTemp.Columns.Add("ClaveSATPais", typeof(string));
DTTemp.Columns.Add("Precio", typeof(decimal)); DTTemp.Columns.Add("Precio", typeof(decimal));
@@ -954,7 +982,7 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
else else
{ {
bool Continuar = Partidas.AddPartida(CvePS, CveUnidadMedida, Precio, UsuarioActual.CveEmpresa, CveUsuario, CveExportacion, Cantidad, PesoUnitario, CvePais); bool Continuar = Partidas.AddPartida(CvePS, CveUnidadMedida, CveTipoEmpaque, Precio, UsuarioActual.CveEmpresa, CveUsuario, CveExportacion, Cantidad, PesoUnitario, CvePais);
Partidas.Dispose(); Partidas.Dispose();
if (Continuar) if (Continuar)
{ {
@@ -965,7 +993,7 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
else else
{ {
bool Continuar = Partidas.UpdatePartida(CveExportacionDetalle, CvePS, CveUnidadMedida, Precio, CveUsuario, Cantidad, PesoUnitario, CvePais); bool Continuar = Partidas.UpdatePartida(CveExportacionDetalle, CvePS, CveUnidadMedida, CveTipoEmpaque, Precio, CveUsuario, Cantidad, PesoUnitario, CvePais);
Partidas.Dispose(); Partidas.Dispose();
if (Continuar) if (Continuar)
{ {
@@ -980,6 +1008,7 @@ public partial class Export_ExpDetalle : ClsPaginas
else else
{ {
DdlUM.Items.Clear(); DdlUM.Items.Clear();
DdlTipoEmpaque.Items.Clear();
DdlPS.SelectedValue = "-1"; DdlPS.SelectedValue = "-1";
DdlPaisOrigen.SelectedValue = "-1"; DdlPaisOrigen.SelectedValue = "-1";
TxtPrecio.Text = ""; TxtPrecio.Text = "";
@@ -991,7 +1020,7 @@ public partial class Export_ExpDetalle : ClsPaginas
} }
protected void DdlPS_SelectedIndexChanged(object sender, EventArgs e) protected void DdlPS_SelectedIndexChanged(object sender, EventArgs e)
{ {
CargarUnidadMedida(DdlPS.Text, DdlUM.Text); CargarUnidadMedida(DdlPS.Text, DdlUM.Text, DdlTipoEmpaque.Text);
UpPSS.Update(); UpPSS.Update();
} }
@@ -1010,7 +1039,9 @@ public partial class Export_ExpDetalle : ClsPaginas
DataRow RowExp = DTExportaciones.Rows[0]; DataRow RowExp = DTExportaciones.Rows[0];
string ClienteExportador = DTExportaciones.FiltroPrimeroValor("ClienteExportador"); string ClienteExportador = DTExportaciones.FiltroPrimeroValor("ClienteExportador");
string DirExportador = DTExportaciones.FiltroPrimeroValor("DirExportador"); string DirExportador = DTExportaciones.FiltroPrimeroValor("DirExportador");
string RFCExp = DTExportaciones.FiltroPrimeroValor("RFCExp");
string ClienteImportador = DTExportaciones.FiltroPrimeroValor("ClienteImportador"); string ClienteImportador = DTExportaciones.FiltroPrimeroValor("ClienteImportador");
string DirImportador = DTExportaciones.FiltroPrimeroValor("DirImportador");
string RFCImp = DTExportaciones.FiltroPrimeroValor("RFCImp"); string RFCImp = DTExportaciones.FiltroPrimeroValor("RFCImp");
string IMMEXimp = DTExportaciones.FiltroPrimeroValor("IMMEXimp"); string IMMEXimp = DTExportaciones.FiltroPrimeroValor("IMMEXimp");
string NumFactura = DTExportaciones.FiltroPrimeroValor("SerieFolio"); string NumFactura = DTExportaciones.FiltroPrimeroValor("SerieFolio");
@@ -1056,6 +1087,7 @@ public partial class Export_ExpDetalle : ClsPaginas
decimal TotalInc = 0.00m; decimal TotalInc = 0.00m;
decimal TotalDec = 0.00m; decimal TotalDec = 0.00m;
string DescContenedor = DTExportaciones.FiltroPrimeroValor("DescripcionContenedor");
string ContenedorPlaca = DTExportaciones.FiltroPrimeroValor("ContenedorPlaca"); string ContenedorPlaca = DTExportaciones.FiltroPrimeroValor("ContenedorPlaca");
string Proveedor = DTExportaciones.FiltroPrimeroValor("Proveedor"); string Proveedor = DTExportaciones.FiltroPrimeroValor("Proveedor");
string SCAC = DTExportaciones.FiltroPrimeroValor("SCAC"); string SCAC = DTExportaciones.FiltroPrimeroValor("SCAC");
@@ -1073,7 +1105,9 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("CveExportacion", CveExportacion.ToString())); para.Add(new ReportParameter("CveExportacion", CveExportacion.ToString()));
para.Add(new ReportParameter("ClienteExportador", ClienteExportador)); para.Add(new ReportParameter("ClienteExportador", ClienteExportador));
para.Add(new ReportParameter("DirExportador", DirExportador)); para.Add(new ReportParameter("DirExportador", DirExportador));
para.Add(new ReportParameter("RFCExp", RFCExp));
para.Add(new ReportParameter("ClienteImportador", ClienteImportador)); para.Add(new ReportParameter("ClienteImportador", ClienteImportador));
para.Add(new ReportParameter("DirImportador", DirImportador));
para.Add(new ReportParameter("RFCImp", RFCImp)); para.Add(new ReportParameter("RFCImp", RFCImp));
para.Add(new ReportParameter("IMMEXimp", IMMEXimp)); para.Add(new ReportParameter("IMMEXimp", IMMEXimp));
para.Add(new ReportParameter("NumFactura", NumFactura)); para.Add(new ReportParameter("NumFactura", NumFactura));
@@ -1125,6 +1159,7 @@ public partial class Export_ExpDetalle : ClsPaginas
para.Add(new ReportParameter("DecOtros", DecOtros.ToString("#,###.####"))); para.Add(new ReportParameter("DecOtros", DecOtros.ToString("#,###.####")));
para.Add(new ReportParameter("TotalDec", TotalDec.ToString("#,###.####"))); para.Add(new ReportParameter("TotalDec", TotalDec.ToString("#,###.####")));
para.Add(new ReportParameter("DescContenedor", DescContenedor));
para.Add(new ReportParameter("ContenedorPlaca", ContenedorPlaca)); para.Add(new ReportParameter("ContenedorPlaca", ContenedorPlaca));
para.Add(new ReportParameter("Proveedor", Proveedor)); para.Add(new ReportParameter("Proveedor", Proveedor));
para.Add(new ReportParameter("SCAC", SCAC)); para.Add(new ReportParameter("SCAC", SCAC));
@@ -1163,10 +1198,32 @@ public partial class Export_ExpDetalle : ClsPaginas
row["ValorUnitarioMN"] = Convert.ToDecimal(row["ValorTotalMXP"]) / cantidad; row["ValorUnitarioMN"] = Convert.ToDecimal(row["ValorTotalMXP"]) / cantidad;
} }
} }
ReportDataSource RDSPartidas = new ReportDataSource(); ReportDataSource RDSPartidas = new ReportDataSource();
RDSPartidas.Name = "DsPartidas"; RDSPartidas.Name = "DsPartidas";
RDSPartidas.Value = DTPartidas; RDSPartidas.Value = DTPartidas;
lrds.Add(RDSPartidas); lrds.Add(RDSPartidas);
var EmpaquesAgrupado = from row in DTPartidas.AsEnumerable()
where !string.IsNullOrWhiteSpace(row.Field<string>("TipoEmpaque"))
group row by row.Field<string>("TipoEmpaque") into g
select new
{
TipoEmpaque = g.Key,
Cantidad = g.Sum(r => r.Field<decimal>("Cantidad"))
};
DataTable DTBultos = new DataTable();
DTBultos.Columns.Add("TipoEmpaque", typeof(string));
DTBultos.Columns.Add("Cantidad", typeof(decimal));
foreach (var item in EmpaquesAgrupado)
{
DTBultos.Rows.Add(item.TipoEmpaque, item.Cantidad);
}
ReportDataSource RDSBultos = new ReportDataSource();
RDSBultos.Name = "DsBultos";
RDSBultos.Value = DTBultos;
lrds.Add(RDSBultos);
} }
} }
@@ -1177,7 +1234,7 @@ public partial class Export_ExpDetalle : ClsPaginas
NombreArchivo = NumFactura; NombreArchivo = NumFactura;
} }
string Formato = "FormatoExportacion.mrt"; string Formato = "FormatoImportacion.mrt";
para.Add(new ReportParameter("Formato", "PDF")); para.Add(new ReportParameter("Formato", "PDF"));
string Ruta = ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\{UsuarioActual.CveEmpresa}\Formatos\{Formato}"; string Ruta = ModExtensiones.DirectorioBaseEmpresas + $@"Empresas\{UsuarioActual.CveEmpresa}\Formatos\{Formato}";

View File

@@ -53,6 +53,21 @@
width: 100%; width: 100%;
height: 500px; height: 500px;
} }
#<%= GVExportaciones.ClientID %> .btn,
#<%= GVExportaciones.ClientID %> .btn-circle {
display: inline-block !important;
width: auto !important;
min-width: 0 !important;
max-width: none !important;
vertical-align: middle !important;
margin-bottom: 0 !important;
margin-right: 4px;
float: none !important;
clear: none !important;
}
</style> </style>
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="E" Runat="Server">
@@ -148,11 +163,11 @@
</asp:UpdatePanel> </asp:UpdatePanel>
<asp:UpdatePanel ID="upDatosExp" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="upDatosExp" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GVExportaciones" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacion" Width="100%" EmptyDataText="No se encontraron Exportaciones" ToolTip="Exportaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None"> <asp:GridView ID="GVExportaciones" runat="server" data-sort="true" AutoGenerateColumns="False" DataKeyNames="CveExportacion" Width="100%" EmptyDataText="No se encontraron Exportaciones" ToolTip="Exportaciones" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" GridLines="None" OnRowDataBound="GVExportaciones_RowDataBound" OnRowCreated="GVExportaciones_RowCreated">
<Columns> <Columns>
<asp:TemplateField HeaderText="Exportación" ItemStyle-HorizontalAlign="Left"> <asp:TemplateField ItemStyle-HorizontalAlign="Left">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HlExpDetalle" runat="server" Text='<%# Eval("CveExportacion") %>' NavigateUrl='<%# Eval("CveExportacion", "ExpDetalle.aspx?CveExportacion={0}") %>'>></asp:HyperLink> <asp:HyperLink ID="HlExpDetalle" runat="server" Text='<%# Eval("CveExportacion") %>'></asp:HyperLink>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="FechaIng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Fecha de Ingreso" DataFormatString="{0:d}" /> <asp:BoundField DataField="FechaIng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="100px" HeaderText="Fecha de Ingreso" DataFormatString="{0:d}" />
@@ -224,14 +239,28 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Editar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> <asp:TemplateField HeaderText="Acciones" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="120px">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton data-toggle="tooltip" title="Editar" ID="LnkEditar" OnClick="EditarExp_Click" CssClass="btn btn-circle btn-sm green" runat="server" Text="<i class='fa fa-pencil'></i>"></asp:LinkButton> <span style="white-space: nowrap;">
</ItemTemplate> <asp:HyperLink
</asp:TemplateField> ID="HlEditar"
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px"> runat="server"
<ItemTemplate> CssClass="btn btn-circle btn-sm green"
<asp:LinkButton ID="LnkEliminar" runat="server" OnClick="EliminarExp_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la Exportación?" data-btn-ok-label="Sí" /> Text="<i class='fa fa-pencil'></i>"
ToolTip="Editar">
</asp:HyperLink>
&nbsp;
<asp:LinkButton
ID="LnkEliminar"
runat="server"
OnClick="EliminarExp_Click"
CssClass="btn btn-circle btn-sm red"
Text="<i class='icon-trash'></i>"
data-toggle="confirmation"
data-popout="true"
data-original-title="¿Está seguro que desea eliminar la Exportación?"
data-btn-ok-label="Sí" />
</span>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>

View File

@@ -28,7 +28,7 @@ public partial class Export_RepExportaciones : ClsPaginas
private bool EsImportacion private bool EsImportacion
{ {
get{ return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); } get { return (ViewState["EsImportacion"] == null) ? false : Boolean.Parse(ViewState["EsImportacion"].ToString()); }
set { ViewState["EsImportacion"] = value; } set { ViewState["EsImportacion"] = value; }
} }
public string EmptyDataTextPersonalizado { get; set; } public string EmptyDataTextPersonalizado { get; set; }
@@ -43,7 +43,7 @@ public partial class Export_RepExportaciones : ClsPaginas
if (Request["Opcion"] != null) if (Request["Opcion"] != null)
{ {
if (Request["Opcion"] == "I") if (Request["Opcion"] == "I")
EsImportacion = true; EsImportacion = true;
} }
Page.Title = EsImportacion ? "Importaciones" : "Exportaciones"; Page.Title = EsImportacion ? "Importaciones" : "Exportaciones";
@@ -125,4 +125,76 @@ public partial class Export_RepExportaciones : ClsPaginas
Alert("La Exportación se ha eliminado correctamente."); Alert("La Exportación se ha eliminado correctamente.");
} }
} }
protected void GVExportaciones_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
var dataItem = (System.Data.DataRowView)e.Row.DataItem;
int cveExportacion = Convert.ToInt32(dataItem["CveExportacion"]);
HyperLink hl = (HyperLink)e.Row.FindControl("HlExpDetalle");
// Usa la bandera EsImportacion de la página
if (EsImportacion)
hl.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}&Opcion=I";
else
hl.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}";
// EDITAR
HyperLink hlEditar = (HyperLink)e.Row.FindControl("HlEditar");
if (EsImportacion)
hlEditar.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}&Opcion=I";
else
hlEditar.NavigateUrl = $"ExpDetalle.aspx?CveExportacion={cveExportacion}";
// Tipo Exportación
Label lblTipoExp = (Label)e.Row.FindControl("lblTipoExp");
if (lblTipoExp != null)
{
string valor = dataItem["TipoExportacion"].ToString();
switch (valor)
{
case "1":
lblTipoExp.Text = "(IMP) Importación";
break;
case "2":
lblTipoExp.Text = "(EXP) Exportación/retorno";
break;
case "3":
lblTipoExp.Text = "(TRA) Tránsitos";
break;
default:
lblTipoExp.Text = "Desconocido";
break;
}
}
// Estatus
Label lblEstatus = (Label)e.Row.FindControl("lblEstatus");
if (lblEstatus != null)
{
string valor = dataItem["CveExportacionEstatus"].ToString();
switch (valor)
{
case "1":
lblEstatus.Text = "Tránsito";
break;
case "2":
lblEstatus.Text = "Completa";
break;
default:
lblEstatus.Text = "Desconocido";
break;
}
}
}
}
protected void GVExportaciones_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
// Cambia el texto del primer encabezado (ajusta el índice si no es la primera columna)
e.Row.Cells[0].Text = EsImportacion ? "Importación" : "Exportación";
}
}
} }

View File

@@ -140,47 +140,50 @@
} }
*/ */
/*Begin ScrollADS V2*/ /*Begin ScrollADS V2*/
.divContainerads { .divContainerads {
width: 100%; width: 100%;
max-height: calc(100vh - 260px); max-height: calc(100vh - 260px);
overflow-y: auto; overflow-y: auto;
}
table.adssigscroll {
min-width: 100%;
background-color: #fff;
}
table.adssigscroll tbody, table.adssigscroll thead {
background-color: #fff;
}
table.adssigscroll tr {
background-color: inherit;
}
table.adssigscroll tr.stickyRow {
position: sticky;
top: 0; /* Se mantiene pegado en la parte superior */
background-color: inherit; /* Para que no se superponga con otros elementos */
z-index: 4; /* Asegura que esté sobre otros elementos */
} }
.adssigrid-order tr > th::after {
content: "\f0dc";
font:normal normal normal 14px / 1 FontAwesome;
display: inline-block;
margin-left: 5px;
color: #32A1CF;
}
.adssigrid-order tr > th.asce::after {
content: "\f0de";
}
.adssigrid-order tr > th.desc::after { table.adssigscroll {
content: "\f0dd"; min-width: 100%;
} background-color: #fff;
}
table.adssigscroll tbody, table.adssigscroll thead {
background-color: #fff;
}
table.adssigscroll tr {
background-color: inherit;
}
table.adssigscroll tr.stickyRow {
position: sticky;
top: 0; /* Se mantiene pegado en la parte superior */
background-color: inherit; /* Para que no se superponga con otros elementos */
z-index: 4; /* Asegura que esté sobre otros elementos */
}
.adssigrid-order tr > th::after {
content: "\f0dc";
font: normal normal normal 14px / 1 FontAwesome;
display: inline-block;
margin-left: 5px;
color: #32A1CF;
}
.adssigrid-order tr > th.asce::after {
content: "\f0de";
}
.adssigrid-order tr > th.desc::after {
content: "\f0dd";
}
/*END ScrollADS V2*/ /*END ScrollADS V2*/
</style> </style>
</asp:Content> </asp:Content>
@@ -221,17 +224,25 @@ table.adssigscroll {
<asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" /> <asp:CheckBox ID="chkexpand" CssClass="hidden" runat="server" />
</div> </div>
<div class="titlefiltros titlefiltrosmedia caption "> <div class="titlefiltros titlefiltrosmedia caption ">
<div class="row" style="padding-top: 10px; position: relative;"> <div class="row" style="display: flex; align-items: center;">
<div class="col-md-1 truncate textfilter">Proveedor</div> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div style="width: 100px;">Proveedor</div>
<ADS:Dropdownlost ID="DdlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" Width="100%" CssClassDdl="select2me" CssStyle="width: 100%;"></ADS:Dropdownlost> <ADS:Dropdownlost ID="DdlProveedor" runat="server" DataValueField="CveProveedor" DataTextField="RazonSocial" Width="100%" CssClassDdl="select2me" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div> </div>
<label class="col-md-1 truncate textfilter2">Producto:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div style="width: 100px;">Producto</div>
<ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" Width="100%" CssStyle="width: 100%; "></ADS:Dropdownlost> <ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" DataValueField="CvePS" CssClassDdl="select2me" Width="100%" CssStyle="width: 100%; "></ADS:Dropdownlost>
</div> </div>
<label class="col-md-1 textfilter">Fecha Fin:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-1" style="min-width: 110px;"> <div style="width: 100px;">Existencia</div>
<asp:DropDownList ID="DdlExistencia" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
<asp:ListItem Text="Con existencia" Value="2" />
<asp:ListItem Text="Sin existencia" Value="3" />
<asp:ListItem Text="Todos" Value="4" />
</asp:DropDownList>
</div>
<div class="col-md-2" style="display: flex; align-items: center;">
<div style="width: 100px;">Fecha Fin</div>
<div style="display: inline-block; vertical-align: text-bottom;"> <div style="display: inline-block; vertical-align: text-bottom;">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 110px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 80px" MaxLength="10"></asp:TextBox> <asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 80px" MaxLength="10"></asp:TextBox>
@@ -243,15 +254,8 @@ table.adssigscroll {
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div> </div>
</div> </div>
<label class="col-md-1 truncate">Producto:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-1"> <div style="width: 100px;">Ver por</div>
<asp:DropDownList ID="DdlExistencia" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
<asp:ListItem Text="Con existencia" Value="2" />
<asp:ListItem Text="Sin existencia" Value="3" />
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Ver por:</label>
<div class="col-md-1">
<asp:DropDownList ID="Ddlgrupo" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;"> <asp:DropDownList ID="Ddlgrupo" runat="server" CssClass="select2me" Width="100%" CssStyle="width: 100%;">
<asp:ListItem Text="Almacenes" Value="1" /> <asp:ListItem Text="Almacenes" Value="1" />
<asp:ListItem Text="Sucursales" Value="2" /> <asp:ListItem Text="Sucursales" Value="2" />
@@ -261,51 +265,60 @@ table.adssigscroll {
</div> </div>
</div> </div>
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>> <div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
<div class="row"> <div class="row" style="display: flex; align-items: center;">
<label class="col-md-1 truncate">Clasificación:</label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div style="width: 100px;">Clasificación</div>
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 150px !important;"> <asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
<asp:ListItem Selected="True" Text=" Todas" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text=" Todas" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Unidad Medida:</label>
<div class="col-md-1"> <div class="col-md-2" style="display: none; align-items: center;">
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 100px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida"> <div style="width: 100px;" class="truncate text" title="Unidad de medida">Unidad de medida</div>
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 100% !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Almacén:</label>
<div class="col-md-2"> <div class="col-md-2" style="display: flex; align-items: center;">
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" <div style="width: 100px;" class="truncate text" title="Tipo Almacen">Tipo Almacen</div>
DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox> <asp:DropDownList ID="DdlTipoAlmacen" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100% !important;">
<%--<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>--%>
</div>
<label class="col-md-1 truncate">Tipo Almacen:</label>
<div class="col-md-1">
<asp:DropDownList ID="DdlTipoAlmacen" CssClass="select2me" runat="server" AppendDataBoundItems="true" DataTextField="TipoAlmacen" DataValueField="CveTipoAlmacen" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate">Tránsito?:</label>
<div class="col-md-1"> <div class="col-md-1" style="display: flex; align-items: center;">
<div style="width: 100px;" class="truncate text" title="Incluir Proyectados">Incluir Proyectados</div>
<asp:DropDownList ID="DdlProyeccionFiltro" runat="server" CssClass="select2me" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Text="Todos (Entradas/Salidas)" Value="3" />
<asp:ListItem Text="Entradas" Value="1" />
<asp:ListItem Text="Salidas" Value="2" />
<asp:ListItem Text="No" Value="0" Selected="True" />
</asp:DropDownList>
</div>
<div class="col-md-1" style="display: flex; align-items: center;">
<div style="width: 100px;">Tránsito?</div>
<asp:DropDownList ID="DdlIncluyeTransitorios" CssClass="select2me" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;"> <asp:DropDownList ID="DdlIncluyeTransitorios" CssClass="select2me" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 100px !important;">
<asp:ListItem Text="No" Value="0" Selected="True"></asp:ListItem> <asp:ListItem Text="No" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="Si (Origen)" Value="1"></asp:ListItem> <asp:ListItem Text="Si (Origen)" Value="1"></asp:ListItem>
<asp:ListItem Text="Si (Destino)" Value="2"></asp:ListItem> <asp:ListItem Text="Si (Destino)" Value="2"></asp:ListItem>
<asp:ListItem Text="Separado(Destino)" Value="3" /> <asp:ListItem Text="Separado(Destino)" Value="3" />
</asp:DropDownList> </asp:DropDownList>
<%--<asp:CheckBox ID="ChkIncluyeTransitorios" runat="server" Checked="false" />--%> </div>
<div class="col-md-4" style="display: flex; align-items: center;">
<div style="width: 120px;margin-left: -10px;">Almacén</div>
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100% !important;" runat="server"
DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
</div> </div>
</div> </div>
<asp:Panel ID="pnlOrden" runat="server" CssClass="row"> <asp:Panel ID="pnlOrden" runat="server" CssClass="row">
<div class="col-md-2" style="display: flex; align-items: center;">
<asp:Label runat="server" ID="Label3" Text="Producto:" class="col-md-1 truncate" /> <div style="width: 100px;" class="truncate text" title="Producto">Producto</div>
<div class="col-md-2"> <asp:TextBox runat="server" ID="TxtPS" CssClass="form-control" Height="30px" Width="100%"></asp:TextBox>
<asp:TextBox runat="server" ID="TxtPS" CssClass="form-control" Height="30px"></asp:TextBox>
</div> </div>
<asp:Label runat="server" ID="LblOrden" class="col-md-1 truncate">Orden:</asp:Label> <div class="col-md-2" style="display: flex; align-items: center;">
<div class="col-md-2"> <div runat="server" id="LblOrden" class="col-md-1 truncate">Orden</div>
<asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%"> <asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" /> <asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
<asp:ListItem Text="Marca,Modelo,Rin,Medida de Barrenación" Value="1" /> <asp:ListItem Text="Marca,Modelo,Rin,Medida de Barrenación" Value="1" />
@@ -314,32 +327,16 @@ table.adssigscroll {
<asp:ListItem Text="Rin,Medida de Barrenación" Value="4" /> <asp:ListItem Text="Rin,Medida de Barrenación" Value="4" />
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<div class="col-md-3">
<div class="row"> <div class="col-md-3" style="display: flex; align-items: center;">
<asp:Label runat="server" ID="LblMarca" class="col-md-3 truncate">Marca:</asp:Label> <div runat="server" id="LblMarca" class="truncate text">Marca</div>
<div class="col-md-9"> <asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height: 50px !important;">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height: 50px !important;"> <asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem> </asp:ListBox>
</asp:ListBox>
</div>
</div>
</div>
<asp:Label runat="server" ID="LblProyectado" Text="Incluir Proyectados" class="col-md-1 truncate" />
<div class="col-md-2">
<asp:DropDownList ID="DdlProyeccionFiltro" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Todos (Entradas/Salidas)" Value="3" />
<asp:ListItem Text="Entradas" Value="1" />
<asp:ListItem Text="Salidas" Value="2" />
<asp:ListItem Text="No" Value="0" Selected="True" />
</asp:DropDownList>
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
@@ -352,8 +349,8 @@ table.adssigscroll {
<ContentTemplate> <ContentTemplate>
<div class="divContainerads"> <div class="divContainerads">
<asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" ShowHeaderWhenEmpty="true" <asp:GridView ID="GvDatos" runat="server" ShowHeader="true" EmptyDataText="No hay registros." AutoGenerateColumns="True" ShowHeaderWhenEmpty="true"
DataKeyNames="CvePS" CssClass="adssigrid-scroll adssigrid-order table table-striped table-advance table-hover " data-cols="2" data-rows="2" data-heightmenos="300" GridLines="None" > DataKeyNames="CvePS" CssClass="adssigrid-scroll adssigrid-order table table-striped table-advance table-hover " data-cols="2" data-rows="2" data-heightmenos="300" GridLines="None">
<Columns> <Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="120px"> <asp:TemplateField ItemStyle-HorizontalAlign="Left" ItemStyle-Width="120px">
<HeaderTemplate> <HeaderTemplate>

View File

@@ -184,7 +184,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
dt = ObjMovimientos.DtResultados dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn) Dim ListaBorrar As New List(Of DataColumn)
If Not TienePermisoImportes AndAlso DdlExistencia.SelectedValue.ToEntero = 2 Then If Not TienePermisoImportes AndAlso DdlExistencia.SelectedValue.ToEntero().Contiene(2, 4) Then
dt.Columns.RemoveAt(dt.Columns.Count - 2) 'CP-quito columna de importe total dt.Columns.RemoveAt(dt.Columns.Count - 2) 'CP-quito columna de importe total
dt.Columns.RemoveAt(dt.Columns.Count - 2) 'Valor-quito columna de importe total dt.Columns.RemoveAt(dt.Columns.Count - 2) 'Valor-quito columna de importe total
End If End If
@@ -247,17 +247,21 @@ Partial Class Inventarios_KardexAlmacenHorizontal
'Dim Liga As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={e.Row.DataKey("CveAlmacen")}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}") 'Dim Liga As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={e.Row.DataKey("CveAlmacen")}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
'e.Row.FCHyperLink("HplAlmacen").NavigateUrl = Liga 'e.Row.FCHyperLink("HplAlmacen").NavigateUrl = Liga
If e.Row.RowIndex = 0 Then If e.Row.RowIndex = 0 AndAlso DdlExistencia.SelectedValue.ToEntero().Contiene(2, 4) Then
e.Row.CssClass = "Totales" e.Row.CssClass = "Totales"
End If End If
'e.Row.Attributes.Add("style", " max-height:31px!important") 'e.Row.Attributes.Add("style", " max-height:31px!important")
e.Row.HorizontalAlign = HorizontalAlign.Right If DdlExistencia.SelectedValue.ToEntero = 3 Then
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left e.Row.HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left Else
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left e.Row.HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
End If
Dim Index As Integer = 0 Dim Index As Integer = 0
For Each Cells As TableCell In e.Row.Cells For Each Cells As TableCell In e.Row.Cells
@@ -315,17 +319,15 @@ Partial Class Inventarios_KardexAlmacenHorizontal
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui). 'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
' e.Row.Cells(0).Width = New Unit("200px") ' e.Row.Cells(0).Width = New Unit("200px")
If DdlExistencia.SelectedValue.ToEntero.Contiene(2, 3, 4) Then
If DdlExistencia.SelectedValue.ToEntero = 2 Then
Try Try
If DdlExistencia.SelectedValue.ToEntero = 3 Then
e.Row.Cells(1).Visible = False
End If
e.Row.Cells(2).Visible = False e.Row.Cells(2).Visible = False
e.Row.Cells(3).Visible = False e.Row.Cells(3).Visible = False
Catch ex As Exception Catch ex As Exception
End Try End Try
Else
e.Row.Cells(0).Visible = False
End If End If
If e.Row.RowType = DataControlRowType.Header Then If e.Row.RowType = DataControlRowType.Header Then
@@ -334,7 +336,6 @@ Partial Class Inventarios_KardexAlmacenHorizontal
End Sub End Sub
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
Imprimir("Excel") Imprimir("Excel")
End Sub End Sub
Private Sub Imprimir(Optional reporte As String = "PDF") Private Sub Imprimir(Optional reporte As String = "PDF")

View File

@@ -9814,26 +9814,6 @@ public partial class Nomina_Nomina2 : ClsPaginas
script = string.Format("Savexml(\"{0} {1}.xml\", $('.ltlxml').html());", Xmlname, empleado); script = string.Format("Savexml(\"{0} {1}.xml\", $('.ltlxml').html());", Xmlname, empleado);
//System.IO.FileInfo file = new System.IO.FileInfo(PathXML);
//string mimeType = "text/plain";
//try
//{
// mimeType = MimeMapping.GetMimeMapping(PathXML);
//}
//catch (Exception)
//{
//}
//// Response.Write(path)
//Response.Clear();
//Response.ClearHeaders();
//Response.ClearContent();
//Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(file.Name)}");
//Response.AddHeader("Content-Length", file.Length.ToString());
//Response.ContentType = mimeType;
//Response.Flush();
//Response.TransmitFile(file.FullName);
//Response.End();
} }
if (!string.IsNullOrEmpty(PathXMLF) && System.IO.File.Exists(PathXMLF)) if (!string.IsNullOrEmpty(PathXMLF) && System.IO.File.Exists(PathXMLF))
{ {

View File

@@ -4,10 +4,6 @@
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style> <style>
/* .GVGetMovtoPermanenteRep .headerHide:not(Titulos) th:nth-child(2) {
display: none;
}
*/
.GVGetMovtoPermanenteRep tr:not(.cvetipo0) td .btnhideshow { .GVGetMovtoPermanenteRep tr:not(.cvetipo0) td .btnhideshow {
display: none; display: none;
} }
@@ -16,13 +12,6 @@
background-color: #ddd; background-color: #ddd;
} }
/*.GVGetMovtoPermanenteRep tr:not(.cvetipo0) td:nth-child(1) {
display: none;
}
.GVGetMovtoPermanenteRep tr:.cvetipo0 td:nth-child(2) {
display: none;
}*/
.GVGetMovtoPermanenteRep tr:not(.cvetipo0) td .lblconcepto { .GVGetMovtoPermanenteRep tr:not(.cvetipo0) td .lblconcepto {
display: none; display: none;
} }
@@ -34,16 +23,6 @@
.hidden { .hidden {
display: none; display: none;
} }
/* Ocultar las columnas 3 a 9 en filas que no tienen la clase cvetipo0 */
/*.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(3),
.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(4),
.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(5),
.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(6),
.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(7),
.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(8),
.GVGetMovtoPermanenteRep tr.cvetipo0 td:nth-child(9) {
display: none;
}*/
.GVGetMovtoPermanenteRep td:nth-child(3), .GVGetMovtoPermanenteRep td:nth-child(3),
.GVGetMovtoPermanenteRep td:nth-child(4), .GVGetMovtoPermanenteRep td:nth-child(4),

View File

@@ -54,6 +54,17 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
get { return TxtRpdFechaFin.Text; } get { return TxtRpdFechaFin.Text; }
set { TxtRpdFechaFin.Text = value; } set { TxtRpdFechaFin.Text = value; }
} }
private DataTable dtmovs
{
get
{
if (ViewState["dtmovs"] == null) { return null; }
else { return (DataTable)ViewState["dtmovs"]; }
}
set { ViewState["dtmovs"] = value; }
}
#endregion #endregion
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
@@ -148,6 +159,7 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
//string fechaFin = ""; //string fechaFin = "";
int CvePeriodo = DdlPeriodo.SelectedValue.ToEntero() > 0 ? DdlPeriodo.SelectedValue.ToEntero() : -1; int CvePeriodo = DdlPeriodo.SelectedValue.ToEntero() > 0 ? DdlPeriodo.SelectedValue.ToEntero() : -1;
ObjGetM.GetMovtoPermanenteRepFechas(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto, fechaInicio.ToDateTime().ToString("yyyy-MM-dd"), fechaFin.ToDateTime().ToString("yyyy-MM-dd"), CvePeriodo); ObjGetM.GetMovtoPermanenteRepFechas(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto, fechaInicio.ToDateTime().ToString("yyyy-MM-dd"), fechaFin.ToDateTime().ToString("yyyy-MM-dd"), CvePeriodo);
dtmovs = ObjGetM.DtResultados;
GVGetMovtoPermanenteRep.DataSource = ObjGetM.DtResultados; GVGetMovtoPermanenteRep.DataSource = ObjGetM.DtResultados;
GVGetMovtoPermanenteRep.DataBind(); GVGetMovtoPermanenteRep.DataBind();
@@ -221,14 +233,8 @@ public partial class Nomina_RepMovtosPermanentes : ClsPaginas
protected void LnkFormatoxls_Click(object sender, EventArgs e) protected void LnkFormatoxls_Click(object sender, EventArgs e)
{ {
using (ClsNominas ObjGetM = new ClsNominas()) if(dtmovs != null && dtmovs.Rows.Count >0)
{ ExportarExcel(dtmovs);
//string fechaInicio = "";
//string fechaFin = "";
ObjGetM.GetMovtoPermanenteRepFechas(RcvePersonal, UsuarioActual.CveEmpresa, RcveTipo, RcveSaldo, RcveEstatus, RcveConcepto, fechaInicio.ToDateTime().ToString("yyyy-MM-dd"), fechaFin.ToDateTime().ToString("yyyy-MM-dd"));
ExportarExcel(ObjGetM.DtResultados);
}
} }

View File

@@ -168,11 +168,7 @@
<asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlVendedores" runat="server" DataTextField="Vendedor" DataValueField="CveVendedor" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div3" runat="server" visible="false"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-2 truncate">Marca</div>
<div class="col-md-4">
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
</div>
<div class="col-md-2 truncate">Mes y Año</div> <div class="col-md-2 truncate">Mes y Año</div>
<div class="col-md-4"> <div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;"> <div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 95px !important; padding: 0px;">
@@ -185,6 +181,12 @@
<ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender runat="server" ID="CEFechaI" TargetControlID="TxtFechaI" PopupButtonID="ImgFechaI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div3" runat="server" visible="false">
<div class="col-md-2 truncate">Marca</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlMarcas" runat="server" DataTextField="Marca" DataValueField="CveMarca" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
</div>
</div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div2" runat="server" visible="false"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;" id="Div2" runat="server" visible="false">
<div class="col-md-2">Clasificación Superior</div> <div class="col-md-2">Clasificación Superior</div>
<div class="col-md-10"> <div class="col-md-10">

View File

@@ -44,7 +44,6 @@ Partial Class CatMetasVendedores
GvDatos.Columns(1).Visible = False GvDatos.Columns(1).Visible = False
GvDatos.Columns(2).Visible = False GvDatos.Columns(2).Visible = False
GvDatos.Columns(3).Visible = False GvDatos.Columns(3).Visible = False
GvDatos.Columns(4).Visible = False
DivLblSucursal.Visible = False DivLblSucursal.Visible = False
DivSucursal.Visible = False DivSucursal.Visible = False
@@ -109,13 +108,15 @@ Partial Class CatMetasVendedores
End Sub End Sub
Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click Protected Sub LnkAgregar_Click() Handles LnkAgregar.Click
BtnAgregarMetaVendedor.Text = "Agregar"
ResetDatosSeleccionadosModal()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD")) RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"))
End Sub End Sub
Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click
Dim CveVendedor As Integer = DdlVendedores.SelectedValue.ToEntero() Dim CveVendedor As Integer = DdlVendedores.SelectedValue.ToEntero()
Dim Fecha As Date = MinFecha Dim Fecha As Date = TxtFechaI.Text.ToDate()
Dim CveMarca As Integer = -1 Dim CveMarca As Integer = -1
Dim CveClasificacionSuperior As Integer = -1 Dim CveClasificacionSuperior As Integer = -1
Dim CveClasificacion As Integer = -1 Dim CveClasificacion As Integer = -1
@@ -128,14 +129,13 @@ Partial Class CatMetasVendedores
Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, "))) Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
Exit Sub Exit Sub
End If End If
Fecha = TxtFechaI.Text.ToDate()
CveClasificacionSuperior = DdlClasificacionSup.SelectedValue.ToEntero CveClasificacionSuperior = DdlClasificacionSup.SelectedValue.ToEntero
CveClasificacion = DdlClasificacion.SelectedValue.ToEntero CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
CveMarca = DdlMarca.SelectedValue.ToEntero CveMarca = DdlMarca.SelectedValue.ToEntero
Else Else
If Not (DdlVendedores.SelectedValue.ToEntero > 0) Then If Not (DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "") Then
Alert("Falta Seleccionar el vendedor") Alert(String.Format("Falta Seleccionar {0}{1}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
Exit Sub Exit Sub
End If End If
End If End If
@@ -177,11 +177,10 @@ Partial Class CatMetasVendedores
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow) Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor") DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
TxtFechaI.Text = GvRow.DataKey("MesAño")
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
TxtFechaI.Text = GvRow.DataKey("MesAño")
DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup")) DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion")) DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))

View File

@@ -281,6 +281,12 @@ Partial Class Ventas_Promociones
'DdlPS.Items.Insert(0, New ListItem("Todos", "-1")) 'DdlPS.Items.Insert(0, New ListItem("Todos", "-1"))
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso Request("CvePromocion") IsNot Nothing AndAlso Request("CvePromocion").ToString.ToEntero > 0 Then
If DdlSubProyecto.Items.FindByValue("-1") Is Nothing Then
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
End If
End If
DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa) DdlVendedor.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedor.DataBind() DdlVendedor.DataBind()
DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1")) DdlVendedor.Items.Insert(0, New ListItem("Todos", "-1"))

View File

@@ -3438,7 +3438,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="portlet light xspadding bordered whitoutcol"> <div class="portlet light xspadding bordered whitoutcol" id="DivComplementoSC" runat="server" visible="false">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -3455,16 +3455,17 @@
<div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;"> <div class="portlet-body form-horizontal form-row-sepe formnombottom" style="display: none;">
<div class="form-body"> <div class="form-body">
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4"> <div class="col-md-4" style="display: flex">
NumPerLicoAut No.Permiso
<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtNumPerLicoAut" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtNumPerLicoAut" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4"> <div class="col-md-4" style="display: flex">
Calle Calle<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtSCCalle" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtSCCalle" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
@@ -3511,16 +3512,16 @@
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4"> <div class="col-md-4" style="display: flex">
Municipio Municipio<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtSCMunicipio" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtSCMunicipio" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4"> <div class="col-md-4" style="display: flex">
Estado Estado<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:DropDownList ID="DdlSCEstado" DataTextField="NombreEstado" DataValueField="CveEstado" runat="server" CssClass="form-control input-sm select2me" Width="100%"> <asp:DropDownList ID="DdlSCEstado" DataTextField="NombreEstado" DataValueField="CveEstado" runat="server" CssClass="form-control input-sm select2me" Width="100%">
@@ -3528,8 +3529,8 @@
</div> </div>
</div> </div>
<div class="row" style="display: flex; align-items: center; margin-bottom: 10px;"> <div class="row" style="display: flex; align-items: center; margin-bottom: 10px;">
<div class="col-md-4"> <div class="col-md-4" style="display: flex">
Código Postal C.Postal<div style="color: red">*</div>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox ID="TxtSCCP" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox> <asp:TextBox ID="TxtSCCP" CssClass="form-control" runat="server" CausesValidation="true" Width="100%"></asp:TextBox>
@@ -6943,6 +6944,8 @@
<asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" /> <asp:Button ID="BtnRefacturacionConfirmarAceptacion" runat="server" ClientIDMode="Static" Text="Refacturacion Aceptacion Documento" Style="display: none;" />
<asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" /> <asp:Button ID="BtnRefrescarPagina" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" />
<asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" /> <asp:Button ID="BtnAplicaNuevaNC" runat="server" ClientIDMode="Static" Text="AplicarNC" Style="display: none;" />
<asp:Button ID="BtnCreaApartirDePrecioOriginal" runat="server" ClientIDMode="Static" Text="Crear" Style="display: none;" OnClick="BtnCreaApartirDePrecioOriginal_Click" />
<asp:Button ID="BtnCreaApartirDePrecioNuevo" runat="server" ClientIDMode="Static" Text="Refrescar" Style="display: none;" OnClick="BtnCreaApartirDePrecioNuevo_Click" />
<asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" /> <asp:HiddenField ID="HdnCveVentaAcuse" runat="server" ClientIDMode="Static" Value="0" />
<%--FLETES--%> <%--FLETES--%>
@@ -11225,6 +11228,13 @@
$('#BtnCargarPSAdicionales').click(); $('#BtnCargarPSAdicionales').click();
} }
function BtnCreaApartirDePrecioOriginal() {
$('#BtnCreaApartirDePrecioOriginal').click();
}
function BtnCreaApartirDePrecioNuevo() {
$('#BtnCreaApartirDePrecioNuevo').click();
}
$('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); }); $('.DdlPS').on("select2:open", function (e) { $('.select2-container.select2-container--default .select2-dropdown .select2anothertable').remove(); });
$("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) { $("body").on("mouseenter", ".select2-container.select2-container--default.select2-container--open .select2-dropdown li", function (event) {

View File

@@ -2738,10 +2738,12 @@ Partial Class Ventas
CargaDdlClientesSucursal() CargaDdlClientesSucursal()
End If End If
DivComplementoSC.Visible = UsuarioActual.CveRol = 1
DdlSCEstado.DataSource = GlobalDTGralEstados("MEX") DdlSCEstado.DataSource = GlobalDTGralEstados("MEX")
DdlSCEstado.DataBind() DdlSCEstado.DataBind()
DdlSCEstado.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlSCEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
UPComplementosSAT.Update()
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante 'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso UsuarioActual.Empresa.UsaAC Then
@@ -35909,7 +35911,14 @@ Partial Class Ventas
#Region " CREAR APARTIR DE " #Region " CREAR APARTIR DE "
Protected Sub BtnCrearApartirDe_Click(sender As Object, e As System.EventArgs) Handles BtnCrearApartirDe.Click Protected Sub BtnCrearApartirDe_Click(sender As Object, e As System.EventArgs) Handles BtnCrearApartirDe.Click
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" Then
Alert("Se va crear una nueva cotización. ¿Requiere que se actualicen a los precios actuales?", TipoMensaje.MsgDosBotones, "BtnCreaApartirDePrecioOriginal()", TextoConfirmacion:="No", TextoSegundoBoton:="Si", JSBtn2:="BtnCreaApartirDePrecioNuevo()", ShowCloseButton:=False)
Else
CreaAPartirDe(False)
End If
End Sub
Private Sub CreaAPartirDe(Optional RecargaPrecios As Boolean = False)
Dim FolioOriginal As String = TxtFolio.Text Dim FolioOriginal As String = TxtFolio.Text
HdnCveVenta.Value = "" HdnCveVenta.Value = ""
@@ -36102,6 +36111,14 @@ Partial Class Ventas
GvFacturasRelacionadas.Columns(2).Visible = True GvFacturasRelacionadas.Columns(2).Visible = True
If RecargaPrecios Then
Dim CvePrecioListaSugerido As Integer = Me.CvePrecioListaCliente
If CvePrecioListaSugerido <= 0 Then
CvePrecioListaSugerido = GlobalDTPrecioListas(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "Predeterminada = 'True'").ToEntero()
End If
RecalculaPrecios(False, AplicarPromociones:=False, AplicarDescuentoGlobal:=False, CvePrecioListaSugerido:=CvePrecioListaSugerido)
End If
CalculaTotalesVenta() CalculaTotalesVenta()
Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100) Dim PorcentajeRetIVA = (TmpDT.MAX("PorcentajeRetIVA").ToDecimal() * 100)
@@ -36169,6 +36186,7 @@ Partial Class Ventas
UpFacturasRelacionadas.Update() UpFacturasRelacionadas.Update()
UpEmitirTransitorio.Update() UpEmitirTransitorio.Update()
End Sub End Sub
#End Region #End Region
#Region " GENERAR FACTURA " #Region " GENERAR FACTURA "
@@ -41133,7 +41151,7 @@ Partial Class Ventas
RegistraScript("MuestraAnticipos();", "AE") RegistraScript("MuestraAnticipos();", "AE")
End Sub End Sub
Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False) Private Sub RecalculaPrecios(ByRef RecalculoPromociones As Boolean, Optional AplicarPromociones As Boolean = False, Optional AplicarDescuentoGlobal As Boolean = False, Optional CvePrecioListaSugerido As Integer = -1)
Dim PuedeRecalcular As Boolean = False Dim PuedeRecalcular As Boolean = False
Dim DescuentoManual As Decimal = 0, DescuentoPorcentaje As Decimal = 0 Dim DescuentoManual As Decimal = 0, DescuentoPorcentaje As Decimal = 0
@@ -41168,8 +41186,6 @@ Partial Class Ventas
Dim CodigoPS As String = Row("CodigoPS").ToString() Dim CodigoPS As String = Row("CodigoPS").ToString()
Dim PUOriginal As Decimal = Row("PU").ToString().ToDecimal() Dim PUOriginal As Decimal = Row("PU").ToString().ToDecimal()
Dim CvePrecioListaSugerido As Integer = -1
Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing Dim ObjPrecioSugerido As Modelos.MPrecioSugerido = Nothing
If AplicarPromociones OrElse AplicarDescuentoGlobal Then If AplicarPromociones OrElse AplicarDescuentoGlobal Then
@@ -41177,7 +41193,7 @@ Partial Class Ventas
ObjPrecioSugerido.PrecioSugerido = PUOriginal ObjPrecioSugerido.PrecioSugerido = PUOriginal
ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero() ObjPrecioSugerido.CvePrecioLista = Row("CvePrecioLista").ToString().ToEntero()
Else Else
ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion) ObjPrecioSugerido = CalculaPrecioSugerido(CvePS, CveClasificacion, CvePrecioListaSugerido:=CvePrecioListaSugerido)
End If End If
If ObjPrecioSugerido.PrecioSugerido > 0 Then If ObjPrecioSugerido.PrecioSugerido > 0 Then
@@ -42041,6 +42057,7 @@ Partial Class Ventas
Where row.RowType = DataControlRowType.DataRow Where row.RowType = DataControlRowType.DataRow
Select New With Select New With
{ {
.CveVentaDetalle = row.DataKey("CveVentaDetalle").ToEntero(),
.Codigo = row.DataKey("Codigo").Trim(), .Codigo = row.DataKey("Codigo").Trim(),
.NumeroParte = row.DataKey("NumeroParte").Trim(), .NumeroParte = row.DataKey("NumeroParte").Trim(),
.Descripcion = row.DataKey("PS").Trim(), .Descripcion = row.DataKey("PS").Trim(),
@@ -42049,13 +42066,32 @@ Partial Class Ventas
.Precio = row.FCLiteral("LtlPU").Text.Trim().ToDecimal(), .Precio = row.FCLiteral("LtlPU").Text.Trim().ToDecimal(),
.SubImporte = row.DataKey("TotalImporte").ToDecimal(), .SubImporte = row.DataKey("TotalImporte").ToDecimal(),
.MargenUtilidad = row.FCLabel("LblCostoPorcentaje").Text.Replace("%", "").Replace(" ", "").Trim().ToDecimal(), .MargenUtilidad = row.FCLabel("LblCostoPorcentaje").Text.Replace("%", "").Replace(" ", "").Trim().ToDecimal(),
.UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal() .UltimoCosto = row.FCLabel("LblCosto").Text.Trim().ToDecimal(),
.PL1 = 0D,
.PL2 = 0D
}).QueryToDataTable(True) }).QueryToDataTable(True)
If DtExcel.Rows.Count < 1 Then If DtExcel.Rows.Count < 1 Then
Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia) Alert("No hay resultados en la busqueda.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim DtPreciosLista As DataTable = Nothing
If UsuarioActual.CveEmpresa = 189 Then
Dim ObjVta As New ClsVentas
If ObjVta.GetVentaDetallePreciosLista(Me.CveVenta, UsuarioActual.CveEmpresa) Then
DtPreciosLista = ObjVta.DtResultados.Copy()
End If
ObjVta.Dispose()
If DtPreciosLista IsNot Nothing Then
For Each Row As DataRow In DtExcel.Rows
Row("PL1") = DtPreciosLista.FiltroPrimeroValor("PL1", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal()
Row("PL2") = DtPreciosLista.FiltroPrimeroValor("PL2", $"CveVentaDetalle={Row("CveVentaDetalle")}").ToDecimal()
Next
End If
End If
Dim folio = LblSerie.Text + "-" + TxtFolio.Text Dim folio = LblSerie.Text + "-" + TxtFolio.Text
@@ -42069,6 +42105,9 @@ Partial Class Ventas
DtExcel.Columns("MargenUtilidad").ColumnName = "Margen de utilidad" DtExcel.Columns("MargenUtilidad").ColumnName = "Margen de utilidad"
DtExcel.Columns("UltimoCosto").ColumnName = "Último costo" DtExcel.Columns("UltimoCosto").ColumnName = "Último costo"
'QUITAR COLUMNA DE VENTA DETALLE, EL USUARIO NO DEBE VERLA
DtExcel.Columns.Remove("CveVentaDetalle")
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim FileExcel As New ExcelFile() Dim FileExcel As New ExcelFile()
@@ -42093,6 +42132,10 @@ Partial Class Ventas
worksheet.Columns(7).Style.NumberFormat = "#,##0.00" worksheet.Columns(7).Style.NumberFormat = "#,##0.00"
'ULTIMO COSTO 'ULTIMO COSTO
worksheet.Columns(8).Style.NumberFormat = "$#,##0.00_);($#,##0.00)" worksheet.Columns(8).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
'PL1
worksheet.Columns(9).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
'PL2
worksheet.Columns(10).Style.NumberFormat = "$#,##0.00_);($#,##0.00)"
Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns() Dim columnCount As Integer = worksheet.CalculateMaxUsedColumns()
For i As Integer = 0 To columnCount For i As Integer = 0 To columnCount
@@ -42101,5 +42144,14 @@ Partial Class Ventas
FileExcel.Save(Response, $"{folio}.xlsx", SaveOptions.XlsxDefault) FileExcel.Save(Response, $"{folio}.xlsx", SaveOptions.XlsxDefault)
End Sub End Sub
Protected Sub BtnCreaApartirDePrecioOriginal_Click(sender As Object, e As EventArgs)
CreaAPartirDe(RecargaPrecios:=False)
End Sub
Protected Sub BtnCreaApartirDePrecioNuevo_Click(sender As Object, e As EventArgs)
CreaAPartirDe(RecargaPrecios:=True)
End Sub
End Class End Class