filtra uso cfdi por regimen fiscal del cliente en cfdi 4.0, folio y fecha fijo al facturar remision
This commit is contained in:
@@ -1091,13 +1091,17 @@ Public Class ClsPaginas
|
||||
' Application("GlobalDTSucursales") = value
|
||||
' End Set
|
||||
'End Property
|
||||
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1) As DataTable
|
||||
Property GlobalDTSATUsosCFDI(Optional EsPersonaFisica As Integer = -1, Optional RegimenFiscalReceptor As String = "-1") As DataTable
|
||||
Get
|
||||
If EsPersonaFisica <> -1 Then
|
||||
Dim Tipo As String = ""
|
||||
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
|
||||
Dim Tipo As New StringBuilder
|
||||
If EsPersonaFisica = 1 Then Tipo.Append("AplicaPersonaFisica = 1") Else Tipo.Append("AplicaPersonaMoral = 1")
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable), Tipo, " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
|
||||
If RegimenFiscalReceptor <> "-1" Then
|
||||
Tipo.AppendFormat("AND RegimenFiscalReceptor LIKE '%{0}%'", RegimenFiscalReceptor)
|
||||
End If
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTSATUsosCFDI"), DataTable), Tipo.ToString(), " UsoCFDIDescripcion", DataViewRowState.CurrentRows)
|
||||
GlobalDTSATUsosCFDI = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
|
||||
@@ -1321,6 +1321,14 @@ Partial Class Ventas
|
||||
ViewState("RFCReceptorVenta") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property RegimenFiscalCliente As String
|
||||
Get
|
||||
Return IfNull(ViewState("RegimenFiscalCliente"), "").ToString()
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("RegimenFiscalCliente") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property Adjunto As String
|
||||
Get
|
||||
Return If(IsNothing(ViewState("Adjunto")), "", ViewState("Adjunto").ToString())
|
||||
@@ -5662,8 +5670,12 @@ Partial Class Ventas
|
||||
'End If
|
||||
End Sub
|
||||
Private Sub CargaUsoCFDI()
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
|
||||
RegimenFiscalCliente = "-1"
|
||||
End If
|
||||
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||
|
||||
DdlUsoCFDI.DataBind()
|
||||
DdlSucursalUsoCFDI.DataBind()
|
||||
@@ -5945,6 +5957,10 @@ Partial Class Ventas
|
||||
ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
|
||||
ViewState("CliPais") = ObjCliente.Pais
|
||||
ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal
|
||||
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||
RegimenFiscalCliente = ObjCliente.DtResultados(0)("CodigoRegimenFiscal").ToString()
|
||||
CargaUsoCFDI()
|
||||
End If
|
||||
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
||||
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
|
||||
If Not ClienteDesglosaIEPS Then
|
||||
@@ -10083,8 +10099,8 @@ Partial Class Ventas
|
||||
'si es cancelacion, debe de conservar el folio actual
|
||||
If Not EsCancelacion Then ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero(), -1)
|
||||
|
||||
'SI ES FACTURACION DE REMISION O COTIZACION NO TOMAR EL FOLIO QUE SE MUESTRA
|
||||
If Not EsCancelacion AndAlso ObjFactura.Folio > 0 AndAlso TipoDoctoViejo.Contiene("Rem", "Cot") Then
|
||||
'SI NO ESTABLECIO UN FOLIO FIJO Y SI ES FACTURACION DE REMISION O COTIZACION NO TOMAR EL FOLIO QUE SE MUESTRA
|
||||
If Not EstablecioFolio AndAlso (Not EsCancelacion AndAlso ObjFactura.Folio > 0 AndAlso TipoDoctoViejo.Contiene("Rem", "Cot")) Then
|
||||
ObjFactura.Folio = -1
|
||||
End If
|
||||
|
||||
@@ -19230,6 +19246,7 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Protected Sub TxtFolio_TextChanged(sender As Object, e As System.EventArgs) Handles TxtFolio.TextChanged
|
||||
ViewState("EstablecioFolio") = True
|
||||
Alert("Se estableció el Folio Fijo para el nuevo documento.")
|
||||
End Sub
|
||||
Private Sub HabilitarFacturacionSucursal()
|
||||
trsucursalciente.Visible = True
|
||||
@@ -30534,7 +30551,11 @@ Partial Class Ventas
|
||||
|
||||
BtnEmitirImprimir.Text = "Facturar"
|
||||
DdlTipoComprobante.SelectedValue = "Ing"
|
||||
TxtFecha.Text = Now.ToShortDateString()
|
||||
|
||||
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
|
||||
TxtFecha.Text = Now.ToShortDateString()
|
||||
End If
|
||||
|
||||
UpPS.Update()
|
||||
UpFacturar.Update()
|
||||
|
||||
@@ -31252,7 +31273,9 @@ Partial Class Ventas
|
||||
|
||||
Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue
|
||||
DdlTipoComprobante.SelectedValue = TipoDoctoNuevo
|
||||
TxtFecha.Text = Now.ToString()
|
||||
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
|
||||
TxtFecha.Text = Now.ToString()
|
||||
End If
|
||||
TxtFechaPago.Text = If(TipoDoctoViejo = "Rem" AndAlso EsDiasCreditoFijo, Now.AddDays(DiasCredito), If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza))).ToShortDateString
|
||||
TxtFechaEjecucion.Text = Now.ToString()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user