Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -78,6 +78,7 @@ Public Class ClsInventarios
|
|||||||
Public Property CveVenta As Integer
|
Public Property CveVenta As Integer
|
||||||
Public Property TipoEstatus As Integer
|
Public Property TipoEstatus As Integer
|
||||||
Public Property EsDevolucionVenta As Integer
|
Public Property EsDevolucionVenta As Integer
|
||||||
|
Public Property CantidadVenta As Decimal
|
||||||
Public Property CvePersonal As Integer
|
Public Property CvePersonal As Integer
|
||||||
Public Property NombreCompleto As String
|
Public Property NombreCompleto As String
|
||||||
Public Property NombreCapturo As String
|
Public Property NombreCapturo As String
|
||||||
@@ -3576,8 +3577,9 @@ Public Class ClsInventarios
|
|||||||
|
|
||||||
If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then
|
If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then
|
||||||
Dim dr As DataRow = Data.Rows(0)
|
Dim dr As DataRow = Data.Rows(0)
|
||||||
TipoEstatus = dr("TipoEstatus").ToString.ToEntero
|
TipoEstatus = dr("TipoEstatus").ToString().ToEntero
|
||||||
EsDevolucionVenta = dr("EsVentaDevolucion").ToString.ToEntero
|
EsDevolucionVenta = dr("EsVentaDevolucion").ToString().ToEntero
|
||||||
|
CantidadVenta = dr("CantidadVenta").ToString().ToDecimal()
|
||||||
Retorno = True
|
Retorno = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ Public Class ClsOS
|
|||||||
|
|
||||||
|
|
||||||
Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer,
|
Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer,
|
||||||
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
|
Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet")
|
DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet")
|
||||||
@@ -516,6 +516,7 @@ Public Class ClsOS
|
|||||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||||
.Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad
|
.Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad
|
||||||
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
|
||||||
|
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
|
|||||||
@@ -7115,7 +7115,7 @@ Public Class ClsPaginas
|
|||||||
params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString))
|
params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString))
|
||||||
End If
|
End If
|
||||||
'COMPU DN DIFUSA
|
'COMPU DN DIFUSA
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177) Then
|
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177, 186) Then
|
||||||
Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor))
|
Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor))
|
||||||
params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, "")))
|
params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, "")))
|
||||||
params.Add(New ReportParameter("Entrega", Vta.Entrega))
|
params.Add(New ReportParameter("Entrega", Vta.Entrega))
|
||||||
|
|||||||
@@ -6931,7 +6931,7 @@ Public Class ClsVentas
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
Public Function GetVentasMedicasIndicadoresRep(Grupo As Integer, FechaI As Date, FechaF As Date, CveCliente As Integer, CveMedico As Integer, CveProcedimiento As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetVentasMedicasIndicadoresRep(Grupo As Integer, FechaI As Date, FechaF As Date, CveCliente As Integer, CveMedico As Integer, CveProcedimiento As Integer, CveEmpresa As Integer, CveVendedor As Integer) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
DataAdapter("PA_Vta_VentasMedicasIndicadoresRepGet")
|
DataAdapter("PA_Vta_VentasMedicasIndicadoresRepGet")
|
||||||
@@ -6943,6 +6943,7 @@ Public Class ClsVentas
|
|||||||
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||||
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
.Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||||
End With
|
End With
|
||||||
Try
|
Try
|
||||||
SqlAdapter.Fill(Data)
|
SqlAdapter.Fill(Data)
|
||||||
|
|||||||
@@ -681,6 +681,49 @@ Namespace Extensiones
|
|||||||
directorioNew.Clear()
|
directorioNew.Clear()
|
||||||
Return retorno
|
Return retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
<Runtime.CompilerServices.Extension()>
|
||||||
|
Public Function FilesCopy(oldName As String, newName As String, newDirectorio As String, Optional Sobreescribir As Boolean = False, Optional ConcatenarDirectorioBase As Boolean = True) As Boolean
|
||||||
|
Dim retorno As Boolean = True
|
||||||
|
Dim directorioOld As New StringBuilder
|
||||||
|
Dim directorioNew As New StringBuilder
|
||||||
|
directorioOld.AppendFormat("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, oldName)
|
||||||
|
If newName = "" Then
|
||||||
|
newName = oldName
|
||||||
|
Else
|
||||||
|
newName = String.Format("{0}{1}", newName, System.IO.Path.GetExtension(directorioOld.ToString()))
|
||||||
|
End If
|
||||||
|
|
||||||
|
'SI VA A LA CARPETA DE EMPRESAS TIENE QUE TOMAR LA RUTA DE EMPRESAS
|
||||||
|
If ConcatenarDirectorioBase Then
|
||||||
|
If newDirectorio.Contains("Empresas") Then
|
||||||
|
directorioNew.AppendFormat("{0}{1}\", ModExtensiones.DirectorioBaseEmpresas, newDirectorio)
|
||||||
|
Else
|
||||||
|
directorioNew.AppendFormat("{0}{1}\", AppDomain.CurrentDomain.BaseDirectory, newDirectorio)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
'SI YA TIENE EL DIRECTORIO COMPLETO NO CONCANTENA EL DIRECTORIO
|
||||||
|
directorioNew.AppendFormat("{0}\", newDirectorio)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If Not Directory.Exists(directorioNew.ToString) Then
|
||||||
|
Directory.CreateDirectory(directorioNew.ToString)
|
||||||
|
End If
|
||||||
|
|
||||||
|
directorioNew.Append(newName)
|
||||||
|
Try
|
||||||
|
My.Computer.FileSystem.CopyFile(directorioOld.ToString, directorioNew.ToString, Sobreescribir)
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
Alert("", String.Format("{0} code[FilesMove]", ex.Message), TipoMensaje.MsgAdvertencia)
|
||||||
|
retorno = False
|
||||||
|
End Try
|
||||||
|
directorioOld.Clear()
|
||||||
|
directorioNew.Clear()
|
||||||
|
Return retorno
|
||||||
|
End Function
|
||||||
|
|
||||||
<Runtime.CompilerServices.Extension()>
|
<Runtime.CompilerServices.Extension()>
|
||||||
Public Function DirectoryExistsCreate(ByRef NombreDirectorio As String) As Boolean
|
Public Function DirectoryExistsCreate(ByRef NombreDirectorio As String) As Boolean
|
||||||
|
|
||||||
|
|||||||
@@ -1967,7 +1967,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
ValidaUsaConsola()
|
ValidaUsaConsola()
|
||||||
|
|
||||||
|
|
||||||
|
Dim CantidadVenta As Decimal = 0
|
||||||
'' INICIA: VALIDACIONES
|
'' INICIA: VALIDACIONES
|
||||||
|
|
||||||
'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE!
|
'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE!
|
||||||
@@ -1975,6 +1975,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then
|
If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then
|
||||||
TipoEstatus = ObjVentaInv.TipoEstatus
|
TipoEstatus = ObjVentaInv.TipoEstatus
|
||||||
EsDevolucionVenta = ObjVentaInv.EsDevolucionVenta
|
EsDevolucionVenta = ObjVentaInv.EsDevolucionVenta
|
||||||
|
CantidadVenta = ObjVentaInv.CantidadVenta
|
||||||
End If
|
End If
|
||||||
ObjVentaInv.Dispose()
|
ObjVentaInv.Dispose()
|
||||||
|
|
||||||
@@ -2166,7 +2167,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
DtDatosVenta = ObjInventario.DtResultados
|
DtDatosVenta = ObjInventario.DtResultados
|
||||||
End If
|
End If
|
||||||
Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal)
|
||||||
If CantidadGV > DtDatosVenta.SUMD("CantidadF") Then
|
|
||||||
|
'VERIFICA SI LA CANTIDADES NOT SON MAYORES A LO ESTABLECIDO EN LA VENTA O LO QUE FALTA POR RECIBIR
|
||||||
|
If CantidadGV > DtDatosVenta.SUMD("CantidadF") OrElse Cantidad > CantidadVenta Then
|
||||||
ObjInventario.RollBack()
|
ObjInventario.RollBack()
|
||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
ObjConta.Dispose()
|
ObjConta.Dispose()
|
||||||
@@ -2175,7 +2178,13 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
'' identificar que productos no están completos.
|
'' identificar que productos no están completos.
|
||||||
CargaVentaPorSurtir(CveVentaSurtir)
|
CargaVentaPorSurtir(CveVentaSurtir)
|
||||||
CargaPendientes()
|
CargaPendientes()
|
||||||
Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
|
||||||
|
If Cantidad > CantidadVenta Then
|
||||||
|
Alert("No se puede procesar una cantidad mayor a la que esta definida en la venta.", TipoMensaje.MsgAdvertencia)
|
||||||
|
Else
|
||||||
|
Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -3290,6 +3299,14 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'SI YA FUE DEVUELTO LA CANTIDAD COMPLETA DE LA DEVOLUCION,MARCAR PARA QUE NO APAREZCA
|
||||||
|
If Not ErrorMovInv AndAlso Cantidad.RoundSQL(6) = CantidadVenta.RoundSQL(6) AndAlso TipoDocto = "Dev" Then
|
||||||
|
If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then
|
||||||
|
TextoError.AppendFormat("Ocurrió un error al actualizar la devolucion.")
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
|
|
||||||
ObjInventario.Commit()
|
ObjInventario.Commit()
|
||||||
|
|||||||
@@ -1314,46 +1314,55 @@
|
|||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" >Material Utilizado</h4>
|
<h4 class="modal-title" >Material Utilizado</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtPacienteModal">
|
|
||||||
<asp:TextBox ID="TxtPacienteModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
|
||||||
<asp:RequiredFieldValidator ID="RfvTxtPacienteModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPacienteModal"
|
|
||||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Paciente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
|
|
||||||
<label for="<%= TxtPacienteModal.ClientID.ToString()%>">Paciente:</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtEpisodioModal">
|
|
||||||
<asp:TextBox ID="TxtEpisodioModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
|
|
||||||
<asp:RequiredFieldValidator ID="RfvTxtEpisodioModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEpisodioModal"
|
|
||||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Episodio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
|
|
||||||
<label for="<%= TxtEpisodioModal.ClientID.ToString()%>">Episodio:</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtFolioRemisionModal">
|
|
||||||
<asp:TextBox ID="TxtFolioRemisionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
|
|
||||||
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Folio:</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server">
|
|
||||||
<asp:TextBox ID="TxtObservacionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="250"></asp:TextBox>
|
|
||||||
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Observaciones:</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
||||||
|
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtPacienteModal">
|
||||||
|
<asp:TextBox ID="TxtPacienteModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvTxtPacienteModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtPacienteModal"
|
||||||
|
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Paciente''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtPacienteModal.ClientID.ToString()%>">Paciente:</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtEpisodioModal">
|
||||||
|
<asp:TextBox ID="TxtEpisodioModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RfvTxtEpisodioModal" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtEpisodioModal"
|
||||||
|
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Episodio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpMaterialUtilizado"></asp:RequiredFieldValidator>
|
||||||
|
<label for="<%= TxtEpisodioModal.ClientID.ToString()%>">Episodio:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright" runat="server" visible="false" id="DvTxtFolioRemisionModal">
|
||||||
|
<asp:TextBox ID="TxtFolioRemisionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="20"></asp:TextBox>
|
||||||
|
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Folio:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group form-md-line-input input-iconright" runat="server">
|
||||||
|
<asp:TextBox ID="TxtObservacionModal" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="250"></asp:TextBox>
|
||||||
|
<label for="<%= TxtFolioRemisionModal.ClientID.ToString()%>">Observaciones:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
<asp:TextBox ID="AnexoManerialUtilizado" CssClass="ADSdropzone hidden" data-maxFile="5" Text="" runat="server"></asp:TextBox>
|
<asp:TextBox ID="AnexoManerialUtilizado" CssClass="ADSdropzone hidden" data-maxFile="5" Text="" runat="server"></asp:TextBox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
<asp:GridView ID="GvMU" runat="server" AutoGenerateColumns="False" EmptyDataText="No se ha capturado material utilizado"
|
<asp:GridView ID="GvMU" runat="server" AutoGenerateColumns="False" EmptyDataText="No se ha capturado material utilizado"
|
||||||
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS,Descuento,Observaciones"
|
DataKeyNames="CveVentaDetalle,Cantidad,CveAlmacenActual,CvePS,CveUM,PU,CveMovimientoDetalle,Lote,Serie,FechaCaducidad,AplicaSerie,AplicaLote,AplicaCaducidad,CodigoPS,Descuento,Observaciones"
|
||||||
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMU_RowDataBound">
|
CssClass="table table-striped table-advance table-hover Widthall" GridLines="None" OnRowDataBound="GvMU_RowDataBound">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
@@ -1365,32 +1374,32 @@
|
|||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Utilizado</HeaderTemplate>
|
<HeaderTemplate>Utilizado</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtUtilizado" runat="server" Width="50px" ></asp:TextBox>
|
<asp:TextBox ID="TxtUtilizado" runat="server" Width="50px"></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtUtilizado" ValidChars="1234567890." />
|
<ajax:FilteredTextBoxExtender runat="server" FilterType="Custom" TargetControlID="TxtUtilizado" ValidChars="1234567890." />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Concepto</HeaderTemplate>
|
<HeaderTemplate>Concepto</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>' ></asp:Literal>
|
<asp:Literal ID="LtlcodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Serie</HeaderTemplate>
|
<HeaderTemplate>Serie</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblSerie" runat="server" Text='<%# Eval("Serie") %>'></asp:Label>
|
<asp:Label ID="LblSerie" runat="server" Text='<%# Eval("Serie") %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Lote</HeaderTemplate>
|
<HeaderTemplate>Lote</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblLote" runat="server" Text='<%# Eval("Lote") %>'></asp:Label>
|
<asp:Label ID="LblLote" runat="server" Text='<%# Eval("Lote") %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Fecha Cad.</HeaderTemplate>
|
<HeaderTemplate>Fecha Cad.</HeaderTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Label ID="LblFechaCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:dd/MM/yyyy}") %>' ></asp:Label>
|
<asp:Label ID="LblFechaCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:dd/MM/yyyy}") %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
|||||||
@@ -1851,6 +1851,9 @@ Partial Class OS_OrdenesServicios
|
|||||||
GvEB.DataSource = Nothing
|
GvEB.DataSource = Nothing
|
||||||
End If
|
End If
|
||||||
GvEB.DataBind()
|
GvEB.DataBind()
|
||||||
|
|
||||||
|
UPEventoBitacora.Update()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -3062,11 +3065,24 @@ Partial Class OS_OrdenesServicios
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim TieneArchivos As Boolean = False
|
||||||
|
Dim Filesgral As List(Of Archivo) = AnexoManerialUtilizado.getfiles().Archivos
|
||||||
|
For Each fileItem As Archivo In Filesgral
|
||||||
|
TieneArchivos = True
|
||||||
|
Exit For
|
||||||
|
Next
|
||||||
|
If Not TieneArchivos Then
|
||||||
|
Alert("Debe de Agregar Un Documento de Confirmación (hasta 5 maximo).")
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
Dim CveAlmacenActual As Integer = DTSolicitudDev.FiltroPrimeroValor("CveAlmacenActual").ToEntero
|
||||||
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
Dim CveMoneda As Integer = DTSolicitudDev.FiltroPrimeroValor("CveMoneda").ToEntero
|
||||||
Dim CveSubProyectoPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveSubProyecto").ToEntero
|
Dim CveSubProyectoPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveSubProyecto").ToEntero
|
||||||
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
Dim CveVentaPedido As Integer = DTSolicitudDev.FiltroPrimeroValor("CveVenta").ToEntero
|
||||||
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
|
Dim CveAlmacenDestino As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto = {CveSubProyectoPedido}").ToEntero
|
||||||
|
Dim CveVentaRemisionGenerada As Integer = -1
|
||||||
|
|
||||||
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then
|
If DdlTipoVenta.SelectedValue.ToEntero = 5 Then
|
||||||
Dim TotalSeleccionado As Decimal = 0
|
Dim TotalSeleccionado As Decimal = 0
|
||||||
@@ -3193,6 +3209,8 @@ Partial Class OS_OrdenesServicios
|
|||||||
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
|
Respuesta = GeneraRemision(CveVentaPedido, ObjV.IniciaTransacSQL())
|
||||||
|
|
||||||
If Respuesta.CveVenta > 0 Then
|
If Respuesta.CveVenta > 0 Then
|
||||||
|
|
||||||
|
CveVentaRemisionGenerada = Respuesta.CveVenta
|
||||||
If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
|
If ObjV.GetVentaDetalle(Respuesta.CveVenta) Then
|
||||||
Dim dtClon As DataTable = ObjV.DtResultados.Copy
|
Dim dtClon As DataTable = ObjV.DtResultados.Copy
|
||||||
dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
|
dtClon.DefaultView.Sort = "CveVentaDetalle ASC"
|
||||||
@@ -3329,7 +3347,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ProcesoOK Then
|
If ProcesoOK Then
|
||||||
ProcesoOK = GuardarArchivoConfirmacion(ObjV.IniciaTransacSQL, CveOS)
|
ProcesoOK = GuardarArchivoConfirmacion(ObjV.IniciaTransacSQL, CveOS, CveVentaRemisionGenerada)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If ProcesoOK Then
|
If ProcesoOK Then
|
||||||
@@ -3358,7 +3376,7 @@ Partial Class OS_OrdenesServicios
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer) As Boolean
|
Private Function GuardarArchivoConfirmacion(ByRef transaccion As SqlTransaction, CveOSActual As Integer, CveVentaRemisionGenerada As Integer) As Boolean
|
||||||
Dim respuesta As Boolean = False
|
Dim respuesta As Boolean = False
|
||||||
|
|
||||||
|
|
||||||
@@ -3367,33 +3385,55 @@ Partial Class OS_OrdenesServicios
|
|||||||
Dim FileExtension As String = "-1"
|
Dim FileExtension As String = "-1"
|
||||||
Dim Filesgral As List(Of Archivo) = AnexoManerialUtilizado.getfiles().Archivos
|
Dim Filesgral As List(Of Archivo) = AnexoManerialUtilizado.getfiles().Archivos
|
||||||
Dim Filename As String = ""
|
Dim Filename As String = ""
|
||||||
|
'Dim ProcesoOK As Boolean = True
|
||||||
|
|
||||||
|
|
||||||
For Each fileItem As Archivo In Filesgral
|
For Each fileItem As Archivo In Filesgral
|
||||||
|
|
||||||
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
FileExtension = IO.Path.GetExtension(String.Format("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "")
|
||||||
Filename = fileItem.filename
|
Filename = fileItem.filename
|
||||||
Next
|
|
||||||
|
|
||||||
|
If Filename = String.Empty Then
|
||||||
|
respuesta = False
|
||||||
|
Alert("Error al agregar Documento de Confirmación")
|
||||||
|
Exit For
|
||||||
|
Else
|
||||||
|
|
||||||
If Filename = String.Empty Then
|
If CveVentaRemisionGenerada > 0 Then
|
||||||
respuesta = True
|
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaRemisionGenerada) Then
|
||||||
Else
|
|
||||||
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOS:=CveOSActual) Then
|
|
||||||
If Filename <> "" Then
|
|
||||||
|
|
||||||
|
Try
|
||||||
|
Filename.FilesCopy(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
||||||
|
Catch ex As Exception
|
||||||
|
Alert("Error al mover archivo de confirmación", TipoMensaje.MsgAdvertencia)
|
||||||
|
respuesta = False
|
||||||
|
Exit For
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Else
|
||||||
|
respuesta = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ObjEventoBitacora.AddEventoBitacora("Documento de Confirmación", String.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveOS:=CveOSActual) Then
|
||||||
Try
|
Try
|
||||||
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
Filename.FilesMove(String.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString), String.Format("{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
|
||||||
respuesta = True
|
respuesta = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Error al mover archivo de confirmación", TipoMensaje.MsgAdvertencia)
|
Alert("Error al mover archivo de confirmación", TipoMensaje.MsgAdvertencia)
|
||||||
respuesta = False
|
respuesta = False
|
||||||
|
Exit For
|
||||||
End Try
|
End Try
|
||||||
|
Else
|
||||||
|
respuesta = False
|
||||||
|
Exit For
|
||||||
End If
|
End If
|
||||||
AnexoManerialUtilizado.Text = "[]"
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
AnexoManerialUtilizado.Text = "[]"
|
||||||
|
|
||||||
Return respuesta
|
Return respuesta
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ Partial Class OS_RepOSMedicas
|
|||||||
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
|
txtFechaI.Text = NowADS().FirstDayOfMonth.ToShortDateString
|
||||||
txtFechaF.Text = NowADS().AddDays(2).ToShortDateString
|
txtFechaF.Text = NowADS().AddDays(2).ToShortDateString
|
||||||
|
|
||||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
|
||||||
|
DdlMedico.DataSource = If(UsuarioActual.CveVendedor > 0, GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros($" Estatus = 'True' AND CveVendedor = {UsuarioActual.CveVendedor} "), GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' "))
|
||||||
DdlMedico.DataBind()
|
DdlMedico.DataBind()
|
||||||
|
|
||||||
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
DdlProcedimiento.DataSource = GlobalDTProcedimientos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
||||||
@@ -151,7 +152,7 @@ Partial Class OS_RepOSMedicas
|
|||||||
|
|
||||||
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
|
If ObjOS.GetRepOrdenesServicioMedicasRep(FechaI, FechaF, Cvecliente, DdlVendedor.SelectedValue.ToEntero, DdlEstatusOS.SelectedValue.ToEntero, DdlTecnico.SelectedValue.ToEntero, DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveEmpresa,
|
||||||
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
|
CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveEspecialidad:=DdlEspecialidad.SelectedValue.ToEntero,
|
||||||
CveClienteSucursal:=CveClienteSucursal) Then
|
CveClienteSucursal:=CveClienteSucursal, CveUsuario:=UsuarioActual.CveUsuario) Then
|
||||||
GvDatos.DataSource = ObjOS.DtResultados
|
GvDatos.DataSource = ObjOS.DtResultados
|
||||||
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
|
If ObjOS.DtResultados IsNot Nothing AndAlso ObjOS.DtResultados.Rows.Count > 0 Then
|
||||||
LnkPersonalizar.Visible = True
|
LnkPersonalizar.Visible = True
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ using System.Text;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using ClosedXML;
|
using ClosedXML;
|
||||||
|
|
||||||
|
using System.Web.SessionState;
|
||||||
|
using System.Web.Hosting;
|
||||||
|
|
||||||
public class TareasJam : IHttpHandler
|
public class TareasJam : IHttpHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -50,12 +53,15 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
private bool EjecutaThalamus(int CveEmpresa, HttpContext context)
|
private bool EjecutaThalamus(int CveEmpresa, HttpContext context)
|
||||||
{
|
{
|
||||||
|
Usuario Usuario = ValidaUsuarioSistema(100, 119);
|
||||||
|
|
||||||
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
this.GuardaLog("EjecutaThalamus: Inicio. ");
|
||||||
|
|
||||||
bool Respuesta = false;
|
bool Respuesta = false;
|
||||||
StringBuilder SBLog = new StringBuilder();
|
StringBuilder SBLog = new StringBuilder();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ClsGenerales ObjGenerales = new ClsGenerales();
|
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||||
|
|
||||||
DataTable DTProductos = new DataTable();
|
DataTable DTProductos = new DataTable();
|
||||||
@@ -116,7 +122,7 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
SBLog.AppendLine("<b>Consultas</b><br>");
|
SBLog.AppendLine("<b>Consultas</b><br>");
|
||||||
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
SBLog.AppendLine("<table border='1'><tr><th>Consulta</th><th>Registros</th></tr>");
|
||||||
Usuario Usuario = ValidaUsuarioSistema(100, 119);
|
|
||||||
|
|
||||||
this.GuardaLog("EjecutaThalamus: Consultando Productos. ");
|
this.GuardaLog("EjecutaThalamus: Consultando Productos. ");
|
||||||
if (ObjGenerales.GetJAMCorveta(1))
|
if (ObjGenerales.GetJAMCorveta(1))
|
||||||
@@ -319,6 +325,8 @@ public class TareasJam : IHttpHandler
|
|||||||
|
|
||||||
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
|
||||||
var wsClientes = wbAClientes.Worksheet(1);
|
var wsClientes = wbAClientes.Worksheet(1);
|
||||||
|
wsClientes.Column(8).Style.NumberFormat.Format = "@";
|
||||||
|
wsClientes.Column(9).Style.NumberFormat.Format = "@";
|
||||||
|
|
||||||
count = 2;
|
count = 2;
|
||||||
|
|
||||||
@@ -332,7 +340,8 @@ public class TareasJam : IHttpHandler
|
|||||||
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
|
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
|
||||||
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
|
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
|
||||||
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
|
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
|
||||||
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
|
|
||||||
|
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
|
||||||
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
|
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
|
||||||
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
|
||||||
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
|
||||||
@@ -372,7 +381,7 @@ public class TareasJam : IHttpHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//ErrorProceso = true;
|
ErrorProceso = true;
|
||||||
|
|
||||||
|
|
||||||
if (!ErrorProceso)
|
if (!ErrorProceso)
|
||||||
@@ -630,25 +639,65 @@ public class TareasJam : IHttpHandler
|
|||||||
return Respuesta;
|
return Respuesta;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Usuario ValidaUsuarioSistema(int CveUsuario, int CveEmpresa)
|
private Usuario ValidaUsuarioSistema(int CveUsuario, int CveEmpresa)
|
||||||
|
{
|
||||||
|
Usuario UsuarioActual = null/* TODO Change to default(_) if this is not a reference type */;
|
||||||
|
ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
|
||||||
|
|
||||||
|
if (ObjUsuarios.GetUsuarios(CveUsuario))
|
||||||
{
|
{
|
||||||
Usuario UsuarioActual = null/* TODO Change to default(_) if this is not a reference type */;
|
if (ObjUsuarios.DtResultados.Rows.Count > 0)
|
||||||
ClsSisUsuarios ObjUsuarios = new ClsSisUsuarios();
|
|
||||||
if (ObjUsuarios.GetUsuarios(CveUsuario))
|
|
||||||
{
|
{
|
||||||
if (ObjUsuarios.DtResultados.Rows.Count > 0)
|
string Usuario = ObjUsuarios.DtResultados.Rows[0]["Usuario"].ToString();
|
||||||
|
string Contrasenia = ObjUsuarios.DtResultados.Rows[0]["Contraseña"].ToString();
|
||||||
|
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
||||||
|
UsuarioActual.CveEmpresa = CveEmpresa;
|
||||||
|
|
||||||
|
if( HttpContext.Current.Session == null)
|
||||||
{
|
{
|
||||||
string Usuario = ObjUsuarios.DtResultados.Rows(0)("Usuario").ToString();
|
// CrearHttpContextArtificial();
|
||||||
string Contrasenia = ObjUsuarios.DtResultados.Rows(0)("Contraseña").ToString();
|
CrearHttpContextConSession();
|
||||||
UsuarioActual = ObjUsuarios.ValidaUsuario(Usuario, Contrasenia, CveEmpresa: CveEmpresa);
|
|
||||||
UsuarioActual.CveEmpresa = CveEmpresa;
|
|
||||||
HttpContext.Current.Session("UsuarioSIG") = UsuarioActual;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HttpContext.Current.Session["UsuarioSIG"] = UsuarioActual;
|
||||||
}
|
}
|
||||||
ObjUsuarios.Dispose();
|
|
||||||
return UsuarioActual;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ObjUsuarios.Dispose();
|
||||||
|
return UsuarioActual;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//public static void CrearHttpContextArtificial()
|
||||||
|
//{
|
||||||
|
// // Crear un SimpleWorkerRequest
|
||||||
|
// var workerRequest = new SimpleWorkerRequest("/dummy", null, new StringWriter());
|
||||||
|
|
||||||
|
// // Crear un HttpContext utilizando el SimpleWorkerRequest
|
||||||
|
// HttpContext.Current = new HttpContext(workerRequest);
|
||||||
|
|
||||||
|
// // Ahora puedes usar HttpContext.Current como si estuviera en un contexto web
|
||||||
|
// // Nota: La sesión aún no está disponible
|
||||||
|
//}
|
||||||
|
|
||||||
|
public static void CrearHttpContextConSession()
|
||||||
|
{
|
||||||
|
//CrearHttpContextArtificial();
|
||||||
|
|
||||||
|
// Para agregar soporte de sesión, debemos inicializar el manejador de sesión
|
||||||
|
var sessionContainer = new HttpSessionStateContainer("id",
|
||||||
|
new SessionStateItemCollection(),
|
||||||
|
new HttpStaticObjectsCollection(),
|
||||||
|
10,
|
||||||
|
true,
|
||||||
|
HttpCookieMode.AutoDetect,
|
||||||
|
SessionStateMode.InProc,
|
||||||
|
false);
|
||||||
|
|
||||||
|
SessionStateUtility.AddHttpSessionStateToContext(HttpContext.Current, sessionContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private bool VerificarArchivo(FileInfo FInfo, long Tamanio, string FTPServer, string FTPUsr, string FTPPass)
|
private bool VerificarArchivo(FileInfo FInfo, long Tamanio, string FTPServer, string FTPUsr, string FTPPass)
|
||||||
|
|||||||
@@ -73,7 +73,15 @@ Partial Class Ventas_CatMedicos
|
|||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
|
|
||||||
If ObjVentas.GetMedicos(-1, UsuarioActual.CveEmpresa, -1) Then
|
If ObjVentas.GetMedicos(-1, UsuarioActual.CveEmpresa, -1) Then
|
||||||
GvDatos.DataSource = ObjVentas.DtResultados
|
|
||||||
|
If UsuarioActual.CveVendedor > 0 Then
|
||||||
|
GvDatos.DataSource = ObjVentas.DtResultados.FiltraParametros($" CveVendedor = {UsuarioActual.CveVendedor}")
|
||||||
|
Else
|
||||||
|
GvDatos.DataSource = ObjVentas.DtResultados
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
GvDatos.DataSource = Nothing
|
GvDatos.DataSource = Nothing
|
||||||
End If
|
End If
|
||||||
@@ -252,8 +260,10 @@ Partial Class Ventas_CatMedicos
|
|||||||
|
|
||||||
|
|
||||||
Dim objVentas As New ClsVentas
|
Dim objVentas As New ClsVentas
|
||||||
|
Dim CveVendedor As Integer = If(UsuarioActual.CveVendedor > 0, UsuarioActual.CveVendedor, -1)
|
||||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
||||||
If objVentas.GetVentasMedicasIndicadoresRep(DdlGrupo.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, CveCliente, DdlMedico.SelectedValue.ToEntero, DdlProcedimiento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
|
||||||
|
If objVentas.GetVentasMedicasIndicadoresRep(DdlGrupo.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, CveCliente, DdlMedico.SelectedValue.ToEntero, DdlProcedimiento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveVendedor) Then
|
||||||
GvIndicadores.DataSource = objVentas.DtResultados
|
GvIndicadores.DataSource = objVentas.DtResultados
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ Partial Class Ventas_CatProcedimientos
|
|||||||
|
|
||||||
Dim objVentas As New ClsVentas
|
Dim objVentas As New ClsVentas
|
||||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
Dim CveCliente As Integer = If(DdlClientes.SelectedValue.ToEntero > 0, DdlClientes.SelectedValue.ToEntero, -1)
|
||||||
If objVentas.GetVentasMedicasIndicadoresRep(DdlGrupo.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, CveCliente, DdlMedico.SelectedValue.ToEntero, DdlProcedimiento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
If objVentas.GetVentasMedicasIndicadoresRep(DdlGrupo.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate, CveCliente, DdlMedico.SelectedValue.ToEntero, DdlProcedimiento.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, -1) Then
|
||||||
GvIndicadores.DataSource = objVentas.DtResultados
|
GvIndicadores.DataSource = objVentas.DtResultados
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@@ -1521,7 +1521,7 @@ Partial Class ProductosyServicios
|
|||||||
If CvePS = -1 Then
|
If CvePS = -1 Then
|
||||||
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
|
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper
|
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper
|
||||||
If ObjProductosServicios.AddPS(DdlClasificacion.SelectedValue.ToEntero, -1, DdlUnidadMedida.SelectedValue.ToEntero, TxtCodigo.Text.Trim, "", TxtCodigoBarras.Text.Trim, PSS,
|
If ObjProductosServicios.AddPS(DdlClasificacion.SelectedValue.ToEntero, -1, DdlUnidadMedida.SelectedValue.ToEntero, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS,
|
||||||
TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, (TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, CveProveedor, True,
|
TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, (TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, CveProveedor, True,
|
||||||
ChkAplicaParaVenta.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMetodoInv, EsPaquete, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero,
|
ChkAplicaParaVenta.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveMetodoInv, EsPaquete, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero,
|
||||||
FuePorXML:=False, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarca, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim,
|
FuePorXML:=False, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarca, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim,
|
||||||
|
|||||||
@@ -138,13 +138,30 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
string RFCReceptor = GvRow.DataKey("RFCReceptor");
|
string RFCReceptor = GvRow.DataKey("RFCReceptor");
|
||||||
string Folio = GvRow.DataKey("Folio");
|
string Folio = GvRow.DataKey("Folio");
|
||||||
string TipoDocto = GvRow.DataKey("TipoDocto");
|
string TipoDocto = GvRow.DataKey("TipoDocto");
|
||||||
string Nombre = GvRow.DataKey("Nombre");
|
string Nombre = GvRow.DataKey("Nombre");
|
||||||
string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
|
|
||||||
int CveEstatusFactura = GvRow.DataKey("CveEstatusFactura").ToEntero();
|
int CveEstatusFactura = GvRow.DataKey("CveEstatusFactura").ToEntero();
|
||||||
|
|
||||||
|
string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
|
||||||
|
int CveVentaSustitucion = GvRow.DataKey("CveVentaSustitucion").ToEntero();
|
||||||
|
string RFCReceptorSustitucion = GvRow.DataKey("RFCReceptorSustitucion");
|
||||||
|
|
||||||
|
int CveMotivoSustitucion = 0;
|
||||||
|
|
||||||
|
if (CveVentaSustitucion > 0)
|
||||||
|
{
|
||||||
|
//VERIFICA EL ESTATUS DE LA FACTURA NUEVA, SI ESTA ESTÁ CANCELADA, SE MANDA UNA CANCELACIÓN SIN FOLIO DE SUSTITUCIÓN Y CON EL CÓDIGO 02
|
||||||
|
Timbrado.AcuseCancelacionSAT VigenciaExtra = Timbrado.VerificarVigenciaSAT(FolioSustitucion, UsuarioActual.Empresa.RFC, RFCReceptorSustitucion, Total.ToString(), true);
|
||||||
|
if (VigenciaExtra.Estado.ToUpper() == "CANCELADO")
|
||||||
|
{
|
||||||
|
FolioSustitucion = "";
|
||||||
|
CveMotivoSustitucion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CveVenta > 0 && Uuid != "")
|
if (CveVenta > 0 && Uuid != "")
|
||||||
{
|
{
|
||||||
var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, Total, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusFactura: CveEstatusFactura);
|
var respuesta = VerificarVigenciaSAT(CveVenta, CveCliente, Folio, TipoDocto, Uuid, UsuarioActual.Empresa.RFC, RFCReceptor, Total, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusFactura: CveEstatusFactura, CveMotivoSustitucion: CveMotivoSustitucion);
|
||||||
CargaDatos();
|
CargaDatos();
|
||||||
if (respuesta.CveEstatus.Contiene(4, 5))
|
if (respuesta.CveEstatus.Contiene(4, 5))
|
||||||
{
|
{
|
||||||
@@ -302,7 +319,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
UPDatos.Update();
|
UPDatos.Update();
|
||||||
|
|
||||||
}
|
}
|
||||||
private MRespuestaSAT VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false, string FolioSustitucion = "", int CveEstatusFactura = -1)
|
private MRespuestaSAT VerificarVigenciaSAT(int CveVenta, int CveCliente, string Folio, string TipoDocto, string uuid, string emisor, string receptor, string total, bool EsRefacturacion = false, string FolioSustitucion = "", int CveEstatusFactura = -1, int CveMotivoSustitucion = 0)
|
||||||
{
|
{
|
||||||
//HdnLigaRefacturar.Value = "";
|
//HdnLigaRefacturar.Value = "";
|
||||||
|
|
||||||
@@ -341,7 +358,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
|
|
||||||
if (!UsuarioActual.Empresa.FacturaProduccion && (string.IsNullOrEmpty(uuid) || uuid.Contains("test")))
|
if (!UsuarioActual.Empresa.FacturaProduccion && (string.IsNullOrEmpty(uuid) || uuid.Contains("test")))
|
||||||
{
|
{
|
||||||
var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion, FolioSustitucion: FolioSustitucion);
|
var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion, FolioSustitucion: FolioSustitucion, CveMotivoCancelacion : CveMotivoSustitucion);
|
||||||
|
|
||||||
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
||||||
if (!respCancelacion.HuboError)
|
if (!respCancelacion.HuboError)
|
||||||
@@ -384,7 +401,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
|
|||||||
{
|
{
|
||||||
CveEstatus = 5;
|
CveEstatus = 5;
|
||||||
|
|
||||||
var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion, FolioSustitucion: FolioSustitucion);
|
var respCancelacion = CancelarDocumento(CveVenta, CveEstatus, CveCliente, Folio, uuid, CancelacionAcuse, CancelacionFecha, TipoDocto, total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: EsRefacturacion, FolioSustitucion: FolioSustitucion, CveMotivoCancelacion: CveMotivoSustitucion);
|
||||||
|
|
||||||
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
//sb.AppendFormat("{0} <br/>", respCancelacion.Mensaje);
|
||||||
if (!respCancelacion.HuboError)
|
if (!respCancelacion.HuboError)
|
||||||
|
|||||||
@@ -37294,10 +37294,10 @@ Partial Class Ventas
|
|||||||
DdlMedicoModal.ClearSelection()
|
DdlMedicoModal.ClearSelection()
|
||||||
DdlMedicoModal.SelectedValue = Nothing
|
DdlMedicoModal.SelectedValue = Nothing
|
||||||
|
|
||||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
DdlMedico.DataSource = If(UsuarioActual.CveVendedor > 0, GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros($" Estatus = 'True' AND CveVendedor = {UsuarioActual.CveVendedor} "), GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' "))
|
||||||
DdlMedico.DataBind()
|
DdlMedico.DataBind()
|
||||||
|
|
||||||
DdlMedicoModal.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' ")
|
DdlMedicoModal.DataSource = If(UsuarioActual.CveVendedor > 0, GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros($" Estatus = 'True' AND CveVendedor = {UsuarioActual.CveVendedor} "), GlobalDTMedicos(UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 'True' "))
|
||||||
DdlMedicoModal.DataBind()
|
DdlMedicoModal.DataBind()
|
||||||
|
|
||||||
If CveMedicoSeleccion > 0 Then
|
If CveMedicoSeleccion > 0 Then
|
||||||
|
|||||||
Reference in New Issue
Block a user