5 Conta: Convertir un FyE a proveedor, en acciones, agregar,, debe ser acreedor, con datos fiscales 04 - 85
This commit is contained in:
@@ -131,6 +131,16 @@
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel runat="server" >
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkConvertirDeudor" OnClick="LnkConvertirDeudor_Click" runat="server" Visible="false">
|
||||
<i class="fa fa-share-square-o" aria-hidden="true"></i> Convertir en Deudor
|
||||
</asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
|
||||
|
||||
@@ -998,6 +998,12 @@ Partial Class RH_Personal
|
||||
CarcaConceptosNomina()
|
||||
CargaFonacot()
|
||||
End If
|
||||
|
||||
|
||||
ValidaDeudorAcreedor()
|
||||
|
||||
|
||||
|
||||
Else
|
||||
cargatipoTrabajador()
|
||||
MostrarOcultarFechasEstatus()
|
||||
@@ -8188,6 +8194,57 @@ Partial Class RH_Personal
|
||||
args.IsValid = retorno
|
||||
End Sub
|
||||
|
||||
Private Sub ValidaDeudorAcreedor()
|
||||
|
||||
Dim RFCval As String = TxtRFC.Text.Trim
|
||||
|
||||
If CvePersonal > 0 AndAlso (RFCval <> "-1" And RFCval <> "") Then
|
||||
Dim CveProveedor As Integer = GlobalDTCompProveedores(UsuarioActual.CveEmpresa, RFC:=TxtRFC.Text).FiltroPrimeroValor("CveProveedor").ToEntero
|
||||
If Not CveProveedor > 0 Then
|
||||
LnkConvertirDeudor.Visible = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkConvertirDeudor_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim ProcesoOK = True
|
||||
|
||||
Dim ObjProveedores As New ClsCompProveedores()
|
||||
Dim ObjCuentasDeposito As New ClsGenerales(ObjProveedores.IniciaTransacSQL())
|
||||
Dim NuevoCveProveedor As Integer = -1
|
||||
|
||||
Dim CveProveedorClasificacion As Integer = GlobalDTProveedorClasificacion(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveProveedorClasificacion").ToEntero
|
||||
|
||||
If ObjProveedores.AddProveedor(TxtCodigo.Text.Trim, TxtNombres.Text.Trim, TxtNombres.Text.Trim, TxtNombres.Text.Trim, TxtRFC.Text.Trim, $"{TxtCalle.Text} #{TxtNumExt.Text} {TxtColonia.Text}", TxtTelefono.Text.Trim.Replace("("c, "").Replace(")"c, "").Replace("-"c, "").Replace(" ", ""),
|
||||
TxtNombres.Text.Trim, TxtCorreo.Text.Trim, TxtCelularPersonal.Text.Trim.Replace("("c, "").Replace(")"c, "").Replace("-"c, "").Replace(" ", ""), 0, 0,
|
||||
TxtObservaciones.Text.Trim, 0, 0, 0,
|
||||
CveProveedorClasificacion, -1, TxtCorreo.Text.Trim, TxtCorreo.Text.Trim, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
2, 1, DIOTCveTipoTercero:=1, DIOTCveTipoOperacion:=3, CP:=TxtCP.Text.ToEntero, CveRegimenFiscal:=1) Then
|
||||
|
||||
NuevoCveProveedor = ObjProveedores.CveProveedor
|
||||
|
||||
Else
|
||||
ProcesoOK = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If ProcesoOK Then
|
||||
ObjCuentasDeposito.Commit()
|
||||
GlobalDTCompProveedores(UsuarioActual.CveEmpresa) = Nothing
|
||||
GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing
|
||||
Alert($"Deudor Agregado Correctamente <b><a target='_blank' href='../Compras/Proveedores.aspx?CveProveedor={NuevoCveProveedor}' class='Texto'>{TxtCodigo.Text.Trim}</a></b>")
|
||||
LnkConvertirDeudor.Visible = False
|
||||
Else
|
||||
ObjProveedores.RollBack()
|
||||
End If
|
||||
ObjProveedores.Dispose()
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user