-
This commit is contained in:
@@ -1764,6 +1764,23 @@ Partial Class Ventas
|
||||
ViewState("CvePrecioLista") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property FacturarSucursal As Boolean
|
||||
Get
|
||||
Return CBool(IfNull(ViewState("FacturarSucursal"), "False", ViewState("FacturarSucursal")))
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("FacturarSucursal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ClienteSucursal As Modelos.SucursalModel
|
||||
Get
|
||||
Return CType(ViewState("ClienteSucursal"), Modelos.SucursalModel)
|
||||
End Get
|
||||
Set(value As Modelos.SucursalModel)
|
||||
ViewState("ClienteSucursal") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -4572,6 +4589,12 @@ Partial Class Ventas
|
||||
|
||||
DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString())
|
||||
|
||||
Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString())
|
||||
|
||||
If Me.FacturarSucursal Then
|
||||
HabilitarFacturacionSucursal()
|
||||
End If
|
||||
|
||||
CargaPS(-1, DdlPS)
|
||||
|
||||
'CARGA GV DE OC RELACIONADAS
|
||||
@@ -4808,7 +4831,10 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Private Sub CargaUsoCFDI()
|
||||
DdlUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
|
||||
|
||||
DdlUsoCFDI.DataBind()
|
||||
DdlSucursalUsoCFDI.DataBind()
|
||||
End Sub
|
||||
Private Sub CargaTiposRelacion()
|
||||
DdlTiposRelacion.DataSource = GlobalDTVtaTiposRelacion
|
||||
@@ -5227,6 +5253,11 @@ Partial Class Ventas
|
||||
DdlSucursalCliente.Items.Insert(0, New ListItem("Matriz", "-1"))
|
||||
DdlSucursalCliente.DataBind()
|
||||
|
||||
'SI UTILIZA EL RFC GENERICO PERMITE FACTURAR SUCURSAL
|
||||
If (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then
|
||||
HabilitarFacturacionSucursal()
|
||||
End If
|
||||
|
||||
'CargaFolios()
|
||||
|
||||
CargaDatosEstimaciones(CveCliente)
|
||||
@@ -5582,6 +5613,11 @@ Partial Class Ventas
|
||||
|
||||
|
||||
Private Sub CargaClienteSucursal(CveClienteSuc As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing)
|
||||
Me.ClienteSucursal = Nothing
|
||||
Me.FacturarSucursal = False
|
||||
LtlTitleRFCSucursal.Text = ""
|
||||
LtlRFCSucursal.Text = ""
|
||||
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If CveClienteSuc > 0 Then
|
||||
If ObjCliente.GetSucursales(CveCliente, CveClienteSuc) Then
|
||||
@@ -5618,6 +5654,32 @@ Partial Class Ventas
|
||||
UpParametros.Update()
|
||||
End If
|
||||
|
||||
'SI EL CLIENTE TIENE RFC GENERICO Y LA SUCURSAL TIENE RFC DEBE FACTURAR LA SUCURSAL
|
||||
If LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then
|
||||
Me.FacturarSucursal = True
|
||||
|
||||
LtlTitleRFCSucursal.Text = "RFC:"
|
||||
LtlRFCSucursal.Text = ObjCliente.DtResultados.Rows(0)("RFC").ToString()
|
||||
|
||||
Me.ClienteSucursal = New Modelos.SucursalModel
|
||||
Me.ClienteSucursal.Nombre = ObjCliente.DtResultados.Rows(0)("SucursalCliente").ToString()
|
||||
Me.ClienteSucursal.RFC = ObjCliente.DtResultados.Rows(0)("RFC").ToString()
|
||||
Me.ClienteSucursal.NoExt = CliNoExt
|
||||
Me.ClienteSucursal.NoInt = CliNoInt
|
||||
Me.ClienteSucursal.Localidad = CliLocalidad
|
||||
Me.ClienteSucursal.Direccion = LblDireccion.Text
|
||||
Me.ClienteSucursal.Colonia = LblColonia.Text
|
||||
Me.ClienteSucursal.Municipio = LblCiudad.Text
|
||||
Me.ClienteSucursal.Estado = LblEstado.Text
|
||||
Me.ClienteSucursal.CP = LblCP.Text
|
||||
Me.ClienteSucursal.Pais = CliPais
|
||||
Me.ClienteSucursal.CorreoSucursal = CliCorreoCot.ToString()
|
||||
Me.ClienteSucursal.TelefonoSucursal = LblTelefono.Text
|
||||
Me.ClienteSucursal.Sucursal = If(DdlSucursalCliente.SelectedValue.ToEntero() > 0, DdlSucursalCliente.SelectedItem.Text, "")
|
||||
Me.ClienteSucursal.ImprimeNombreSucursal = ImprimeNombreSucursal.ToString()
|
||||
|
||||
End If
|
||||
|
||||
If CveVenta <= 0 Then
|
||||
CveMetodoPagoCliente = ObjCliente.DtResultados.Rows(0)("CveMetodoPago").ToString().ToEntero()
|
||||
|
||||
@@ -5672,10 +5734,12 @@ Partial Class Ventas
|
||||
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
|
||||
End If
|
||||
|
||||
ObjCliente.Dispose()
|
||||
|
||||
UPPVentas.Update()
|
||||
UpEstatus.Update()
|
||||
UPCondicionesPago.Update()
|
||||
ObjCliente.Dispose()
|
||||
UpCliente.Update()
|
||||
End Sub
|
||||
Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
|
||||
Dim Retorno As Decimal = 0
|
||||
@@ -6636,6 +6700,11 @@ Partial Class Ventas
|
||||
DtOCTmpDT = TmpDT.Copy
|
||||
TmpDTError = TmpDT.Copy
|
||||
|
||||
If (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso String.IsNullOrEmpty(Me.ClienteSucursal.RFC))) Then
|
||||
Alert("La sucursal no tiene asignada un RFC.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
'CUANDO ES PEDIDO SE DEBE ESPECIFICAR EL NUMERO DE CONTRATO
|
||||
If TrTipoPedido.Visible AndAlso DdlTipoPedido.SelectedIndex = 2 Then
|
||||
If String.IsNullOrEmpty(TxtObsFact.Text.Trim()) Then
|
||||
@@ -6999,6 +7068,22 @@ Partial Class Ventas
|
||||
Exit Sub
|
||||
End If
|
||||
dttsat.Dispose()
|
||||
|
||||
If UsuarioActual.CveEmpresa = 72 Then
|
||||
Dim DtNoEncontrados As DataTable = TmpDT.FiltraParametros("ISNULL(SATClaveProdServ,'') = '01010101' ")
|
||||
If DtNoEncontrados IsNot Nothing AndAlso DtNoEncontrados.Rows.Count > 0 Then
|
||||
Dim StrNoEncontrados As New StringBuilder
|
||||
StrNoEncontrados.Append("Los siguientes productos no tiene asignado la clave Producto SAT o Unidad Medida SAT<br/><br/>")
|
||||
For Each drt As DataRow In DtNoEncontrados.Rows
|
||||
StrNoEncontrados.AppendFormat("{0} <br/>", drt("CodigoPS"))
|
||||
Next
|
||||
Alert(StrNoEncontrados.ToString(), TipoMensaje.MsgAdvertencia)
|
||||
DtNoEncontrados.Dispose()
|
||||
StrNoEncontrados.Clear()
|
||||
Exit Sub
|
||||
End If
|
||||
DtNoEncontrados.Dispose()
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura Is Nothing Or (ObjFactura.Cliente Is Nothing And Not CveEmpresaCRM > 0) Then
|
||||
@@ -7910,6 +7995,10 @@ Partial Class Ventas
|
||||
'ObjFacturaDevolucion.SetSucursal(Me)
|
||||
|
||||
ObjFacturaDevolucion.ClienteSucursal = New Modelos.SucursalModel
|
||||
If Me.ClienteSucursal IsNot Nothing Then
|
||||
ObjFacturaDevolucion.ClienteSucursal.RFC = Me.ClienteSucursal.RFC
|
||||
ObjFacturaDevolucion.ClienteSucursal.Nombre = Me.ClienteSucursal.Nombre
|
||||
End If
|
||||
ObjFacturaDevolucion.ClienteSucursal.NoExt = CliNoExt
|
||||
ObjFacturaDevolucion.ClienteSucursal.NoInt = CliNoInt
|
||||
ObjFacturaDevolucion.ClienteSucursal.Localidad = CliLocalidad
|
||||
@@ -8146,6 +8235,11 @@ Partial Class Ventas
|
||||
'ObjFacturaBonificacion.SetSucursal(Me)
|
||||
|
||||
ObjFacturaBonificacion.ClienteSucursal = New Modelos.SucursalModel
|
||||
If Me.ClienteSucursal IsNot Nothing Then
|
||||
ObjFacturaBonificacion.ClienteSucursal.Nombre = Me.ClienteSucursal.Nombre
|
||||
ObjFacturaBonificacion.ClienteSucursal.RFC = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
|
||||
ObjFacturaBonificacion.ClienteSucursal.NoExt = CliNoExt
|
||||
ObjFacturaBonificacion.ClienteSucursal.NoInt = CliNoInt
|
||||
ObjFacturaBonificacion.ClienteSucursal.Localidad = CliLocalidad
|
||||
@@ -8377,7 +8471,6 @@ Partial Class Ventas
|
||||
ObjFactura = New Modelos.Factura
|
||||
End If
|
||||
|
||||
|
||||
ObjFactura.Version = "3.3"
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
@@ -8389,7 +8482,7 @@ Partial Class Ventas
|
||||
ObjFactura.Moneda = DdlMoneda.SelectedItem.Text
|
||||
ObjFactura.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", $"CveMoneda = {DdlMoneda.SelectedValue}")
|
||||
ObjFactura.TipoDocto = If(IfNull(ViewState("CveRemision"), 0).ToString().ToEntero() > 0, "Ing", DdlTipoComprobante.SelectedValue)
|
||||
|
||||
ObjFactura.FacturarSucursal = (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso Not String.IsNullOrEmpty(Me.ClienteSucursal.RFC)))
|
||||
|
||||
'ObjFactura.RefDocto = TxtDocto.Text.Trim
|
||||
'si es cancelacion, debe de conservar el folio actual
|
||||
@@ -8838,8 +8931,12 @@ Partial Class Ventas
|
||||
'ObjFactura.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||
ObjFactura.SetSubProyectoMatriz(Me)
|
||||
ObjFactura.SetSubProyecto(Me)
|
||||
ObjFactura.ClienteSucursal = New Modelos.SucursalModel
|
||||
ObjFactura.ClienteSucursal = New Modelos.SucursalModel()
|
||||
If Not CveEmpresaCRM > 0 Then
|
||||
If Me.ClienteSucursal IsNot Nothing Then
|
||||
ObjFactura.ClienteSucursal.RFC = Me.ClienteSucursal.RFC
|
||||
ObjFactura.ClienteSucursal.Nombre = Me.ClienteSucursal.Nombre
|
||||
End If
|
||||
ObjFactura.ClienteSucursal.NoExt = CliNoExt
|
||||
ObjFactura.ClienteSucursal.NoInt = CliNoInt
|
||||
ObjFactura.ClienteSucursal.Localidad = CliLocalidad
|
||||
@@ -9238,7 +9335,12 @@ Partial Class Ventas
|
||||
ObjFacturaDevolucion.CveSubProyecto = DdlSubProyectoDatos.SelectedValue.ToEntero()
|
||||
ObjFacturaDevolucion.SetSubProyectoMatriz(Me)
|
||||
ObjFacturaDevolucion.SetSubProyecto(Me)
|
||||
|
||||
ObjFacturaDevolucion.ClienteSucursal = New Modelos.SucursalModel
|
||||
If Me.ClienteSucursal IsNot Nothing Then
|
||||
ObjFacturaDevolucion.ClienteSucursal.RFC = Me.ClienteSucursal.RFC
|
||||
ObjFacturaDevolucion.ClienteSucursal.Nombre = Me.ClienteSucursal.Nombre
|
||||
End If
|
||||
ObjFacturaDevolucion.ClienteSucursal.NoExt = CliNoExt
|
||||
ObjFacturaDevolucion.ClienteSucursal.NoInt = CliNoInt
|
||||
ObjFacturaDevolucion.ClienteSucursal.Localidad = CliLocalidad
|
||||
@@ -9251,6 +9353,7 @@ Partial Class Ventas
|
||||
ObjFacturaDevolucion.ClienteSucursal.CorreoSucursal = CliCorreoCot.ToString()
|
||||
ObjFacturaDevolucion.ClienteSucursal.TelefonoSucursal = LblTelefono.Text
|
||||
ObjFacturaDevolucion.ClienteSucursal.Sucursal = If(DdlSucursalCliente.SelectedValue.ToEntero() > 0, DdlSucursalCliente.SelectedItem.Text, "")
|
||||
ObjFacturaDevolucion.ClienteSucursal.ImprimeNombreSucursal = ImprimeNombreSucursal.ToString()
|
||||
|
||||
'ENVIO DIRECCION
|
||||
ObjFacturaDevolucion.EnviarA = New Modelos.EnviarAModel
|
||||
@@ -9298,13 +9401,18 @@ Partial Class Ventas
|
||||
|
||||
Timbre.Comprobante.Confirmacion = ""
|
||||
|
||||
Timbre.Receptor.RFC = Obj.Cliente.RFC
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||
If Obj.FacturarSucursal Then
|
||||
Timbre.Receptor.RFC = Obj.ClienteSucursal.RFC
|
||||
Timbre.Receptor.Nombre = Obj.ClienteSucursal.Nombre
|
||||
Else
|
||||
Timbre.Receptor.RFC = Obj.Cliente.RFC
|
||||
Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||
End If
|
||||
|
||||
Timbre.Receptor.ResidenciaFiscal = ""
|
||||
Timbre.Receptor.NumeroRegistroTributario = ""
|
||||
Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
|
||||
|
||||
|
||||
If HdnTipoDescuento.Value = "3" And DdlTipoAmortizacionAnticipo.SelectedValue.ToEntero() > 0 Then
|
||||
|
||||
Timbre.CFDIRelacionados.TipoRelacion = "07"
|
||||
@@ -9373,8 +9481,6 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
Dim totIVA As Decimal = Obj.IVA
|
||||
Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
@@ -9942,7 +10048,7 @@ Partial Class Ventas
|
||||
CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero() > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)),
|
||||
CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, CveAcercamientoCRM:=CveAcercamientoCRM,
|
||||
DiasCredito:=factura.DiasCredito, EsDiasCreditoFijo:=factura.EsDiasCreditoFijo, AnticipoEspecial:=If(TrAntEspecial.Visible, ChkAntEspecial.Checked, False),
|
||||
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero) Then
|
||||
Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal) Then
|
||||
ErrorList.Add("Ocurrió un error al Generar la Venta.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||
Else
|
||||
If factura.TipoDocto.Contiene("Dev", "Egs") Or DtVentasNC IsNot Nothing Or CveEstatusRefacturacion = 1 Then
|
||||
@@ -14986,6 +15092,10 @@ Partial Class Ventas
|
||||
DdlIVA.SelectedValue = "1.16"
|
||||
PorcentajeIVA = ViewState("IVA").ToString().ToDecimal
|
||||
End Select
|
||||
'SI ES COTIZACION HABILITAR EL DDL DE IVA
|
||||
If CveVenta <= 0 AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
DdlIVA.Visible = True
|
||||
End If
|
||||
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count > 0 AndAlso (Not CveVenta > 0 Or EsCreaApartirDe Or CveDevolucion > 0) Then RecalculaIVA()
|
||||
'ViewState("SubProyectoPorcentajeIVA") = dr("IVA")
|
||||
ViewState("TipoFormato") = dr("TipoFormato")
|
||||
@@ -15033,7 +15143,11 @@ Partial Class Ventas
|
||||
|
||||
DdlVendedor.SelectedValue = "0"
|
||||
DdlVendedor.Items.Insert(0, New ListItem("Sin Asignar", "0"))
|
||||
|
||||
DdlVendedorSucursal.DataSource = DdlVendedor.DataSource
|
||||
|
||||
DdlVendedor.DataBind()
|
||||
DdlVendedorSucursal.DataBind()
|
||||
|
||||
DdlVendedor.SelectedValueExist(CveVendedorActual)
|
||||
|
||||
@@ -15627,6 +15741,11 @@ Partial Class Ventas
|
||||
MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: Sin Unidad Medida SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
|
||||
Return False
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa = 72 AndAlso DrPS("SATClavePS").ToString() = "01010101" Then
|
||||
MensajeCveSAT.AppendFormat("<b>{0}-{1}</b>: El producto/servicio no existe en el catálogo del SAT<br/>", DrPS("Codigo").ToString(), DrPS("PS").ToString())
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -16715,6 +16834,84 @@ Partial Class Ventas
|
||||
Protected Sub TxtFolio_TextChanged(sender As Object, e As System.EventArgs) Handles TxtFolio.TextChanged
|
||||
ViewState("EstablecioFolio") = True
|
||||
End Sub
|
||||
Private Sub HabilitarFacturacionSucursal()
|
||||
trsucursalciente.Visible = True
|
||||
LnkAgregarSucursal.Visible = True
|
||||
LblSucursal.Text = "Cliente"
|
||||
If (CveVenta <= 0 OrElse NuevaFactura = 1) Then
|
||||
DdlSucursalCliente.Enabled = True
|
||||
End If
|
||||
DdlSucursalCliente_SelectedIndexChanged(DdlSucursalCliente, EventArgs.Empty)
|
||||
|
||||
UpCliente.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub ChkFacturarSucursal_CheckedChanged(sender As Object, e As EventArgs)
|
||||
|
||||
End Sub
|
||||
Protected Sub LnkAgregarSucursal_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript("showDivAgregarSucursal();")
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregarSucursal.Click
|
||||
|
||||
Dim LT As String = "0"
|
||||
Dim LG As String = "0"
|
||||
|
||||
If CveCliente > 0 Then
|
||||
Dim ObjCliente As New ClsClientes
|
||||
Try
|
||||
If ObjCliente.AddSucursal(CveCliente, TxtNombreSucursal.Text.Trim, UsuarioActual.CveUsuario, TxtCiudadSucursal.Text.Trim, TxtColoniaSucursal.Text.Trim, TxtCPSucursal.Text.Trim, TxtDireccionSucursal.Text.Trim, TxtEstadoSucursal.Text.Trim, TxtLocalidadSucursal.Text.Trim, TxtPaisSucursal.Text.Trim, TxtNumExtSucursal.Text.Trim, TxtNumIntSucursal.Text.Trim, TxtTelefonoSucursal.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", ""), TxtCorreoSucursal.Text.Trim, "", "",
|
||||
DdlVendedorSucursal.SelectedValue.ToEntero, "", -1, 0, -1, DdlSucursalUsoCFDI.SelectedValue.ToEntero, -1, -1, LT:=LT, LG:=LG, RFC:=TxtRFCSucursal.Text.Trim()) Then
|
||||
TxtNombreSucursal.Text = ""
|
||||
TxtCiudadSucursal.Text = ""
|
||||
TxtColoniaSucursal.Text = ""
|
||||
TxtCPSucursal.Text = ""
|
||||
TxtDireccionSucursal.Text = ""
|
||||
TxtEstadoSucursal.Text = ""
|
||||
TxtLocalidadSucursal.Text = ""
|
||||
TxtPaisSucursal.Text = ""
|
||||
TxtNumExtSucursal.Text = ""
|
||||
TxtNumIntSucursal.Text = ""
|
||||
TxtTelefonoSucursal.Text = ""
|
||||
TxtCorreoSucursal.Text = ""
|
||||
|
||||
DdlVendedorSucursal.SelectedIndex = 0
|
||||
DdlSucursalUsoCFDI.SelectedIndex = 0
|
||||
|
||||
|
||||
Alert("La nueva Sucursal del Cliente se guardó correctamente.", TipoMensaje.MsgInformacion)
|
||||
|
||||
'VUELVE A CARGAR LAS SUCURSALES
|
||||
DdlSucursalCliente.Items.Clear()
|
||||
If ObjCliente.GetSucursales(CveCliente) Then
|
||||
DdlSucursalCliente.DataSource = ObjCliente.DtResultados
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
trsucursalciente.Visible = True
|
||||
Else
|
||||
trsucursalciente.Visible = False
|
||||
End If
|
||||
Else
|
||||
trsucursalciente.Visible = False
|
||||
DdlSucursalCliente.DataSource = Nothing
|
||||
End If
|
||||
DdlSucursalCliente.Items.Insert(0, New ListItem("Matriz", "-1"))
|
||||
DdlSucursalCliente.DataBind()
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar la sucursal", ex)
|
||||
End Try
|
||||
ObjCliente.Dispose()
|
||||
|
||||
End If
|
||||
|
||||
UpCliente.Update()
|
||||
RegistraScript("hideDivAgregarSucursal();")
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub ConfiguraTipoDocto()
|
||||
|
||||
'Esconde Todo
|
||||
@@ -17830,6 +18027,11 @@ Partial Class Ventas
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = LblRFC.Text.Trim
|
||||
|
||||
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
|
||||
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
|
||||
Dim SWatch As New Stopwatch
|
||||
SWatch.Start()
|
||||
|
||||
@@ -18478,12 +18680,22 @@ Partial Class Ventas
|
||||
Select Case RBLPago.SelectedValue.ToEntero()
|
||||
Case 1 'CREDITO
|
||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||
'SI ES CREDITO EL METODO DE PAGO DEBE SER PPD
|
||||
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
|
||||
DdlMetodoPago33.SelectedValueExist("3")
|
||||
DdlMetodoPago33.Enabled = False
|
||||
End If
|
||||
Case 2 'CONTADO
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Or (UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 And DdlTipoComprobante.SelectedValue = "Cot") Then
|
||||
DivContado.Visible = True
|
||||
TxtImporteContado.Text = TxtTotal.Text
|
||||
End If
|
||||
TxtFechaPago.Text = Now.ToShortDateString
|
||||
'SI ES CONTADO EL METODO DE PAGO DEBE SER PUE
|
||||
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
|
||||
DdlMetodoPago33.SelectedValueExist("1")
|
||||
DdlMetodoPago33.Enabled = False
|
||||
End If
|
||||
Case 3 ' TERMINAL
|
||||
DivTerminal.Visible = True
|
||||
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
|
||||
@@ -18491,6 +18703,7 @@ Partial Class Ventas
|
||||
|
||||
LimpiaContado()
|
||||
UpContado.Update()
|
||||
UPCondicionesPago.Update()
|
||||
End Sub
|
||||
Private Sub CargaCuentas()
|
||||
|
||||
@@ -20046,6 +20259,12 @@ Partial Class Ventas
|
||||
|
||||
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
|
||||
Dim RFCReceptor As String = LblRFC.Text.Trim
|
||||
|
||||
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
|
||||
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
|
||||
RFCReceptor = Me.ClienteSucursal.RFC
|
||||
End If
|
||||
|
||||
Dim SWatch As New Stopwatch
|
||||
SWatch.Start()
|
||||
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True)
|
||||
@@ -25959,6 +26178,12 @@ Partial Class Ventas
|
||||
Return Retorno
|
||||
End Function
|
||||
Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String)
|
||||
|
||||
If (FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso String.IsNullOrEmpty(Me.ClienteSucursal.RFC))) Then
|
||||
Alert("La sucursal no tiene asignada un RFC.", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If GvPagos.Rows.Count = 0 And UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 And RBLPago.SelectedValue.ToEntero() = 2 Then
|
||||
Alert("No se puede facturar hasta que se haya especificado detalladamente la forma de pago", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user