diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index 2422f98ee..2fa90b6e1 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -1676,7 +1676,8 @@ Public Class ClsClientes
End Function
Public Function AgregarClienteNoFrecuente(Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer,
RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
- NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1, Optional RegimenSociedad As String = "-1", Optional TipoPersona As Boolean = False) As Boolean
+ NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1, Optional RegimenSociedad As String = "-1",
+ Optional TipoPersona As Boolean = False, Optional CveRegimenFiscal As Integer = -1, Optional CveUsoCFDI As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ClientesNoFrecuenteAdd")
@@ -1703,6 +1704,8 @@ Public Class ClsClientes
.Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
.Add("@RegimenSociedad", SqlDbType.VarChar).Value = RegimenSociedad
.Add("@TipoPersona", SqlDbType.Bit).Value = TipoPersona
+ .Add("@CveRegimenFiscal", SqlDbType.Int).Value = CveRegimenFiscal
+ .Add("@CveUsoCFDI", SqlDbType.Int).Value = CveUsoCFDI
End With
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 690d09452..8aec07c6d 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -4274,7 +4274,12 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
- ImprimirPDF(String.Format("Empresas/Grales/Formatos/Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios")
+ If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
+ ImprimirPDFStimulsoft(String.Format("Empresas/Grales/Formatos/Traslado.mrt", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios")
+ Else
+ ImprimirPDF(String.Format("Empresas/Grales/Formatos/Traslado.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Aviso de Traslado - {0}", Folio), RDSName:="DsInventarios")
+ End If
+
End If
diff --git a/Compras/RepCxP.aspx b/Compras/RepCxP.aspx
index 118bd0604..643599192 100644
--- a/Compras/RepCxP.aspx
+++ b/Compras/RepCxP.aspx
@@ -1,777 +1,797 @@
-<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepCxP.aspx.vb" Inherits="Compras_RepCxP" %>
-
-<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
-
-
-
-
-
-
-
TodosSi
diff --git a/Ventas/RepVentas.aspx.vb b/Ventas/RepVentas.aspx.vb
index df2c98fa7..21fc6d4cb 100644
--- a/Ventas/RepVentas.aspx.vb
+++ b/Ventas/RepVentas.aspx.vb
@@ -156,7 +156,8 @@ Partial Class Ventas_RepVentas
DdlGrupo.Items.Insert(12, New ListItem("Año/Mes Ejec.", "13"))
DdlGrupo.Items.Insert(13, New ListItem("Fecha Ejec.", "14"))
DdlGrupo.Items.Insert(13, New ListItem("Tipo Cliente", "20"))
- DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
+ DdlGrupo.Items.Insert(13, New ListItem("Vendedor/Cliente", "21"))
+ DdlGrupo.Items.Insert(13, New ListItem("Giro", "22"))
DdlGrupo.DataBind()
DdlGrupo.SelectedValueExist("3")
End Sub
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index bd1dddfbe..1ac9a835a 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -7616,53 +7616,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
-
FísicaMoral
-
-
-
-
- <%--
-
-
-
-
--%>
-
@@ -7701,12 +7680,30 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -7714,18 +7711,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -7747,26 +7732,16 @@
-
-
-
-
-
-
-
-
-
-
-
+
-
+
@@ -7774,12 +7749,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 47cafa9cd..11be021c2 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2315,6 +2315,7 @@ Partial Class Ventas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+
If Not IsPostBack Then
If IfNull(Request("Opcionx"), "").ToString = "Saldar" And UsuarioActual.CveUsuario = 100 Then
@@ -3166,6 +3167,10 @@ Partial Class Ventas
BrSubProyecto.Visible = DdlProyecto.Visible
divProyectoPyME.Visible = DdlProyecto.Visible
+ If UsuarioActual.CveEmpresa.Contiene(172, 173) Then
+ LnkAddVenta.Visible = True
+ End If
+
'MOSTRAR LA OPCION DE AGREGAR PS EN BDH
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveVenta <= 0 Then
ImgOtrosConceptos.Visible = False
@@ -7686,33 +7691,36 @@ Partial Class Ventas
e.Row.FCTextBox("TxtDescuento").Enabled = False
End If
- 'Si es una devolucion
- If NuevaFactura = 0 Then
- e.Row.FCDropDownList("DdlUnidadMedida").Enabled = False
- e.Row.FCDropDownList("DdlClasificacion").Enabled = False
- e.Row.FCDropDownLost("DdlPS").Enabled = False
- e.Row.FCDropDownList("DdlProyecto").Enabled = False
- e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
- e.Row.FCTextBox("TxtPrecio").Enabled = False
- ElseIf NuevaFactura = 1 Or CveContrato > 0 Then
- e.Row.FCDropDownList("DdlUnidadMedida").Enabled = False
- e.Row.FCDropDownList("DdlClasificacion").Enabled = False
- e.Row.FCDropDownLost("DdlPS").Enabled = False
- e.Row.FCTextBox("TxtCantidad").Enabled = False
- e.Row.FCTextBox("TxtPrecio").Enabled = False
- e.Row.FCTextBox("TxtDescuento").Enabled = False
- If TieneAlmacen Then e.Row.FCLinkButton("imgD").Visible = False
+ If Not EsCreaApartirDe Then
+ 'Si es una devolucion
+ If NuevaFactura = 0 Then
+ e.Row.FCDropDownList("DdlUnidadMedida").Enabled = False
+ e.Row.FCDropDownList("DdlClasificacion").Enabled = False
+ e.Row.FCDropDownLost("DdlPS").Enabled = False
+ e.Row.FCDropDownList("DdlProyecto").Enabled = False
+ e.Row.FCDropDownList("DdlSubProyecto").Enabled = False
+ e.Row.FCTextBox("TxtPrecio").Enabled = False
+ ElseIf NuevaFactura = 1 Or CveContrato > 0 Then
+ e.Row.FCDropDownList("DdlUnidadMedida").Enabled = False
+ e.Row.FCDropDownList("DdlClasificacion").Enabled = False
+ e.Row.FCDropDownLost("DdlPS").Enabled = False
+ e.Row.FCTextBox("TxtCantidad").Enabled = False
+ e.Row.FCTextBox("TxtPrecio").Enabled = False
+ e.Row.FCTextBox("TxtDescuento").Enabled = False
+
+ If TieneAlmacen Then e.Row.FCLinkButton("imgD").Visible = False
+
+ If UsuarioActual.TienePermisoProceso(222) Then
+ e.Row.FCDropDownList("DdlUnidadMedida").Enabled = True
+ e.Row.FCDropDownList("DdlClasificacion").Enabled = True
+ e.Row.FCDropDownLost("DdlPS").Enabled = True
+ e.Row.FCTextBox("TxtCantidad").Enabled = True
+ e.Row.FCTextBox("TxtPrecio").Enabled = True
+ e.Row.FCTextBox("TxtDescuento").Enabled = True
+ End If
- If UsuarioActual.TienePermisoProceso(222) Then
- e.Row.FCDropDownList("DdlUnidadMedida").Enabled = True
- e.Row.FCDropDownList("DdlClasificacion").Enabled = True
- e.Row.FCDropDownLost("DdlPS").Enabled = True
- e.Row.FCTextBox("TxtCantidad").Enabled = True
- e.Row.FCTextBox("TxtPrecio").Enabled = True
- e.Row.FCTextBox("TxtDescuento").Enabled = True
End If
-
End If
'Si es facturacion de OC o Contrato
@@ -14867,7 +14875,7 @@ Partial Class Ventas
Next
End If
- If factura.TipoDocto.Contiene("Ing", "Dev") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
+ If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Ing", "Dev") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
Dim Filtro As String = ""
Select Case factura.TipoDocto
@@ -15048,6 +15056,73 @@ Partial Class Ventas
End If
+ If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso factura.TipoDocto.Contiene("Rem") AndAlso DivAlmacen.Visible AndAlso GvInv.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("cbInv").Checked) > 0 Then
+
+ Dim DebeGenerarMovimiento As Boolean = TmpDTDetalle.COUNT("CvePS", "CveTipoPS = 2") > 0
+
+ If DebeGenerarMovimiento Then
+
+ Dim CveAlmacenSalida As Integer = ddlAlmacen.SelectedValue.ToEntero()
+ Dim CveAlmacenExA As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=10).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={DdlSubProyecto.SelectedValue}").ToEntero()
+
+ Dim CveRemision As Integer = factura.CveVenta
+ Dim CveMoneda As Integer = DdlMoneda.SelectedValue.ToEntero()
+
+ Dim DtProductos As DataTable = TmpDTDetalle.FiltraParametros("CveTipoPS = 2")
+
+ Dim MovDetalle As DataTable = New DataTable()
+ MovDetalle.Columns.Add(New DataColumn("Cantidad", GetType(Integer)))
+ MovDetalle.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
+ MovDetalle.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
+ MovDetalle.Columns.Add(New DataColumn("PU", GetType(Decimal)))
+ MovDetalle.Columns.Add(New DataColumn("Serie", GetType(String)))
+ MovDetalle.Columns.Add(New DataColumn("Lote", GetType(String)))
+ MovDetalle.Columns.Add(New DataColumn("FechaCaducidad", GetType(DateTime)))
+ MovDetalle.Columns.Add(New DataColumn("CveVentaDetalle", GetType(Integer)))
+
+ For Each RowPS As DataRow In DtProductos.Rows
+ Dim RowInv = MovDetalle.NewRow
+
+ RowInv("Cantidad") = RowPS("Cantidad").ToString().ToDecimal()
+ RowInv("CveUM") = RowPS("CveUM").ToString().ToEntero()
+ RowInv("CvePS") = RowPS("CvePS").ToString().ToEntero()
+ RowInv("PU") = 0
+ RowInv("Serie") = ""
+ RowInv("Lote") = ""
+ RowInv("FechaCaducidad") = MinFecha
+ RowInv("CveVentaDetalle") = RowPS("CveVentaDetalle").ToString().ToEntero()
+
+ MovDetalle.Rows.Add(RowInv)
+ Next
+
+ 'Le damos salida de apartado por traspaso
+ Dim CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=False, ObjConta:=ObjConta, CveAlmacenDestino:=CveAlmacenExA)
+
+ If Not CveMovimientoSalidaPorTraspaso > 0 Then
+ OcurrioError = True
+ End If
+
+ 'Le damos entrada al general por traspaso
+ If Not OcurrioError Then
+ Dim GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenExA, 9, CveMoneda, CveRemision, CveMovimientoRelacionado:=CveMovimientoSalidaPorTraspaso, AplicaMovimientoDetalleEntrada:=False, ObjConta:=ObjConta) > 0
+
+ If Not GeneroMovimientoAlmacen Then
+ OcurrioError = True
+ End If
+ End If
+
+ 'VERIFICA QUE SE REALIZO EL MOVIMIENTO DE ALMACEN
+ If Not OcurrioError AndAlso DebeGenerarMovimiento Then
+ If Not (ObjInventario.GetInv_Mov(factura.CveVenta, UsuarioActual.CveEmpresa) AndAlso ObjInventario.DtResultados.Rows.Count > 0) Then
+ OcurrioError = True
+ ErrorList.Add("Ocurrió un error al verificar inventario. Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
+ End If
+ End If
+
+ End If
+
+ End If
+
End If
Catch ex As Exception
@@ -19762,7 +19837,7 @@ Partial Class Ventas
If TieneMovimientosContrato Then
MovDetalle = CuadrarFacturaMovimientos(ObjVentas, CveRemision, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}"))
Else
- MovDetalle = CuadrarFacturaMovimientos(ObjVentas, CveRemision, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (TieneSalidaxFactura IS NULL OR SaldoAlmacen > 0)"))
+ MovDetalle = CuadrarFacturaMovimientos(ObjVentas, CveRemision, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")} AND (SaldoAlmacen > 0 AND CantidadDisponible > 0)"))
End If
End If
@@ -19977,7 +20052,8 @@ Partial Class Ventas
Return Not OcurrioError
End Function
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = True,
- Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer
+ Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing,
+ Optional CveAlmacenDestino As Integer = -1) As Integer
Dim OcurrioError As Boolean = False
Dim ContadorMovtosDetalles = 0
@@ -19990,7 +20066,7 @@ Partial Class Ventas
'Creamos el movimiento
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, ConceptoEntrada, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1,
- CveMovimientoRelacionado:=CveMovimientoRelacionado, Modulo:="Vta/E4")
+ CveMovimientoRelacionado:=CveMovimientoRelacionado, CveAlmacenDestino:=CveAlmacenDestino, Modulo:="Vta/E4")
If CveMovimientoInventario > 0 Then
@@ -21391,9 +21467,14 @@ Partial Class Ventas
'REGENERAR EL PDF
If Not OcurrioError Then
Try
+ Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa
+ Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario
+
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
- Dim Hilo As New System.Threading.Thread(Sub() RegenerarPDF(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, strURLHOST))
- Hilo.Start()
+ RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST)
+ '
+ 'Dim Hilo As New System.Threading.Thread(Sub() )
+ 'Hilo.Start()
Catch ex As Exception
OnError("Ocurrió un error al regenerar el PDF", ex)
End Try
@@ -22408,12 +22489,13 @@ Partial Class Ventas
DivDireccionCliente.Visible = False
DivNumeroCPCliente.Visible = False
- DivColoniaTelefonoCliente.Visible = False
+ 'DivColoniaTelefonoCliente.Visible = False
DivCiudadLocalidadCliente.Visible = False
DivEstadoPaisCliente.Visible = False
DivCorreoCuentaCliente.Visible = False
DivBotonesAgregarCliente.Visible = False
DivFormaCliente.Visible = False
+ divRegimenCliente.Visible = False
UpAgregarCliente.Update()
CargaEstados()
@@ -22427,7 +22509,7 @@ Partial Class Ventas
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True
- DivColoniaTelefonoCliente.Visible = True
+ 'DivColoniaTelefonoCliente.Visible = True
DivCiudadLocalidadCliente.Visible = True
DivEstadoPaisCliente.Visible = True
DivCorreoCuentaCliente.Visible = True
@@ -22440,9 +22522,16 @@ Partial Class Ventas
RFVCiudadC.Visible = False
RFVLocalidadC.Visible = False
RFVSATPais.Visible = False
+ divRegimenCliente.Visible = UsuarioActual.Empresa.Funcionalidad(350) = "1"
+
+ RdTipoPersona.SelectedValue = "0"
DdlMetodoCliente.SelectedValueExist(1)
DdlFormaCliente.SelectedValueExist(1)
+
+ DdlRegimenFiscalCliente.DataSource = GlobalDTRegimenesFiscales().FiltraParametros("CveRegimenFiscal = 11")
+ DdlRegimenFiscalCliente.DataBind()
+ CargaComboCFDICliente()
Else
Dim ObjCliente As New ClsClientes
If ObjCliente.ValidaClienteRFC(TxtRFCCliente.Text, UsuarioActual.CveEmpresa) Then
@@ -22457,12 +22546,13 @@ Partial Class Ventas
DivTipoPersona.Visible = True
DivDireccionCliente.Visible = True
DivNumeroCPCliente.Visible = True
- DivColoniaTelefonoCliente.Visible = True
+ 'DivColoniaTelefonoCliente.Visible = True
DivCiudadLocalidadCliente.Visible = True
DivEstadoPaisCliente.Visible = True
DivCorreoCuentaCliente.Visible = True
DivBotonesAgregarCliente.Visible = True
DivFormaCliente.Visible = True
+ divRegimenCliente.Visible = UsuarioActual.Empresa.Funcionalidad(350) = "1"
End If
End If
ObjCliente.Dispose()
@@ -22477,12 +22567,54 @@ Partial Class Ventas
DdlMetodoCliente.SelectedValueExist(-1)
DdlFormaCliente.SelectedValueExist(-1)
+ DdlRegimenFiscalCliente.DataSource = GlobalDTRegimenesFiscales()
+ DdlRegimenFiscalCliente.DataBind()
+ CargaComboCFDICliente()
+
End If
End Sub
+ Private Sub CargaComboCFDICliente()
+ If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
+ DdlUsoCFDICliente.DataSource = GlobalDTSATUsosCFDI().FiltraParametros("CveUsoCFDI = 23")
+ DdlUsoCFDICliente.DataBind()
+ Else
+ Dim RegimenFiscalCliente = DdlRegimenFiscalCliente.SelectedValue.ToString()
+ If Not UsuarioActual.Empresa.Funcionalidad(350).Contiene("1", "2") Then
+ RegimenFiscalCliente = "-1"
+ End If
+
+ DdlUsoCFDICliente.Items.Clear()
+ If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
+ Dim EsPersonaMoral As Boolean = (RdTipoPersona.SelectedValue = "1")
+ DdlUsoCFDICliente.DataSource = GlobalDTSATUsosCFDI(If(Not EsPersonaMoral, 1, 0), RegimenFiscalReceptor:=RegimenFiscalCliente)
+ Else
+ DdlUsoCFDICliente.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica, RegimenFiscalReceptor:=RegimenFiscalCliente)
+ End If
+
+ DdlUsoCFDICliente.DataBind()
+ DdlUsoCFDICliente.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ End If
+
+
+ UpAgregarCliente.Update()
+ End Sub
+
+ Protected Sub DdlRegimenFiscalCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
+ CargaComboCFDICliente()
+ End Sub
+
Private Sub BtnAgregarCliente_Click(sender As Object, e As EventArgs) Handles BtnAgregarCliente.Click
Dim CvePrecioLista As Integer = -1
+ Dim CveRegimenFiscal As Integer = -1
+ Dim CveUsoCFDI As Integer = 3
+
+ If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
+ CveRegimenFiscal = DdlRegimenFiscalCliente.SelectedValue.ToEntero()
+ CveUsoCFDI = DdlUsoCFDICliente.SelectedValue.ToEntero()
+ End If
+
If DdlSubProyectoDatos.SelectedValue.ToEntero() > 0 Then
Dim Dr As DataRow = GlobalDTSubProyectos(-1, DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa).Rows(0)
If Dr IsNot Nothing Then
@@ -22500,7 +22632,7 @@ Partial Class Ventas
TxtColoniaCliente.Text.Trim, TxtLocalidadCliente.Text.Trim, TxtCiudadCliente.Text.Trim, DdlEstadoSAT.SelectedValue.ToEntero,
TxtRFCCliente.Text.Trim, TxtCPCliente.Text.Trim, TxtTelefonoCliente.Text.Trim, TxtCorreoCliente.Text.Trim,
DdlSubProyectoDatos.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "", -1, -1, CvePrecioLista:=CvePrecioLista,
- RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona) Then
+ RegimenSociedad:=TxtRegimenSociedad.Text, TipoPersona:=TipoPersona, CveRegimenFiscal:=CveRegimenFiscal, CveUsoCFDI:=CveUsoCFDI) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
RegistraScript("hideDivEC();")
@@ -22672,6 +22804,10 @@ Partial Class Ventas
LBAplicaDevolucion.Visible = False
End If
+ If DdlTipoComprobante.SelectedValue = "Dev" AndAlso VentaSaldoAlmacen <> 0 Then
+ LiDevolucionAlmacen.Visible = False
+ End If
+
End If
UpnTools.Update()
@@ -30820,25 +30956,6 @@ Partial Class Ventas
Exit Sub
End If
- 'VERIFICA QUE LAS FACTURAS TENGAN EL MISMO ESTATUS EN ALMACEN (NO MEZCLAR REMISIONES 'SURTIDAS' CON 'NO SURTIDAS')
- 'If dtSeleccionadas.COUNT("Surtido", "Surtido = 'Si'") > 0 AndAlso dtSeleccionadas.COUNT("Surtido", "Surtido = 'No'") > 0 Then
- ' Dim SbRem As New StringBuilder
- ' SbRem.Append("Solo debe seleccionar remisiones con el mismo estatus de almacen. Por favor verifique y vuelva a intentar.")
-
- ' SbRem.Append("Remisiones Surtidas:")
- ' For Each RowSurtida As DataRow In dtSeleccionadas.FiltraParametros("Surtido = 'Si'", DistinctColumns:={"Folio"}).Rows
- ' SbRem.AppendFormat("{0}", RowSurtida("Folio"))
- ' Next
-
- ' SbRem.Append("Remisiones No Surtidas:")
- ' For Each RowSurtida As DataRow In dtSeleccionadas.FiltraParametros("Surtido = 'No'", DistinctColumns:={"Folio"}).Rows
- ' SbRem.AppendFormat("{0}", RowSurtida("Folio"))
- ' Next
-
- ' Alert(SbRem.ToString(), TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- 'End If
-
DdlMoneda.SelectedValue = GlobalDTMonedas.FiltroPrimeroValor("CveMoneda", $"Abreviatura = '{dtSeleccionadas.FiltroPrimeroValor("Abreviatura")}'")
DdlMoneda.Enabled = False
CambiaMoneda()
@@ -31059,6 +31176,11 @@ Partial Class Ventas
BtnEmitirImprimir.Visible = False
End If
+ 'SI HAY REMISIONES SURTIDAS, NO GENERAR EL MOVIMIENTO AUTOMATICO
+ If UsuarioActual.Empresa.Funcionalidad(567) = "1" AndAlso dtSeleccionadas.COUNT("Surtido", "Surtido = 'Si'") > 0 Then
+ DivAlmacen.Visible = False
+ End If
+
End If
TxtFechaPago.Text = If(EsDiasCreditoFijo, Now.AddDays(DiasCredito).ToShortDateString, TxtFechaPago.Text)
@@ -31069,8 +31191,9 @@ Partial Class Ventas
UpParametros.Update()
UPEstimaciones.Update()
UPCondicionesPago.Update()
- HuboCambioRemi = Not HuboCambioRemi
+ UpINV.Update()
+ HuboCambioRemi = Not HuboCambioRemi
RegistraScript("$('#DivRemisiones').modal('hide');", "DivRemisionesHide")
End Sub
@@ -33414,9 +33537,13 @@ Partial Class Ventas
'REGENERAR EL PDF
Try
+ Dim CveEmpresaPDF As Integer = UsuarioActual.CveEmpresa
+ Dim CveUsuarioPDF As Integer = UsuarioActual.CveUsuario
+
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
- Dim Hilo As New System.Threading.Thread(Sub() RegenerarPDF(CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, strURLHOST))
- Hilo.Start()
+ RegenerarPDF(CveVenta, CveEmpresaPDF, CveUsuarioPDF, strURLHOST)
+ 'Dim Hilo As New System.Threading.Thread(Sub() )
+ 'Hilo.Start()
Catch ex As Exception
OnError("Ocurrió un error al regenerar el PDF", ex)
End Try
@@ -34380,6 +34507,28 @@ Partial Class Ventas
DivRazonSocial2.Attributes.Add("class", "col-md-8")
DVRegimenSociedad.Visible = True
+ If TxtRFCCliente.Text.ToUpper = "XAXX010101000" Then
+ DdlRegimenFiscalCliente.DataSource = GlobalDTRegimenesFiscales().FiltraParametros("CveRegimenFiscal = 11")
+ DdlRegimenFiscalCliente.DataBind()
+ Else
+ Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal")
+ Dim Val As String
+
+ If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
+ 'verifico que sino existe el valor. lo limpie
+ Val = dt.FiltroPrimeroValor("CveRegimenFiscal", "CveRegimenFiscal = " & DdlRegimenFiscalCliente.SelectedValue)
+ If Val = "" Then 'sino encuentra valor, lo limpia
+ DdlRegimenFiscalCliente.Items.Clear()
+ DdlRegimenFiscalCliente.SelectedValue = Nothing
+ End If
+ End If
+
+ DdlRegimenFiscalCliente.DataSource = dt
+ DdlRegimenFiscalCliente.DataBind()
+ DdlRegimenFiscalCliente.SelectedValueExist(Val)
+
+ End If
+
End If
UpAgregarCliente.Update()