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
|
' Application("GlobalDTSucursales") = value
|
||||||
' End Set
|
' End Set
|
||||||
'End Property
|
'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
|
Get
|
||||||
If EsPersonaFisica <> -1 Then
|
If EsPersonaFisica <> -1 Then
|
||||||
Dim Tipo As String = ""
|
Dim Tipo As New StringBuilder
|
||||||
If EsPersonaFisica = 1 Then Tipo = "AplicaPersonaFisica = 1" Else Tipo = "AplicaPersonaMoral = 1"
|
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
|
GlobalDTSATUsosCFDI = Dv.ToTable
|
||||||
Dv.Dispose()
|
Dv.Dispose()
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -1321,6 +1321,14 @@ Partial Class Ventas
|
|||||||
ViewState("RFCReceptorVenta") = value
|
ViewState("RFCReceptorVenta") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
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
|
Private Property Adjunto As String
|
||||||
Get
|
Get
|
||||||
Return If(IsNothing(ViewState("Adjunto")), "", ViewState("Adjunto").ToString())
|
Return If(IsNothing(ViewState("Adjunto")), "", ViewState("Adjunto").ToString())
|
||||||
@@ -5662,8 +5670,12 @@ Partial Class Ventas
|
|||||||
'End If
|
'End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaUsoCFDI()
|
Private Sub CargaUsoCFDI()
|
||||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
If UsuarioActual.Empresa.Funcionalidad(350) <> "1" Then
|
||||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
RegimenFiscalCliente = "-1"
|
||||||
|
End If
|
||||||
|
|
||||||
|
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||||
|
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
|
||||||
|
|
||||||
DdlUsoCFDI.DataBind()
|
DdlUsoCFDI.DataBind()
|
||||||
DdlSucursalUsoCFDI.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("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim)
|
||||||
ViewState("CliPais") = ObjCliente.Pais
|
ViewState("CliPais") = ObjCliente.Pais
|
||||||
ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal
|
ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||||
|
RegimenFiscalCliente = ObjCliente.DtResultados(0)("CodigoRegimenFiscal").ToString()
|
||||||
|
CargaUsoCFDI()
|
||||||
|
End If
|
||||||
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
|
||||||
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
|
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
|
||||||
If Not ClienteDesglosaIEPS Then
|
If Not ClienteDesglosaIEPS Then
|
||||||
@@ -10083,8 +10099,8 @@ Partial Class Ventas
|
|||||||
'si es cancelacion, debe de conservar el folio actual
|
'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)
|
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
|
'SI NO ESTABLECIO UN FOLIO FIJO Y 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
|
If Not EstablecioFolio AndAlso (Not EsCancelacion AndAlso ObjFactura.Folio > 0 AndAlso TipoDoctoViejo.Contiene("Rem", "Cot")) Then
|
||||||
ObjFactura.Folio = -1
|
ObjFactura.Folio = -1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -19230,6 +19246,7 @@ Partial Class Ventas
|
|||||||
End Sub
|
End Sub
|
||||||
Protected Sub TxtFolio_TextChanged(sender As Object, e As System.EventArgs) Handles TxtFolio.TextChanged
|
Protected Sub TxtFolio_TextChanged(sender As Object, e As System.EventArgs) Handles TxtFolio.TextChanged
|
||||||
ViewState("EstablecioFolio") = True
|
ViewState("EstablecioFolio") = True
|
||||||
|
Alert("Se estableció el Folio Fijo para el nuevo documento.")
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub HabilitarFacturacionSucursal()
|
Private Sub HabilitarFacturacionSucursal()
|
||||||
trsucursalciente.Visible = True
|
trsucursalciente.Visible = True
|
||||||
@@ -30534,7 +30551,11 @@ Partial Class Ventas
|
|||||||
|
|
||||||
BtnEmitirImprimir.Text = "Facturar"
|
BtnEmitirImprimir.Text = "Facturar"
|
||||||
DdlTipoComprobante.SelectedValue = "Ing"
|
DdlTipoComprobante.SelectedValue = "Ing"
|
||||||
TxtFecha.Text = Now.ToShortDateString()
|
|
||||||
|
If Not (EstablecioFolio AndAlso UsuarioActual.TienePermisoProceso(130)) Then
|
||||||
|
TxtFecha.Text = Now.ToShortDateString()
|
||||||
|
End If
|
||||||
|
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
UpFacturar.Update()
|
UpFacturar.Update()
|
||||||
|
|
||||||
@@ -31252,7 +31273,9 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue
|
Dim TipoDoctoViejo As String = DdlTipoComprobante.SelectedValue
|
||||||
DdlTipoComprobante.SelectedValue = TipoDoctoNuevo
|
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
|
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()
|
TxtFechaEjecucion.Text = Now.ToString()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user