- registro de gastos de médicos
This commit is contained in:
@@ -3484,6 +3484,60 @@ Public Class ClsCompras
|
|||||||
|
|
||||||
|
|
||||||
End Function
|
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
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -874,7 +874,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<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">
|
<asp:UpdatePanel ID="UPPAnticiposSel" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<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="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" />
|
<asp:Button runat="server" ID="BtnProrateoDeducible" Visible="false" Text="Prorratear 8.5%" CommandArgument="Prorratear Deducible" CssClass="btn btn-success" />
|
||||||
</div>
|
</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">
|
<asp:UpdatePanel ID="UpDVAtencionOCAnticipo" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|||||||
@@ -74,23 +74,7 @@ Partial Class Compras_Compras
|
|||||||
ViewState("TmpDTOriginal") = value
|
ViewState("TmpDTOriginal") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
Private Property DtCheques As DataTable
|
||||||
Get
|
Get
|
||||||
Return CType(ViewState("DtCheques"), DataTable)
|
Return CType(ViewState("DtCheques"), DataTable)
|
||||||
@@ -109,15 +93,6 @@ Partial Class Compras_Compras
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
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)
|
Public Property ListaDocumentos As List(Of String)
|
||||||
Get
|
Get
|
||||||
ListaDocumentos = DirectCast(ViewState("ListaDocumentos"), List(Of String))
|
ListaDocumentos = DirectCast(ViewState("ListaDocumentos"), List(Of String))
|
||||||
@@ -161,30 +136,22 @@ Partial Class Compras_Compras
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
'Private Property DtCuentas As DataTable
|
Private Property DTMedicos 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
|
|
||||||
Get
|
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
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
ViewState("tDTAcarreos") = value
|
ViewState("DTMedicos") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Private Property DtDeudores As DataTable
|
Private Property DtDeudores As DataTable
|
||||||
Get
|
Get
|
||||||
Return CType(ViewState("DtDeudores"), DataTable)
|
Return CType(ViewState("DtDeudores"), DataTable)
|
||||||
@@ -421,14 +388,7 @@ Partial Class Compras_Compras
|
|||||||
ViewState("PUSerieLote") = value
|
ViewState("PUSerieLote") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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>
|
<Serializable>
|
||||||
Public Class Anticipos
|
Public Class Anticipos
|
||||||
@@ -702,6 +662,7 @@ Partial Class Compras_Compras
|
|||||||
Private Property Descuentos As Decimal = 0
|
Private Property Descuentos As Decimal = 0
|
||||||
Private Property Amortizaciones As Decimal = 0
|
Private Property Amortizaciones As Decimal = 0
|
||||||
Private Property EmisorRFC As String
|
Private Property EmisorRFC As String
|
||||||
|
Private Property EmisorRegimenFiscal As String
|
||||||
Private Property ReceptorRFC As String
|
Private Property ReceptorRFC As String
|
||||||
Private Property TrasladoIVA As Decimal = 0
|
Private Property TrasladoIVA As Decimal = 0
|
||||||
Private Property RetencionIVA As Decimal = 0
|
Private Property RetencionIVA As Decimal = 0
|
||||||
@@ -1257,7 +1218,6 @@ Partial Class Compras_Compras
|
|||||||
CveMetodoPago = -1
|
CveMetodoPago = -1
|
||||||
RFCProveedor = ""
|
RFCProveedor = ""
|
||||||
CargaDdlTipoGasto()
|
CargaDdlTipoGasto()
|
||||||
CreaTmpAcarreos()
|
|
||||||
EsContado = False
|
EsContado = False
|
||||||
CierrePeriodo = False
|
CierrePeriodo = False
|
||||||
NCDevolucion = False
|
NCDevolucion = False
|
||||||
@@ -1292,7 +1252,6 @@ Partial Class Compras_Compras
|
|||||||
'VALIDACION DE XML
|
'VALIDACION DE XML
|
||||||
NuevaValidacionXML = IfNull(Request("NuevaValidacionXML"), 0).ToString.ToEntero
|
NuevaValidacionXML = IfNull(Request("NuevaValidacionXML"), 0).ToString.ToEntero
|
||||||
|
|
||||||
IdVale = New List(Of Integer)
|
|
||||||
ListaDocumentos = New List(Of String)
|
ListaDocumentos = New List(Of String)
|
||||||
|
|
||||||
TotalGeneral = 0
|
TotalGeneral = 0
|
||||||
@@ -1372,11 +1331,16 @@ Partial Class Compras_Compras
|
|||||||
DdlPersonal.DataSource = dtpersonal 'ObjPersonal.DtResultados
|
DdlPersonal.DataSource = dtpersonal 'ObjPersonal.DtResultados
|
||||||
DdlPersonalReembolso.DataSource = dtpersonal.FiltraParametros("CveEstatusPersonal = 1")
|
DdlPersonalReembolso.DataSource = dtpersonal.FiltraParametros("CveEstatusPersonal = 1")
|
||||||
|
|
||||||
|
|
||||||
'ObjPersonal.Dispose()
|
'ObjPersonal.Dispose()
|
||||||
DdlPersonal.DataBind()
|
DdlPersonal.DataBind()
|
||||||
DdlPersonalReembolso.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
|
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
|
||||||
DVCultivosCuadro.Visible = True
|
DVCultivosCuadro.Visible = True
|
||||||
DdlSubProyecto.AutoPostBack = True
|
DdlSubProyecto.AutoPostBack = True
|
||||||
@@ -1979,13 +1943,12 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
If impuesto = "001" Then
|
If impuesto = "001" Then
|
||||||
impuesto = "Retención ISR"
|
impuesto = "Retención ISR"
|
||||||
|
If ValorXML(retencion, "TasaOCuota").Trim.ToDecimal = 0.0125 Then RetISRResico = True
|
||||||
ElseIf impuesto = "002" Then
|
ElseIf impuesto = "002" Then
|
||||||
impuesto = "Retención IVA"
|
impuesto = "Retención IVA"
|
||||||
ElseIf impuesto = "003" Then
|
ElseIf impuesto = "003" Then
|
||||||
impuesto = "IEPS"
|
impuesto = "IEPS"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
' Validar si Base coincide con Importe
|
' Validar si Base coincide con Importe
|
||||||
If baseValue <> importeValue Then
|
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>")
|
'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
|
||||||
End If
|
End If
|
||||||
Next
|
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
|
If SbValRet.ToString.Trim.Length > 0 Then
|
||||||
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
|
Alert(SbValRet.ToString, TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
CargaConceptosXML(XMLDoc)
|
CargaConceptosXML(XMLDoc)
|
||||||
End If
|
End If
|
||||||
@@ -3312,6 +3276,14 @@ Partial Class Compras_Compras
|
|||||||
BtnEliminarCompra.Visible = False
|
BtnEliminarCompra.Visible = False
|
||||||
End If
|
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
|
Else
|
||||||
Alert("La compra solicitada no se encontró. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
Alert("La compra solicitada no se encontró. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
@@ -3462,12 +3434,6 @@ Partial Class Compras_Compras
|
|||||||
Deudores.Dispose()
|
Deudores.Dispose()
|
||||||
End Sub
|
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()
|
Protected Sub CargaAcreedores()
|
||||||
Dim ObjMov As New ClsMovimientos
|
Dim ObjMov As New ClsMovimientos
|
||||||
|
|
||||||
@@ -5097,306 +5063,315 @@ Partial Class Compras_Compras
|
|||||||
End Select
|
End Select
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
'-------INICIA U S A A C -------------------------------------------------------------------
|
If UsuarioActual.Empresa.Funcionalidad(578) = "1" Then
|
||||||
'If UsuarioActual.Empresa.UsaAC AndAlso Not TieneError Then
|
If DTMedicos IsNot Nothing AndAlso DTMedicos.Rows.Count > 0 Then
|
||||||
|
|
||||||
' If TotalPorDevengar <= TxtTotal.Text.ToDouble And TotalPorDevengar > 0 Then
|
For Each dr As DataRow In DTMedicos.Rows
|
||||||
' ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
|
ObjCompras.AddGastoMedicos(CveCompra, dr("CveMedico").ToString.ToEntero, -1)
|
||||||
' ObjContaAC.IniciaTransacSQL()
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
' ''POLIZA COMPROMETIDO SOLO SI NO SE VINCULA OC
|
End If
|
||||||
' If HdnVCveOC.Value.ToEntero > 0 Then
|
'-------INICIA U S A A C -------------------------------------------------------------------
|
||||||
|
'If UsuarioActual.Empresa.UsaAC AndAlso Not TieneError Then
|
||||||
|
|
||||||
' IDPolizaComprometido = 1
|
' If TotalPorDevengar <= TxtTotal.Text.ToDouble And TotalPorDevengar > 0 Then
|
||||||
' TotalPorDevengar = TotalPorDevengar * 2
|
' ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
' Else
|
' ObjContaAC.IniciaTransacSQL()
|
||||||
' TotalPorDevengar = TotalPorDevengar * 3
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' IdPoliza = ObjContaAC.AddPoliza(3, TxtDescripcion.Text.Trim, TotalPorDevengar, TotalPorDevengar, UsuarioActual.CveUsuario, TxtFecha.Text.ToDate)
|
' ''POLIZA COMPROMETIDO SOLO SI NO SE VINCULA OC
|
||||||
|
' If HdnVCveOC.Value.ToEntero > 0 Then
|
||||||
|
|
||||||
' 'Dim filtro As New StringBuilder
|
' IDPolizaComprometido = 1
|
||||||
' If IdPoliza > 0 Then
|
' TotalPorDevengar = TotalPorDevengar * 2
|
||||||
' PolizaFolio = ObjContaAC.Folio
|
' Else
|
||||||
' 'Dim RegistroMatriz As DataRow
|
' TotalPorDevengar = TotalPorDevengar * 3
|
||||||
' 'Dim CuentaCargo As Integer
|
' End If
|
||||||
' Dim CuentaAbono As Integer
|
|
||||||
' Dim Importe As Decimal
|
|
||||||
|
|
||||||
' 'CUENTA PROVEEDOR
|
' IdPoliza = ObjContaAC.AddPoliza(3, TxtDescripcion.Text.Trim, TotalPorDevengar, TotalPorDevengar, UsuarioActual.CveUsuario, TxtFecha.Text.ToDate)
|
||||||
' 'If tIdContaProveedor <= 0 Then
|
|
||||||
' ' 'normalmente debe de ser la cuenta 021120000000000000, para el caso de APH, se el cmabio al 2119
|
|
||||||
' ' If ObjContaAC.GetCuentas(-1, "021190000000000000", -1) Then
|
|
||||||
' ' Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("")
|
|
||||||
' ' If drCuenta IsNot Nothing Then
|
|
||||||
|
|
||||||
' ' CuentaAbono = drCuenta("Id").ToString.ToEntero
|
' 'Dim filtro As New StringBuilder
|
||||||
' ' Dim FolioProveedor = ObjContaAC.GetFolioProveedores("021190000000000000").ToString
|
' If IdPoliza > 0 Then
|
||||||
' ' ViewState("CtaProveedor") = ObjContaAC.AddCuenta(String.Format("02119{0}000000000", FolioProveedor.PadLeft(4, "0"c)), NombreProveedor, "D", 2, 0, 1, 0, "", 1, CuentaAbono)
|
' PolizaFolio = ObjContaAC.Folio
|
||||||
' ' ObjProveedores.UpdateProveedorIdCuentaAC(CveProveedor, CtaProveedor)
|
' 'Dim RegistroMatriz As DataRow
|
||||||
|
' 'Dim CuentaCargo As Integer
|
||||||
|
' Dim CuentaAbono As Integer
|
||||||
|
' Dim Importe As Decimal
|
||||||
|
|
||||||
|
' 'CUENTA PROVEEDOR
|
||||||
|
' 'If tIdContaProveedor <= 0 Then
|
||||||
|
' ' 'normalmente debe de ser la cuenta 021120000000000000, para el caso de APH, se el cmabio al 2119
|
||||||
|
' ' If ObjContaAC.GetCuentas(-1, "021190000000000000", -1) Then
|
||||||
|
' ' Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("")
|
||||||
|
' ' If drCuenta IsNot Nothing Then
|
||||||
|
|
||||||
|
' ' CuentaAbono = drCuenta("Id").ToString.ToEntero
|
||||||
|
' ' Dim FolioProveedor = ObjContaAC.GetFolioProveedores("021190000000000000").ToString
|
||||||
|
' ' ViewState("CtaProveedor") = ObjContaAC.AddCuenta(String.Format("02119{0}000000000", FolioProveedor.PadLeft(4, "0"c)), NombreProveedor, "D", 2, 0, 1, 0, "", 1, CuentaAbono)
|
||||||
|
' ' ObjProveedores.UpdateProveedorIdCuentaAC(CveProveedor, CtaProveedor)
|
||||||
|
|
||||||
|
|
||||||
' ' Else
|
' ' Else
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' ErrorACMEnsaje.Append(" - DrCuenta Nula")
|
' ' ErrorACMEnsaje.Append(" - DrCuenta Nula")
|
||||||
' ' End If
|
' ' End If
|
||||||
' ' Else
|
' ' Else
|
||||||
' ' ErrorACMEnsaje.Append(" - Error al consultar cuenta 021190000000000000 ")
|
' ' ErrorACMEnsaje.Append(" - Error al consultar cuenta 021190000000000000 ")
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' End If
|
' ' End If
|
||||||
' 'End If
|
' 'End If
|
||||||
|
|
||||||
' Dim ConceptoRenglon As String = ""
|
' Dim ConceptoRenglon As String = ""
|
||||||
' If Not ErrorAC Then
|
' If Not ErrorAC Then
|
||||||
|
|
||||||
|
|
||||||
' 'INVENTARIOS EN AC
|
' 'INVENTARIOS EN AC
|
||||||
' Dim ContadorInventario As Integer = GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked)
|
' Dim ContadorInventario As Integer = GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked)
|
||||||
|
|
||||||
' Dim tTotalIVA, tTotalGral, tDiferenciaIVA, tIVA, tRetIVA, tRetISR As Decimal
|
' Dim tTotalIVA, tTotalGral, tDiferenciaIVA, tIVA, tRetIVA, tRetISR As Decimal
|
||||||
' Dim ipresup As Integer = 0
|
' Dim ipresup As Integer = 0
|
||||||
' 'COMIENZA: PRUEBA AGRUPACION CONCEPTOS
|
' 'COMIENZA: PRUEBA AGRUPACION CONCEPTOS
|
||||||
' Dim Presup = From gvr As DataRow In TmpDT.Rows.Cast(Of DataRow)()
|
' Dim Presup = From gvr As DataRow In TmpDT.Rows.Cast(Of DataRow)()
|
||||||
' Group gvr By Grp = New With {
|
' Group gvr By Grp = New With {
|
||||||
' Key .CvePresupuestoEgreso = gvr("CvePresupuestoEgreso").ToString.ToEntero,
|
' Key .CvePresupuestoEgreso = gvr("CvePresupuestoEgreso").ToString.ToEntero,
|
||||||
' Key .CveOrdencompraDetalle = If(gvr("CveOrdencompraDetalle").ToString.ToEntero > 0, 1, -1),
|
' Key .CveOrdencompraDetalle = If(gvr("CveOrdencompraDetalle").ToString.ToEntero > 0, 1, -1),
|
||||||
' Key .CveActivoFijo = If(gvr("TipoAF").ToString.ToEntero = 2, gvr("CveActivoFijo").ToString.ToEntero, -1)
|
' Key .CveActivoFijo = If(gvr("TipoAF").ToString.ToEntero = 2, gvr("CveActivoFijo").ToString.ToEntero, -1)
|
||||||
' } Into Group
|
' } Into Group
|
||||||
' Select Grp.CvePresupuestoEgreso, Grp.CveActivoFijo, Grp.CveOrdencompraDetalle,
|
' Select Grp.CvePresupuestoEgreso, Grp.CveActivoFijo, Grp.CveOrdencompraDetalle,
|
||||||
' TotalImporte = Group.Sum(Function(r) r("Total").ToString.ToDecimal)
|
' TotalImporte = Group.Sum(Function(r) r("Total").ToString.ToDecimal)
|
||||||
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||||
|
|
||||||
' 'Dim tTotalIVA, tTotalGral, tDiferenciaIVA, tIVA As Double
|
' 'Dim tTotalIVA, tTotalGral, tDiferenciaIVA, tIVA As Double
|
||||||
' tTotalIVA = TxtIVA.Text.ToDecimal
|
' tTotalIVA = TxtIVA.Text.ToDecimal
|
||||||
' tRetIVA = TxtRetIVA.Text.ToDecimal
|
' tRetIVA = TxtRetIVA.Text.ToDecimal
|
||||||
' tRetISR = TxtRetISR.Text.ToDecimal
|
' tRetISR = TxtRetISR.Text.ToDecimal
|
||||||
|
|
||||||
' 'tTotalIVA = tTotalIVA - tRetIVA - tRetISR
|
' 'tTotalIVA = tTotalIVA - tRetIVA - tRetISR
|
||||||
|
|
||||||
' tTotalGral = TxtTotal.Text.ToDecimal + tRetIVA + tRetISR ' EL TOTAL GENERAL DEBE DE SER EL SUBTOTAL + IVA, NO SE DEBEN DE INCLUIR LAS RETENCIONES, POR ESO SE RESTA
|
' tTotalGral = TxtTotal.Text.ToDecimal + tRetIVA + tRetISR ' EL TOTAL GENERAL DEBE DE SER EL SUBTOTAL + IVA, NO SE DEBEN DE INCLUIR LAS RETENCIONES, POR ESO SE RESTA
|
||||||
' tDiferenciaIVA = tTotalIVA
|
' tDiferenciaIVA = tTotalIVA
|
||||||
|
|
||||||
' ipresup = 0
|
' ipresup = 0
|
||||||
|
|
||||||
' Dim CuentaMatrizAlmacen As Integer
|
' Dim CuentaMatrizAlmacen As Integer
|
||||||
|
|
||||||
' 'PresupuestoEgresos
|
' 'PresupuestoEgresos
|
||||||
' Dim DtPresupuestosTemp As DataTable
|
' Dim DtPresupuestosTemp As DataTable
|
||||||
' Dim IdCuentaComprometido, IdCuentaPorEjercer, IdCuentaDevengado, IdCuentaMatriz As Integer
|
' Dim IdCuentaComprometido, IdCuentaPorEjercer, IdCuentaDevengado, IdCuentaMatriz As Integer
|
||||||
' ' Dim DescuentoConIVA As Decimal
|
' ' Dim DescuentoConIVA As Decimal
|
||||||
' Dim tPorIVA As Decimal = tTotalIVA / (tTotalGral - tTotalIVA)
|
' Dim tPorIVA As Decimal = tTotalIVA / (tTotalGral - tTotalIVA)
|
||||||
' Dim tAjusteTotal As Decimal
|
' Dim tAjusteTotal As Decimal
|
||||||
|
|
||||||
' For Each grp In Presup
|
' For Each grp In Presup
|
||||||
' Importe = grp.TotalImporte
|
' Importe = grp.TotalImporte
|
||||||
' TotalDetalle += Importe
|
' TotalDetalle += Importe
|
||||||
' ipresup += 1
|
' ipresup += 1
|
||||||
' If Importe > 0 Then
|
' If Importe > 0 Then
|
||||||
' 'saco la proporcion de iva que le corresponde
|
' 'saco la proporcion de iva que le corresponde
|
||||||
' tIVA = Math.Round(Importe * tPorIVA, 2)
|
' tIVA = Math.Round(Importe * tPorIVA, 2)
|
||||||
' tDiferenciaIVA -= tIVA
|
' tDiferenciaIVA -= tIVA
|
||||||
' 'identifico si es el ultimo registro, para ver si es necesario un ajuste
|
' 'identifico si es el ultimo registro, para ver si es necesario un ajuste
|
||||||
' If ipresup = Presup.Count Then
|
' If ipresup = Presup.Count Then
|
||||||
' If Math.Round(TotalDetalle - tTotalGral, 2) <= 0.01 AndAlso tDiferenciaIVA > 0 Then
|
' If Math.Round(TotalDetalle - tTotalGral, 2) <= 0.01 AndAlso tDiferenciaIVA > 0 Then
|
||||||
' tIVA += tDiferenciaIVA
|
' tIVA += tDiferenciaIVA
|
||||||
' End If
|
' End If
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' 'le sumo el iva al concepto
|
' 'le sumo el iva al concepto
|
||||||
' Importe += tIVA
|
' Importe += tIVA
|
||||||
|
|
||||||
' 'codigo Provisional, para cuand tenga descuento, solo tome el subtotal * el iva,RMF
|
' 'codigo Provisional, para cuand tenga descuento, solo tome el subtotal * el iva,RMF
|
||||||
' If TxtDescuento.Text.ToDouble > 0 Then
|
' If TxtDescuento.Text.ToDouble > 0 Then
|
||||||
' Importe = grp.TotalImporte * 1.16D
|
' Importe = grp.TotalImporte * 1.16D
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' tAjusteTotal += Importe
|
' tAjusteTotal += Importe
|
||||||
' 'valido que la sumas de lo detalles no exceda al totalgeneral
|
' 'valido que la sumas de lo detalles no exceda al totalgeneral
|
||||||
' If Math.Round(tAjusteTotal, 2) > tTotalGral Then
|
' If Math.Round(tAjusteTotal, 2) > tTotalGral Then
|
||||||
' 'le resto la diferencia
|
' 'le resto la diferencia
|
||||||
' Importe -= (tAjusteTotal - tTotalGral)
|
' Importe -= (tAjusteTotal - tTotalGral)
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' 'Presupuesto Egresos
|
' 'Presupuesto Egresos
|
||||||
' DtPresupuestosTemp = DtPresupuestos.FiltraParametros(String.Format("CvePresupuestoEgreso = {0}", grp.CvePresupuestoEgreso))
|
' DtPresupuestosTemp = DtPresupuestos.FiltraParametros(String.Format("CvePresupuestoEgreso = {0}", grp.CvePresupuestoEgreso))
|
||||||
' If DtPresupuestosTemp.Rows.Count <> 1 Then
|
' If DtPresupuestosTemp.Rows.Count <> 1 Then
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' ErrorACMEnsaje.Append(" - DtPresupuestosTemp.Rows.Count <> 1 ")
|
' ErrorACMEnsaje.Append(" - DtPresupuestosTemp.Rows.Count <> 1 ")
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
' IdCuentaComprometido = DtPresupuestosTemp.Rows(0)("IdCuentaComprometido").ToString.ToEntero
|
' IdCuentaComprometido = DtPresupuestosTemp.Rows(0)("IdCuentaComprometido").ToString.ToEntero
|
||||||
' IdCuentaPorEjercer = DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero
|
' IdCuentaPorEjercer = DtPresupuestosTemp.Rows(0)("IdCuentaPorEjercer").ToString.ToEntero
|
||||||
' IdCuentaDevengado = DtPresupuestosTemp.Rows(0)("IdCuentaDevengado").ToString.ToEntero
|
' IdCuentaDevengado = DtPresupuestosTemp.Rows(0)("IdCuentaDevengado").ToString.ToEntero
|
||||||
' IdCuentaMatriz = DtPresupuestosTemp.Rows(0)("IdCuentaMatriz").ToString.ToEntero
|
' IdCuentaMatriz = DtPresupuestosTemp.Rows(0)("IdCuentaMatriz").ToString.ToEntero
|
||||||
|
|
||||||
' 'COMPROMETIDO DEPENDIENTE SI EXISTE SU POLIZA
|
' 'COMPROMETIDO DEPENDIENTE SI EXISTE SU POLIZA
|
||||||
' If grp.CveOrdencompraDetalle = -1 Then
|
' If grp.CveOrdencompraDetalle = -1 Then
|
||||||
' ConceptoRenglon = String.Format("GC Fact: {0}-{1} {2}", TxtSerie.Text.Trim, TxtFolio.Text.Trim, DdlProveedor.SelectedItem.Text)
|
' ConceptoRenglon = String.Format("GC Fact: {0}-{1} {2}", TxtSerie.Text.Trim, TxtFolio.Text.Trim, DdlProveedor.SelectedItem.Text)
|
||||||
' If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaComprometido, False, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
' If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaComprometido, False, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaPorEjercer, True, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
' If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaPorEjercer, True, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 1")
|
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 1")
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 2")
|
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 2")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' ConceptoRenglon = String.Format("GD Fact:{0}-{1} {2}", TxtSerie.Text.Trim, TxtFolio.Text.Trim, DdlProveedor.SelectedItem.Text)
|
' ConceptoRenglon = String.Format("GD Fact:{0}-{1} {2}", TxtSerie.Text.Trim, TxtFolio.Text.Trim, DdlProveedor.SelectedItem.Text)
|
||||||
' 'DEVENGADO
|
' 'DEVENGADO
|
||||||
' If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaDevengado, False, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
' If ObjContaAC.AddMovimiento(IdPoliza, IdCuentaDevengado, False, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaComprometido, True, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
' If Not ObjContaAC.AddMovimiento(IdPoliza, IdCuentaComprometido, True, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 3")
|
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 3")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 4")
|
' ErrorACMEnsaje.Append(" - Error al agregar movimiento contabilidad 4")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' If ContadorInventario > 0 Then
|
' If ContadorInventario > 0 Then
|
||||||
|
|
||||||
' ' CuentaMatrizAlmacen = CtaAlmacen
|
' ' CuentaMatrizAlmacen = CtaAlmacen
|
||||||
' ElseIf grp.CveActivoFijo > 0 Then
|
' ElseIf grp.CveActivoFijo > 0 Then
|
||||||
|
|
||||||
' Dim CtaAF As Integer = -1
|
' Dim CtaAF As Integer = -1
|
||||||
' Dim AF As String = ""
|
' Dim AF As String = ""
|
||||||
' Dim CuentaInicial As Integer = -1
|
' Dim CuentaInicial As Integer = -1
|
||||||
|
|
||||||
' If ObjAF.GetActivosFijos(grp.CveActivoFijo, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "", -1, UsuarioActual.CveEmpresa) Then
|
' If ObjAF.GetActivosFijos(grp.CveActivoFijo, UsuarioActual.CveEmpresa, "-1", "-1", -1, -1, "-1", -1, -1, -1, -1, -1, "", -1, UsuarioActual.CveEmpresa) Then
|
||||||
' CtaAF = ObjAF.Cuenta
|
' CtaAF = ObjAF.Cuenta
|
||||||
' AF = ObjAF.Descripcion
|
' AF = ObjAF.Descripcion
|
||||||
' CuentaInicial = ObjAF.CuentaInicial
|
' CuentaInicial = ObjAF.CuentaInicial
|
||||||
' Else
|
' Else
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' ErrorACMEnsaje.Append(" - Error al obtener activos fijos ")
|
' ErrorACMEnsaje.Append(" - Error al obtener activos fijos ")
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' If Not CuentaInicial > 0 Then
|
' If Not CuentaInicial > 0 Then
|
||||||
' CuentaInicial = 1241
|
' CuentaInicial = 1241
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' 'CUENTA AF
|
' 'CUENTA AF
|
||||||
' If CtaAF <= 0 Then
|
' If CtaAF <= 0 Then
|
||||||
' If ObjContaAC.GetCuentas(-1, String.Format("0{0}0000000000000", CuentaInicial), -1) Then
|
' If ObjContaAC.GetCuentas(-1, String.Format("0{0}0000000000000", CuentaInicial), -1) Then
|
||||||
' Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("")
|
' Dim drCuenta As DataRow = ObjContaAC.DtResultados.FiltroPrimero("")
|
||||||
' If drCuenta IsNot Nothing Then
|
' If drCuenta IsNot Nothing Then
|
||||||
' ErrorACMEnsaje.Append(" - Error al obtener cuentas 0{0}0000000000000 drCuenta nula")
|
' ErrorACMEnsaje.Append(" - Error al obtener cuentas 0{0}0000000000000 drCuenta nula")
|
||||||
' CuentaAbono = drCuenta("Id").ToString.ToEntero
|
' CuentaAbono = drCuenta("Id").ToString.ToEntero
|
||||||
' Dim FolioAF As String = ObjContaAC.GetFolioProveedores(String.Format("0{0}0000000000000", CuentaInicial)).ToString
|
' Dim FolioAF As String = ObjContaAC.GetFolioProveedores(String.Format("0{0}0000000000000", CuentaInicial)).ToString
|
||||||
' CtaAF = ObjContaAC.AddCuenta(String.Format("0{0}{1}000000000", CuentaInicial, FolioAF.PadLeft(4, "0"c)), AF, "A", 2, 0, 1, 0, "", 1, CuentaAbono)
|
' CtaAF = ObjContaAC.AddCuenta(String.Format("0{0}{1}000000000", CuentaInicial, FolioAF.PadLeft(4, "0"c)), AF, "A", 2, 0, 1, 0, "", 1, CuentaAbono)
|
||||||
|
|
||||||
' ObjAF.UpdateActivosFijosCuentaAC(grp.CveActivoFijo, CtaAF, UsuarioActual.CveUsuario)
|
' ObjAF.UpdateActivosFijosCuentaAC(grp.CveActivoFijo, CtaAF, UsuarioActual.CveUsuario)
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - Error al obtener cuentas 0{0}0000000000000 drCuenta nulo")
|
' ErrorACMEnsaje.Append(" - Error al obtener cuentas 0{0}0000000000000 drCuenta nulo")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' End If
|
' End If
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - Error al obtener cuentas 0{0}0000000000000")
|
' ErrorACMEnsaje.Append(" - Error al obtener cuentas 0{0}0000000000000")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' End If
|
' End If
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' CuentaMatrizAlmacen = CtaAF
|
' CuentaMatrizAlmacen = CtaAF
|
||||||
' Else
|
' Else
|
||||||
' CuentaMatrizAlmacen = IdCuentaMatriz
|
' CuentaMatrizAlmacen = IdCuentaMatriz
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
' ''AFECTAR MATRIZ EGRESOS
|
' ''AFECTAR MATRIZ EGRESOS
|
||||||
' If ObjContaAC.AddMovimiento(IdPoliza, CuentaMatrizAlmacen, False, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
' If ObjContaAC.AddMovimiento(IdPoliza, CuentaMatrizAlmacen, False, MultiplicadorNC * Importe, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
|
|
||||||
|
|
||||||
' ''VERIFICA SI TIENE DESCUENTO (AMORTIZACION)
|
' ''VERIFICA SI TIENE DESCUENTO (AMORTIZACION)
|
||||||
' 'If TxtDescuento.Text.ToDouble > 0 Then
|
' 'If TxtDescuento.Text.ToDouble > 0 Then
|
||||||
' ' DescuentoConIVA = TxtDescuento.Text.ToDouble * 1.16
|
' ' DescuentoConIVA = TxtDescuento.Text.ToDouble * 1.16
|
||||||
|
|
||||||
' ' 'Valida que el descuento con iva cuadre en los totales
|
' ' 'Valida que el descuento con iva cuadre en los totales
|
||||||
' ' If Math.Abs(DescuentoConIVA - (Importe - TxtTotal.Text.ToDouble)) < 0.02 Then
|
' ' If Math.Abs(DescuentoConIVA - (Importe - TxtTotal.Text.ToDouble)) < 0.02 Then
|
||||||
' ' DescuentoConIVA = Importe - TxtTotal.Text.ToDouble
|
' ' DescuentoConIVA = Importe - TxtTotal.Text.ToDouble
|
||||||
' ' ElseIf DescuentoConIVA <> (Importe - TxtTotal.Text.ToDouble) Then
|
' ' ElseIf DescuentoConIVA <> (Importe - TxtTotal.Text.ToDouble) Then
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' Exit For
|
' ' Exit For
|
||||||
' ' End If
|
' ' End If
|
||||||
|
|
||||||
' ' 'actualizo el idcuenta del presupuesto
|
' ' 'actualizo el idcuenta del presupuesto
|
||||||
' ' If ObjContaAC.AddMovimiento(123456, IdPoliza, tIdContaProveedor, True, Importe - DescuentoConIVA, "", ConceptoRenglon, 0, Fecha, "") Then
|
' ' If ObjContaAC.AddMovimiento(123456, IdPoliza, tIdContaProveedor, True, Importe - DescuentoConIVA, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ' 'agrego a la cuenta contable anticipos
|
' ' 'agrego a la cuenta contable anticipos
|
||||||
' ' If Not ObjContaAC.AddMovimiento(123456, IdPoliza, CtaProveedorAnticipos, True, DescuentoConIVA, "", ConceptoRenglon, 0, Fecha, "") Then
|
' ' If Not ObjContaAC.AddMovimiento(123456, IdPoliza, CtaProveedorAnticipos, True, DescuentoConIVA, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' Exit For
|
' ' Exit For
|
||||||
' ' End If
|
' ' End If
|
||||||
' ' Else
|
' ' Else
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' Exit For
|
' ' Exit For
|
||||||
' ' End If
|
' ' End If
|
||||||
|
|
||||||
' 'Else
|
' 'Else
|
||||||
' ' 'actualizo el idcuenta del presupuesto
|
' ' 'actualizo el idcuenta del presupuesto
|
||||||
' ' Importe = TxtTotal.Text.ToDouble
|
' ' Importe = TxtTotal.Text.ToDouble
|
||||||
' ' If Not ObjContaAC.AddMovimiento(123456, IdPoliza, tIdContaProveedor, True, If(ArrAnticipos.Count > 0, ImporteAnticipo, Importe), "", ConceptoRenglon, 0, Fecha, "") Then
|
' ' If Not ObjContaAC.AddMovimiento(123456, IdPoliza, tIdContaProveedor, True, If(ArrAnticipos.Count > 0, ImporteAnticipo, Importe), "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' Exit For
|
' ' Exit For
|
||||||
' ' End If
|
' ' End If
|
||||||
|
|
||||||
' 'End If
|
' 'End If
|
||||||
|
|
||||||
|
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - Error AFECTAR MATRIZ EGRESOS ObjContaAC.AddMovimiento")
|
' ErrorACMEnsaje.Append(" - Error AFECTAR MATRIZ EGRESOS ObjContaAC.AddMovimiento")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
' ''TERMINA AFECTAR MATRIZ EGRESOS
|
' ''TERMINA AFECTAR MATRIZ EGRESOS
|
||||||
|
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - For Each grp In Presup Importe > 0 ")
|
' ErrorACMEnsaje.Append(" - For Each grp In Presup Importe > 0 ")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' Exit For
|
' Exit For
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' Next
|
' Next
|
||||||
|
|
||||||
' ''actualizo el idcuenta del presupuesto
|
' ''actualizo el idcuenta del presupuesto
|
||||||
' 'Importe = TxtTotal.Text.ToDecimal
|
' 'Importe = TxtTotal.Text.ToDecimal
|
||||||
' 'If Not ObjContaAC.AddMovimiento(IdPoliza, tIdContaProveedor, True, MultiplicadorNC * (If(ArrAnticipos.Count > 0, ImporteAnticipo, Importe)), "", ConceptoRenglon, 0, Fecha, "") Then
|
' 'If Not ObjContaAC.AddMovimiento(IdPoliza, tIdContaProveedor, True, MultiplicadorNC * (If(ArrAnticipos.Count > 0, ImporteAnticipo, Importe)), "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ' ErrorACMEnsaje.Append(" - actualizo el idcuenta del presupuesto ObjContaAC.AddMovimiento 3")
|
' ' ErrorACMEnsaje.Append(" - actualizo el idcuenta del presupuesto ObjContaAC.AddMovimiento 3")
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' 'End If
|
' 'End If
|
||||||
' 'End If
|
' 'End If
|
||||||
|
|
||||||
' 'If tRetISR > 0 Then 'CtaProveedorRetISR
|
' 'If tRetISR > 0 Then 'CtaProveedorRetISR
|
||||||
' ' ConceptoRenglon = String.Format("GD Fact: {0}-{1} {2}", TxtSerie.Text.Trim, TxtFolio.Text.Trim, DdlProveedor.SelectedItem.Text)
|
' ' ConceptoRenglon = String.Format("GD Fact: {0}-{1} {2}", TxtSerie.Text.Trim, TxtFolio.Text.Trim, DdlProveedor.SelectedItem.Text)
|
||||||
' ' If Not ObjContaAC.AddMovimiento(IdPoliza, 0, True, MultiplicadorNC * tRetISR, "", ConceptoRenglon, 0, Fecha, "") Then
|
' ' If Not ObjContaAC.AddMovimiento(IdPoliza, 0, True, MultiplicadorNC * tRetISR, "", ConceptoRenglon, 0, Fecha, "") Then
|
||||||
' ' ErrorACMEnsaje.Append(" RetISR > 0 ObjContaAC.AddMovimiento")
|
' ' ErrorACMEnsaje.Append(" RetISR > 0 ObjContaAC.AddMovimiento")
|
||||||
' ' ErrorAC = True
|
' ' ErrorAC = True
|
||||||
' ' End If
|
' ' End If
|
||||||
' 'End If
|
' 'End If
|
||||||
|
|
||||||
' 'TERMINA: PRUEBA AGRUPACION CONCEPTOS
|
' 'TERMINA: PRUEBA AGRUPACION CONCEPTOS
|
||||||
|
|
||||||
' 'registrar amortizar anticipos
|
' 'registrar amortizar anticipos
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
' Else
|
' Else
|
||||||
' ErrorACMEnsaje.Append(" - Id Poliza = 0 ")
|
' ErrorACMEnsaje.Append(" - Id Poliza = 0 ")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' End If
|
' End If
|
||||||
' Else
|
' Else
|
||||||
' TieneError = True
|
' TieneError = True
|
||||||
' ErrorACMEnsaje.Append("- TotalPorDevengar <= TxtTotal.Text.ToDouble And TotalPorDevengar > 0")
|
' ErrorACMEnsaje.Append("- TotalPorDevengar <= TxtTotal.Text.ToDouble And TotalPorDevengar > 0")
|
||||||
' ErrorAC = True
|
' ErrorAC = True
|
||||||
' End If
|
' End If
|
||||||
'End If
|
'End If
|
||||||
'-------FIN U S A A C -------------------------------------------------------------------
|
'-------FIN U S A A C -------------------------------------------------------------------
|
||||||
|
|
||||||
If Not ErrorAC AndAlso Not TieneError Then
|
If Not ErrorAC AndAlso Not TieneError Then
|
||||||
|
|
||||||
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
|
||||||
|
|
||||||
@@ -5465,18 +5440,6 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
End If
|
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
|
'AGREGA AF COMPRA - Cuando es Compra se guarda CveCompraDetalle en AF
|
||||||
If Row("TipoAF").ToString.ToEntero = 2 Then
|
If Row("TipoAF").ToString.ToEntero = 2 Then
|
||||||
Dim Valor As Decimal = Row("Total").ToString.ToDecimal
|
Dim Valor As Decimal = Row("Total").ToString.ToDecimal
|
||||||
@@ -9951,14 +9914,15 @@ Partial Class Compras_Compras
|
|||||||
Dim node As XmlNode
|
Dim node As XmlNode
|
||||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces)
|
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")
|
EmisorRFC = ValorXML(node, "RFC")
|
||||||
|
EmisorRegimenFiscal = ValorXML(node, "RegimenFiscal")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces)
|
node = XMLDoc.SelectSingleNode(String.Format("//{0}:CfdiRelacionados", Prefijo), namespaces)
|
||||||
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Receptor", 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")
|
ReceptorRFC = ValorXML(node, "RFC")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -18579,7 +18543,7 @@ Partial Class Compras_Compras
|
|||||||
Dim ObjMovtos As New ClsMovimientos()
|
Dim ObjMovtos As New ClsMovimientos()
|
||||||
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, "-1", "-1") Then
|
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, "-1", "-1") Then
|
||||||
GvFacturaNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0")
|
GvFacturaNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0")
|
||||||
TmpCXP = ObjMovtos.DtResultados.FiltraParametros("Saldo > 0")
|
|
||||||
End If
|
End If
|
||||||
ObjMovtos.Dispose()
|
ObjMovtos.Dispose()
|
||||||
GvFacturaNC.DataBind()
|
GvFacturaNC.DataBind()
|
||||||
@@ -21457,6 +21421,32 @@ Partial Class Compras_Compras
|
|||||||
#End Region
|
#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