Definición de carta porte dentro de ventas (sin timbrar)

This commit is contained in:
2022-04-05 18:17:43 -07:00
parent 4352a30f60
commit 6e11faf31e
4 changed files with 1067 additions and 197 deletions

View File

@@ -3684,7 +3684,7 @@ Public Class ClsGenerales
Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer, Public Function AddGralTimbre(TipoDocto As String, CveSubProyecto As Integer, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0, Optional Serie As String = "-1", Optional Folio As Integer = -1, Optional Estatus As Integer = 0,
Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False) As Integer Optional CveEntregaAlmacen As Integer = -1, Optional AplicaCP As Boolean = False, Optional CveVenta As Integer = -1) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_Gral_TimbreAdd") DataAdapter("PA_Gral_TimbreAdd")
@@ -3701,6 +3701,7 @@ Public Class ClsGenerales
.Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP .Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen .Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
.Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
.Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output .Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output
@@ -3722,7 +3723,7 @@ Public Class ClsGenerales
Return Retorno Return Retorno
End Function End Function
Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer) As Boolean Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, FechaI As Date, FechaF As Date, Estatus As Integer, CveEmpresa As Integer, CveMovimiento As Integer, Optional CveVenta As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Gral_TimbreGet") DataAdapter("PA_Gral_TimbreGet")
@@ -3734,7 +3735,7 @@ Public Class ClsGenerales
.Add("@Estatus", SqlDbType.Int).Value = Estatus .Add("@Estatus", SqlDbType.Int).Value = Estatus
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With End With
Try Try

View File

@@ -365,6 +365,252 @@ Public Class Timbres
End If End If
Return Timbre Return Timbre
End Function End Function
Public Class MMensajeCartaPorte
Public Property TieneError As Boolean
Public Property Mensaje As String
Public Property CveMovimiento As Integer
Public Property FechaSalida As DateTime
Public Property CartaPorte As CFDICartaPorte
End Class
Public Shared Function PreParaCartaPorteFactura(CveTimbre As Integer, Obj As Modelos.Factura, UsuarioActual As Usuario) As MMensajeCartaPorte
Dim Retorno As New MMensajeCartaPorte
Try
Dim CartaPorte As New CFDICartaPorte
Dim _MsgError As New StringBuilder
Dim TieneError As Boolean = False
CartaPorte.TranspInternac = "No"
CartaPorte.EntradaSalidaMercancia = ""
CartaPorte.ViaEntradaSalida = ""
CartaPorte.Mercancias.UnidadPeso = "KGM"
CartaPorte.Mercancias.CargoporTasacion = 0
Dim FI As Date = New Date(1900, 1, 1)
Dim FF As Date = New Date(9999, 1, 1)
Dim FechaLlegada As DateTime
Dim Distancia As Integer = 1
Dim ObjGrales As New ClsGenerales
If ObjGrales.GetGralTimbre(CveTimbre, "Man", FI, FF, -1, UsuarioActual.CveEmpresa, -1) Then
If ObjGrales.DtResultados.Rows.Count = 1 Then
Dim DtMovimientos As DataTable = Nothing
Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
'Timbre.Receptor.RFC = drT("DestinatarioRFC").ToString
'Timbre.Receptor.Nombre = drT("DestinatarioNombre").ToString
Retorno.CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
Retorno.FechaSalida = drT("FechaEntrega").ToString.ToDateTime
FechaLlegada = drT("FechaLlegada").ToString.ToDateTime
Distancia = drT("Distancia").ToString.ToEntero
'ObjFactura.Folio = drT("Folio").ToString.ToEntero
'ObjFactura.Serie = drT("Serie").ToString
'Timbre.Comprobante.Serie = Obj.Serie
'Timbre.Comprobante.Folio = Obj.Folio.ToString
'If drT("FolioFiscalRelacionado").ToString <> "" Then
' Timbre.CFDIRelacionados.TipoRelacion = "05"
' Timbre.CFDIRelacionados.UUID.Add(drT("FolioFiscalRelacionado").ToString)
'End If
If ObjGrales.GetGralMovimientosDetalleTimbre(CveTimbre, UsuarioActual.CveEmpresa) Then
DtMovimientos = ObjGrales.DtResultados
Else
TieneError = True
_MsgError.AppendLine("Error al obtener Movimientos")
End If
'ObjFactura.DtDetalle = DtMovimientos
'AplicaCP = Boolean.Parse(drT("AplicaCP").ToString)
'ObjFactura.CveSubProyecto = drT("CveSubProyecto").ToString.ToEntero
'ObjFactura.SetSubProyecto()
'ObjFactura.SetSubProyectoMatriz()
CartaPorte.FiguraTransporte.AutoTransporte.PermisoSCT = drT("ClaveTipoPermisoSCT").ToString '"TPAF01"
CartaPorte.FiguraTransporte.AutoTransporte.NumPermisoSCT = drT("NumPermisoSCT").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroResponsabilidadCivil = drT("NombreAseguradora").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroResponsabilidadCivil = drT("NumPolizaSeguro").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroMedioAmbiente = drT("NombreAseguradoraMedioAmbiente").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroMedioAmbiente = drT("NumPolizaSeguroMedioAmbiente").ToString
CartaPorte.FiguraTransporte.AutoTransporte.NombreSeguroCarga = drT("NombreAseguradoraCarga").ToString
CartaPorte.FiguraTransporte.AutoTransporte.PolizaSeguroCarga = drT("NumPolizaSeguroCarga").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.ConfigVehicular = drT("ConfigCartaPorte").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.PlacaVM = drT("Placa").ToString
CartaPorte.FiguraTransporte.AutoTransporte.Vehiculo.AnioModeloVM = drT("Anio").ToString.ToEntero
If drT("ClaveTipoRemolque1").ToString <> "" Then
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
End If
If drT("ClaveTipoRemolque2").ToString <> "" Then
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
End If
If drT("ClaveTipoRemolque1").ToString <> "" Then
Dim Rem1 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque1"), .Placa = drT("PlacaRemolque1")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem1)
End If
If drT("ClaveTipoRemolque2").ToString <> "" Then
Dim Rem2 As New CFDICartaPorteRemolque With {.SubTipoRemolque = drT("ClaveTipoRemolque2"), .Placa = drT("PlacaRemolque2")}
CartaPorte.FiguraTransporte.AutoTransporte.Remolques.Add(Rem2)
End If
Dim DomOrigen As CFDICartaPorteDomicilio = Nothing
DomOrigen = New CFDICartaPorteDomicilio With {.Calle = drT("DirOriCalle").ToString,
.Colonia = drT("DirOriClaveSATColonia").ToString,
.CP = drT("DirOriCP").ToString,
.Estado = drT("DirOriClaveSATEstado").ToString,
.Pais = drT("DirOriClaveSATPais").ToString,
.Municipio = drT("DIrOriClaveSATMunicipio").ToString,
.Localidad = drT("DirOriClaveSATLocalidad").ToString}
Dim DomDestino As CFDICartaPorteDomicilio = Nothing
DomDestino = New CFDICartaPorteDomicilio With {.Calle = drT("DirDesCalle").ToString,
.Colonia = drT("DirDesClaveSATColonia").ToString,
.CP = drT("DirDesCP").ToString,
.Estado = drT("DirDesClaveSATEstado").ToString,
.Pais = drT("DirDesClaveSATPais").ToString,
.Municipio = drT("DirDesClaveSATMunicipio").ToString,
.Localidad = drT("DirDesClaveSATLocalidad").ToString}
Dim Ubica As New CFDICartaPorteUbicacion
Ubica.TipoEstacion = ""
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = drT("RemitenteRFC").ToString,
.FechaHoraSalidaLlegada = Retorno.FechaSalida.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01",
.NombreRemitenteDestinatario = drT("RemitenteNombre").ToString,
.Domicilio = DomOrigen}
CartaPorte.Ubicaciones.Add(Ubica)
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = drT("DestinatarioRFC").ToString,
.FechaHoraSalidaLlegada = FechaLlegada.ToString("yyyy-MM-ddTHH:mm:ss"),
.NombreRemitenteDestinatario = drT("DestinatarioNombre").ToString,
.Domicilio = DomDestino,
.DistanciaRecorrida = Distancia}
CartaPorte.Ubicaciones.Add(Ubica)
CartaPorte.FiguraTransporte.ClaveTransporte = "01"
Dim DomicilioOperador As New CFDICartaPorteDomicilio With {.Calle = drT("FiguraDomicilio").ToString,
.NumeroExterior = drT("FiguraNumeroExterior").ToString,
.NumeroInterior = drT("FiguraNumeroInterior").ToString,
.Colonia = drT("FiguraClaveSATColonia").ToString,
.Municipio = drT("FiguraClaveSATMunicipio").ToString,
.Estado = drT("FiguraClaveSATEstado").ToString,
.CP = drT("FiguraCP").ToString}
CartaPorte.FiguraTransporte.Operadores.Add(New CFDICartaPorteOperador With {
.RFCFigura = drT("FiguraRFC").ToString,
.NombreFigura = drT("FiguraChofer").ToString,
.NumLicencia = drT("FiguraLicencia").ToString,
.NumRegidTribFigura = drT("FiguraNumRegidTribFigura").ToString,
.ResidenciaFiscalFigura = drT("FiguraResidenciaFiscalFigura").ToString,
.Domicilio = DomicilioOperador})
'concepto único
Dim concepto As New CFDIConceptos With {.Cantidad = 1,
.Descripcion = "Flete",
.ValorUnitario = 0,
.Importe = 0,
.Descuento = 0,
.Unidad = "Servicio",
.ClaveUnidad = "E48",
.ClaveProdServ = "78101802",
.Noidentificacion = "",
.CuentaPredial = ""}
For Each drr As DataRow In DtMovimientos.Rows
Dim tPS As String = ""
If drr("PS").ToString.Length = 1 Then
tPS = drr("Obs").ToString
Else
If drr("PS").ToString.Length = 0 Then
tPS = ""
Else
tPS = String.Format("{0} {1}", drr("PS"), drr("Obs"))
End If
End If
Dim conceptoCarta As New CFDICartaPorteMercancia With {
.BienesTransp = drr("SATClaveProdServ").ToString,
.ClaveSTCC = "", 'para metodo ferroviario
.Cantidad = drr("Cantidad").ToString.ToDecimal,
.Descripción = tPS,
.ClaveUnidad = drr("SATClaveUM").ToString,
.Unidad = drr("UM").ToString,
.Dimensiones = drr("Dimensiones").ToString,
.PesoenKg = drr("PesoKg").ToString.ToDecimal,
.MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", ""),
.ClaveMaterialPeligroso = drr("ClaveMaterialPeligroso").ToString,
.Embalaje = drr("ClaveEmbalaje").ToString,
.DescripEmbalaje = drr("Embalaje").ToString,
.ValorMercancia = drr("PU").ToString.ToDecimal,
.Moneda = "MXN", 'temporal
.FraccionArrancelaria = "",
.UUIDComercioExt = ""
}
Dim DetalleMercancia As New CFDICartaPorteMercanciaDetalleMercancia With {.PesoNeto = drr("PesoKg").ToString.ToDecimal, .NumPiezas = drr("Cantidad").ToString.ToDecimal}
conceptoCarta.DetalleMercancia = DetalleMercancia
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta)
CartaPorte.Mercancias.Mercancias.Add(conceptoCarta)
Next
Retorno.CartaPorte = CartaPorte
Else
TieneError = True
_MsgError.AppendLine("Consultar datos de timbrado")
End If
ObjGrales.Dispose()
Else
_MsgError.AppendLine("Consultar datos de timbrado")
End If
Retorno.TieneError = If(_MsgError.ToString().Length > 0, True, False)
Retorno.Mensaje = _MsgError.ToString()
Catch ex As Exception
Retorno.TieneError = True
Retorno.Mensaje = ex.ToString()
End Try
Return Retorno
End Function
Public Function Timbrar() As Boolean Public Function Timbrar() As Boolean
Dim Respuesta As Boolean = False Dim Respuesta As Boolean = False
@@ -383,4 +629,4 @@ Public Class Timbres
End Function End Function
End Class End Class

View File

@@ -493,7 +493,7 @@
<table> <table>
<asp:CheckBox ID="ChkDireccionEnvio" runat="server" AutoPostBack="true" /> <asp:CheckBox ID="ChkDireccionEnvio" runat="server" AutoPostBack="true" />
<span style="margin-left: 1px;"> <span style="margin-left: 1px;">
<asp:DropDownList ID="DdlDireccionEnvio" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false"> <asp:DropDownList ID="DdlDireccionEnvio" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalClienteVentaDireccion" DataValueField="CveDireccionEnvio" Width="180px" Visible="false" OnSelectedIndexChanged="DdlDireccionEnvio_SelectedIndexChanged">
<asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="true" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</span> </span>
@@ -2219,7 +2219,7 @@
<ContentTemplate> <ContentTemplate>
<asp:UpdatePanel ID="UPComplementosSAT" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPComplementosSAT" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<table border="0" cellpadding="0" cellspacing="0" class="TextTab"> <table border="0" cellpadding="0" cellspacing="0" class="TextTab" style="width: 100%">
<tr valign="top"> <tr valign="top">
<td rowspan="2" colspan="1"> <td rowspan="2" colspan="1">
<div class="portlet light xspadding bordered whitoutcol" style="width: 330px;"> <div class="portlet light xspadding bordered whitoutcol" style="width: 330px;">
@@ -2445,7 +2445,9 @@
</div> </div>
</td> </td>
<td rowspan="1" colspan="2"> <td rowspan="1" colspan="2">
<div class="portlet light xspadding bordered whitoutcol" style="width: 850px;"> <div class="row">
<div class="col-md-7">
<div class="portlet light xspadding bordered whitoutcol" style="width: 100%;">
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
@@ -2614,6 +2616,127 @@
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
</div> </div>
</div>
<div class="col-md-5">
<div id="DivCartaPorte" runat="server" visible="false" class="portlet light xspadding bordered whitoutcol" style="width: 100%">
<div class="portlet-title">
<div class="caption font-green">
<i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">CARTA PORTE</span>
</div>
<div class="actions">
<div class="btn-group">
</div>
</div>
<div class="tools">
<a href="javascript:;" class="collapse"></a>
</div>
</div>
<div class="portlet-body ">
<div class="rowpadding">
<asp:UpdatePanel ID="UpEmitirTransitorio" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row rowpadding">
<label class="col-md-2">Emitir:</label>
<div class="col-md-10">
<asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" CssClass="chksino" Text=" " />
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Origen:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtOrigenCP" runat="server" Enabled="false" Text="" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Destino:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtDestinoCP" runat="server" Enabled="false" Text="" CssClass="form-control input-sm"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Fecha Llegada:</label>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaLlegadaCP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaSalidaCP" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaSalidaCP" runat="server" TargetControlID="TxtFechaLlegadaCP" Mask="99/99/9999" MaskType="Date" DisplayMoney="Right" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFechaSalidaCP" TargetControlID="TxtFechaLlegadaCP" PopupButtonID="ImgFechaSalidaCP" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
<label class="col-md-2">Fecha Entrega:</label>
<div class="col-md-4">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 117px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaEntregaCP" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaEntregaCP" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFechaEntregaCP" runat="server" TargetControlID="TxtFechaEntregaCP" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFEchaEntregaCP" TargetControlID="TxtFechaEntregaCP" PopupButtonID="ImgFechaEntregaCP" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Distancia:</label>
<div class="col-md-10">
<asp:TextBox ID="TxtDistancia" runat="server" CssClass="form-control input-sm" type="number"></asp:TextBox>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Chofer:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<br />
<div class="row rowpadding">
<label class="col-md-2">Unidad:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlUnidadCamionActivoFijo_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<br />
<div class="row rowpadding" runat="server" id="DvConfiguracionVeiculo" visible="false">
<label class="col-md-2">Configuración:</label>
<div class="col-md-10">
<asp:DropDownList ID="DdlConfigAuto" CssClass="form-control input-sm select2me" Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DdlConfigAuto_SelectedIndexChanged" CausesValidation="true" DataTextField="ClaveConfigAutoTransporteDescripcion" DataValueField="CveConfigAutoTransporte" Style="padding: 0px">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlConfigAuto" runat="server" Enabled="false" ControlToValidate="DdlConfigAuto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Configuración Carta Porte''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCERfvDdlConfigAuto" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlConfigAuto" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque1" visible="false">
<label class="col-md-2">Remolque 1:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlRemolque1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlRemolque1_SelectedIndexChanged"></asp:DropDownList>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque2" visible="false">
<label class="col-md-2">Remolque 2:</label>
<div class="col-md-10">
<asp:DropDownList runat="server" ID="DdlRemolque2" AutoPostBack="true" Width="100%" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></asp:DropDownList>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">

View File

@@ -1356,6 +1356,15 @@ Partial Class Ventas
ViewState("ListaAnticiposAplicados") = value ViewState("ListaAnticiposAplicados") = value
End Set End Set
End Property End Property
Private Property CveTimbreCartaPorteVenta As Integer
Get
Return If(IsNothing(ViewState("CveTimbreCartaPorteVenta")), -1, ViewState("CveTimbreCartaPorteVenta").ToString().ToEntero())
End Get
Set(value As Integer)
ViewState("CveTimbreCartaPorteVenta") = value
End Set
End Property
#End Region #End Region
#Region "Propiedades PuntoVenta" #Region "Propiedades PuntoVenta"
@@ -2272,6 +2281,9 @@ Partial Class Ventas
UpFacturar.Update() UpFacturar.Update()
'CargaTiposDocumentos() 'CargaTiposDocumentos()
TrEmitir.Visible = False TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 Then
DivCartaPorte.Visible = True
End If
ViewState("EstablecioFolio") = False ViewState("EstablecioFolio") = False
'ViewState("SubProyectoPorcentajeIVA") = 0 'ViewState("SubProyectoPorcentajeIVA") = 0
RefacturacionGeneroNC = False RefacturacionGeneroNC = False
@@ -2353,6 +2365,7 @@ Partial Class Ventas
End If End If
DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat") DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat")
DivPSSAT.Visible = True DivPSSAT.Visible = True
@@ -2448,7 +2461,7 @@ Partial Class Ventas
CargaCuentasTerminal() CargaCuentasTerminal()
CargaDdlNCPS() CargaDdlNCPS()
CargarCamiones()
'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante 'SI USUARIO USA AMORTIZACIÓN CONTABLE, se carga las tablas para usarlas mas adelante
If UsuarioActual.Empresa.UsaAC Then If UsuarioActual.Empresa.UsaAC Then
@@ -2643,6 +2656,9 @@ Partial Class Ventas
ObjInventario.Dispose() ObjInventario.Dispose()
End If End If
If DdlTipoComprobante.SelectedValue = "Ing" Then
CargaVentaCortePorte(Me.CveVenta)
End If
End If End If
Else Else
@@ -4888,6 +4904,7 @@ Partial Class Ventas
If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then If DbRowVenta("CveDireccionEnvio").ToString().ToEntero() > 0 AndAlso DbRowVenta("CveDireccionEnvio").ToString() IsNot Nothing Then
ChkDireccionEnvio.Checked = True ChkDireccionEnvio.Checked = True
DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero()) DdlDireccionEnvio.SelectedValueExist(DbRowVenta("CveDireccionEnvio").ToString().ToEntero())
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
DdlDireccionEnvio.Enabled = False DdlDireccionEnvio.Enabled = False
ChkDireccionEnvio.Enabled = False ChkDireccionEnvio.Enabled = False
DdlDireccionEnvio.Visible = True DdlDireccionEnvio.Visible = True
@@ -4942,7 +4959,6 @@ Partial Class Ventas
End If End If
DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString(), DbRowVenta("SubProyecto").ToString()) DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString(), DbRowVenta("SubProyecto").ToString())
DdlSubProyecto.SelectedValueExist(DbRowVenta("CveSubProyecto").ToString()) DdlSubProyecto.SelectedValueExist(DbRowVenta("CveSubProyecto").ToString())
CargarAlmacenes() CargarAlmacenes()
If DdlSubProyectoCobranza.Items.Count = 0 Then If DdlSubProyectoCobranza.Items.Count = 0 Then
@@ -6014,6 +6030,7 @@ Partial Class Ventas
End If End If
End If End If
CargaDireccionCP()
ViewState("Vendedor") = ObjCliente.Vendedor ViewState("Vendedor") = ObjCliente.Vendedor
ViewState("CtaContable") = ObjCliente.CuentaContable ViewState("CtaContable") = ObjCliente.CuentaContable
@@ -7088,6 +7105,8 @@ Partial Class Ventas
CargaVendedores() CargaVendedores()
CargaDireccionCP()
'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES 'SI LA VENTA YA ESTA REGISTRADA NO DEBE HABILITAR ACCIONES
If CveVenta <= 0 Then If CveVenta <= 0 Then
LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva() LnkRemisiones.Visible = If(UsuarioActual.TienePermisoProceso(199), True, False) : LnkOCs.Visible = True : LnkCotizaciones.Visible = True : LnkPedido2SinFacturar.Visible = True : InicializaAplicarNCMasiva()
@@ -7099,6 +7118,7 @@ Partial Class Ventas
UpEstatus.Update() UpEstatus.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
UpCliente.Update() UpCliente.Update()
UpEmitirTransitorio.Update()
End Sub End Sub
Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal Private Function CargaCreditoDisponible(tCveCliente As Integer, tCveSucursalCliente As Integer, Optional ByRef ObjVentas As ClsVentas = Nothing) As Decimal
Dim Retorno As Decimal = 0 Dim Retorno As Decimal = 0
@@ -8158,6 +8178,17 @@ Partial Class Ventas
End If End If
End If End If
If ChkEmitirCartaPorte.Checked Then
If String.IsNullOrEmpty(TxtOrigenCP.Text.Trim()) Then
Alert("La carta porte no tiene un origen definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If String.IsNullOrEmpty(TxtDestinoCP.Text.Trim()) Then
Alert("La carta porte no tiene un destino definido.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO 'CUANDO ES COTIZACION Y SE VA A FACTURAR SE HACE INGRESO
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then If DdlTipoComprobante.SelectedValue = "Cot" AndAlso BtnEmitirImprimir.Text = "Facturar" Then
DdlTipoComprobante.SelectedValue = "Ing" DdlTipoComprobante.SelectedValue = "Ing"
@@ -8300,6 +8331,7 @@ Partial Class Ventas
End If End If
End If End If
'SI NO TIENE AUTORIZACION VERIFICAR LIMITE DE CREDITO Y CANDADOS DE VENTA
'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada. 'No exceder el limite de credito, Si no tiene contrato limita el credito, si tiene no hace nada. Si no tiene remisiones tampoco hace nada.
If Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then If Me.CveAutorizacion <= 0 AndAlso (Not CveContrato > 0 Or CveContratoTipo.Contiene(28)) AndAlso (Not NuevaFactura = 1) AndAlso RBLPago.SelectedValue = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso RemisionesLista.Count <= 0 AndAlso TxtTotal.Text.ToDecimal > 0 AndAlso Not CvePedidoA > 0 Then
'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then 'If UsuarioActual.Empresa.Funcionalidad(518) = "1" AndAlso Not UsuarioActual.TienePermisoProceso(185) Then
@@ -8335,6 +8367,20 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
ObjVentas.Dispose() ObjVentas.Dispose()
'VERIFICA SI TIENE BLOQUEO POR DIAS VENCIDOS
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
Dim Vta As New ClsVentas
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa, TipoVerificacion:=2)
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
Vta.Dispose()
If Opcion = 2 Then
Alert(OpcionMsg, TipoMensaje.MsgError)
Exit Sub
End If
End If
End If End If
'End If 'End If
@@ -8778,9 +8824,18 @@ Partial Class Ventas
Dim CveVentaAnterior As Integer = Me.CveVenta Dim CveVentaAnterior As Integer = Me.CveVenta
Dim CveTimbreCartaPorte As Integer = -1
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS,
ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre) ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion, CveAnticipoPadre:=CveAnticipoPadre)
If ErrorList.Count = 0 AndAlso ChkEmitirCartaPorte.Checked AndAlso ObjFactura.TipoDocto = "Ing" Then
CveTimbreCartaPorte = GuardarCartaPorte(ObjFactura, ObjGeneral, ObjClientes)
If CveTimbreCartaPorte <= 0 Then
ErrorList.Add("Ocurrió un error al registrar la carta porte")
End If
End If
'Agregamos las OCs a la tabla 'Agregamos las OCs a la tabla
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso DTOrdenesCompraPS IsNot Nothing AndAlso DTOrdenesCompraPS.Rows.Count > 0 AndAlso ErrorList.Count = 0 Then
Dim CveVentaDetalle As Integer = 0 Dim CveVentaDetalle As Integer = 0
@@ -9162,14 +9217,27 @@ Partial Class Ventas
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
End If End If
If ChkEmitirCartaPorte.Checked AndAlso CveTimbreCartaPorte > 0 Then
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorte, ObjFactura, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
DebeTimbrar = False
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
End If
End If
Dim ObjTimbrado As New Timbrado Dim ObjTimbrado As New Timbrado
If DebeTimbrar Then
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
End If
Dim FolioFiscalFactura As String = ObjTimbrado.UUID Dim FolioFiscalFactura As String = ObjTimbrado.UUID
Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
ObjTimbrado = Nothing ObjTimbrado = Nothing
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION 'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
If DebeTimbrar AndAlso ListaNotasCreditoGeneradas.Count > 0 Then If DebeTimbrar AndAlso SeTimbro AndAlso ListaNotasCreditoGeneradas.Count > 0 Then
Try Try
For Each NCGenerada In ListaNotasCreditoGeneradas For Each NCGenerada In ListaNotasCreditoGeneradas
If NCGenerada.Timbre IsNot Nothing Then If NCGenerada.Timbre IsNot Nothing Then
@@ -12040,6 +12108,8 @@ Partial Class Ventas
End If End If
End If End If
'SI ES REFACTURACION, NO DEBE AFECTAR LOS USADOS
If Not NuevaFactura.Contiene(1) Then
If ObjFactura.TipoDocto = "Ing" Then If ObjFactura.TipoDocto = "Ing" Then
If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then If Not GuardarUsados(2, ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados") ErrorList.Add("Error al guardar usados")
@@ -12049,6 +12119,8 @@ Partial Class Ventas
ErrorList.Add("Error al guardar usados") ErrorList.Add("Error al guardar usados")
End If End If
End If End If
End If
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then If DtVentasNC Is Nothing Then
@@ -12372,7 +12444,7 @@ Partial Class Ventas
'INVENTARIOS 'INVENTARIOS
If ErrorList.Count = 0 Then If ErrorList.Count = 0 Then
If Not EsNCAmortizacion AndAlso Not NCDescuento Then If Not EsNCAmortizacion AndAlso Not NCDescuento Then
If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura) Then If GuardarVentaInventarios(ObjInventario, ObjVentas, ObjConta, factura, TmpDTDetalle) Then
ErrorList.Add("Ocurrio un error al Guardar Inventario") ErrorList.Add("Ocurrio un error al Guardar Inventario")
End If End If
End If End If
@@ -14026,7 +14098,7 @@ Partial Class Ventas
End Try End Try
End Function End Function
Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura) As Boolean Private Function GuardarVentaInventarios(ObjInventario As ClsInventarios, ObjVentas As ClsVentas, ObjConta As ClsContabilidad, factura As Modelos.Factura, TmpDTDetalle As DataTable) As Boolean
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Try Try
@@ -14035,7 +14107,7 @@ Partial Class Ventas
If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then If RemisionesLista.Count > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
For Each CveRemision As Integer In RemisionesLista For Each CveRemision As Integer In RemisionesLista
'El almacen general es el Primer Almacen de Material en la Sucursal 'El almacen general es el Primer Almacen de Material en la Sucursal
If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9) Then If Not TraspasoAlmacen(ObjInventario, ObjVentas, CveRemision, ObjConta, True, 9, TmpDTDetalle) Then
OcurrioError = True OcurrioError = True
ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico") ErrorList.Add("Ocurrió un error al verificar inventario de remisiones.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
Exit For Exit For
@@ -16004,6 +16076,14 @@ Partial Class Ventas
Dim TmpDTComplementosTimbrado As New DataTable Dim TmpDTComplementosTimbrado As New DataTable
PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado) PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
Dim RespCartaPorte = Timbres.PreParaCartaPorteFactura(CveTimbreCartaPorteVenta, ObjFactura, UsuarioActual)
If Not RespCartaPorte.TieneError Then
ObjFactura.Timbre.Complementos.CartaPorte = RespCartaPorte.CartaPorte
Else
Exit sub
Alert(RespCartaPorte.Mensaje, TipoMensaje.MsgAdvertencia)
End If
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
'MENSAJE PRINCIPAL 'MENSAJE PRINCIPAL
@@ -17078,7 +17158,6 @@ Partial Class Ventas
DdlSubProyectoEjecucion.SelectedValueExist(DdlSubProyectoDatos.SelectedValue) DdlSubProyectoEjecucion.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
DdlSubProyectoCobranza.SelectedValueExist(DdlSubProyectoDatos.SelectedValue) DdlSubProyectoCobranza.SelectedValueExist(DdlSubProyectoDatos.SelectedValue)
'If ObjSucursal.GetSucursales(UsuarioActual.CveEmpresa) Then 'If ObjSucursal.GetSucursales(UsuarioActual.CveEmpresa) Then
' DTSucursal = ObjSucursal.DtResultados.FiltraParametros(String.Format("CveSucursal = {0}", drc("CveSucursal").ToString().ToEntero())) ' DTSucursal = ObjSucursal.DtResultados.FiltraParametros(String.Format("CveSucursal = {0}", drc("CveSucursal").ToString().ToEntero()))
' Dim dre As DataRow ' Dim dre As DataRow
@@ -17092,7 +17171,9 @@ Partial Class Ventas
CargaVendedores() CargaVendedores()
UpDetalle.Update() UpDetalle.Update()
UpEmitirTransitorio.Update()
End Sub End Sub
Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True) Private Sub CambiaSucursal(Optional RecargarPartidas As Boolean = True)
CargaFormatoSucursal() CargaFormatoSucursal()
CargaFolios() CargaFolios()
@@ -17103,6 +17184,8 @@ Partial Class Ventas
RecargaSucursalPartidas() RecargaSucursalPartidas()
End If End If
CargaDireccionSucursalOrigen(GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(""))
DdlPS.Attributes.Remove("data-cvesubproyecto") DdlPS.Attributes.Remove("data-cvesubproyecto")
DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue) DdlPS.Attributes.Add("data-cvesubproyecto", DdlSubProyectoDatos.SelectedValue)
@@ -19579,7 +19662,7 @@ Partial Class Ventas
gvr.FCDropDownList("DdlUnidadMedida").DataBind() gvr.FCDropDownList("DdlUnidadMedida").DataBind()
End Sub End Sub
Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean Private Function TraspasoAlmacen(ByRef ObjInventario As ClsInventarios, ByRef ObjVentas As ClsVentas, CveRemision As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer, TmpDTDetalle As DataTable) As Boolean
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Try Try
Dim DtMovimientos As DataTable Dim DtMovimientos As DataTable
@@ -19715,7 +19798,7 @@ Partial Class Ventas
End If End If
If Not OcurrioError AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If Not OcurrioError AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
OcurrioError = Not GenerarMovimientoAlmacenVirtual(CveMovimientoSalidaAlmacen, CveAlmacenParaSalida, ObjInventario, ObjConta:=ObjConta) OcurrioError = Not GenerarMovimientoAlmacenVirtual(TmpDTDetalle, CveMovimientoSalidaAlmacen, CveAlmacenParaSalida, ObjInventario, ObjConta:=ObjConta)
End If End If
End If End If
@@ -20131,7 +20214,7 @@ Partial Class Ventas
Return Not OcurrioError Return Not OcurrioError
End Function End Function
Private Function GenerarMovimientoAlmacenVirtual(CveMovimientoSalidaAlmacen As Integer, CveAlmacen As Integer, ByRef ObjInventario As ClsInventarios, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean Private Function GenerarMovimientoAlmacenVirtual(TmpDTDetalle As DataTable, CveMovimientoSalidaAlmacen As Integer, CveAlmacen As Integer, ByRef ObjInventario As ClsInventarios, Optional ByRef ObjConta As ClsContabilidad = Nothing) As Boolean
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Try Try
@@ -20162,7 +20245,13 @@ Partial Class Ventas
Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal() Dim PU As Decimal = RowUsado("Cargo").ToString().ToDecimal()
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero() Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then Dim CveVentaDetalle As Integer = -1
'RELACIONA LA VENTA DETALLA DE LA REMISION
If TmpDTDetalle IsNot Nothing Then
CveVentaDetalle = TmpDTDetalle.FiltroPrimeroValor("CveVentaDetalle", $"Cantidad = {RowUsado("Cantidad")} AND CvePS = {RowUsado("CvePS")}").ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1, CveVentaDetalle:=CveVentaDetalle) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -21054,6 +21143,10 @@ Partial Class Ventas
TxtCodigo.ReadOnly = False TxtCodigo.ReadOnly = False
End If End If
If CantidadFacturadaRemision = 0 AndAlso UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = True
End If
TxtCantidad.Enabled = True TxtCantidad.Enabled = True
DdlClasificacion.Enabled = True DdlClasificacion.Enabled = True
DdlPS.Enabled = True DdlPS.Enabled = True
@@ -21067,6 +21160,8 @@ Partial Class Ventas
LblSubTotal1.Text = TxtSubTotal.Text LblSubTotal1.Text = TxtSubTotal.Text
LblAmort.Text = TxtSubTotal.Text LblAmort.Text = TxtSubTotal.Text
LimpiaEscondeContado() LimpiaEscondeContado()
UPPVentas.Update()
UpPS.Update() UpPS.Update()
UpCliente.Update() UpCliente.Update()
UPObservaciones.Update() UPObservaciones.Update()
@@ -21164,7 +21259,7 @@ Partial Class Ventas
Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1), Vigencia:=TxtFechaVencimientoCotizacion.Text.Trim.ToDate, CondicionesPago:=If(RBLPago.SelectedValue = "2", 0, 1),
PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(),
CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:="Rem", CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal,
OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero()) Then OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDouble, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero()) Then
OcurrioError = True OcurrioError = True
End If End If
@@ -22562,9 +22657,15 @@ Partial Class Ventas
If ChkDireccionEnvio.Checked Then If ChkDireccionEnvio.Checked Then
DdlDireccionEnvio.Visible = True DdlDireccionEnvio.Visible = True
LnkOtraDireccion.Visible = True LnkOtraDireccion.Visible = True
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
Else Else
DdlDireccionEnvio.Visible = False DdlDireccionEnvio.Visible = False
LnkOtraDireccion.Visible = False LnkOtraDireccion.Visible = False
If SucursalDestinoCP IsNot Nothing Then
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
TxtDestinoCP.Text = ""
End If
End If End If
End Sub End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
@@ -22603,6 +22704,7 @@ Partial Class Ventas
TxtEnvioTel.Text = "" TxtEnvioTel.Text = ""
CargaDireccionesEnvio() CargaDireccionesEnvio()
DdlDireccionEnvio.SelectedValueExist(CveDireccionEnvio) DdlDireccionEnvio.SelectedValueExist(CveDireccionEnvio)
DdlDireccionEnvio_SelectedIndexChanged(DdlDireccionEnvio, EventArgs.Empty)
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()
@@ -23830,6 +23932,10 @@ Partial Class Ventas
ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion ObjFacturaCancelacion.CveAlmacenDevolucion = CveAlmacenDevolucion
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ObjFacturaCancelacion.TipoDocto = "Rem" Then
ChkDevAlm.Checked = True
End If
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion) resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
End If End If
@@ -33835,5 +33941,399 @@ Partial Class Ventas
End If End If
End Sub End Sub
#Region "C A R T A - P O R T E"
Public Sub CargaDireccionCP()
LblDireccion.Text = "Dirección"
LblColonia.Text = "Colonia"
LblCiudad.Text = "Ciudad"
LblEstado.Text = "Estado"
LblCP.Text = "00000"
End Sub
Public Sub CargarCamiones()
TxtFechaEntregaCP.Text = Now.ToString("dd/MM/yyyy")
TxtFechaLlegadaCP.Text = Now.ToString("dd/MM/yyyy")
DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear()
DdlChofer.Items.Clear()
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
DdlChofer.DataBind()
DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
DdlRemolque1.DataSource = ObjInv.DtResultados
End If
End Using
DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind()
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
DdlConfigAuto.DataSource = ObjGrales.DtResultados
End If
End Using
DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlUnidadCamionActivoFijo_SelectedIndexChanged(sender As Object, e As EventArgs)
ChkEmitirCartaPorte.Checked = True
DvRemolque1.Visible = False
DvRemolque2.Visible = False
DdlRemolque1.SelectedValueExist(-1)
DdlRemolque2.SelectedValueExist(-1)
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte"))
DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If
End Using
End If
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlConfigAuto_SelectedIndexChanged(sender As Object, e As EventArgs)
ValidaConfiguracionVeiculo()
End Sub
Public Sub CargaVentaCortePorte(CveVenta As Integer)
TxtFechaEntregaCP.Enabled = False
TxtFechaLlegadaCP.Enabled = False
Using ObjGral As New ClsGenerales
If ObjGral.GetGralTimbre(-1, "Man", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
Dim RowCP As DataRow = ObjGral.DtResultados.Rows(0)
Me.CveTimbreCartaPorteVenta = RowCP("CveTimbre").ToString().ToEntero()
If CveTimbreCartaPorteVenta > 0 Then
ChkEmitirCartaPorte.Checked = True
ChkEmitirCartaPorte.Enabled = False
End If
TxtFechaEntregaCP.Text = RowCP("FechaEntrega").ToString()
TxtFechaLlegadaCP.Text = RowCP("FechaLlegada").ToString()
TxtDistancia.Text = RowCP("Distancia").ToString()
DdlChofer.SelectedValueExist(RowCP("CveChofer").ToString())
DdlUnidadCamion.SelectedValueExist(RowCP("CveCamion").ToString())
End If
End Using
DdlChofer.Enabled = False
DdlUnidadCamion.Enabled = False
End Sub
Private Sub ValidaConfiguracionVeiculo()
DvRemolque1.Visible = False
DvRemolque2.Visible = False
DdlRemolque1.SelectedValueExist(-1)
DdlRemolque2.SelectedValueExist(-1)
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
If Remolque = "1" Then
RequiereRemolque = True
MostrarRemolques = True
End If
If Remolque = "0, 1" Then
RequiereRemolque = False
MostrarRemolques = True
End If
If Remolque = "0" Then
RequiereRemolque = False
MostrarRemolques = False
End If
End If
End Using
Else
RequiereRemolque = False
MostrarRemolques = False
End If
If RequiereRemolque Or MostrarRemolques Then
DvRemolque1.Visible = True
End If
If Not RequiereRemolque Then
DvConfiguracionVeiculo.Visible = False
Else
DvConfiguracionVeiculo.Visible = True
End If
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlRemolque1_SelectedIndexChanged(sender As Object, e As EventArgs)
DdlRemolque2.Items.Clear()
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
DvRemolque2.Visible = True
Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
End If
End Using
DdlRemolque2.DataBind()
Else
DvRemolque2.Visible = False
End If
DdlRemolque2.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
UpEmitirTransitorio.Update()
End Sub
Private Function GuardarCartaPorte(ByRef ObjFactura As Modelos.Factura, ByRef ObjGral As ClsGenerales, ByRef ObjClientes As ClsClientes) As Integer
Dim ErrorProceso As Boolean = False
Dim CveTimbre As Integer = -1
Try
Dim CveDireccionOrigen As Integer = -1
Dim CveDireccionDestino As Integer = -1
If SucursalOrigenCP IsNot Nothing Then
CveDireccionOrigen = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalOrigenCP.Direccion, SucursalOrigenCP.NoExt, SucursalOrigenCP.NoInt, SucursalOrigenCP.Colonia, SucursalOrigenCP.Municipio, SucursalOrigenCP.Estado, SucursalOrigenCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalOrigenCP.CveEstado, CvePais:=SucursalOrigenCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If SucursalDestinoCP IsNot Nothing Then
CveDireccionDestino = 0 'ObjClientes.DireccionEnvioAdd(-1, SucursalDestinoCP.Direccion, SucursalDestinoCP.NoExt, SucursalDestinoCP.NoInt, SucursalDestinoCP.Colonia, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.CP.ToEntero(), "", UsuarioActual.CveUsuario, 1, -1, "", CveEstado:=SucursalDestinoCP.CveEstado, CvePais:=SucursalDestinoCP.CvePais, CveEmpresa:=UsuarioActual.CveEmpresa)
End If
If Not (CveDireccionOrigen > 0 And CveDireccionDestino > 0) Then
ErrorProceso = True
Return -1
End If
Dim Fechallegada As DateTime = TxtFechaLlegadaCP.Text.ToDateTime()
Dim FechaEntrega As DateTime = TxtFechaEntregaCP.Text.ToDateTime()
Dim Distancia As Integer = TxtDistancia.Text.ToEntero()
Dim CveEntregaAlmacen As Integer = ObjGral.AddInvEntregaAlmacenRuta(DdlSubProyectoDatos.SelectedValue.ToEntero, CveDireccionOrigen, CveDireccionDestino, -1, DdlChofer.SelectedValue.ToEntero, DdlUnidadCamion.SelectedValue.ToEntero, FechaEntrega, Fechallegada, "T", "-1", "-1", Fechallegada, 1, 1, Distancia,
CveConfigAutoTransporte:=DdlConfigAuto.SelectedValue.ToEntero, CveCamionRemolque1:=DdlRemolque1.SelectedValue.ToEntero, CveCamionRemolque2:=DdlRemolque2.SelectedValue.ToEntero)
If CveEntregaAlmacen > 0 Then
For Each RowPS As DataRow In ObjFactura.DtDetalle.FiltraParametros("CveTipoPS = 2").Rows
If Not ObjGral.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen, RowPS("CvePS").ToString().ToEntero, RowPS("Cantidad").ToString().ToEntero, RowPS("CveUM").ToString().ToEntero, UsuarioActual.CveUsuario) Then
ErrorProceso = True
Exit For
End If
Next
CveTimbre = ObjGral.AddGralTimbre("Man", DdlSubProyectoDatos.SelectedValue.ToEntero, TxtFecha.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:=CveEntregaAlmacen, AplicaCP:=True, CveVenta:=ObjFactura.CveVenta)
If Not CveTimbre > 0 Then
ErrorProceso = True
End If
Else
ErrorProceso = True
End If
Catch ex As Exception
ErrorProceso = True
OnError("Ocurrió un error al guardar los datos de la carta porte", ex)
End Try
If Not ErrorProceso Then
Return CveTimbre
Else
Return -1
End If
End Function
Property RequiereRemolque As Boolean
Get
If ViewState("RequiereRemolque") Is Nothing Then
ViewState("RequiereRemolque") = False
End If
Return Boolean.Parse(ViewState("RequiereRemolque").ToString)
End Get
Set(value As Boolean)
ViewState("RequiereRemolque") = value
End Set
End Property
Property MostrarRemolques As Boolean
Get
If ViewState("MostrarRemolques") Is Nothing Then
ViewState("MostrarRemolques") = False
End If
Return Boolean.Parse(ViewState("MostrarRemolques").ToString)
End Get
Set(value As Boolean)
ViewState("MostrarRemolques") = value
End Set
End Property
Property SucursalOrigenCP As Modelos.SucursalModel
Get
If ViewState("SucursalOrigenCP") Is Nothing Then
Return Nothing
End If
Return DirectCast(ViewState("SucursalOrigenCP"), Modelos.SucursalModel)
End Get
Set(value As Modelos.SucursalModel)
ViewState("SucursalOrigenCP") = value
End Set
End Property
Property SucursalDestinoCP As Modelos.SucursalModel
Get
If ViewState("SucursalDestinoCP") Is Nothing Then
Return Nothing
End If
Return DirectCast(ViewState("SucursalDestinoCP"), Modelos.SucursalModel)
End Get
Set(value As Modelos.SucursalModel)
ViewState("SucursalDestinoCP") = value
End Set
End Property
Private Sub CargaDireccionSucursalOrigen(Row As DataRow)
If SucursalOrigenCP Is Nothing Then
SucursalOrigenCP = New Modelos.SucursalModel
Else
SucursalOrigenCP = Nothing
SucursalOrigenCP = New Modelos.SucursalModel
End If
Dim SBDomicilioSucursal As New StringBuilder()
Try
If Row IsNot Nothing Then
SucursalOrigenCP.Direccion = Row("Calle").ToString()
SucursalOrigenCP.NoExt = Row("NoExt").ToString()
SucursalOrigenCP.NoInt = Row("NoInt").ToString()
SucursalOrigenCP.Colonia = Row("Colonia").ToString()
SucursalOrigenCP.CP = Row("CP").ToString()
SucursalOrigenCP.Municipio = Row("Municipio").ToString()
'SucursalOrigenCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalOrigenCP.Estado = Row("Estado").ToString()
'SucursalOrigenCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalOrigenCP.Pais = Row("Pais").ToString()
SBDomicilioSucursal.AppendFormat("{0}", Row("Calle").ToString())
If Row("NoInt").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", No.Int: {0}", Row("NoInt").ToString())
End If
If Row("Colonia").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", Col: {0}", Row("Colonia").ToString())
End If
If Row("CP").ToString().ToEntero > 0 Then
SBDomicilioSucursal.AppendFormat(", CP: {0}", Row("CP").ToString())
End If
If Row("NoExt").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(" No.Ext: {0}", Row("NoExt").ToString())
End If
Dim CiudadSucursal As String = String.Format("{0},{1}", Row("Municipio").ToString(), Row("Estado").ToString())
If CiudadSucursal.Length > 0 Then
SBDomicilioSucursal.AppendFormat(", {0}", CiudadSucursal)
End If
If Row("Pais").ToString().Length > 0 Then
SBDomicilioSucursal.AppendFormat(", {0}", Row("Pais").ToString())
End If
If Not String.IsNullOrEmpty(Row("Telefono").ToString()) Then
SucursalOrigenCP.TelefonoSucursal = Row("Telefono").ToString()
End If
End If
Catch ex As Exception
SBDomicilioSucursal.Clear()
GuardaLog(ex.ToString())
End Try
TxtOrigenCP.Text = SBDomicilioSucursal.ToString
UpEmitirTransitorio.Update()
End Sub
Protected Sub DdlDireccionEnvio_SelectedIndexChanged(sender As Object, e As EventArgs)
If SucursalDestinoCP Is Nothing Then
SucursalDestinoCP = New Modelos.SucursalModel
Else
SucursalDestinoCP = Nothing
SucursalDestinoCP = New Modelos.SucursalModel
End If
If TmpDTEnvioDireccion IsNot Nothing AndAlso TmpDTEnvioDireccion.FiltraParametros(String.Format("CveDireccionEnvio = {0}", DdlDireccionEnvio.SelectedValue.ToEntero())).Rows.Count > 0 Then
Dim Row As DataRow = TmpDTEnvioDireccion.FiltroPrimero(String.Format("CveDireccionEnvio = {0}", DdlDireccionEnvio.SelectedValue.ToEntero()))
If Row IsNot Nothing Then
SucursalDestinoCP.Direccion = Row("EnvioDireccion").ToString()
SucursalDestinoCP.Colonia = Row("EnvioColonia").ToString()
SucursalDestinoCP.Municipio = Row("EnvioCiudad").ToString()
'SucursalDestinoCP.CveEstado = Row("CveEstado").ToString().ToEntero()
SucursalDestinoCP.Estado = Row("EnvioEstado").ToString()
'SucursalDestinoCP.CvePais = Row("CvePais").ToString().ToEntero()
SucursalDestinoCP.Pais = Row("Pais").ToString()
SucursalDestinoCP.CP = Row("EnvioCP").ToString()
TxtDestinoCP.Text = String.Format("{0} col. {1},CP:{2}, {3},{4},{5}", SucursalDestinoCP.Direccion, SucursalDestinoCP.Colonia, SucursalDestinoCP.CP, SucursalDestinoCP.Municipio, SucursalDestinoCP.Estado, SucursalDestinoCP.Pais)
Else
TxtDestinoCP.Text = ""
End If
Else
TxtDestinoCP.Text = ""
End If
UpEmitirTransitorio.Update()
End Sub
#End Region
End Class End Class