- registro de gastos de médicos
This commit is contained in:
@@ -3484,6 +3484,60 @@ Public Class ClsCompras
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
#Region "Medicos"
|
||||
|
||||
Public Function AddGastoMedicos(CveCompra As Integer, CveMedico As Integer, CvePS As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Comp_ComprasMedicosAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CveCompra
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar gasto de médico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetGastoMedicos(CveCompra As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Comp_ComprasMedicosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió al obtener los gastos de médico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function RemoveGastoMedicos(CveCompra As Integer, CveMedico As Integer, CvePS As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Comp_ComprasMedicosRemove")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveCompra", SqlDbType.Int).Value = CveCompra
|
||||
.Add("@CveMedico", SqlDbType.Int).Value = CveMedico
|
||||
.Add("@CvePS", SqlDbType.Int).Value = CveCompra
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al eliminar gasto de médico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
@@ -874,7 +874,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="min-height:200px">
|
||||
<div class="col-md-6" style="min-height:200px" id="divi">
|
||||
|
||||
<asp:UpdatePanel ID="UPPAnticiposSel" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
@@ -941,7 +941,46 @@
|
||||
<asp:Button runat="server" ID="btnProrateo2" Visible="false" Text="Prorratear Nomina" CommandArgument="Nomina" CssClass="btn btn-success" />
|
||||
<asp:Button runat="server" ID="BtnProrateoDeducible" Visible="false" Text="Prorratear 8.5%" CommandArgument="Prorratear Deducible" CssClass="btn btn-success" />
|
||||
</div>
|
||||
<asp:UpdatePanel ID="UPPMedicosGastos" runat="server" UpdateMode="Conditional" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class=" col-md-6">
|
||||
<div class="psagregar">
|
||||
<div class="comboxes">
|
||||
<label for="<%= DdlMedico.ClientID.ToString()%>" style="font-size: 13px; color: #888888; opacity: 1; margin-bottom: 0px;">Médico:</label>
|
||||
<asp:Dropdownlist runat="server" ID="DdlMedico" Width="100%"
|
||||
CssStyle="width: 100%;" IncluyeTodos="false" CssClass ="select2me" TabIndex="2"
|
||||
DataTextField="Medico" DataValueField="CveMedico" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align: right!important; padding-top: 15px; padding-left: 0px;">
|
||||
<asp:LinkButton ID="LnkAddMedico" runat="server" CssClass="btn btn-primary smallplus"
|
||||
OnClick="LnkAddMedico_Click"><i class="fa fa-plus"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:GridView ID="GvMedicosGastos" DataKeyNames="CveMedico" runat="server"
|
||||
ShowHeader="true" AutoGenerateColumns="False" EmptyDataText="" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
<asp:BoundField HeaderText="Médico" DataField="Medico" ItemStyle-Width="500px" />
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEliminarMedico" runat="server" CssClass="btn btn-circle btn-xs red" OnClick="LnkEliminarMedico_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar el médico?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="30px" HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UpDVAtencionOCAnticipo" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
@@ -74,23 +74,7 @@ Partial Class Compras_Compras
|
||||
ViewState("TmpDTOriginal") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TmpCXP As DataTable
|
||||
Get
|
||||
Return CType(ViewState("TmpCXP"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpCXP") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Private Property PSDTRemplazo As DataTable
|
||||
' Get
|
||||
' Return CType(ViewState("PSDTRemplazo"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("PSDTRemplazo") = value
|
||||
' End Set
|
||||
'End Property
|
||||
Private Property DtCheques As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtCheques"), DataTable)
|
||||
@@ -109,15 +93,6 @@ Partial Class Compras_Compras
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IdVale As List(Of Integer)
|
||||
Get
|
||||
IdVale = DirectCast(ViewState("IdVale"), List(Of Integer))
|
||||
End Get
|
||||
|
||||
Set(ByVal value As List(Of Integer))
|
||||
ViewState("IdVale") = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property ListaDocumentos As List(Of String)
|
||||
Get
|
||||
ListaDocumentos = DirectCast(ViewState("ListaDocumentos"), List(Of String))
|
||||
@@ -161,30 +136,22 @@ Partial Class Compras_Compras
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'Private Property DtCuentas As DataTable
|
||||
' Get
|
||||
' Return CType(ViewState("DtCuentas"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DtCuentas") = value
|
||||
' End Set
|
||||
'End Property
|
||||
'Private Property CargoFactura As Boolean
|
||||
' Get
|
||||
' Return CType(ViewState("CargoFactura"), Boolean)
|
||||
' End Get
|
||||
' Set(value As Boolean)
|
||||
' ViewState("CargoFactura") = value
|
||||
' End Set
|
||||
'End Property
|
||||
Private Property tDTAcarreos As DataTable
|
||||
Private Property DTMedicos As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("tDTAcarreos")), Nothing, CType(ViewState("tDTAcarreos"), DataTable))
|
||||
If IsNothing(ViewState("DTMedicos")) Then
|
||||
Dim tDT = New DataTable
|
||||
tDT.Columns.Add("CveCompra", GetType(Integer))
|
||||
tDT.Columns.Add("CveMedico", GetType(Integer))
|
||||
tDT.Columns.Add("Medico", GetType(String))
|
||||
ViewState("DTMedicos") = tDT
|
||||
End If
|
||||
Return CType(ViewState("DTMedicos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("tDTAcarreos") = value
|
||||
ViewState("DTMedicos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtDeudores As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtDeudores"), DataTable)
|
||||
@@ -421,14 +388,7 @@ Partial Class Compras_Compras
|
||||
ViewState("PUSerieLote") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TotAcarreos As Double
|
||||
Get
|
||||
Return CType(ViewState("TotAcarreos"), Double)
|
||||
End Get
|
||||
Set(value As Double)
|
||||
ViewState("TotAcarreos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
<Serializable>
|
||||
Public Class Anticipos
|
||||
@@ -702,6 +662,7 @@ Partial Class Compras_Compras
|
||||
Private Property Descuentos As Decimal = 0
|
||||
Private Property Amortizaciones As Decimal = 0
|
||||
Private Property EmisorRFC As String
|
||||
Private Property EmisorRegimenFiscal As String
|
||||
Private Property ReceptorRFC As String
|
||||
Private Property TrasladoIVA As Decimal = 0
|
||||
Private Property RetencionIVA As Decimal = 0
|
||||
@@ -1257,7 +1218,6 @@ Partial Class Compras_Compras
|
||||
CveMetodoPago = -1
|
||||
RFCProveedor = ""
|
||||
CargaDdlTipoGasto()
|
||||
CreaTmpAcarreos()
|
||||
EsContado = False
|
||||
CierrePeriodo = False
|
||||
NCDevolucion = False
|
||||
@@ -1292,7 +1252,6 @@ Partial Class Compras_Compras
|
||||
'VALIDACION DE XML
|
||||
NuevaValidacionXML = IfNull(Request("NuevaValidacionXML"), 0).ToString.ToEntero
|
||||
|
||||
IdVale = New List(Of Integer)
|
||||
ListaDocumentos = New List(Of String)
|
||||
|
||||
TotalGeneral = 0
|
||||
@@ -1372,11 +1331,16 @@ Partial Class Compras_Compras
|
||||
DdlPersonal.DataSource = dtpersonal 'ObjPersonal.DtResultados
|
||||
DdlPersonalReembolso.DataSource = dtpersonal.FiltraParametros("CveEstatusPersonal = 1")
|
||||
|
||||
|
||||
'ObjPersonal.Dispose()
|
||||
DdlPersonal.DataBind()
|
||||
DdlPersonalReembolso.DataBind()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
UPPMedicosGastos.Visible = True
|
||||
DdlMedico.DataSource = GlobalDTMedicos(UsuarioActual.CveEmpresa)
|
||||
DdlMedico.DataBind()
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
|
||||
DVCultivosCuadro.Visible = True
|
||||
DdlSubProyecto.AutoPostBack = True
|
||||
@@ -1979,13 +1943,12 @@ Partial Class Compras_Compras
|
||||
|
||||
If impuesto = "001" Then
|
||||
impuesto = "Retención ISR"
|
||||
If ValorXML(retencion, "TasaOCuota").Trim.ToDecimal = 0.0125 Then RetISRResico = True
|
||||
ElseIf impuesto = "002" Then
|
||||
impuesto = "Retención IVA"
|
||||
ElseIf impuesto = "003" Then
|
||||
impuesto = "IEPS"
|
||||
End If
|
||||
|
||||
|
||||
' Validar si Base coincide con Importe
|
||||
If baseValue <> importeValue Then
|
||||
'SbValRet.Append($"La base e importe de la retención del impuesto {impuesto} no coinciden para {descripcion}. Base: {baseValue.ToString()}, Importe: {importeValue.ToString()} <br>")
|
||||
@@ -2022,13 +1985,14 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
If EmisorRegimenFiscal = "626" AndAlso Not RetISRResico Then
|
||||
SbValRet.Append(" La factura no tiene especificado una retención de ISR, ya que el proveedor es Resico. <br/>")
|
||||
End If
|
||||
|
||||
If SbValRet.ToString.Trim.Length > 0 Then
|
||||
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
CargaConceptosXML(XMLDoc)
|
||||
End If
|
||||
@@ -3312,6 +3276,14 @@ Partial Class Compras_Compras
|
||||
BtnEliminarCompra.Visible = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
If ObjCompra.GetGastoMedicos(CveCompra) Then
|
||||
DTMedicos = ObjCompra.DtResultados
|
||||
GvMedicosGastos.DataSource = ObjCompra.DtResultados
|
||||
GvMedicosGastos.DataBind()
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert("La compra solicitada no se encontró. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
@@ -3462,12 +3434,6 @@ Partial Class Compras_Compras
|
||||
Deudores.Dispose()
|
||||
End Sub
|
||||
|
||||
Private Sub CreaTmpAcarreos()
|
||||
tDTAcarreos = New DataTable
|
||||
tDTAcarreos.Columns.Add("CvePreEstimacion", GetType(Integer))
|
||||
tDTAcarreos.Columns.Add("Importe", GetType(Double))
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaAcreedores()
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
|
||||
@@ -5096,6 +5062,15 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End Select
|
||||
End Select
|
||||
End If
|
||||
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||
If DTMedicos IsNot Nothing AndAlso DTMedicos.Rows.Count > 0 Then
|
||||
|
||||
For Each dr As DataRow In DTMedicos.Rows
|
||||
ObjCompras.AddGastoMedicos(CveCompra, dr("CveMedico").ToString.ToEntero, -1)
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
'-------INICIA U S A A C -------------------------------------------------------------------
|
||||
'If UsuarioActual.Empresa.UsaAC AndAlso Not TieneError Then
|
||||
@@ -5465,18 +5440,6 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
'Vincula Vales
|
||||
'If IdVale.Count > 0 Then
|
||||
' For Each cve As Integer In IdVale
|
||||
' If Not ObjAF.UpdateValeCombustible(cve, CveCompra, -1, "", -1, -1, -1, UsuarioActual.CveEmpresa) Then
|
||||
' ErrorAF = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
'AGREGA AF COMPRA - Cuando es Compra se guarda CveCompraDetalle en AF
|
||||
If Row("TipoAF").ToString.ToEntero = 2 Then
|
||||
Dim Valor As Decimal = Row("Total").ToString.ToDecimal
|
||||
@@ -9951,14 +9914,15 @@ Partial Class Compras_Compras
|
||||
Dim node As XmlNode
|
||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces)
|
||||
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
If node IsNot Nothing Then
|
||||
EmisorRFC = ValorXML(node, "RFC")
|
||||
EmisorRegimenFiscal = ValorXML(node, "RegimenFiscal")
|
||||
End If
|
||||
|
||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces)
|
||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", Prefijo), namespaces)
|
||||
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
If node IsNot Nothing Then
|
||||
ReceptorRFC = ValorXML(node, "RFC")
|
||||
End If
|
||||
|
||||
@@ -18579,7 +18543,7 @@ Partial Class Compras_Compras
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, "-1", "-1") Then
|
||||
GvFacturaNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0")
|
||||
TmpCXP = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0")
|
||||
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
GvFacturaNC.DataBind()
|
||||
@@ -21457,6 +21421,32 @@ Partial Class Compras_Compras
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "Gastos de médicos"
|
||||
Protected Sub LnkAddMedico_Click(sender As Object, e As EventArgs)
|
||||
|
||||
'agregar un médico al listado
|
||||
|
||||
Dim trow As DataRow = DTMedicos.NewRow
|
||||
trow("CveMedico") = DdlMedico.SelectedValue
|
||||
trow("Medico") = DdlMedico.SelectedItem.Text
|
||||
DTMedicos.Rows.Add(trow)
|
||||
GvMedicosGastos.DataSource = DTMedicos
|
||||
GvMedicosGastos.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkEliminarMedico_Click(sender As Object, e As EventArgs)
|
||||
Dim btn As LinkButton = CType(sender, LinkButton)
|
||||
Dim gvr As GridViewRow = CType(btn.NamingContainer, GridViewRow)
|
||||
|
||||
Dim DTIndex = gvr.RowIndex
|
||||
DTMedicos.Rows(DTIndex).Delete()
|
||||
DTMedicos.AcceptChanges()
|
||||
GvMedicosGastos.DataSource = DTMedicos
|
||||
GvMedicosGastos.DataBind()
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user