-- cambios en carta porte
This commit is contained in:
@@ -14,7 +14,6 @@ Partial Class Acarreos_CatChoferes
|
||||
CargaDatos()
|
||||
CargaDdlTransportista()
|
||||
|
||||
Dim DT As DataTable = GlobalDTColonia(-1)
|
||||
CargaDdls()
|
||||
|
||||
|
||||
@@ -23,14 +22,10 @@ Partial Class Acarreos_CatChoferes
|
||||
|
||||
|
||||
Private Sub CargaDdls()
|
||||
|
||||
|
||||
|
||||
DdlEstado.DataSource = GlobalDTEstado(-1).FiltraParametros("ClaveSATPais = 'MEX'")
|
||||
DdlEstado.DataSource = GlobalDTEstado("MEX")
|
||||
DdlEstado.DataBind()
|
||||
DdlEstado.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
|
||||
|
||||
DdlMunicipio.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
DdlLocalidad.Items.Insert(0, New ListItem("Seleccione Una", "-1"))
|
||||
DdlColonia.Items.Insert(0, New ListItem("Seleccione Una", "-1"))
|
||||
@@ -153,10 +148,9 @@ Partial Class Acarreos_CatChoferes
|
||||
DdlLocalidad.DataSource = GlobalDTLocalidad(DdlEstado.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero)
|
||||
DdlLocalidad.DataBind()
|
||||
|
||||
DdlColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado("MEX").FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString).FiltraParametros($"CveMunicipio = {DdlMunicipio.SelectedValue.ToEntero}")(0)("ClaveSATMunicipio").ToString).FiltraParametros(If(TxtCP.Text.Trim.Length > 0, $"CP = {TxtCP.Text}", ""))
|
||||
DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtCP.Text.Trim.Length > 0, TxtCP.Text.ToEntero, -1))
|
||||
DdlColonia.DataBind()
|
||||
|
||||
|
||||
End If
|
||||
|
||||
DdlLocalidad.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
@@ -282,12 +276,9 @@ Partial Class Acarreos_CatChoferes
|
||||
DdlLocalidad.DataSource = GlobalDTLocalidad(DdlEstado.SelectedValue.ToEntero, DdlMunicipio.SelectedValue.ToEntero)
|
||||
DdlLocalidad.DataBind()
|
||||
|
||||
DdlColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado("MEX").FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString).FiltraParametros($"CveMunicipio = {DdlMunicipio.SelectedValue.ToEntero}")(0)("ClaveSATMunicipio").ToString).FiltraParametros(If(TxtCP.Text.Trim.Length > 0, $"CP = {TxtCP.Text}", ""))
|
||||
DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtCP.Text.Trim.Length > 0, TxtCP.Text.ToEntero, -1))
|
||||
DdlColonia.DataBind()
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
DdlLocalidad.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
|
||||
@@ -320,12 +311,11 @@ Partial Class Acarreos_CatChoferes
|
||||
Dim CveColonia As Integer = DdlColonia.SelectedValue.ToEntero
|
||||
|
||||
If CPTxt > 0 And CveColonia > 0 Then
|
||||
Dim CP As Integer = GlobalDTColonia(-1).FiltroPrimeroValor("CP", $"CveColonia = {CveColonia}")
|
||||
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
|
||||
If CPTxt <> CP Then
|
||||
Alert("El codigo postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlColonia_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -218,16 +218,16 @@ Public Class CFDIComprobante
|
||||
End Property
|
||||
Public Property TipoDocto As String
|
||||
Public Property FormadePago As String
|
||||
Public Property CondicionesdePago As String
|
||||
Public Property CondicionesdePago As String = ""
|
||||
Public Property Fecha As Date
|
||||
Public Property Subtotal As Decimal = 0
|
||||
Public Property SubTotal As Decimal = 0
|
||||
Public Property Descuentos As Decimal = 0
|
||||
Public Property Total As Decimal = 0
|
||||
Public Property MotivoDescuento As String = ""
|
||||
Public Property TipoCambio As String = "1"
|
||||
Public Property Moneda As String = ""
|
||||
Public Property TipoComprobante As String = ""
|
||||
Public Property MetodoPago As String = ""
|
||||
Public Property Total As Decimal = 0
|
||||
Public Property LugarExpedicion As String = ""
|
||||
Public Property NumCuentaPago As String = ""
|
||||
Public Property Confirmacion As String = ""
|
||||
@@ -616,9 +616,8 @@ Public Class CFDICartaPorteUbicacion
|
||||
Public Property NumEstacion As String = ""
|
||||
Public Property NombreEstacion As String = ""
|
||||
Public Property NavegacionTrafico As String = ""
|
||||
Public Property FechaHoraSalida As String = ""
|
||||
Public Property FechaHoraSalidaLlegada As String = ""
|
||||
Public Property DistanciaRecorrida As Decimal = 0
|
||||
Public Property FechaHoraProgLlegada As String
|
||||
Public Property Domicilio As New CFDICartaPorteDomicilio
|
||||
End Class
|
||||
|
||||
@@ -652,7 +651,11 @@ End Class
|
||||
|
||||
<Serializable>
|
||||
Public Class CFDICartaPorteMercancias
|
||||
Public Property PesoBrutoTotal As Double = 0
|
||||
Public ReadOnly Property PesoBrutoTotal As Double
|
||||
Get
|
||||
Return Mercancias.Sum(Function(item) item.PesoenKg)
|
||||
End Get
|
||||
End Property
|
||||
Public Property UnidadPeso As String = ""
|
||||
Public ReadOnly Property PesoNetoTotal As Double
|
||||
Get
|
||||
@@ -706,6 +709,7 @@ Public Class CFDICartaPorteMercanciaTransporta
|
||||
Public Property Cantidad As Decimal = 0
|
||||
Public Property IDOrigen As String = ""
|
||||
Public Property IDDestino As String = ""
|
||||
Public Property CvesTransportes As String = ""
|
||||
|
||||
End Class
|
||||
|
||||
@@ -744,10 +748,11 @@ End Class
|
||||
|
||||
<Serializable>
|
||||
Public Class CFDICartaPorteOperador
|
||||
Public Property RFCOperador As String = ""
|
||||
Public Property TipoFigura As String = "01"
|
||||
Public Property RFCFigura As String = ""
|
||||
Public Property NumLicencia As String = ""
|
||||
Public Property NombreOperador As String = ""
|
||||
Public Property NumRegidTribOperador As String = ""
|
||||
Public Property ResidenciaFiscalOperador As String = ""
|
||||
Public Property NombreFigura As String = ""
|
||||
Public Property NumRegidTribFigura As String = ""
|
||||
Public Property ResidenciaFiscalFigura As String = ""
|
||||
Public Property Domicilio As New CFDICartaPorteDomicilio
|
||||
End Class
|
||||
|
||||
@@ -2844,11 +2844,13 @@ Public Class ClsGenerales
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetSATColonia(ClaveSATMunicipio As String) As Boolean
|
||||
Public Function GetSATColonia(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("Gral_SAT_ColoniaGet")
|
||||
DataAdapter("PA_Gral_SAT_ColoniaGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@ClaveSATEstado", SqlDbType.VarChar).Value = ClaveSATEstado
|
||||
.Add("@ClaveSATMunicipio", SqlDbType.VarChar).Value = ClaveSATMunicipio
|
||||
.Add("@ClaveSATColonia", SqlDbType.VarChar).Value = ClaveSATColonia
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
@@ -3613,8 +3615,10 @@ Public Class ClsGenerales
|
||||
#Region "GRAL TIMBRES"
|
||||
|
||||
|
||||
Public Function AddGralTimbre(TipoDocto As String, Serie As String, Folio As Integer, FolioFiscal As String, Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer,
|
||||
Estatus As Integer, CvePAC As Integer, AplicaCP As Boolean, CveEntregaAlmacen As Integer, CveSubProyectoOrigen As Integer) 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 CveEntregaAlmacen As Integer = -1,
|
||||
Optional AplicaCP As Boolean = False) As Integer
|
||||
|
||||
Dim Retorno As Integer = -1
|
||||
DataAdapter("PA_Gral_TimbreAdd")
|
||||
@@ -3624,15 +3628,13 @@ Public Class ClsGenerales
|
||||
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
.Add("@Folio", SqlDbType.Int).Value = Folio
|
||||
.Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
.Add("@CvePAC", SqlDbType.Int).Value = CvePAC
|
||||
.Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
|
||||
.Add("@CveEntregaAlmacen", SqlDbType.Int).Value = CveEntregaAlmacen
|
||||
.Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyectoOrigen
|
||||
.Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyecto
|
||||
|
||||
.Add("@CveTimbre", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
.Add("@FolioInsertado", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||
@@ -3654,15 +3656,13 @@ Public Class ClsGenerales
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function GetGralTimbre(CveTimbre As Integer, TipoDocto As String, Serie As String, Folio As Integer, 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) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_TimbreGet")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
|
||||
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
.Add("@Folio", SqlDbType.Int).Value = Folio
|
||||
.Add("@FechaI", SqlDbType.Date).Value = FechaI
|
||||
.Add("@FechaF", SqlDbType.Date).Value = FechaF
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
@@ -3681,37 +3681,49 @@ Public Class ClsGenerales
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateGralTimbre(CveTimbre As Integer, TipoDocto As String, Serie As String, Folio As Integer, FolioFiscal As String, Fecha As Date, CveUsuario As Integer, CveEmpresa As Integer,
|
||||
Estatus As Integer, CvePAC As Integer, CvePACCancelacion As Integer, FechaCancelacion As Date, AplicaCP As Boolean, SelloCancelacion As String
|
||||
) As Boolean
|
||||
Public Function UpdateTimbreTimbrado(CveTimbre As Integer, FolioFiscal As String, Fecha As DateTime, CveUsuario As Integer, CveEmpresa As Integer,
|
||||
CvePAC As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_TimbreUpdate")
|
||||
DataAdapter("PA_Gral_TimbreTimbrado")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
|
||||
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
.Add("@Folio", SqlDbType.Int).Value = Folio
|
||||
.Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
|
||||
.Add("@CvePAC", SqlDbType.Int).Value = CvePAC
|
||||
.Add("@CvePACCancelacion", SqlDbType.Int).Value = CvePACCancelacion
|
||||
.Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion
|
||||
.Add("@AplicaCP", SqlDbType.Bit).Value = AplicaCP
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion
|
||||
|
||||
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el timbre", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function CancelarTimbreTimbrado(CveTimbre As Integer, FechaCancelacion As DateTime, CvePACCancelacion As Integer, SelloCancelacion As String, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Gral_TimbreTimbradoCancelar")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveTimbre", SqlDbType.Int).Value = CveTimbre
|
||||
.Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion
|
||||
.Add("@CvePACCancelacion", SqlDbType.Int).Value = CvePACCancelacion
|
||||
.Add("@SelloCancelacion", SqlDbType.VarChar).Value = SelloCancelacion
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el timbrado", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
@@ -3758,13 +3770,13 @@ Public Class ClsGenerales
|
||||
|
||||
End Function
|
||||
|
||||
Public Function AddInvEntregaAlmacenRuta(CveSubProyectoOrigen As Integer, CveMovimientoAlmacen As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, Tipo As String, Orden As Integer, Estatus As Integer) As Integer
|
||||
Public Function AddInvEntregaAlmacenRuta(CveSubProyecto As Integer, CveDireccionOrigen As Integer, CveDireccionDestino As Integer, CveMovimientoAlmacen As Integer, CveChofer As Integer, CveCamion As Integer, FechaEntrega As Date, Tipo As String, Orden As Integer, Estatus As Integer) As Integer
|
||||
Dim Retorno As Integer = -1
|
||||
DataAdapter("PA_Inv_EntregaAlmacenRutaAdd")
|
||||
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveSubProyectoOrigen", SqlDbType.Int).Value = CveSubProyectoOrigen
|
||||
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
|
||||
.Add("@CveMovimientoAlmacen", SqlDbType.Int).Value = CveMovimientoAlmacen
|
||||
.Add("@CveDireccionOrigen", SqlDbType.Int).Value = CveDireccionOrigen
|
||||
.Add("@CveDireccionDestino", SqlDbType.Int).Value = CveDireccionDestino
|
||||
|
||||
@@ -1032,7 +1032,7 @@ Public Class ClsNominas
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateEstatusNomNominas(Estatus As Integer, CvePAC As Integer, FolioFiscal As String, SelloSAT As String, FechaCancelacion As DateTime, CveNomina As Integer, Optional SubTotal As Double = -1, Optional Descuento As Double = -1, Optional ISR As Double = -1, Optional Total As Double = -1, Optional DiasPagados As Double = -1, Optional isFiniquito As Boolean = False) As Boolean
|
||||
Public Function UpdateEstatusNomNominas(Estatus As Integer, CvePAC As Integer, FolioFiscal As String, FechaTimbrado As DateTime, FechaCancelacion As DateTime, CveNomina As Integer, Optional SubTotal As Double = -1, Optional Descuento As Double = -1, Optional ISR As Double = -1, Optional Total As Double = -1, Optional DiasPagados As Double = -1, Optional isFiniquito As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Nom_NominasUpdateEstatus")
|
||||
@@ -1042,7 +1042,7 @@ Public Class ClsNominas
|
||||
.Add("@CveEstatusCFDi", SqlDbType.Int).Value = Estatus
|
||||
.Add("@CvePAC", SqlDbType.Int).Value = CvePAC
|
||||
.Add("@FolioFiscal", SqlDbType.VarChar).Value = FolioFiscal
|
||||
.Add("@SelloDigitalSAT", SqlDbType.VarChar).Value = SelloSAT
|
||||
.Add("@FechaTimbrado", SqlDbType.DateTime).Value = FechaTimbrado
|
||||
.Add("@FechaCancelacion", SqlDbType.DateTime).Value = FechaCancelacion
|
||||
.Add("@SubTotal", SqlDbType.Money).Value = SubTotal
|
||||
.Add("@Descuento", SqlDbType.Money).Value = Descuento
|
||||
|
||||
@@ -372,56 +372,68 @@ Public Class ClsPaginas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property GlobalDTPais() As DataTable
|
||||
|
||||
Property GlobalDTGralPaises() As DataTable
|
||||
Get
|
||||
GlobalDTPais = DirectCast(Application("GlobalDTPais"), DataTable)
|
||||
If Application("GlobalDTGralPaises") Is Nothing Then
|
||||
Dim ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetSATPais() Then Application("GlobalDTGralPaises") = ObjGrales.DtResultados Else Application("GlobalDTGralPaises") = Nothing
|
||||
ObjGrales.Dispose()
|
||||
End If
|
||||
GlobalDTGralPaises = DirectCast(Application("GlobalDTGralPaises"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTPais") = value
|
||||
Application("GlobalDTGralPaises") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property GlobalDTEstado(ClaveSATPais As String) As DataTable
|
||||
Property GlobalDTEstado(ClaveSATPais As String, Optional CvePais As Integer = -1) As DataTable
|
||||
Get
|
||||
If Application("GlobalDTEstado") Is Nothing Then
|
||||
Dim AppNombre As String = "GlobalDTEstado"
|
||||
If Application(AppNombre) Is Nothing Then
|
||||
Dim ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetSATEstado("-1") Then Application("GlobalDTEstado") = ObjGrales.DtResultados Else Application("GlobalDTEstado") = Nothing
|
||||
If ObjGrales.GetSATEstado("-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing
|
||||
ObjGrales.Dispose()
|
||||
End If
|
||||
|
||||
If ClaveSATPais <> "-1" Then
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTEstado"), DataTable), String.Format("ClaveSATPais = '{0}'", ClaveSATPais), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTEstado = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTEstado = DirectCast(Application("GlobalDTEstado"), DataTable)
|
||||
End If
|
||||
Dim Filtro As New StringBuilder
|
||||
Filtro.Append(" 1 = 1 ")
|
||||
If ClaveSATPais <> "-1" Then Filtro.AppendFormat(" AND ClaveSATPais = '{0}' ", ClaveSATPais)
|
||||
If CvePais > 0 Then Filtro.AppendFormat(" AND CvePais = {0} ", CvePais)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
|
||||
GlobalDTEstado = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTEstado") = value
|
||||
Dim AppNombre As String = "GlobalDTEstado"
|
||||
Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property GlobalDTMunicipio(ClaveSATEstado As String) As DataTable
|
||||
Property GlobalDTMunicipio(ClaveSATEstado As String, Optional CveEstado As Integer = -1) As DataTable
|
||||
Get
|
||||
If Application("GlobalDTMunicipio") Is Nothing Then
|
||||
|
||||
Dim AppNombre As String = "GlobalDTMunicipio"
|
||||
If Application(AppNombre) Is Nothing Then
|
||||
Dim ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetSATMunicipio("-1") Then Application("GlobalDTMunicipio") = ObjGrales.DtResultados Else Application("GlobalDTMunicipio") = Nothing
|
||||
If ObjGrales.GetSATMunicipio("-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing
|
||||
ObjGrales.Dispose()
|
||||
End If
|
||||
|
||||
If ClaveSATEstado <> "-1" Then
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTMunicipio"), DataTable), String.Format("ClaveSATEstado = '{0}'", ClaveSATEstado), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTMunicipio = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTMunicipio = DirectCast(Application("GlobalDTMunicipio"), DataTable)
|
||||
End If
|
||||
Dim Filtro As New StringBuilder
|
||||
Filtro.Append(" 1 = 1 ")
|
||||
If ClaveSATEstado <> "-1" Then Filtro.AppendFormat(" AND ClaveSATEstado = '{0}' ", ClaveSATEstado)
|
||||
If CveEstado > 0 Then Filtro.AppendFormat(" AND CveEstado = {0} ", CveEstado)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
|
||||
GlobalDTMunicipio = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTMunicipio") = value
|
||||
Dim AppNombre As String = "GlobalDTMunicipio"
|
||||
Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -466,26 +478,34 @@ Public Class ClsPaginas
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
Property GlobalDTColonia(ClaveSATMunicipio As String) As DataTable
|
||||
Property GlobalDTGralColonias(ClaveSATEstado As String, ClaveSATMunicipio As String, ClaveSATColonia As String,
|
||||
Optional CveMunicipio As Integer = -1, Optional CodigoPostal As Integer = -1, Optional CveColonia As Integer = -1) As DataTable
|
||||
Get
|
||||
If Application("GlobalDTColonia") Is Nothing Then
|
||||
Dim AppNombre As String = "GlobalDTGralColonias"
|
||||
If Application(AppNombre) Is Nothing Then
|
||||
Dim ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetSATColonia("-1") Then Application("GlobalDTColonia") = ObjGrales.DtResultados Else Application("GlobalDTColonia") = Nothing
|
||||
If ObjGrales.GetSATColonia("-1", "-1", "-1") Then Application(AppNombre) = ObjGrales.DtResultados Else Application(AppNombre) = Nothing
|
||||
ObjGrales.Dispose()
|
||||
End If
|
||||
|
||||
If ClaveSATMunicipio <> "-1" Then
|
||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTColonia"), DataTable), String.Format("ClaveSATMunicipio = '{0}'", ClaveSATMunicipio), "", DataViewRowState.CurrentRows)
|
||||
GlobalDTColonia = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
Else
|
||||
GlobalDTColonia = DirectCast(Application("GlobalDTColonia"), DataTable)
|
||||
End If
|
||||
Dim Filtro As New StringBuilder
|
||||
Filtro.Append(" 1 = 1 ")
|
||||
If ClaveSATEstado <> "-1" Then Filtro.AppendFormat(" AND ClaveSATEstado = '{0}' ", ClaveSATEstado)
|
||||
If ClaveSATMunicipio <> "-1" Then Filtro.AppendFormat(" AND ClaveSATMunicipio = '{0}' ", ClaveSATMunicipio)
|
||||
If ClaveSATColonia <> "-1" Then Filtro.AppendFormat(" AND ClaveSATColonia = '{0}' ", ClaveSATColonia)
|
||||
If CveMunicipio > 0 Then Filtro.AppendFormat(" AND CveMunicipio = {0} ", CveMunicipio)
|
||||
If CodigoPostal > 0 Then Filtro.AppendFormat(" AND CP = {0} ", CodigoPostal)
|
||||
If CveColonia > 0 Then Filtro.AppendFormat(" AND CveColonia = {0} ", CveColonia)
|
||||
|
||||
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Filtro.ToString, "", DataViewRowState.CurrentRows)
|
||||
GlobalDTGralColonias = Dv.ToTable
|
||||
Dv.Dispose()
|
||||
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTColonia") = value
|
||||
Dim AppNombre As String = "GlobalDTGralColonias"
|
||||
Application(AppNombre) = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -2420,39 +2440,6 @@ Public Class ClsPaginas
|
||||
#End Region
|
||||
|
||||
#Region "***********************************************************************DT GENERALES**************************************************************************************"
|
||||
Property GlobalDTGralPaises() As DataTable
|
||||
Get
|
||||
GlobalDTGralPaises = DirectCast(Application("GlobalDTGralPaises"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTGralPaises") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTGralEstados(CvePais As Integer) As DataTable
|
||||
Get
|
||||
GlobalDTGralEstados = DirectCast(Application("GlobalDTGralEstados"), DataTable).FiltraParametros(String.Format("CvePais ={0}", CvePais))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTGralEstados") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTGralMunicipios(CveEstado As Integer) As DataTable
|
||||
Get
|
||||
GlobalDTGralMunicipios = DirectCast(Application("GlobalDTGralMunicipios"), DataTable).FiltraParametros(String.Format("CveEstado ={0}", CveEstado))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTGralMunicipios") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property GlobalDTGralPoblaciones() As DataTable
|
||||
Get
|
||||
GlobalDTGralPoblaciones = DirectCast(Application("GlobalDTGralPoblaciones"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
Application("GlobalDTGralPoblaciones") = value
|
||||
End Set
|
||||
End Property
|
||||
Property GlobalDTGralCategorias(CveEmpresa As Integer) As DataTable
|
||||
|
||||
Get
|
||||
@@ -6751,7 +6738,7 @@ Public Class ClsPaginas
|
||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||
End Try
|
||||
End Sub
|
||||
Protected Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True) As Byte()
|
||||
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True) As Byte()
|
||||
Dim retorno As Byte() = Nothing
|
||||
|
||||
' Dim ObjVentas As New ClsVentas
|
||||
@@ -6823,12 +6810,9 @@ Public Class ClsPaginas
|
||||
End Try
|
||||
|
||||
If EsXMLValido Then
|
||||
Dim TC As Decimal = 1
|
||||
Try
|
||||
TC = XmlDoc.DocumentElement.Attributes("TipoCambio").InnerText.ToDecimal
|
||||
Catch ex As Exception
|
||||
TC = 1
|
||||
End Try
|
||||
Dim TC As Decimal = ValorNodoXML(XmlDoc.DocumentElement, "TC").ToDecimal
|
||||
If TC <= 0 Then TC = 1
|
||||
|
||||
If ValorNodoXML(XmlDoc.DocumentElement, "version") = "3.3" Then
|
||||
Vta.FechaEmision = ValorNodoXML(XmlDoc.DocumentElement, "fecha").ToDate
|
||||
Vta.NoSerieCertificadoContribuyente = ValorNodoXML(XmlDoc.DocumentElement, "NoCertificado")
|
||||
@@ -7424,8 +7408,8 @@ Public Class ClsPaginas
|
||||
|
||||
RutaFormato = String.Format("{0}Formatos\{1}.rdlc", UsuarioActual.Empresa.Ruta, NombreArchivo)
|
||||
RutaFormatoDefault = String.Format("Empresas\Grales\Formatos\{0}.rdlc", NombreArchivo)
|
||||
Case "RNC"
|
||||
|
||||
Case "RNC"
|
||||
|
||||
NombreArchivo = "RemisionNC"
|
||||
NombreArchivoDescarga = "RemisionNC"
|
||||
|
||||
@@ -6175,6 +6175,7 @@ Namespace Modelos
|
||||
Public Property DtMovimientosUsados As DataTable
|
||||
Public Property CveAlmacenDevolucion As Integer
|
||||
Public Property CveVenta As Integer
|
||||
Public Property CveTimbre As Integer
|
||||
Public Property CveEmpresa As Integer
|
||||
Public Property CveSucursal As Integer 'sucursal de la empresa que factura
|
||||
Public Property CveSubProyecto As Integer
|
||||
@@ -6244,7 +6245,7 @@ Namespace Modelos
|
||||
End Property
|
||||
|
||||
Public Property Inv_CveMovimiento As Integer
|
||||
Public Property Inv_CveEstatusEntrega As Integer
|
||||
Public Property Inv_CveEstatusEntrega As Integer = 0
|
||||
Public Property Inv_EstatusEntrega As String
|
||||
Public Property Inv_ValorInventario As Decimal
|
||||
Public Property Fecha As DateTime
|
||||
@@ -6266,7 +6267,8 @@ Namespace Modelos
|
||||
Public Property EstatusFactura As String
|
||||
Public Property SeTimbro As String
|
||||
Public Property TipoDocto As String
|
||||
Public Property RefDocto As String
|
||||
Public Property TipoComprobante As String
|
||||
Public Property RefDocto As String = ""
|
||||
Public Property RealizarDevolucionAlmacen As Boolean
|
||||
Public Property CveAlmacenDevolucionVenta As Integer
|
||||
|
||||
@@ -6402,24 +6404,24 @@ Namespace Modelos
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property MotivoDescuento As String
|
||||
Public Property MotivoDescuento As String = ""
|
||||
|
||||
|
||||
#Region "Totales"
|
||||
Public Property SubTotal As Decimal
|
||||
Public Property Descuento As Decimal
|
||||
Public Property Amortizacion As Decimal
|
||||
Public Property SubTotal As Decimal = 0
|
||||
Public Property Descuento As Decimal = 0
|
||||
Public Property Amortizacion As Decimal = 0
|
||||
|
||||
'IVA
|
||||
Public Property RetIVA As Decimal
|
||||
Public Property RetISR As Decimal
|
||||
Public Property IVA As Decimal
|
||||
Public Property IEPS As Decimal
|
||||
Public Property RetIVA As Decimal = 0
|
||||
Public Property RetISR As Decimal = 0
|
||||
Public Property IVA As Decimal = 0
|
||||
Public Property IEPS As Decimal = 0
|
||||
|
||||
Public Property Total As Decimal
|
||||
Public Property Otros As Decimal
|
||||
Public Property Total As Decimal = 0
|
||||
Public Property Otros As Decimal = 0
|
||||
|
||||
Public Property TotalRemNCAplicado As Decimal
|
||||
Public Property TotalRemNCAplicado As Decimal = 0
|
||||
|
||||
#Region "Totales por Tipo de cambio"
|
||||
|
||||
@@ -6507,32 +6509,31 @@ Namespace Modelos
|
||||
End Property
|
||||
#End Region
|
||||
#End Region
|
||||
Public Property AtencionA As String
|
||||
Public Property AtnA As String
|
||||
Public Property TelefonoGenerico As String
|
||||
Public Property Det_OrdenCompra As String
|
||||
Public Property Det_FechaOrdenCompra As String
|
||||
Public Property Det_ContraRecibo As String
|
||||
Public Property Observaciones As String
|
||||
Public Property AtencionA As String = ""
|
||||
Public Property TelefonoGenerico As String = ""
|
||||
Public Property Det_OrdenCompra As String = ""
|
||||
Public Property Det_FechaOrdenCompra As String = ""
|
||||
Public Property Det_ContraRecibo As String = ""
|
||||
Public Property Observaciones As String = ""
|
||||
|
||||
Public Property Alfa1 As String
|
||||
Public Property Alfa2 As String
|
||||
Public Property Alfa3 As String
|
||||
Public Property Alfa1 As String = ""
|
||||
Public Property Alfa2 As String = ""
|
||||
Public Property Alfa3 As String = ""
|
||||
|
||||
Public Property Fech1 As Date
|
||||
Public Property Fech2 As Date
|
||||
Public Property Fech3 As Date
|
||||
|
||||
Public Property Num1 As Double
|
||||
Public Property Num2 As Double
|
||||
Public Property Num3 As Double
|
||||
Public Property Num1 As Double = 0
|
||||
Public Property Num2 As Double = 0
|
||||
Public Property Num3 As Double = 0
|
||||
|
||||
Public Property DiasCredito As Integer
|
||||
Public Property EsDiasCreditoFijo As Boolean
|
||||
|
||||
Public Property CveCorte As Integer
|
||||
Public Property CveMesa As Integer
|
||||
Public Property NumeroPersonas As Integer
|
||||
Public Property CveCorte As Integer = -1
|
||||
Public Property CveMesa As Integer = -1
|
||||
Public Property NumeroPersonas As Integer = 0
|
||||
|
||||
<ComponentModel.DataAnnotations.Schema.NotMapped>
|
||||
Public Property FechaPago As Date
|
||||
@@ -6540,15 +6541,15 @@ Namespace Modelos
|
||||
Public Property CveNCaVincular As Integer
|
||||
Public Property FolioFiscal As String
|
||||
Public Property NoSerieCertificado As String
|
||||
Public Property SelloCFDi As String
|
||||
Public Property SelloSAT As String
|
||||
Public Property SelloCFDi As String = ""
|
||||
Public Property SelloSAT As String = ""
|
||||
Public Property FechaEmision As Date
|
||||
Public Property FechaCertificacion As Date
|
||||
Public Property NoSerieCertificadoContribuyente As String
|
||||
Public Property NumeroCuenta As String
|
||||
Public Property NumeroCuenta As String = ""
|
||||
Public Property CveTipoAmortizacionAnticipo As Integer = -1
|
||||
Public Property DescripcionContrato As String
|
||||
Public Property NumeroDescripcionContrato As String
|
||||
Public Property DescripcionContrato As String = ""
|
||||
Public Property NumeroDescripcionContrato As String = ""
|
||||
Public Property CveComplementoTimbrado As Integer = 0
|
||||
Public Property ComplementoINE As Modelos.ComplementoINE
|
||||
Public Property FordGSDB As String = ""
|
||||
@@ -6646,28 +6647,28 @@ Namespace Modelos
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Property CveClienteSucursal As Integer
|
||||
Public Property CveClienteSucursal As Integer = 0
|
||||
Public Property ClienteSucursal As Modelos.SucursalModel
|
||||
Public Property EnviarA As Modelos.EnviarAModel
|
||||
Public Property NumeroContrato As String
|
||||
Public Property PedidoContrato As String
|
||||
Public Property OrdenCompra As String = "-1"
|
||||
Public Property NumeroContrato As String = ""
|
||||
Public Property PedidoContrato As String = ""
|
||||
Public Property OrdenCompra As String = ""
|
||||
Public Property CveMetodoPago As Integer
|
||||
Public Property MetodoPago As String
|
||||
Public Property ClaveMetodoPagoSAT As String
|
||||
Public Property MetodoPago As String = ""
|
||||
Public Property ClaveMetodoPagoSAT As String = ""
|
||||
Public Property CveMetodoPago33 As Integer
|
||||
Public Property MetodoPago33 As String
|
||||
Public Property MetodoPago33 As String = ""
|
||||
Public Property CveFormaPago33 As Integer
|
||||
Public Property MetodoPagoSAT33 As String
|
||||
Public Property FormaPago33 As String
|
||||
Public Property FormaPagoSAT33 As String
|
||||
Public Property MetodoPagoSAT33 As String = ""
|
||||
Public Property FormaPago33 As String = ""
|
||||
Public Property FormaPagoSAT33 As String = ""
|
||||
Public Property UsoCFDI As String = ""
|
||||
Public Property CveUsoCFDI As Integer
|
||||
Public Property ClaveUsoCFDI As String = ""
|
||||
Public Property CveTipoRelacion As Integer = -1
|
||||
Public Property CveEstatusFactura As Integer
|
||||
Public Property CveVendedor As Integer
|
||||
Public Property VendedorCodigo As String
|
||||
Public Property VendedorCodigo As String = ""
|
||||
Public Property CveSucursalEjecucion As Integer
|
||||
Public Property FechaEjecucion As Date
|
||||
Public Property CveSucursalCobranza As Integer
|
||||
@@ -6675,15 +6676,15 @@ Namespace Modelos
|
||||
Public Property CveSubProyectoCobranza As Integer
|
||||
Public Property CveSubProyectoEjecucion As Integer
|
||||
Public Property CveOS As Integer
|
||||
Public Property CveContrato As Integer
|
||||
Public Property CveVentaPadre As Integer
|
||||
Public Property CvePrePoliza As Integer
|
||||
Public Property Entrega As String
|
||||
Public Property TiempoEntrega As String
|
||||
Public Property CveContrato As Integer = -1
|
||||
Public Property CveVentaPadre As Integer = -1
|
||||
Public Property CvePrePoliza As Integer = -1
|
||||
Public Property Entrega As String = ""
|
||||
Public Property TiempoEntrega As String = ""
|
||||
Public Property Vigencia As Date
|
||||
Public Property TipoEstatus As Integer
|
||||
Public Property CveCondicionEntrega As Integer
|
||||
Public Property CondicionEntrega As String
|
||||
Public Property CondicionEntrega As String = ""
|
||||
|
||||
Public Property TipoRelacion As String
|
||||
Public Property UUIDRelacionados As List(Of String)
|
||||
@@ -9667,21 +9668,21 @@ Namespace Modelos
|
||||
End Sub
|
||||
|
||||
Public Property AplicaFEMSA As Boolean = False 'AplicaFEMSA
|
||||
Public Property FEMSA_NumSociedad As String 'TxtFEMSA_NumSociedad.Text.Trim,
|
||||
Public Property FEMSA_NumProveedor As String 'TxtFEMSA_NumProveedor.Text.Trim,
|
||||
Public Property FEMSA_Mail As String 'TxtFEMSA_Mail.Text.Trim
|
||||
Public Property FEMSA_NumSociedad As String = "" 'TxtFEMSA_NumSociedad.Text.Trim,
|
||||
Public Property FEMSA_NumProveedor As String = "" 'TxtFEMSA_NumProveedor.Text.Trim,
|
||||
Public Property FEMSA_Mail As String = "" 'TxtFEMSA_Mail.Text.Trim
|
||||
|
||||
|
||||
Public Property FEMSA_Version As Integer 'TxtFEMSA_Version.Text.ToEntero, ClaseDocto,
|
||||
Public Property FEMSA_Version As Integer 'TxtFEMSA_Version.Text.ToEntero, ClaseDocto,
|
||||
Public Property FEMSA_NumPedido As Long 'TxtFEMSA_NumPedido.Text.Trim.ToLong,
|
||||
Public Property FEMSA_NumEntrada As String 'TxtFEMSA_NumEntrada.Text.Trim,
|
||||
Public Property FEMSA_NumRemision As String 'TxtFEMSA_NumRemision.Text.Trim,
|
||||
Public Property FEMSA_NumSocio As String 'TxtFEMSA_NumSocio.Text.Trim,
|
||||
Public Property FEMSA_CentroCosto As String 'TxtFEMSA_CentroCosto.Text.Trim,
|
||||
Public Property FEMSA_IPeriodoLiquidacion As String 'TxtFEMSA_IPeriodoLiquidacion.Text.Trim,
|
||||
Public Property FEMSA_FPeriodoLiquidacion As String 'TxtFEMSA_FPeriodoLiquidacion.Text.Trim,
|
||||
Public Property FEMSA_CodRetencion1 As String 'TxtFEMSA_CodRetencion1.Text.Trim,
|
||||
Public Property FEMSA_CodRetencion2 As String 'TxtFEMSA_CodRetencion2.Text.Trim,
|
||||
Public Property FEMSA_NumEntrada As String = "" 'TxtFEMSA_NumEntrada.Text.Trim,
|
||||
Public Property FEMSA_NumRemision As String = "" 'TxtFEMSA_NumRemision.Text.Trim,
|
||||
Public Property FEMSA_NumSocio As String = "" 'TxtFEMSA_NumSocio.Text.Trim,
|
||||
Public Property FEMSA_CentroCosto As String = "" 'TxtFEMSA_CentroCosto.Text.Trim,
|
||||
Public Property FEMSA_IPeriodoLiquidacion As String = "" 'TxtFEMSA_IPeriodoLiquidacion.Text.Trim,
|
||||
Public Property FEMSA_FPeriodoLiquidacion As String = "" 'TxtFEMSA_FPeriodoLiquidacion.Text.Trim,
|
||||
Public Property FEMSA_CodRetencion1 As String = "" 'TxtFEMSA_CodRetencion1.Text.Trim,
|
||||
Public Property FEMSA_CodRetencion2 As String = "" 'TxtFEMSA_CodRetencion2.Text.Trim,
|
||||
End Class
|
||||
|
||||
<Serializable>
|
||||
|
||||
@@ -1754,7 +1754,7 @@ Public Class Timbrado
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
|
||||
Using ObjNomina2 As New ClsNominas()
|
||||
|
||||
If ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then
|
||||
If ObjNomina2.UpdateEstatusNomNominas(3, UsuarioActual.Empresa.CvePAC, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
@@ -2137,16 +2137,16 @@ Public Class Timbrado
|
||||
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
|
||||
|
||||
''DATOS GENERALES
|
||||
cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, "MEX", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida)
|
||||
cfdi.CartaPorte(Carta.TranspInternac, Carta.EntradaSalidaMercancia, "", Carta.ViaEntradaSalida, Carta.TotalDistanciaRecorrida)
|
||||
|
||||
'UBICACIONES
|
||||
If Carta.Ubicaciones IsNot Nothing AndAlso Carta.Ubicaciones.Count > 0 Then
|
||||
For Each ubica As CFDICartaPorteUbicacion In Carta.Ubicaciones
|
||||
'origen
|
||||
cfdi.CartaPorteUbicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.IDUbicacion, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalida, ubica.TipoEstacion, ubica.DistanciaRecorrida)
|
||||
cfdi.CartaPorteUbicacion(ubica.TipoUbicacion, ubica.IDUbicacion, ubica.RFCRemitenteDestinatario, ubica.NombreRemitenteDestinatario, ubica.NumRegIdTrib, ubica.ResidenciaFiscal, ubica.NumEstacion, ubica.NombreEstacion, ubica.NavegacionTrafico, ubica.FechaHoraSalidaLlegada, ubica.TipoEstacion, ubica.DistanciaRecorrida)
|
||||
'cfdi.CartaPorteOrigen(ubica.Origen.IDOrigen, ubica.Origen.RFCRemitente, ubica.Origen.NombreRemitente, ubica.NumRegIdTrib, ubica.Origen.ResidenciaFiscal, ubica.Origen.NumEstacion, ubica.Origen.NombreEstacion, ubica.Origen.NavegacionTrafico, ubica.Origen.FechaHoraSalida)
|
||||
cfdi.CartaPorteDomicilio(ubica.Domicilio.Calle, ubica.Domicilio.NumeroExterior, ubica.Domicilio.NumeroInterior, ubica.Domicilio.Colonia, ubica.Domicilio.Localidad, ubica.Domicilio.Referencia, ubica.Domicilio.Municipio, ubica.Domicilio.Estado, ubica.Domicilio.Pais, ubica.Domicilio.CP)
|
||||
'''destino
|
||||
''''destino
|
||||
'cfdi.CartaPorteUbicacion(ubica.TipoEstacion, ubica.DistanciaRecorridaDestino)
|
||||
'cfdi.CartaPorteDestino(ubica.Destino.IDDestino, ubica.Destino.RFCDestinatario, ubica.Destino.NombreDestinatario, ubica.Destino.NumRegIdTrib, ubica.Destino.ResidenciaFiscal, ubica.Destino.NumEstacion, ubica.Destino.NombreEstacion, ubica.Destino.NavegacionTrafico, ubica.Destino.FechaHoraProgLlegada)
|
||||
' cfdi.CartaPorteDomicilio(ubica.Destino.Domicilio.Calle, ubica.Destino.Domicilio.NumeroExterior, ubica.Destino.Domicilio.NumeroInterior, ubica.Destino.Domicilio.Colonia, ubica.Destino.Domicilio.Localidad, ubica.Destino.Domicilio.Referencia, ubica.Destino.Domicilio.Municipio, ubica.Destino.Domicilio.Estado, ubica.Destino.Domicilio.Pais, ubica.Destino.Domicilio.CP)
|
||||
@@ -2154,16 +2154,18 @@ Public Class Timbrado
|
||||
|
||||
End If
|
||||
|
||||
'MERCANCIAS
|
||||
If Carta.Mercancias IsNot Nothing Then
|
||||
cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
|
||||
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
|
||||
'MERCANCIAS
|
||||
If Carta.Mercancias IsNot Nothing Then
|
||||
cfdi.CartaPorteMercancias(Carta.Mercancias.PesoBrutoTotal, Carta.Mercancias.UnidadPeso, Carta.Mercancias.PesoNetoTotal, Carta.Mercancias.NumTotalMercancias, Carta.Mercancias.CargoporTasacion)
|
||||
If Carta.Mercancias IsNot Nothing AndAlso Carta.Mercancias.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDICartaPorteMercancia In Carta.Mercancias.Mercancias
|
||||
cfdi.CartaPorteMercancia(concep.BienesTransp, concep.ClaveSTCC, concep.Descripción, concep.Cantidad, concep.ClaveUnidad, concep.Unidad, concep.Dimensiones, concep.MaterialPeligroso, concep.ClaveMaterialPeligroso, If(concep.ClaveMaterialPeligroso <> "", concep.Embalaje, ""), concep.DescripEmbalaje, concep.PesoenKg, concep.ValorMercancia, concep.Moneda, concep.FraccionArrancelaria, concep.UUIDComercioExt)
|
||||
For Each transp In concep.MercanciasCantidadTransporta
|
||||
cfdi.CartaPorteCantidadTransporta(transp.Cantidad, transp.IDOrigen, transp.IDDestino, transp.CvesTransportes)
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
'
|
||||
If Carta.FiguraTransporte IsNot Nothing Then
|
||||
|
||||
@@ -2186,13 +2188,15 @@ Public Class Timbrado
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
'If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
|
||||
' For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
|
||||
' cfdi.CartaPorteOperador(concep.RFCOperador, concep.NumLicencia, concep.NombreOperador, concep.NumRegidTribOperador, concep.ResidenciaFiscalOperador)
|
||||
' cfdi.CartaPorteOperadorDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP)
|
||||
' Next
|
||||
' End If
|
||||
If Carta.FiguraTransporte.Operadores IsNot Nothing AndAlso Carta.FiguraTransporte.Operadores.Count > 0 Then
|
||||
For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
|
||||
cfdi.CartaPorteTiposFigura(concep.TipoFigura, concep.RFCFigura, concep.NumLicencia, concep.NombreFigura, concep.NumRegidTribFigura, If(concep.ResidenciaFiscalFigura <> "MEX", concep.ResidenciaFiscalFigura, ""))
|
||||
If concep.TipoFigura.Contiene("02", "03") Then ' “02”- Propietario o “03” -Arrendador
|
||||
cfdi.CartaPortePartesTransporte("PT01")
|
||||
cfdi.CartaPortePartesTransporteDomicilio(concep.Domicilio.Calle, concep.Domicilio.NumeroExterior, concep.Domicilio.NumeroInterior, concep.Domicilio.Colonia, concep.Domicilio.Localidad, concep.Domicilio.Referencia, concep.Domicilio.Municipio, concep.Domicilio.Estado, concep.Domicilio.Pais, concep.Domicilio.CP)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
@@ -2414,45 +2418,28 @@ Public Class Timbrado
|
||||
swmili = sw.ElapsedMilliseconds
|
||||
sw.Start()
|
||||
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
|
||||
Select Case ObjCFDITimbre.Comprobante.TipoComprobante
|
||||
Case "N"
|
||||
|
||||
'Actualiza Estatus Factura
|
||||
If Ventas.CveVenta > 0 Then
|
||||
|
||||
Using ObjVentas As New ClsVentas()
|
||||
|
||||
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
End If
|
||||
End Using
|
||||
|
||||
'Genero la addenda Ford
|
||||
If Ventas.Cliente.Ford_GSDB <> "" Then
|
||||
|
||||
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
|
||||
|
||||
Dim FolioFactura As String = ""
|
||||
If UsuarioActual.CveEmpresa = 8 Then FolioFactura = Ventas.Folio.ToString ' sogo, pordefault manda el folio de la factura
|
||||
GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB)
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
|
||||
Using ObjNomina2 As New ClsNominas()
|
||||
|
||||
If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0, isFiniquito:=Ventas.Timbre.IStimbreFiniquito) Then
|
||||
If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0, isFiniquito:=Ventas.Timbre.IStimbreFiniquito) Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then
|
||||
Case "T"
|
||||
|
||||
Dim objGrales As New ClsGenerales
|
||||
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC) Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
End If
|
||||
objGrales.Dispose()
|
||||
|
||||
Using ObjInv As New ClsInventarios()
|
||||
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
|
||||
Retorno = ""
|
||||
@@ -2460,8 +2447,36 @@ Public Class Timbrado
|
||||
Retorno = "Error"
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Case Else
|
||||
|
||||
'Actualiza Estatus Factura
|
||||
If Ventas.CveVenta > 0 Then
|
||||
|
||||
Using ObjVentas As New ClsVentas()
|
||||
|
||||
If ObjVentas.UpdateEstatusFactura(3, FolioFiscal, "", ObjCFDITimbre.Comprobante.Fecha, Ventas.CveVenta, CvePAC:=CvePACEspecial, RFCReceptor:=ObjCFDITimbre.Receptor.RFC) Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
End If
|
||||
End Using
|
||||
|
||||
'Genero la addenda Ford
|
||||
If Ventas.Cliente.Ford_GSDB <> "" Then
|
||||
|
||||
Dim RutaCadena As String = String.Format("{0}{1}.xml", RutaArchivo, NombreArchivoXML) 'If(UsuarioActual.Empresa.FacturaProduccion, String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.SerieFolio), String.Format("{0}XML\{1}\{2}.xml", Ruta, Ventas.TipoDocto, Ventas.SerieFolio))
|
||||
|
||||
Dim FolioFactura As String = ""
|
||||
If UsuarioActual.CveEmpresa = 8 Then FolioFactura = Ventas.Folio.ToString ' sogo, pordefault manda el folio de la factura
|
||||
GeneraAddendaFord(RutaCadena, FolioFactura, Ventas.FordASN, Ventas.FordGSDB)
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End Select
|
||||
|
||||
|
||||
If Not IO.Directory.Exists($"{UsuarioActual.Empresa.Ruta}CBB\") Then IO.Directory.CreateDirectory($"{UsuarioActual.Empresa.Ruta}CBB\")
|
||||
|
||||
@@ -3047,7 +3062,7 @@ Public Class Timbrado
|
||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "N" Then
|
||||
Using ObjNomina2 As New ClsNominas()
|
||||
|
||||
If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, "", ("01/01/2000").ToDate, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then
|
||||
If ObjNomina2.UpdateEstatusNomNominas(3, CvePACEspecial, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Comprobante.Fecha, ObjCFDITimbre.Nomina.CveNomina, 0, 0, 0, 0, 0) Then
|
||||
Retorno = ""
|
||||
Else
|
||||
Retorno = "Error"
|
||||
@@ -3936,10 +3951,10 @@ Public Class Timbrado
|
||||
ComCartaPorte.FiguraTransporte.Operadores = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperador(Carta.FiguraTransporte.Operadores.Count - 1) {}
|
||||
For Each concep As CFDICartaPorteOperador In Carta.FiguraTransporte.Operadores
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i) = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperador
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).RFCOperador = concep.RFCOperador
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).RFCOperador = concep.RFCFigura
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).NumLicencia = concep.NumLicencia
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).NombreOperador = concep.NombreOperador
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).NumRegIdTribOperador = concep.NumRegidTribOperador
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).NombreOperador = concep.NombreFigura
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).NumRegIdTribOperador = concep.NumRegidTribFigura
|
||||
'OComCartaPorte.FiguraTransporte.Operadores(i)(0) = concep.ResidenciaFiscalOperador 'falta
|
||||
|
||||
ComCartaPorte.FiguraTransporte.Operadores(i).Domicilio = New ProfactCartaPorte.CartaPorteFiguraTransporteOperadoresOperadorDomicilio()
|
||||
|
||||
355
App_Code/Timbres.vb
Normal file
355
App_Code/Timbres.vb
Normal file
@@ -0,0 +1,355 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Public Class Timbres
|
||||
Private _MsgError As StringBuilder
|
||||
Private _MensajeAlert As StringBuilder
|
||||
Public Property TieneError As Boolean
|
||||
Public ReadOnly Property MsgError As String
|
||||
Get
|
||||
Return _MsgError.ToString
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MensajeAlert As String
|
||||
Get
|
||||
Return _MensajeAlert.ToString
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property CveMovimiento As Integer
|
||||
Private Property UsuarioActual As Usuario
|
||||
Private Property AplicaCP As Boolean
|
||||
Private Property FechaSalidaLlegada As Date
|
||||
|
||||
Private Property Serie As String
|
||||
Private Property Folio As Integer
|
||||
Private Property CveTimbre As Integer
|
||||
|
||||
Private Property CPCliente As Integer
|
||||
Public Property ObjFactura As Modelos.Factura
|
||||
|
||||
Public Sub New()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub New(TipoDocto As String, tCveTimbre As Integer, tUsuarioActual As Usuario)
|
||||
_MsgError = New StringBuilder
|
||||
UsuarioActual = tUsuarioActual
|
||||
CveTimbre = tCveTimbre
|
||||
CreaObjetosTraslados(TipoDocto, tCveTimbre)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub CreaObjetosTraslados(TipoDocto As String, CveTimbre As Integer)
|
||||
ObjFactura = New Modelos.Factura
|
||||
ObjFactura.Version = "3.3"
|
||||
ObjFactura.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjFactura.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjFactura.UsuarioActual = UsuarioActual
|
||||
'ObjFactura.TipoCambio = 1
|
||||
ObjFactura.ConvertirPesos = False
|
||||
ObjFactura.CveMoneda = 1
|
||||
ObjFactura.Moneda = "XXX"
|
||||
ObjFactura.MonedaSAT = "XXX"
|
||||
ObjFactura.MonedaAbreviatura = "XXX"
|
||||
ObjFactura.TipoDocto = TipoDocto
|
||||
ObjFactura.TipoComprobante = "T"
|
||||
|
||||
ObjFactura.Fecha = Now
|
||||
ObjFactura.FechaPago = Now
|
||||
ObjFactura.FechaEjecucion = Now
|
||||
ObjFactura.UsuarioCreo = UsuarioActual.Usuario
|
||||
ObjFactura.TipoDocumento = "Traspaso"
|
||||
|
||||
|
||||
ObjFactura.RFCReceptor = "XAXX010101000" ' RFC empresa traslado , si es entrega RFC Cliente
|
||||
|
||||
ObjFactura.Inv_CveMovimiento = CveMovimiento
|
||||
ObjFactura.CveTimbre = CveTimbre
|
||||
|
||||
If CveTimbre > 0 AndAlso ObjFactura.TipoComprobante = "T" Then
|
||||
|
||||
ObjFactura.Timbre = PreParaTimbreCartaPorte(ObjFactura)
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function PreParaTimbreCartaPorte(Obj As Modelos.Factura) As CFDITimbre
|
||||
Dim Timbre As New CFDITimbre
|
||||
Timbre.Comprobante.TipoComprobante = "T"
|
||||
Timbre.Comprobante.Fecha = Obj.Fecha
|
||||
Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
Timbre.Comprobante.SubTotal = Obj.SubTotal
|
||||
Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
Timbre.Comprobante.Moneda = "XXX"
|
||||
Timbre.Comprobante.TipoCambio = "" ' CONDICIÓN SI LA MONEDA ES 'XXX'
|
||||
|
||||
Timbre.Receptor.RFC = UsuarioActual.Empresa.RFC
|
||||
Timbre.Receptor.Nombre = UsuarioActual.Empresa.Empresa
|
||||
Timbre.Receptor.UsoCFDI = "P01"
|
||||
|
||||
|
||||
Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
Dim totIVA As Decimal = Obj.IVA
|
||||
Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
Dim totRetISR As Decimal = Obj.RetISR
|
||||
Dim i As Integer = 1
|
||||
|
||||
|
||||
Timbre.Comprobante.LugarExpedicion = UsuarioActual.Empresa.CP.ToString
|
||||
|
||||
|
||||
'DETALLES
|
||||
Dim tPS As String = ""
|
||||
|
||||
Dim CartaPorte As New CFDICartaPorte
|
||||
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 ObjGrales As New ClsGenerales
|
||||
If ObjGrales.GetGralTimbre(CveTimbre, "-1", FI, FF, 0, UsuarioActual.CveEmpresa, -1) Then
|
||||
|
||||
If ObjGrales.DtResultados.Rows.Count = 1 Then
|
||||
Dim DtMovimientos As DataTable = Nothing
|
||||
|
||||
Dim drT As DataRow = ObjGrales.DtResultados.Rows(0)
|
||||
|
||||
CveMovimiento = drT("CveMovimientoAlmacen").ToString.ToEntero
|
||||
FechaSalidaLlegada = drT("FechaEntrega").ToString.ToDate
|
||||
|
||||
ObjFactura.Folio = drT("Folio").ToString.ToEntero
|
||||
ObjFactura.Serie = drT("Serie").ToString
|
||||
Timbre.Comprobante.Serie = Obj.Serie
|
||||
Timbre.Comprobante.Folio = Obj.Folio.ToString
|
||||
|
||||
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()
|
||||
|
||||
If AplicaCP Then
|
||||
|
||||
CartaPorte.FiguraTransporte.AutoTransporte.PermSCT = drT("TipoPermisoSCT").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
|
||||
|
||||
CPCliente = drT("CPCliente").ToString.ToEntero
|
||||
|
||||
|
||||
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.DistanciaRecorrida = 1
|
||||
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Origen", .IDUbicacion = "OR000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,
|
||||
.FechaHoraSalidaLlegada = Now.ToString("yyyy-MM-ddTHH:mm:ss"),' "2021-08-23T11:13:01",
|
||||
.NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa,
|
||||
.Domicilio = DomOrigen}
|
||||
CartaPorte.Ubicaciones.Add(Ubica)
|
||||
Ubica = New CFDICartaPorteUbicacion With {.TipoUbicacion = "Destino", .IDUbicacion = "DE000001", .RFCRemitenteDestinatario = UsuarioActual.Empresa.RFC,'UsuarioActual.Empresa.RFC,'"CAMJ841219I33",
|
||||
.FechaHoraSalidaLlegada = FechaSalidaLlegada.ToString("yyyy-MM-ddT23:59:59"),
|
||||
.NombreRemitenteDestinatario = UsuarioActual.Empresa.Empresa,
|
||||
.Domicilio = DomDestino,
|
||||
.DistanciaRecorrida = 1}
|
||||
|
||||
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 = ""}
|
||||
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
|
||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
|
||||
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 = "",
|
||||
.PesoenKg = drr("PesoKg").ToString.ToDecimal,
|
||||
.MaterialPeligroso = If(drr("ClaveMaterialPeligroso").ToString <> "", "Sí", "No"),
|
||||
.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}
|
||||
conceptoCarta.DetalleMercancia = DetalleMercancia
|
||||
|
||||
Dim MercanciaTransporta As New CFDICartaPorteMercanciaTransporta With {.Cantidad = drr("Cantidad").ToString.ToDecimal, .IDOrigen = "OR000001", .IDDestino = "DE000001"}
|
||||
conceptoCarta.MercanciasCantidadTransporta.Add(MercanciaTransporta)
|
||||
|
||||
totSubTotal = totSubTotal - concepto.Importe
|
||||
CartaPorte.Mercancias.Mercancias.Add(conceptoCarta)
|
||||
|
||||
i += 1
|
||||
Next
|
||||
Timbre.Complementos.CartaPorte = CartaPorte
|
||||
|
||||
Else
|
||||
'' T R A S L A D O S
|
||||
|
||||
'DETALLES
|
||||
|
||||
For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
|
||||
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
|
||||
|
||||
'CONDICIONANTE, ESPECIAL
|
||||
If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" 'LES COMENTAN QUE NO DEBE IR LA ETIQUETA DE LA UNIDAD EN EL PRODUCTO
|
||||
|
||||
Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString.ToDecimal,
|
||||
.Descripcion = tPS,
|
||||
.ValorUnitario = drr("PU").ToString.ToDecimal,
|
||||
.Importe = drr("TotalImporte").ToString.ToDecimal,
|
||||
.Descuento = drr("Descuento").ToString.ToDecimal,
|
||||
.Unidad = drr("UM").ToString,
|
||||
.ClaveUnidad = drr("SATClaveUM").ToString,
|
||||
.ClaveProdServ = drr("SATClaveProdServ").ToString,
|
||||
.Noidentificacion = drr("Noidentificacion").ToString,
|
||||
.CuentaPredial = drr("CuentaPredial").ToString}
|
||||
'VERIFICA SUMA SUBTOTALES
|
||||
If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'PROCESO DE AJUSTA DE DECIMALES
|
||||
concepto.Importe = totSubTotal
|
||||
End If
|
||||
totSubTotal = totSubTotal - concepto.Importe
|
||||
|
||||
'SIEMPRE ESTAMOS AGREGANDO EL IVA
|
||||
'concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString.ToDecimal, .Impuesto = "002", .Importe = drr("ImporteIVA").ToString.ToDecimal})
|
||||
|
||||
Timbre.Conceptos.Add(concepto)
|
||||
i += 1
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
Else
|
||||
TieneError = True
|
||||
_MsgError.AppendLine("Consultar datos de timbrado")
|
||||
End If
|
||||
|
||||
ObjGrales.Dispose()
|
||||
|
||||
End If
|
||||
Return Timbre
|
||||
End Function
|
||||
Public Function Timbrar() As Boolean
|
||||
|
||||
Dim Respuesta As Boolean = False
|
||||
|
||||
Dim ObjTimbrado As New Timbrado
|
||||
|
||||
If ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura) Then
|
||||
Respuesta = True
|
||||
Else
|
||||
Respuesta = False
|
||||
_MsgError.AppendLine(ObjTimbrado.MensajeErrorCFDI)
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
BIN
Bin/GoCfdi.dll
BIN
Bin/GoCfdi.dll
Binary file not shown.
@@ -931,8 +931,8 @@ Partial Class PopUpVerFactura
|
||||
Dim TransporteInternacional As String = ""
|
||||
Dim PermisoSTCC As String = ""
|
||||
Dim NumPermiso As String = ""
|
||||
Dim Aseguradora As String = ""
|
||||
Dim NumPolizaSeguro As String = ""
|
||||
Dim AseguradoraRespCivil As String = ""
|
||||
Dim NumPolizaSeguroRespCivil As String = ""
|
||||
Dim NombreAseguradoraMedioAmbiente As String = ""
|
||||
Dim NumPolizaSeguroMedioAmbiente As String = ""
|
||||
Dim NombreAseguradoraCarga As String = ""
|
||||
@@ -950,15 +950,17 @@ Partial Class PopUpVerFactura
|
||||
Dim FechaCertificacion As DateTime = Nothing
|
||||
Dim SelloCFDi As String = ""
|
||||
Dim SelloSAT As String = ""
|
||||
Dim TipoDocto As String = ""
|
||||
|
||||
Dim ObjInv As New ClsGenerales
|
||||
|
||||
If ObjInv.GetGralTimbre(CveTimbre, "-1", "-1", -1, MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
If ObjInv.GetGralTimbre(CveTimbre, "-1", MinFecha, MaxFecha, -1, UsuarioActual.CveEmpresa, -1) Then
|
||||
If ObjInv.DtResultados.Rows.Count > 0 Then
|
||||
Dim Dr As DataRow = ObjInv.DtResultados.Rows(0)
|
||||
If Dr IsNot Nothing Then
|
||||
SerieFolio = Dr("SerieFolio").ToString
|
||||
Telefono = Dr("Telefono").ToString
|
||||
Telefono = Dr("FiguraTelefono").ToString
|
||||
TipoDocto = Dr("TipoDocto").ToString
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -973,6 +975,7 @@ Partial Class PopUpVerFactura
|
||||
|
||||
Dim DtUbicaciones As New DataTable()
|
||||
DtUbicaciones.Columns.Add(New DataColumn("Distancia", GetType(String)))
|
||||
DtUbicaciones.Columns.Add(New DataColumn("TipoUbicacion", GetType(String)))
|
||||
DtUbicaciones.Columns.Add(New DataColumn("RFC", GetType(String)))
|
||||
DtUbicaciones.Columns.Add(New DataColumn("Nombre", GetType(String)))
|
||||
DtUbicaciones.Columns.Add(New DataColumn("FechaHoraSalida", GetType(DateTime)))
|
||||
@@ -990,7 +993,7 @@ Partial Class PopUpVerFactura
|
||||
DtOperadores.Columns.Add(New DataColumn("NombreOperador", GetType(String)))
|
||||
|
||||
Dim XMLDoc As New XmlDocument
|
||||
Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", "Tra", String.Format("{0}", SerieFolio), "xml")
|
||||
Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, "XML", TipoDocto, String.Format("{0}", SerieFolio), "xml")
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
If Archivo.Exists Then
|
||||
@@ -1024,6 +1027,7 @@ Partial Class PopUpVerFactura
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
namespaces.AddNamespace("registrofiscal", "http://www.sat.gob.mx/registrofiscal")
|
||||
namespaces.AddNamespace("cartaporte", "http://www.sat.gob.mx/CartaPorte")
|
||||
namespaces.AddNamespace("cartaporte20", "http://www.sat.gob.mx/CartaPorte20")
|
||||
|
||||
Dim nodeComprobante As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Comprobante", Prefijo), namespaces)
|
||||
If nodeComprobante IsNot Nothing Then
|
||||
@@ -1060,40 +1064,42 @@ Partial Class PopUpVerFactura
|
||||
|
||||
Dim nodeComp As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", Prefijo), namespaces)
|
||||
|
||||
Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte"), namespaces)
|
||||
Dim nodeCartaPorte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:CartaPorte", "cartaporte20"), namespaces)
|
||||
If nodeCartaPorte IsNot Nothing Then
|
||||
TransporteInternacional = ValorXML(nodeCartaPorte, "TranspInternac", "")
|
||||
End If
|
||||
|
||||
Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:AutotransporteFederal", "cartaporte"), namespaces)
|
||||
Dim nodeAutotransporteFederal As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Autotransporte", "cartaporte20"), namespaces)
|
||||
If nodeAutotransporteFederal IsNot Nothing Then
|
||||
PermisoSTCC = ValorXML(nodeAutotransporteFederal, "PermSCT", "")
|
||||
NumPermiso = ValorXML(nodeAutotransporteFederal, "NumPermisoSCT", "")
|
||||
Aseguradora = ValorXML(nodeAutotransporteFederal, "NombreAseg", "")
|
||||
NumPolizaSeguro = ValorXML(nodeAutotransporteFederal, "NumPolizaSeguro", "")
|
||||
|
||||
'Por Definir de donde sale
|
||||
'NombreAseguradoraMedioAmbiente = ValorXML(nodeAutotransporteFederal, "", "")
|
||||
'NumPolizaSeguroMedioAmbiente = ValorXML(nodeAutotransporteFederal, "", "")
|
||||
'NombreAseguradoraCarga = ValorXML(nodeAutotransporteFederal, "", "")
|
||||
'NumPolizaSeguroCarga = ValorXML(nodeAutotransporteFederal, "", "")
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte"), namespaces)
|
||||
Dim nodeIdentificacionVehicular As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:IdentificacionVehicular", "cartaporte20"), namespaces)
|
||||
If nodeIdentificacionVehicular IsNot Nothing Then
|
||||
PlacaVM = ValorXML(nodeIdentificacionVehicular, "PlacaVM", "")
|
||||
AnioModeloVM = ValorXML(nodeIdentificacionVehicular, "AnioModeloVM", "")
|
||||
End If
|
||||
|
||||
Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte"), namespaces)
|
||||
If nodeFiguraTransporte IsNot Nothing Then
|
||||
Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "CveTransporte", "")
|
||||
MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString())
|
||||
Dim nodeSeguros As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:Seguros", "cartaporte20"), namespaces)
|
||||
If nodeIdentificacionVehicular IsNot Nothing Then
|
||||
AseguradoraRespCivil = ValorXML(nodeSeguros, "AseguraRespCivil", "")
|
||||
NumPolizaSeguroRespCivil = ValorXML(nodeSeguros, "PolizaRespCivil", "")
|
||||
|
||||
'Por Definir de donde sale
|
||||
NombreAseguradoraMedioAmbiente = ValorXML(nodeSeguros, "AseguraMedAmbiente", "")
|
||||
NumPolizaSeguroMedioAmbiente = ValorXML(nodeSeguros, "PolizaMedAmbiente", "")
|
||||
NombreAseguradoraCarga = ValorXML(nodeSeguros, "AseguraCarga", "")
|
||||
NumPolizaSeguroCarga = ValorXML(nodeSeguros, "PolizaCarga", "")
|
||||
End If
|
||||
|
||||
Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte"), namespaces)
|
||||
'Dim nodeFiguraTransporte As XmlNode = nodeComp.SelectSingleNode(String.Format("//{0}:FiguraTransporte", "cartaporte20"), namespaces)
|
||||
'If nodeFiguraTransporte IsNot Nothing Then
|
||||
' Dim CveTransporte As String = ValorXML(nodeFiguraTransporte, "TipoFigura", "")
|
||||
' MedioTransporte = String.Format("{0} - {1}", CveTransporte, HtTransporte(CveTransporte).ToString())
|
||||
'End If
|
||||
|
||||
Dim nodeMercancias As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Mercancia", "cartaporte20"), namespaces)
|
||||
For Each node As XmlNode In nodeMercancias
|
||||
Dim Row As DataRow = DtMercancias.NewRow
|
||||
|
||||
@@ -1105,45 +1111,44 @@ Partial Class PopUpVerFactura
|
||||
DtMercancias.Rows.Add(Row)
|
||||
Next
|
||||
|
||||
Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Operador", "cartaporte"), namespaces)
|
||||
Dim nodeOperadores As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:TiposFigura", "cartaporte20"), namespaces)
|
||||
For Each node As XmlNode In nodeOperadores
|
||||
Dim Row As DataRow = DtOperadores.NewRow
|
||||
|
||||
Row("RFC") = ValorXML(node, "RFCOperador", "")
|
||||
Row("RFC") = ValorXML(node, "RFCFigura", "")
|
||||
Row("NumLicencia") = ValorXML(node, "NumLicencia", "")
|
||||
Row("NombreOperador") = ValorXML(node, "NombreOperador", "")
|
||||
Row("NombreOperador") = ValorXML(node, "NombreFigura", "")
|
||||
|
||||
DtOperadores.Rows.Add(Row)
|
||||
Next
|
||||
|
||||
|
||||
Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte"), namespaces)
|
||||
Dim nodeUbicaciones As XmlNodeList = nodeComp.SelectNodes(String.Format("//{0}:Ubicacion", "cartaporte20"), namespaces)
|
||||
For Each node As XmlNode In nodeUbicaciones
|
||||
Dim Row As DataRow = DtUbicaciones.NewRow
|
||||
|
||||
Row("Distancia") = ValorXML(node, "DistanciaRecorrida", "")
|
||||
Dim nodeOrigen = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Origen")
|
||||
If nodeOrigen IsNot Nothing Then
|
||||
Row("RFC") = ValorXML(nodeOrigen, "RFCRemitente", "")
|
||||
Row("Nombre") = ValorXML(nodeOrigen, "NombreRemitente", "")
|
||||
Row("FechaHoraSalida") = ValorXML(nodeOrigen, "FechaHoraSalida", "").ToDateTime()
|
||||
End If
|
||||
Row("TipoUbicacion") = ValorXML(node, "TipoUbicacion", "")
|
||||
Row("FechaHoraSalida") = ValorXML(node, "FechaHoraSalidaLlegada", "")
|
||||
Row("RFC") = ValorXML(node, "RFCRemitenteDestinatario", "")
|
||||
Row("Nombre") = ValorXML(node, "NombreRemitenteDestinatario", "")
|
||||
|
||||
Dim nodeDestino = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Destino") 'node.SelectSingleNode(String.Format("//{0}:Destino", "cartaporte"), namespaces)
|
||||
If nodeDestino IsNot Nothing Then
|
||||
Row("RFC") = ValorXML(nodeDestino, "RFCDestinatario", "")
|
||||
Row("Nombre") = ValorXML(nodeDestino, "NombreDestinatario", "")
|
||||
Row("FechaHoraSalida") = ValorXML(nodeDestino, "FechaHoraProgLlegada", "").ToDateTime()
|
||||
End If
|
||||
|
||||
Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces)
|
||||
Dim nodeDomicilio = node.ChildNodes.Cast(Of XmlNode).FirstOrDefault(Function(x) x.Name = "cartaporte20:Domicilio") 'node.SelectSingleNode(String.Format("//{0}:Domicilio", "cartaporte"), namespaces)
|
||||
If nodeDomicilio IsNot Nothing Then
|
||||
|
||||
Dim Estado As String = ""
|
||||
Dim Municipio As String = ""
|
||||
Dim Colonia As String = ""
|
||||
Dim calle = ValorXML(nodeDomicilio, "Calle", "")
|
||||
Dim Estado = ValorXML(nodeDomicilio, "Estado", "")
|
||||
Dim Pais = ValorXML(nodeDomicilio, "MEX", "")
|
||||
Dim CP = ValorXML(nodeDomicilio, "CodigoPostal", "")
|
||||
|
||||
Row("Direccion") = String.Format("{0} ,{1},{2}. CP {3}", calle, Estado, Pais, CP)
|
||||
Dim dr As DataRow = GlobalDTGralColonias(ValorXML(nodeDomicilio, "Estado", ""), ValorXML(nodeDomicilio, "Municipio", ""), ValorXML(nodeDomicilio, "Colonia", "")).FiltroPrimero("")
|
||||
If dr IsNot Nothing Then
|
||||
Estado = dr("NombreEstado").ToString
|
||||
Municipio = dr("NombreMunicipio").ToString
|
||||
Colonia = dr("NombreAsentamiento").ToString
|
||||
End If
|
||||
Row("Direccion") = String.Format("{0} Col.{1},{2},{3}. CP {4}", calle, Colonia, Municipio, Estado, CP)
|
||||
End If
|
||||
|
||||
DtUbicaciones.Rows.Add(Row)
|
||||
@@ -1197,8 +1202,8 @@ Partial Class PopUpVerFactura
|
||||
params.Add(New ReportParameter("PermisoSTCC", PermisoSTCC))
|
||||
params.Add(New ReportParameter("NumPermiso", NumPermiso))
|
||||
|
||||
params.Add(New ReportParameter("Aseguradora", Aseguradora))
|
||||
params.Add(New ReportParameter("NumPoliza", NumPolizaSeguro))
|
||||
params.Add(New ReportParameter("Aseguradora", AseguradoraRespCivil))
|
||||
params.Add(New ReportParameter("NumPoliza", NumPolizaSeguroRespCivil))
|
||||
|
||||
params.Add(New ReportParameter("NombreAseguradoraMedioAmbiente", NombreAseguradoraMedioAmbiente))
|
||||
params.Add(New ReportParameter("NumPolizaSeguroMedioAmbiente", NumPolizaSeguroMedioAmbiente))
|
||||
@@ -1246,7 +1251,7 @@ Partial Class PopUpVerFactura
|
||||
rds4.Value = DtOperadores
|
||||
lrds.Add(rds4)
|
||||
|
||||
ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, String.Format("Carta Porte -{0}", Now.ToDateTime.ToShortDateString))
|
||||
ImprimirPDF("Empresas/Grales/Formatos/CartaPorteTimbrado.rdlc", lrds, params, SerieFolio)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
@@ -1256,7 +1261,7 @@ Partial Class PopUpVerFactura
|
||||
#Region "OP = 'DesXmlTra' - IMPRIME XML TRASLADO"
|
||||
|
||||
Private Sub DescargaXMLTraslado(Parametros As Hashtable)
|
||||
If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
|
||||
If Parametros("TIPODOCTO") IsNot Nothing AndAlso Parametros("TIPODOCTO").ToString <> "" Then
|
||||
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")
|
||||
Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, Parametros("EXT").ToString, Parametros("TIPODOCTO").ToString, Parametros("FOLIO").ToString, Exten)
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
@@ -1280,29 +1285,32 @@ Partial Class PopUpVerFactura
|
||||
#Region "OP = 'DesPdfTra' - IMPRIME PDF TRASLADO"
|
||||
|
||||
Private Sub DescargaPDFTraslado(Parametros As Hashtable)
|
||||
If Parametros("CVEMOVIMIENTO") IsNot Nothing AndAlso Parametros("CVEMOVIMIENTO").ToString.ToEntero > 0 Then
|
||||
If Parametros("TIPODOCTO") IsNot Nothing AndAlso Parametros("TIPODOCTO").ToString <> "" Then
|
||||
Dim Exten As String = If(Parametros("EXT").ToString.ToLower = "xml", "xml", "pdf")
|
||||
Dim Path As String = String.Format("{0}\{1}\{2}\{3}.{4}", UsuarioActual.Empresa.Ruta, Parametros("EXT").ToString, Parametros("TIPODOCTO").ToString, Parametros("FOLIO").ToString, Exten)
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
Dim cvetimbre As Integer = Parametros("CVETIMBRE").ToString.ToEntero
|
||||
|
||||
If Archivo.Exists Then
|
||||
DescargarArchivoPDFTraslado(Archivo, Path)
|
||||
Else
|
||||
If Exten = "pdf" Then
|
||||
GeneraPDFFactura(Parametros("CVEMOVIMIENTO").ToString.ToEntero)
|
||||
Dim ObjTimbres As New Timbres("Rec", cvetimbre, UsuarioActual)
|
||||
|
||||
GeneraPDFFactura(ObjTimbres.ObjFactura)
|
||||
Archivo = New System.IO.FileInfo(Path)
|
||||
If Archivo.Exists Then
|
||||
DescargarArchivoPDFTraslado(Archivo, Path)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Archivo = Nothing
|
||||
End If
|
||||
End Sub
|
||||
Private Sub DescargarArchivoPDFTraslado(Archivo As System.IO.FileInfo, path As String)
|
||||
HttpContext.Current.Response.Clear()
|
||||
HttpContext.Current.Response.ClearContent()
|
||||
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "application/xml", "application/pdf")
|
||||
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = "xml", "text/xml", "application/pdf")
|
||||
HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
|
||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||
HttpContext.Current.Response.TransmitFile(path)
|
||||
@@ -1310,9 +1318,9 @@ Partial Class PopUpVerFactura
|
||||
HttpContext.Current.Response.End()
|
||||
End Sub
|
||||
|
||||
Private Sub GeneraPDFFactura(CveMovimiento As Integer)
|
||||
Private Sub GeneraPDFFactura(ObjFactura As Modelos.Factura)
|
||||
Try
|
||||
Dim objFactura = CreaObjetosTraslado(CveMovimiento)
|
||||
' Dim objFactura = CreaObjetosTraslado(CveMovimiento)
|
||||
If objFactura IsNot Nothing Then
|
||||
PdfFactura(objFactura)
|
||||
objFactura.Dispose()
|
||||
|
||||
@@ -1482,7 +1482,7 @@ Partial Class Compras_Proveedores
|
||||
DdlCveClasificacionProveedor.Items.Insert(0, New ListItem("Sin Clasificación", "0"))
|
||||
End Sub
|
||||
Private Sub CargaDIOTPais()
|
||||
DdlDIOTPais.DataSource = GlobalDTPais()
|
||||
DdlDIOTPais.DataSource = GlobalDTGralPaises()
|
||||
DdlDIOTPais.DataBind()
|
||||
DdlDIOTPais.Items.Insert(0, New ListItem("-", "0"))
|
||||
End Sub
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GVDatos" runat="server"
|
||||
DataKeyNames="CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor"
|
||||
DataKeyNames="CveEntregaAlmacen,Estatus,CveCliente,CveDireccionOrigen,CveDireccionDestino,CveCamion,CveChofer,FechaEntrega,CveAlmacen,Tipo,AplicaCP,RFCReceptor,RFCEmisor,CveTimbre,CvePAC,FolioFiscal"
|
||||
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
|
||||
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
|
||||
<Columns>
|
||||
@@ -111,8 +111,7 @@
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="SubProyecto" HeaderText="Sucursal" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
|
||||
|
||||
<asp:BoundField DataField="SerieFolio" HeaderText="Folio" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Nombre" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Chofer" HeaderText="Operador" ItemStyle-HorizontalAlign="Left" />
|
||||
@@ -125,7 +124,7 @@
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditar" runat="server" OnClick="imgEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="LnkTimbrar" runat="server" OnClick="LnkTimbrar_Click" AlternateText="Timbrar" ToolTip="Timbrar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-external-link'></i>" />
|
||||
<asp:LinkButton ID="LnkCancelaTimbre" runat="server" OnClick="LnkCancelaTimbre_Click" AlternateText="Cancelar timbre" ToolTip="Cancelar timbre" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||
<asp:LinkButton ID="LnkCancelaTimbre" runat="server" OnClick="LnkCancelaTimbre_Click" AlternateText="Cancelar timbre" ToolTip="Cancelar timbre" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar cancelación?" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
@@ -147,8 +146,7 @@
|
||||
</button>
|
||||
<h4 class="modal-title" id="H3" runat="server">Editar Entrega</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6 form-md-line-input input-iconright">
|
||||
|
||||
@@ -230,10 +230,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
DdlChofer.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void CargaEstatus()
|
||||
{
|
||||
|
||||
@@ -244,10 +241,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void InicializaFechas()
|
||||
{
|
||||
|
||||
@@ -272,9 +266,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
GVDatos.DataBind();
|
||||
UPDatos.Update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -350,8 +342,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
protected void LnkCancelaTimbre_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
return;
|
||||
|
||||
bool ProcesoOK = false;
|
||||
LinkButton LnkCancelarFolioFiscal = (LinkButton)sender;
|
||||
GridViewRow GvRow = (GridViewRow)LnkCancelarFolioFiscal.BindingContainer;
|
||||
@@ -360,31 +351,26 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
string FolioFiscalCancelar = GvRow.DataKey("FolioFiscal").ToString();
|
||||
string RFCReceptor = GvRow.DataKey("RFCReceptor").ToString();
|
||||
string RFCEmisor = GvRow.DataKey("RFCEmisor").ToString();
|
||||
|
||||
int CvePACCancelacion = GvRow.DataKey("CvePAC").ToEntero();
|
||||
bool AplicaCP = bool.Parse( GvRow.DataKey("AplicaCP") );
|
||||
|
||||
|
||||
Timbrado ObjCancelacion = new Timbrado();
|
||||
ClsGenerales ObjGenrales = new ClsGenerales();
|
||||
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||
|
||||
if (EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptor))
|
||||
{
|
||||
if (ObjGenrales.UpdateGralTimbre(CveTimbre, "-1", "-1", -1, "-1", new DateTime(1900, 01, 01), UsuarioActual.CveEmpresa, UsuarioActual.CveEmpresa, 2, -1, CvePACCancelacion, DateTime.Now, AplicaCP,"-1")){
|
||||
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion,"", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa )){
|
||||
ProcesoOK = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion)) {
|
||||
|
||||
if( ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptor, RFCEmisor, CvePACCancelacion)) {
|
||||
|
||||
if(ObjGenrales.UpdateGralTimbre(CveTimbre,"-1","-1",-1,"-1",new DateTime(1900,01,01),UsuarioActual.CveEmpresa,UsuarioActual.CveEmpresa,2,-1, CvePACCancelacion,DateTime.Now, AplicaCP,SelloCancelacion: ObjCancelacion.CancelacionAcuse)){
|
||||
|
||||
}
|
||||
|
||||
Alert("El complemento se cancelo correctamente.");
|
||||
ProcesoOK = true;
|
||||
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
Alert("El complemento se cancelo correctamente.");
|
||||
ProcesoOK = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -392,14 +378,12 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ObjGenrales.Dispose();
|
||||
ObjGenerales.Dispose();
|
||||
|
||||
if (ProcesoOK)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -501,12 +485,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
<style>
|
||||
.smallplus {
|
||||
padding-bottom: 4px;
|
||||
padding-top: 5px;
|
||||
padding-left: 9px;
|
||||
padding-right: 9px;
|
||||
}
|
||||
|
||||
.MultiLineTextBox {
|
||||
resize: none;
|
||||
}
|
||||
@@ -15,7 +22,7 @@
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Entrega Almacen Ruta
|
||||
Entrega Almacen Ruta
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
|
||||
@@ -23,14 +30,14 @@
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<li style="text-align: left!important">
|
||||
<asp:LinkButton runat="server" ID="LnkAgregarRecoleccion" OnClick="LnkAgregarRecoleccion_Click" CssClass="" data-toggle="tooltip" data-placement="left" title="Agregar Recoleción" Text="<i class='fa fa-plus'></i>Agregar Recolección"></asp:LinkButton>
|
||||
</li>
|
||||
<asp:LinkButton runat="server" ID="LnkAgregarRecoleccion" OnClick="LnkAgregarRecoleccion_Click" CssClass="" data-toggle="tooltip" data-placement="left" title="Agregar Recoleción" Text="<i class='fa fa-plus'></i>Agregar Recolección"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
@@ -39,124 +46,58 @@
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" id="idnecesaria">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" Visible="true" />
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" OnClick="BtnConsultar_Click" runat="server" Text="Consultar" class="btn btn-primary" Visible="true" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row">
|
||||
<div class="col-sm-1"><asp:Label runat="server" id="LblSubProyecto"></asp:Label></div>
|
||||
<div class="col-sm-1">
|
||||
<asp:Label runat="server" ID="LblSubProyecto"></asp:Label>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<asp:DropDownList runat="server" Id="DdlSubProyecto" CssClass="select2me" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList>
|
||||
<asp:DropDownList runat="server" ID="DdlSubProyecto" CssClass="select2me" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList>
|
||||
</div>
|
||||
<label class="col-md-1 " style="width: 90px;">Fecha Inicial:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtFechaI" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioI" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaI" runat="server" TargetControlID="TxtFechaI" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario" TargetControlID="TxtFechaI" PopupButtonID="ImgCalendarioI" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaI" runat="server" ControlToValidate="TxtFechaI" Display="None" ErrorMessage="El campo <b>''Fecha Inicial''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoFfvFI" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " style="width: 80px;">Fecha Final:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<label class="col-md-1 " style="width: 80px;">Fecha Final:</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 138px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtFechaF" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgCalendarioF" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="TxtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="Calendario2" TargetControlID="TxtFechaF" PopupButtonID="imgCalendarioF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="cvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="Valida"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFF" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="rfvFechaF" runat="server" ControlToValidate="TxtFechaF" Display="None" ErrorMessage="El campo <b>''Fecha Final''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="Valida"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="vcoRfvFF" runat="server" HighlightCssClass="vco" TargetControlID="rfvFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGeneraRecoleccion" OnClick="LnkGeneraRecoleccion_Click">Recoleccion</asp:LinkButton>
|
||||
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%" OnActiveTabChanged="Tab_ActiveTabChanged" AutoPostBack="true">
|
||||
|
||||
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatosEntrega" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row" >
|
||||
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega1" visible="false">
|
||||
Chofer:
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega2" visible="false">
|
||||
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"></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 class="col-md-1" runat="server" id="DVDatosEntrega3" visible="false">
|
||||
Unidad:
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega4" visible="false">
|
||||
<asp:DropDownList runat="server" ID="DdlUnidadCamion" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="Placa" CausesValidation="true"></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 class="col-md-1" runat="server" id="DVDatosEntrega5" visible="false">
|
||||
Fecha de Entrega:
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega6" visible="false">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DvCartaPorte1" visible="false">
|
||||
Carta Porte:
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DvCartaPorte2" visible="false">
|
||||
|
||||
<asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" Text="Carta Porte" CssClass="chksino" />
|
||||
</div>
|
||||
<div class="col-md-9" runat="server" id="DVDatosEntrega7" >
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" style="text-align:center!important">
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGenerarDocumentos" OnClick="LnkGenerarDocumentos_Click">Preselección de Entregas</asp:LinkButton>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align:center!important">
|
||||
<asp:LinkButton ID="BtnAsignar" OnClick="BtnAsignar_Click" runat="server" Text="Asignar" class="btn btn-primary" ValidationGroup="GrpGuardar" CausesValidation="true" Visible="false" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="BtnAsignar" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%" OnActiveTabChanged="Tab_ActiveTabChanged" AutoPostBack="true">
|
||||
|
||||
<ajax:TabPanel ID="TabEntrega" runat="server" HeaderText="Entrega">
|
||||
<ContentTemplate>
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
@@ -172,13 +113,62 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body rowpadding">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega1" visible="false">
|
||||
Chofer:
|
||||
</div>
|
||||
<div class="col-md-2" runat="server" id="DVDatosEntrega2" visible="false">
|
||||
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" CssClass="form-control input-sm select2me" Width="100%" CausesValidation="true"></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 class="col-md-1" runat="server" id="DVDatosEntrega3" visible="false">
|
||||
Unidad:
|
||||
</div>
|
||||
<div class="col-md-2" runat="server" id="DVDatosEntrega4" visible="false">
|
||||
<asp:DropDownList runat="server" ID="DdlUnidadCamion" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" CausesValidation="true"></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 class="row" runat="server" id="DVGvPaqueteriasGuias">
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega5" visible="false">
|
||||
F. Entrega:
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega6" visible="false">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DvCartaPorte2" visible="false">
|
||||
<asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" Text="Carta Porte" />
|
||||
</div>
|
||||
<div class="col-md-1" runat="server" id="DVDatosEntrega7">
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align: center!important">
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-primary" ID="LnkGenerarDocumentos" OnClick="LnkGenerarDocumentos_Click">Preseleccionar</asp:LinkButton>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="text-align: center!important">
|
||||
<asp:LinkButton ID="BtnAsignar" OnClick="BtnAsignar_Click" runat="server" Text="Asignar" class="btn btn-primary" ValidationGroup="GrpGuardar" CausesValidation="true" Visible="false" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" runat="server" id="DVGvEntregas">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<asp:GridView ID="GvPaqueteriasGuias" runat="server" AutoGenerateColumns="False"
|
||||
<asp:GridView ID="GvEntregas" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="SerieFolio,FechaIng,Nombre,CveVenta,OrdenCompra,NombreComercial,TipoDocto,CorreoNotificacion,CveVendedor,Orden,CveMovimiento,CveDireccionEnvio,CveSubProyectoOrigen"
|
||||
EmptyDataText="No se encontraron registros" ToolTip="Listado de entregas"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
@@ -191,7 +181,6 @@
|
||||
<asp:CheckBox ID="ChkAsigna" runat="server" Checked="false" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Cons" DataField="Num" HeaderStyle-Width="25px" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="LblFolio" runat="server" NavigateUrl='<%# Eval("CveVenta","/Ventas/Ventas.aspx?CveVenta={0}") %>' Text='<%# Eval("SerieFolio") %>'></asp:HyperLink>
|
||||
@@ -218,15 +207,9 @@
|
||||
</Columns>
|
||||
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row" runat="server" id="DVGvGenerarDocumentos" visible="false">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -250,7 +233,7 @@
|
||||
</asp:TemplateField>
|
||||
<%--<asp:BoundField HeaderText="Cons" DataField="Num" HeaderStyle-Width="25px" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
|
||||
<asp:TemplateField HeaderText="Cons" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25px">
|
||||
<asp:TemplateField HeaderText="Cons" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25px" ItemStyle-Font-Size="6pt">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblNum" runat="server" Text='<%# Eval("Num") %>' CssClass="RowOrdenamiento"></asp:Label>
|
||||
<input type="hidden" name="OrdenMovimientos" value='<%# Eval("CveMovimiento") %>' />
|
||||
@@ -282,29 +265,22 @@
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Dirección" DataField="Direccion" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
|
||||
</Columns>
|
||||
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</asp:Panel>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
<ajax:TabPanel ID="TabRecoleccion" runat="server" HeaderText="Recolección">
|
||||
<ContentTemplate>
|
||||
|
||||
@@ -312,82 +288,130 @@
|
||||
<asp:UpdatePanel ID="UpDatosRecoleccion" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<asp:GridView ID="GvDatosRecoleccion" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveEntregaAlmacen,FechaIng,Nombre,NombreComercial,TipoDocto,Orden,CveDireccionOrigen,CveSubProyectoOrigen"
|
||||
EmptyDataText="No se encontraron registros" ToolTip="Listado de recolecciones"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
data-freezerows="1"
|
||||
GridLines="None">
|
||||
<Columns>
|
||||
<%--<asp:BoundField HeaderText="SerieFolio" DataField="Serie Folio" HeaderStyle-Width="150px" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yyyy}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cliente" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Contacto" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Dirección" DataField="Direccion" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:GridView ID="gvR" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveEntregaAlmacen,Orden,CveDireccionOrigen,CveSubProyectoDestino"
|
||||
EmptyDataText="No se encontraron registros" ToolTip="Listado de recolecciones"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
data-freezerows="1"
|
||||
GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" HeaderStyle-Width="3%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="Chk" runat="server" Checked="false" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--<asp:BoundField HeaderText="SerieFolio" DataField="Serie Folio" HeaderStyle-Width="150px" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yyyy}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cliente" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Contacto" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Dirección" DataField="Direccion" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:TemplateField HeaderText="Opciones">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="LnkGvDatosRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" OnClick="LnkGvDatosRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar la recolección?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Opciones">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkGvDatosRecoleccionEditar" runat="server" OnClick="LnkGvDatosRecoleccionEditar_Click" AlternateText="Editar" ToolTip="Actualizar" CausesValidation="False" CssClass="btn btn-circle btn-xs blue" Text="<i class='fa fa-pencil'></i>" />
|
||||
<asp:LinkButton ID="LnkGvDatosRecoleccionEliminar" runat="server" CssClass="btn btn-circle btn-xs red" OnClick="LnkGvDatosRecoleccionEliminar_Click" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea eliminar la recolección?" data-btn-ok-label="si"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="160px" HorizontalAlign="Center"></ItemStyle>
|
||||
</asp:TemplateField>
|
||||
|
||||
</Columns>
|
||||
</Columns>
|
||||
|
||||
</asp:GridView>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row" runat="server" id="DivGvR2" visible="false">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
|
||||
<asp:GridView ID="GvR2" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveEntregaAlmacen,FechaIng,Nombre,NombreComercial,TipoDocto,Orden,CveDireccionOrigen,CveSubProyectoOrigen"
|
||||
EmptyDataText="No se encontraron registros" ToolTip="Listado de recolecciones"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD"
|
||||
data-sort="true"
|
||||
data-freezerows="1"
|
||||
GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" HeaderStyle-Width="3%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="ChkAsigna" runat="server" Checked="false" Visible="false" />
|
||||
|
||||
<a class="blue"><i class="fa fa-arrows-v green" aria-hidden="true"></i></a>
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<%--<asp:BoundField HeaderText="Cons" DataField="Num" HeaderStyle-Width="25px" ItemStyle-HorizontalAlign="Center" />--%>
|
||||
|
||||
<asp:TemplateField HeaderText="Cons" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="25px">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblNum" runat="server" Text='<%# Eval("Num") %>' CssClass="RowOrdenamiento"></asp:Label>
|
||||
<input type="hidden" name="OrdenMovimientos" value='<%# Eval("CveMovimiento") %>' />
|
||||
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Folio" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblFolio" runat="server" Text='<%# Eval("SerieFolio") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
|
||||
</asp:TemplateField>
|
||||
<%--<asp:BoundField HeaderText="Estatus" DataField="Estatus" HeaderStyle-Width="150px" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
<asp:TemplateField HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderStyle-Width="10%">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblFechaIng" runat="server" Text='<%# Eval("FechaIng", "{0:dd/MM/yyyy}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Cliente" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblNombre" runat="server" Text='<%# Eval("Nombre") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Contacto" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LblContacto" runat="server" Text='<%# Eval("Contacto") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField HeaderText="Dirección" DataField="Direccion" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
</Columns>
|
||||
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
|
||||
<div id="DivModalRecoleccion" class="modal ADS fade" role="dialog">
|
||||
@@ -398,41 +422,51 @@
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="H3" runat="server"> <asp:Literal runat="server" ID="LtlModalRecoleccionTitulo">Agregar Recolección</asp:Literal> </h4>
|
||||
<h4 class="modal-title" id="H3" runat="server">
|
||||
<asp:Literal runat="server" ID="LtlModalRecoleccionTitulo">Agregar Recolección</asp:Literal>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
|
||||
<asp:DropDownList runat="server" ID="DdlSubProyectoRecoleccion" CssClass="form-control select2me" Width="100%" DataValueField="CveSubProyecto" DataTextField="SubProyecto"></asp:DropDownList>
|
||||
<asp:Label runat="server" ID="LblSubProyectoRecoleccion" AssociatedControlID="DdlSubProyectoRecoleccion"></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class=" col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlModalRecoleccionCliente" Width="100%" runat="server" DataTextField="Nombre" DataValueField="CveCliente" AutoPostBack="true" OnSelectedIndexChanged="DdlModalRecoleccionCliente_SelectedIndexChanged"
|
||||
Class="form-control select2me">
|
||||
</asp:DropDownList>
|
||||
<ADS:Dropdownlost CssClass="form-control" CssClassDdl="select2me form-control" ID="DdlModalRecoleccionCliente"
|
||||
Width="100%" Onselectedindexchange="DdlModalRecoleccionCliente_SelectedIndexChanged" data-metodo="getcliente"
|
||||
UsaWebService="true" runat="server" DataTextField="NombreComercial" AutoPostBack="true" DataValueField="CveCliente"
|
||||
CssStyle="width: 100%;" Style="padding-top: 10px;"></ADS:Dropdownlost>
|
||||
<label for="<%= DdlModalRecoleccionCliente.ClientID.ToString()%>">Cliente:</label>
|
||||
<i></i>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlModalRecoleccionCliente" runat="server" ControlToValidate="DdlModalRecoleccionCliente" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente1''</b> es necesario." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlModalRecoleccionCliente" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalRecoleccionCliente" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlmodalRecoleccionDirecion" Width="100%" runat="server" DataTextField="EnvioDireccion" DataValueField="CveDireccionEnvio"
|
||||
<asp:DropDownList ID="DdlmodalRecoleccionDireccion" Width="100%" runat="server" DataTextField="EnvioDireccion" DataValueField="CveDireccionEnvio"
|
||||
Class="form-control select2me">
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlmodalRecoleccionDirecion.ClientID.ToString()%>">Dirección:</label>
|
||||
<label for="<%= DdlmodalRecoleccionDireccion.ClientID.ToString()%>">Dirección:</label>
|
||||
<i></i>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlmodalRecoleccionDirecion" runat="server" ControlToValidate="DdlmodalRecoleccionDirecion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente1''</b> es necesario." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlmodalRecoleccionDirecion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlmodalRecoleccionDirecion" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlmodalRecoleccionDireccion" runat="server" ControlToValidate="DdlmodalRecoleccionDireccion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cliente1''</b> es necesario." InitialValue="-1" ValidationGroup="GrpModalRecoleccionGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlmodalRecoleccionDireccion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlmodalRecoleccionDireccion" Width="250px" PopupPosition="BottomLeft"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class=" col-md-2">
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" style="max-width:85px">
|
||||
<div class="form-group form-md-line-input input-iconright" style="max-width: 85px">
|
||||
<asp:TextBox ID="TxtModalRecoleccionCantidad" Width="50px" MaxLength="7" runat="server" TabIndex="1" CssClass="form-control"></asp:TextBox>
|
||||
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Cantidad:</label>
|
||||
<ajax:FilteredTextBoxExtender ID="FETxtModalRecoleccionCantidad" runat="server" TargetControlID="TxtModalRecoleccionCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||
@@ -443,48 +477,41 @@
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright" >
|
||||
<div class=" col-md-2">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlModalRecoleccionUnidad" runat="server" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida" CssClass="form-control input-sm select2me" Style="width: 85px !important;"></asp:DropDownList>
|
||||
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Unidad de Medida:</label>
|
||||
<label for="<%= TxtModalRecoleccionCantidad.ClientID.ToString()%>">Unidad:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlModalRecoleccionUnidad" runat="server" ControlToValidate="DdlModalRecoleccionUnidad" 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="GrpModalRecoleccionGuardaPS"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceRfvDdlModalRecoleccionUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalRecoleccionUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<i></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<div class="psagregar">
|
||||
<div class="comboxes">
|
||||
<label for="<%= DdlClasificacion.ClientID.ToString()%>">Clasificaión/Producto:</label>
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" Width="100%" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<br />
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2" DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlProducto_ValueChanged" />
|
||||
</div>
|
||||
<div class=" col-md-7">
|
||||
<div class="psagregar">
|
||||
<div class="comboxes">
|
||||
<label for="<%= DdlProducto2.ClientID.ToString()%>" style="font-size: 13px; color: #888888; opacity: 1; margin-bottom: 0px;">Producto:</label>
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto2" UsaWebService="true" Width="100%"
|
||||
CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2"
|
||||
DataTextField="PSCodigo" DataValueField="CvePS" Onselectedindexchange="DdlProducto_ValueChanged" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" style="text-align:right!important">
|
||||
<asp:LinkButton ID="LnkModalAgregarPS" runat="server" CssClass="Texto" ValidationGroup="GrpModalRecoleccionGuardaPS" Text="Agregar" OnClick="LnkModalAgregarPS_Click" />
|
||||
<div class="col-md-1" style="text-align: right!important; padding-top: 15px; padding-left: 0px;">
|
||||
<asp:LinkButton ID="LnkModalAgregarPS" runat="server" CssClass="btn btn-primary smallplus" ValidationGroup="GrpModalRecoleccionGuardaPS"
|
||||
OnClick="LnkModalAgregarPS_Click"><i class="fa fa-plus"></i></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:GridView ID="GvModalPSRecoleccion" DataKeyNames="CveEntregaAlmacenDetalle,CodigoPS,CvePS,CveUnidadMedida,Cantidad" runat="server"
|
||||
<asp:GridView ID="GvModalPSRecoleccion" DataKeyNames="CveEntregaAlmacenDetalle,CodigoPS,CvePS,CveUnidadMedida,Cantidad" runat="server"
|
||||
ShowHeader="true" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
@@ -538,10 +565,29 @@
|
||||
axis: 'y',
|
||||
dropOnEmpty: false,
|
||||
start: function (e, ui) {
|
||||
ui.item.addClass("selected");
|
||||
ui.item.addClass("selected");
|
||||
let asd = ui.item.children('a');
|
||||
},
|
||||
stop: function (e, ui) {
|
||||
stop: function (e, ui) {
|
||||
//Ordenar el numero de la columna *Cons*
|
||||
$(".RowOrdenamiento").each(function (index) {
|
||||
let nRow = (index + 1);
|
||||
$(this).text(nRow);
|
||||
});
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
$(".GvR").sortable({
|
||||
items: 'tr:not(tr:first-child)',
|
||||
cursor: 'pointer',
|
||||
axis: 'y',
|
||||
dropOnEmpty: false,
|
||||
start: function (e, ui) {
|
||||
ui.item.addClass("selected");
|
||||
let asd = ui.item.children('a');
|
||||
},
|
||||
stop: function (e, ui) {
|
||||
//Ordenar el numero de la columna *Cons*
|
||||
$(".RowOrdenamiento").each(function (index) {
|
||||
let nRow = (index + 1);
|
||||
@@ -552,8 +598,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -13,18 +13,18 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
{
|
||||
|
||||
|
||||
DataTable DTGenrarDocumentos
|
||||
DataTable DTGenerarDocumentos
|
||||
{
|
||||
get {
|
||||
|
||||
if(ViewState["DTGenrarDocumentos"] == null){
|
||||
ViewState["DTGenrarDocumentos"] = new DataTable();
|
||||
if(ViewState["DTGenerarDocumentos"] == null){
|
||||
ViewState["DTGenerarDocumentos"] = new DataTable();
|
||||
}
|
||||
return (DataTable)ViewState["DTGenrarDocumentos"];
|
||||
return (DataTable)ViewState["DTGenerarDocumentos"];
|
||||
|
||||
}
|
||||
set {
|
||||
ViewState["DTGenrarDocumentos"] = (DataTable)value;
|
||||
ViewState["DTGenerarDocumentos"] = (DataTable)value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,29 +62,23 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
ViewState["DTRecoleccion"] = (DataTable)value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool SelecionEntrega
|
||||
bool SeleccionEntrega
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["SelecionEntrega"] == null)
|
||||
if (ViewState["SeleccionEntrega"] == null)
|
||||
{
|
||||
ViewState["SelecionEntrega"] = false;
|
||||
ViewState["SeleccionEntrega"] = false;
|
||||
}
|
||||
return (bool) ViewState["SelecionEntrega"];
|
||||
return (bool) ViewState["SeleccionEntrega"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["SelecionEntrega"] = (bool)value;
|
||||
ViewState["SeleccionEntrega"] = (bool)value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int CveEntregaAlmacen
|
||||
{
|
||||
get {
|
||||
@@ -105,23 +99,15 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
SelecionEntrega = true;
|
||||
SeleccionEntrega = true;
|
||||
CargaCombos();
|
||||
CargaDatos();
|
||||
|
||||
|
||||
|
||||
CargaDatos();
|
||||
|
||||
#region RECOLEECION
|
||||
CargaDatosRecoleccion();
|
||||
CargaModalClasificaiones();
|
||||
CargaModalDdlPS();
|
||||
|
||||
ModalRecoleccionCargaClientes();
|
||||
|
||||
// CargaDatosRecoleccion();
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -141,36 +127,26 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
{
|
||||
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StringBuilder SBError = new StringBuilder();
|
||||
ActualizaOrdenDTGenrarDocumentos();
|
||||
ActualizaOrdenDTGenerarDocumentos();
|
||||
List<int> ListaTimbres = new List<int>();
|
||||
|
||||
|
||||
|
||||
bool TieneError = false;
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
ObjGeneral.IniciaTransacSQL();
|
||||
|
||||
GridViewRowCollection Grid = GvGenerarDocumentos.Rows;
|
||||
|
||||
|
||||
GridViewRowCollection Grid = GvGenerarDocumentos.Rows;
|
||||
string Usuario = DdlChofer.SelectedItem.Text;
|
||||
|
||||
|
||||
|
||||
|
||||
int CveDireccionOrigen = -1;
|
||||
foreach (GridViewRow row in Grid)
|
||||
{
|
||||
//int CvePaqueteriasGuias = row.DataKey("CvePaqueteriaGuia").ToEntero();
|
||||
int Orden = row.DataKey("Orden").ToEntero();
|
||||
|
||||
//if (ObjGeneral.AsignarEntregasPorRealizar(CvePaqueteriasGuias, CvePersonal: -1, CveAsignacionEntrega: CveAsignacionEntrega, Orden: Orden))
|
||||
//{
|
||||
|
||||
int CveDireccionDestino = row.DataKey("CveDireccionEnvio").ToEntero();
|
||||
int CveDireccionDestino = row.DataKey("CveDireccionEnvio").ToEntero();
|
||||
|
||||
if (CveDireccionDestino <= 0)
|
||||
{
|
||||
@@ -178,40 +154,162 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), row.DataKey("CveMovimiento").ToEntero(), CveDireccionOrigen, CveDireccionDestino, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "E",Orden,0);
|
||||
int CveEntregaAlmacen = ObjGeneral.AddInvEntregaAlmacenRuta(row.DataKey("CveSubProyectoOrigen").ToEntero(), CveDireccionOrigen, CveDireccionDestino, row.DataKey("CveMovimiento").ToEntero(), DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "E",Orden,0);
|
||||
CveDireccionOrigen = row.DataKey("CveDireccionEnvio").ToEntero();
|
||||
|
||||
if (CveEntregaAlmacen > 0)
|
||||
{
|
||||
DateTime MinFecha = new DateTime(1900, 01, 01);
|
||||
int CveTimbre = ObjGeneral.AddGralTimbre("Tra", "-1", -1, "", MinFecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, row.DataKey("CveSubProyectoOrigen").ToEntero());
|
||||
{
|
||||
int CveTimbre = ObjGeneral.AddGralTimbre("Ent", row.DataKey("CveSubProyectoOrigen").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:CveEntregaAlmacen, AplicaCP: ChkEmitirCartaPorte.Checked);
|
||||
|
||||
if (CveTimbre <= 0)
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
|
||||
|
||||
TieneError = true;
|
||||
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ListaTimbres.Add(CveTimbre);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. ");
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
|
||||
foreach (GridViewRow row in Grid)
|
||||
{
|
||||
try
|
||||
{
|
||||
//MandarNotificacionCorreo(row);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
TieneError = true;
|
||||
ModExtensiones.GuardaLog(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGeneral.Commit();
|
||||
StringBuilder MensajeAlert = new StringBuilder();
|
||||
//recorrer para timbrar
|
||||
MensajeAlert.Append(" Entregas creadas correctamente <br/><br/>");
|
||||
|
||||
foreach (int cvetimbre in ListaTimbres)
|
||||
{
|
||||
Timbres ObjTimbres = new Timbres("Ent", cvetimbre, UsuarioActual);
|
||||
MensajeAlert.AppendFormat("Folio: <b>{0}</b> ", ObjTimbres.ObjFactura.SerieFolio);
|
||||
if (ObjTimbres.Timbrar())
|
||||
{
|
||||
|
||||
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>XML <i class='fa fa-file'></i></i></a> ", ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CveTimbre={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", cvetimbre, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)));
|
||||
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>PDF <i class='fa fa-ad-pdf'></i></i></i></a> ", ModExtensiones.Encripta(String.Format("OP=CARPOTIMBRE&CVETIMBRE={0}", cvetimbre)));
|
||||
MensajeAlert.Append("<br/>");
|
||||
|
||||
Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
CargaDatos();
|
||||
DdlChofer.SelectedValueExist("-1");
|
||||
DdlUnidadCamion.SelectedValueExist("-1");
|
||||
ChkEmitirCartaPorte.Checked = false;
|
||||
|
||||
SeleccionEntrega = false;
|
||||
SeleccionarGenerar(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
MensajeAlert.AppendFormat("<ul><li>{0}</li></ul>", ObjTimbres.MsgError);
|
||||
}
|
||||
}
|
||||
UpDatos.Update();
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjGeneral.RollBack();
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
}else
|
||||
{
|
||||
Alert(SBError.ToString(), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void LnkGeneraRecoleccion_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
if (DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
|
||||
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
StringBuilder SBError = new StringBuilder();
|
||||
//ActualizaOrdenDTGenerarDocumentos();
|
||||
List<int> ListaTimbres = new List<int>();
|
||||
|
||||
|
||||
bool TieneError = false;
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
ObjGeneral.IniciaTransacSQL();
|
||||
string Usuario = DdlChofer.SelectedItem.Text;
|
||||
|
||||
int CveDireccionOrigen = -1;
|
||||
foreach (GridViewRow row in gvR.Rows)
|
||||
{
|
||||
int Orden = row.DataKey("Orden").ToEntero();
|
||||
int CveEntregaAlmacen = row.DataKey("CveEntregaAlmacen").ToEntero();
|
||||
|
||||
if (row.FCCheckBox("Chk").Checked)
|
||||
{
|
||||
CveDireccionOrigen = row.DataKey("CveDireccionOrigen").ToEntero();
|
||||
|
||||
if (CveEntregaAlmacen > 0)
|
||||
{
|
||||
int CveTimbre = ObjGeneral.AddGralTimbre("Rec", row.DataKey("CveSubProyectoDestino").ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen:CveEntregaAlmacen , AplicaCP: ChkEmitirCartaPorte.Checked);
|
||||
|
||||
if (CveTimbre <= 0)
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar timbre. ");
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
ListaTimbres.Add(CveTimbre);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SBError.AppendLine($"Factura {row.DataKey("SerieFolio")} error al agregar entrega alamcen. ");
|
||||
TieneError = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!TieneError)
|
||||
{
|
||||
|
||||
foreach (GridViewRow row in gvR.Rows)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -229,16 +327,52 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
if (!TieneError)
|
||||
{
|
||||
ObjGeneral.Commit();
|
||||
Alert("Entregas asignadas correctamente");
|
||||
StringBuilder MensajeAlert = new StringBuilder();
|
||||
//recorrer para timbrar
|
||||
MensajeAlert.Append(" Entregas creadas correctamente <br/><br/>");
|
||||
foreach (int cvetimbre in ListaTimbres)
|
||||
{
|
||||
Timbres ObjTimbres = new Timbres("Rec", cvetimbre, UsuarioActual);
|
||||
|
||||
if (ObjTimbres.Timbrar())
|
||||
{
|
||||
//ClsPaginas.PdfFactura(ref ObjTimbres.ObjFactura,"0",true);
|
||||
|
||||
//MensajeAlert.Append("Emitido con éxito.");
|
||||
|
||||
////XML
|
||||
//string ArchivoXML = String.Format("{0}/XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, ObjTimbres.ObjFactura.TipoDocto, ObjTimbres.ObjFactura.SerieFolio);
|
||||
//if (System.IO.File.Exists(ArchivoXML))
|
||||
// MensajeAlert.AppendFormat("<ul><li><a class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Descargar XML</a></li></ul>", ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CveTimbre={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", cvetimbre, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)));
|
||||
MensajeAlert.AppendFormat("Folio: <b>{0}</b> ", ObjTimbres.ObjFactura.SerieFolio);
|
||||
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>XML <i class='fa fa-file'></i></i></a> ", ModExtensiones.Encripta(String.Format("OP=DesXmlTra&CveTimbre={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", cvetimbre, "XML", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)));
|
||||
MensajeAlert.AppendFormat("<a class='texto' style='color:#337ab7' href='/Compras/PopUpVerFactura.aspx?P={0}' target='_blank'>PDF <i class='fa fa-ad-pdf'></i></i></i></a> ", ModExtensiones.Encripta(String.Format("OP=CARPOTIMBRE&CVETIMBRE={0}", cvetimbre)));
|
||||
MensajeAlert.Append("<br/>");
|
||||
////PDF
|
||||
//string ArchivoPDF = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, ObjTimbres.ObjFactura.TipoDocto, ObjTimbres.ObjFactura.SerieFolio);
|
||||
//if (System.IO.File.Exists(ArchivoPDF))
|
||||
// MensajeAlert.AppendFormat("<ul><li><a class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Descargar PDF</a></li></ul>", Encripta(String.Format("OP=DesPdfTra&CVEMOVIMIENTO={0}&EXT={1}&FOLIO={2}&TIPODOCTO={3}", CveMovimientoTimbrado, "PDF", ObjTimbres.ObjFactura.SerieFolio, ObjTimbres.ObjFactura.TipoDocto)));
|
||||
|
||||
|
||||
//if (UsuarioActual.Empresa.Funcionalidad(161) == "1")
|
||||
// MensajeAlert.AppendFormat("<ul><li><a class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Descargar Carta Porte</a></li></ul>", Encripta(String.Format("OP=CARPOTIMBRE&CVETIMBRE={0}", cvetimbre)));
|
||||
//else
|
||||
// MensajeAlert.AppendFormat("<ul><li><a class='Texto' href='/Compras/PopUpVerFactura.aspx?P={0}'>Descargar Carta Porte</a></li></ul>", ModExtensiones.Encripta(String.Format("OP=CARPO&CveTimbre={0}", cvetimbre)));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
MensajeAlert.AppendFormat("<ul><li>{0}</li></ul>", ObjTimbres.MsgError);
|
||||
}
|
||||
}
|
||||
Alert(MensajeAlert.ToString(), ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
CargaDatos();
|
||||
DdlChofer.SelectedValueExist("-1");
|
||||
DdlUnidadCamion.SelectedValueExist("-1");
|
||||
ChkEmitirCartaPorte.Checked = false;
|
||||
|
||||
SelecionEntrega = false;
|
||||
SeleccioanrGenrar();
|
||||
|
||||
CargaDatos();
|
||||
SeleccionEntrega = false;
|
||||
SeleccionarGenerar(1);
|
||||
UpDatos.Update();
|
||||
}
|
||||
else
|
||||
@@ -246,176 +380,157 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
ObjGeneral.RollBack();
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert(SBError.ToString(), ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
}
|
||||
|
||||
}
|
||||
private void CargaDatos()
|
||||
{
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
if (ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa, 1))
|
||||
{
|
||||
GvPaqueteriasGuias.DataSource = ObjGeneral.DtResultados;
|
||||
GvEntregas.DataSource = ObjGeneral.DtResultados;
|
||||
DTDatosConsulta = ObjGeneral.DtResultados;
|
||||
DTGenrarDocumentos = ObjGeneral.DtResultados.Clone();
|
||||
DTGenerarDocumentos = ObjGeneral.DtResultados.Clone();
|
||||
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
GvPaqueteriasGuias.DataBind();
|
||||
GvEntregas.DataBind();
|
||||
|
||||
UpDatos.Update();
|
||||
}
|
||||
|
||||
|
||||
private void CargaCombos()
|
||||
{
|
||||
|
||||
ClsInventarios ObjInventarios = new ClsInventarios();
|
||||
DdlUnidadCamion.DataSource = get_GlobalDTInvCamiones(UsuarioActual.CveEmpresa);
|
||||
|
||||
if(ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) && ObjInventarios.DtResultados.Rows.Count > 0){
|
||||
DdlUnidadCamion.DataSource = ObjInventarios.DtResultados;
|
||||
}
|
||||
ObjInventarios.Dispose();
|
||||
DdlUnidadCamion.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
DdlUnidadCamion.DataBind();
|
||||
|
||||
TxtFechaI.Text = DateTime.Now.AddDays(-1).ToShortDateString();
|
||||
TxtFechaF.Text = DateTime.Now.ToShortDateString();
|
||||
|
||||
ClsAcarreos ObjAcar = new ClsAcarreos();
|
||||
|
||||
if(ObjAcar.GetChofer(-1, UsuarioActual.CveEmpresa, 1, -1) ){
|
||||
DdlChofer.DataSource = ObjAcar.DtResultados;
|
||||
DdlChofer.DataBind();
|
||||
}
|
||||
ObjAcar.Dispose();
|
||||
|
||||
DdlChofer.DataSource = get_GlobalDTChoferes(UsuarioActual.CveEmpresa);
|
||||
DdlChofer.DataBind();
|
||||
DdlChofer.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
|
||||
TxtFechaEntrega.Text = DateTime.Now.ToShortDateString();
|
||||
|
||||
TxtFechaEntrega.Text = DateTime.Now.ToShortDateString();
|
||||
|
||||
CargarCentrosDeCosto(null, DdlSubProyecto, null, LblSubProyecto);
|
||||
CargarCentrosDeCosto(null, DdlSubProyectoRecoleccion, null, LblSubProyectoRecoleccion);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void CargaModalClasificaiones()
|
||||
{
|
||||
|
||||
DdlClasificacion.DataSource = get_GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby: "Clasificacion");
|
||||
DdlClasificacion.DataBind();
|
||||
|
||||
|
||||
UpModalRecoleccion.Update();
|
||||
}
|
||||
|
||||
private void CargaModalDdlPS()
|
||||
{
|
||||
bool EsWS = UsuarioActual.Empresa.Funcionalidad(105) == "1" | UsuarioActual.Empresa.Funcionalidad(141) == "1" ? true : false;
|
||||
DdlProducto2.setEsWebService(EsWS);
|
||||
if (DdlProducto2.UsaWebService)
|
||||
{
|
||||
DdlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue);
|
||||
}
|
||||
else if (!DdlProducto2.UsaWebService && (DataTable)DdlProducto2.DataSource == null)
|
||||
{
|
||||
DdlProducto2.DataSource = get_GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion: DdlClasificacion.SelectedValue.ToEntero()).FiltraParametros("CveTipoPS = 2");
|
||||
DdlProducto2.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void LnkGenerarDocumentos_Click(object sender, EventArgs e)
|
||||
{
|
||||
SeleccioanrGenrar();
|
||||
}
|
||||
SeleccionarGenerar(1);
|
||||
}
|
||||
private void SeleccionarGenerar(int Opcion ) {
|
||||
|
||||
|
||||
private void SeleccioanrGenrar() {
|
||||
|
||||
if (SelecionEntrega)
|
||||
if (SeleccionEntrega)
|
||||
{
|
||||
|
||||
DTGenrarDocumentos.Rows.Clear();
|
||||
DTGenerarDocumentos.Rows.Clear();
|
||||
|
||||
|
||||
|
||||
int CountRows = 0;
|
||||
foreach (GridViewRow GvRow in GvPaqueteriasGuias.Rows)
|
||||
if (Opcion == 2) //cuando es recolección
|
||||
{
|
||||
|
||||
CheckBox ChkAsigna = GvRow.FCCheckBox("ChkAsigna");
|
||||
|
||||
if (ChkAsigna.Checked)
|
||||
int CountRows = 0;
|
||||
foreach (GridViewRow GvRow in gvR.Rows)
|
||||
{
|
||||
|
||||
int CveMovimiento = GvRow.DataKey("CveMovimiento").ToEntero();
|
||||
CheckBox ChkAsigna = GvRow.FCCheckBox("Chk");
|
||||
|
||||
DataRow dRow = DTGenrarDocumentos.NewRow();
|
||||
DataRow dRowOrigen = DTDatosConsulta.FiltraParametros($"CveMovimiento = {CveMovimiento}").Rows[0];
|
||||
|
||||
int IndexColun = 0;
|
||||
foreach (DataColumn dColumn in DTDatosConsulta.Columns)
|
||||
if (ChkAsigna.Checked)
|
||||
{
|
||||
dRow[IndexColun] = dRowOrigen[IndexColun];
|
||||
IndexColun++;
|
||||
|
||||
int CveMovimiento = GvRow.DataKey("Cve").ToEntero();
|
||||
|
||||
DataRow dRow = DTGenerarDocumentos.NewRow();
|
||||
DataRow dRowOrigen = DTDatosConsulta.FiltraParametros($"CveMovimiento = {CveMovimiento}").Rows[0];
|
||||
|
||||
int IndexColun = 0;
|
||||
foreach (DataColumn dColumn in DTDatosConsulta.Columns)
|
||||
{
|
||||
dRow[IndexColun] = dRowOrigen[IndexColun];
|
||||
IndexColun++;
|
||||
}
|
||||
|
||||
dRow["Num"] = CountRows + 1;
|
||||
DTGenerarDocumentos.Rows.Add(dRow);
|
||||
CountRows++;
|
||||
}
|
||||
|
||||
dRow["Num"] = CountRows + 1;
|
||||
DTGenrarDocumentos.Rows.Add(dRow);
|
||||
CountRows++;
|
||||
}
|
||||
}
|
||||
|
||||
DTGenrarDocumentos.AcceptChanges();
|
||||
|
||||
|
||||
|
||||
|
||||
SelecionEntrega = false;
|
||||
LnkGenerarDocumentos.Text = "Regresar a Preselección";
|
||||
LnkGenerarDocumentos.CssClass = "btn btn-default";
|
||||
|
||||
|
||||
|
||||
|
||||
OcultarmostarDatosEntrega(true);
|
||||
|
||||
|
||||
|
||||
BtnConsultar.Visible = false;
|
||||
|
||||
UpDatos.Update();
|
||||
UpFiltro.Update();
|
||||
|
||||
|
||||
if (CountRows > 0)
|
||||
{
|
||||
GvGenerarDocumentos.DataSource = DTGenrarDocumentos;
|
||||
GvGenerarDocumentos.DataBind();
|
||||
|
||||
DVGvGenerarDocumentos.Visible = true;
|
||||
BtnAsignar.Visible = true;
|
||||
DVGvPaqueteriasGuias.Visible = false;
|
||||
|
||||
RegistraScript("InitOrdenamientoGvGenerarDocumentos();");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("No hay entregas seleccionadas", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
|
||||
int CountRows = 0;
|
||||
foreach (GridViewRow GvRow in GvEntregas.Rows)
|
||||
{
|
||||
|
||||
CheckBox ChkAsigna = GvRow.FCCheckBox("ChkAsigna");
|
||||
|
||||
if (ChkAsigna.Checked)
|
||||
{
|
||||
|
||||
int CveMovimiento = GvRow.DataKey("CveMovimiento").ToEntero();
|
||||
|
||||
DataRow dRow = DTGenerarDocumentos.NewRow();
|
||||
DataRow dRowOrigen = DTDatosConsulta.FiltraParametros($"CveMovimiento = {CveMovimiento}").Rows[0];
|
||||
|
||||
int IndexColun = 0;
|
||||
foreach (DataColumn dColumn in DTDatosConsulta.Columns)
|
||||
{
|
||||
dRow[IndexColun] = dRowOrigen[IndexColun];
|
||||
IndexColun++;
|
||||
}
|
||||
|
||||
dRow["Num"] = CountRows + 1;
|
||||
DTGenerarDocumentos.Rows.Add(dRow);
|
||||
CountRows++;
|
||||
}
|
||||
}
|
||||
|
||||
DTGenerarDocumentos.AcceptChanges();
|
||||
|
||||
SeleccionEntrega = false;
|
||||
LnkGenerarDocumentos.Text = "Regresar";
|
||||
LnkGenerarDocumentos.CssClass = "btn btn-default";
|
||||
|
||||
OcultarmostarDatosEntrega(true);
|
||||
|
||||
BtnConsultar.Visible = false;
|
||||
|
||||
UpDatos.Update();
|
||||
UpFiltro.Update();
|
||||
|
||||
if (CountRows > 0)
|
||||
{
|
||||
GvGenerarDocumentos.DataSource = DTGenerarDocumentos;
|
||||
GvGenerarDocumentos.DataBind();
|
||||
|
||||
DVGvGenerarDocumentos.Visible = true;
|
||||
BtnAsignar.Visible = true;
|
||||
DVGvEntregas.Visible = false;
|
||||
|
||||
RegistraScript("InitOrdenamientoGvGenerarDocumentos();");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("No hay entregas seleccionadas", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
BtnConsultar.Visible = true;
|
||||
SelecionEntrega = true;
|
||||
LnkGenerarDocumentos.Text = "Preselección de Entregas";
|
||||
SeleccionEntrega = true;
|
||||
LnkGenerarDocumentos.Text = "Preseleccionar";
|
||||
LnkGenerarDocumentos.CssClass = "btn btn-primary";
|
||||
|
||||
|
||||
@@ -423,15 +538,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
BtnAsignar.Visible = false;
|
||||
DVGvGenerarDocumentos.Visible = false;
|
||||
DVGvPaqueteriasGuias.Visible = true;
|
||||
DVGvEntregas.Visible = true;
|
||||
UpDatos.Update();
|
||||
UpFiltro.Update();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OcultarmostarDatosEntrega(bool mostrar )
|
||||
{
|
||||
DVDatosEntrega1.Visible = mostrar;
|
||||
@@ -452,34 +565,32 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
if (UsuarioActual.Empresa.Funcionalidad(161).ToEntero() == 1)
|
||||
{
|
||||
DvCartaPorte1.Visible = mostrar;
|
||||
DvCartaPorte2.Visible = mostrar;
|
||||
}
|
||||
UpDatosEntrega.Update();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void ActualizaOrdenDTGenrarDocumentos()
|
||||
private void ActualizaOrdenDTGenerarDocumentos()
|
||||
{
|
||||
string[] OrdenMovimientos = Request.Form.GetValues("OrdenMovimientos");
|
||||
|
||||
int NumOrden = 1;
|
||||
foreach (string CveMovimiento in OrdenMovimientos)
|
||||
{
|
||||
foreach(DataRow dRow in DTGenrarDocumentos.Rows)
|
||||
foreach(DataRow dRow in DTGenerarDocumentos.Rows)
|
||||
{
|
||||
if (CveMovimiento.ToEntero() == dRow["CveMovimiento"].ToString().ToEntero() )
|
||||
{
|
||||
dRow["Orden"] = NumOrden;
|
||||
}
|
||||
}
|
||||
DTGenrarDocumentos.AcceptChanges();
|
||||
DTGenerarDocumentos.AcceptChanges();
|
||||
NumOrden++;
|
||||
}
|
||||
|
||||
|
||||
DataView DTview = new DataView(DTGenrarDocumentos);
|
||||
|
||||
DataView DTview = new DataView(DTGenerarDocumentos);
|
||||
|
||||
// Sort by State and ZipCode column in descending order
|
||||
DTview.Sort = "Orden ASC";
|
||||
@@ -533,17 +644,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
ClsGenerales ObjGeneral = new ClsGenerales();
|
||||
if (ObjGeneral.GetInvEntregaAlmacenRuta(DdlSubProyecto.SelectedValue.ToEntero(), TxtFechaI.Text.ToDate(), TxtFechaF.Text.ToDate(), UsuarioActual.CveEmpresa, 2, 0))
|
||||
{
|
||||
GvDatosRecoleccion.DataSource = ObjGeneral.DtResultados;
|
||||
gvR.DataSource = ObjGeneral.DtResultados;
|
||||
}
|
||||
ObjGeneral.Dispose();
|
||||
GvDatosRecoleccion.DataBind();
|
||||
UpDatosRecoleccion.Update();
|
||||
|
||||
|
||||
|
||||
gvR.DataBind();
|
||||
UpDatosRecoleccion.Update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void CargaDatosRecoleccionDetallePS()
|
||||
{
|
||||
if (CveEntregaAlmacen > 0)
|
||||
@@ -564,21 +671,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
GvModalPSRecoleccion.DataBind();
|
||||
UpModalRecoleccion.Update();
|
||||
}
|
||||
|
||||
private void ModalRecoleccionCargaClientes()
|
||||
{
|
||||
ClsClientes ObjCliente = new ClsClientes();
|
||||
if (ObjCliente.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, 1))
|
||||
{
|
||||
DdlModalRecoleccionCliente.DataSource = ObjCliente.DtResultados;
|
||||
}
|
||||
|
||||
ObjCliente.Dispose();
|
||||
DdlModalRecoleccionCliente.DataBind();
|
||||
DdlModalRecoleccionCliente.Items.Insert(0, new ListItem("Seleccione uno", "-1"));
|
||||
}
|
||||
|
||||
}
|
||||
protected void DdlModalRecoleccionCliente_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
ModalRecoleccionCargaDirecciones();
|
||||
@@ -591,17 +684,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
ClsClientes ObjClientes = new ClsClientes();
|
||||
if (ObjClientes.DireccionEnvioGet(-1, DdlModalRecoleccionCliente.SelectedValue.ToEntero(), -1))
|
||||
{
|
||||
DdlmodalRecoleccionDirecion.DataSource = ObjClientes.DtResultados;
|
||||
DdlmodalRecoleccionDireccion.DataSource = ObjClientes.DtResultados;
|
||||
}
|
||||
ObjClientes.Dispose();
|
||||
ObjClientes.Dispose();
|
||||
}
|
||||
else
|
||||
{
|
||||
DdlmodalRecoleccionDirecion.DataSource = null;
|
||||
}
|
||||
|
||||
DdlmodalRecoleccionDirecion.DataBind();
|
||||
DdlmodalRecoleccionDirecion.Items.Insert(0, new ListItem("Seleccione una", "-1"));
|
||||
DdlmodalRecoleccionDireccion.DataBind();
|
||||
DdlmodalRecoleccionDireccion.Items.Insert(0, new ListItem("Seleccione", "-1"));
|
||||
|
||||
UpModalRecoleccion.Update();
|
||||
}
|
||||
@@ -609,21 +698,8 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
protected void LnkAgregarRecoleccion_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
|
||||
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LtlModalRecoleccionTitulo.Text = "Agregar Recoleccion";
|
||||
|
||||
LtlModalRecoleccionTitulo.Text = "Agregar Recolección";
|
||||
BtnModalRecoleccionGuardar.Text = "Agregar";
|
||||
|
||||
LimpiarModalRecoleccion();
|
||||
@@ -648,16 +724,16 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
|
||||
if (ObjClientes.DireccionEnvioGet(-1, CveClienteEnvio, -1))
|
||||
{
|
||||
DdlmodalRecoleccionDirecion.DataSource = ObjClientes.DtResultados;
|
||||
DdlmodalRecoleccionDireccion.DataSource = ObjClientes.DtResultados;
|
||||
}
|
||||
}
|
||||
ObjClientes.Dispose();
|
||||
|
||||
DdlmodalRecoleccionDirecion.DataBind();
|
||||
DdlmodalRecoleccionDirecion.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||
DdlmodalRecoleccionDirecion.SelectedValueExist(CveDireccionOrigen);
|
||||
DdlmodalRecoleccionDireccion.DataBind();
|
||||
DdlmodalRecoleccionDireccion.Items.Add(new ListItem("Seleccione una", "-1"));
|
||||
DdlmodalRecoleccionDireccion.SelectedValueExist(CveDireccionOrigen);
|
||||
|
||||
DdlModalRecoleccionCliente.SelectedValueExist(CveClienteEnvio);
|
||||
//DdlModalRecoleccionCliente.SelectedValueExist(CveClienteEnvio);
|
||||
|
||||
|
||||
CargaDatosRecoleccionDetallePS();
|
||||
@@ -673,8 +749,8 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
private void LimpiarModalRecoleccion()
|
||||
{
|
||||
|
||||
DdlModalRecoleccionCliente.SelectedValueExist(-1);
|
||||
DdlmodalRecoleccionDirecion.SelectedValueExist(-1);
|
||||
// DdlModalRecoleccionCliente.SelectedValueExist(-1);
|
||||
DdlmodalRecoleccionDireccion.SelectedValueExist(-1);
|
||||
TxtModalRecoleccionCantidad.Text = "";
|
||||
DdlModalRecoleccionUnidad.Items.Clear();
|
||||
DdlModalRecoleccionUnidad.Items.Add(new ListItem("Seleccione una","-1"));
|
||||
@@ -705,72 +781,62 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
protected void BtnModalRecoleccionGuardar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
//if (DdlChofer.SelectedValue.ToEntero() <= 0)
|
||||
//{
|
||||
// Alert("Debe seleccionar un chofer.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
//if (DdlUnidadCamion.SelectedValue.ToEntero() <= 0)
|
||||
//{
|
||||
// Alert("Debe seleccionar una unidad", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
||||
if (DdlmodalRecoleccionDireccion.SelectedValue.ToEntero() <= 0)
|
||||
{
|
||||
Alert("Debe seleccionar la dirección de recolección", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
return;
|
||||
}
|
||||
int CveTimbrenuevo = -1;
|
||||
bool ProcesoOK = false;
|
||||
|
||||
bool ProcesoOK = false;
|
||||
|
||||
|
||||
|
||||
int CveSubProyectoCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1, DdlModalRecoleccionCliente.SelectedValue.ToEntero()).FiltroPrimeroValor("CveSubProyecto").ToEntero();
|
||||
//int CveSubProyectoCliente = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1, DdlModalRecoleccionCliente.SelectedValue.ToEntero()).FiltroPrimeroValor("CveSubProyecto").ToEntero();
|
||||
ClsGenerales ObjGenerales = new ClsGenerales();
|
||||
ObjGenerales.IniciaTransacSQL();
|
||||
|
||||
|
||||
|
||||
|
||||
if( CveEntregaAlmacen == -1)
|
||||
{
|
||||
CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(CveSubProyectoCliente, -1, DdlmodalRecoleccionDirecion.SelectedValue.ToEntero(), -1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "R", 1,0);
|
||||
CveEntregaAlmacen = ObjGenerales.AddInvEntregaAlmacenRuta(DdlSubProyectoRecoleccion.SelectedValue.ToEntero(), DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1,-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), "R", 1,0);
|
||||
if (CveEntregaAlmacen > 0)
|
||||
{
|
||||
CveTimbrenuevo = ObjGenerales.AddGralTimbre("Tra", "-1", -1, "-1", new DateTime(1900, 01, 01), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, CveSubProyectoCliente);
|
||||
//CveTimbrenuevo = ObjGenerales.AddGralTimbre("Rec", "-1", -1, "-1", TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, -1, ChkEmitirCartaPorte.Checked, CveEntregaAlmacen, -1);
|
||||
|
||||
if (CveTimbrenuevo > 0)
|
||||
{
|
||||
foreach (DataRow dRow in DTRecoleccion.Rows)
|
||||
//if (CveTimbrenuevo > 0)
|
||||
//{
|
||||
foreach (DataRow dRow in DTRecoleccion.Rows)
|
||||
{
|
||||
if(ObjGenerales.AddEntregaAlmacenRutaDetalle(CveEntregaAlmacen,dRow["CvePS"].ToString().ToEntero(), dRow["Cantidad"].ToString().ToDecimal(),dRow["CveUnidadMedida"].ToString().ToEntero(), UsuarioActual.CveUsuario))
|
||||
{
|
||||
ProcesoOK = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
{
|
||||
ProcesoOK = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen,DdlmodalRecoleccionDirecion.SelectedValue.ToEntero(),-1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(),TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa))
|
||||
{
|
||||
ProcesoOK = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcesoOK = false;
|
||||
}
|
||||
ProcesoOK = ObjGenerales.UpdateInvEntregaAlmacenRuta(CveEntregaAlmacen, DdlmodalRecoleccionDireccion.SelectedValue.ToEntero(), -1, DdlChofer.SelectedValue.ToEntero(), DdlUnidadCamion.SelectedValue.ToEntero(), TxtFechaEntrega.Text.ToDate(), UsuarioActual.CveEmpresa);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (ProcesoOK)
|
||||
{
|
||||
@@ -780,6 +846,7 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
CveEntregaAlmacen = -1;
|
||||
ObjGenerales.RollBack();
|
||||
}
|
||||
|
||||
@@ -880,17 +947,13 @@ public partial class Inventarios_EntregaAlmacenRuta : ClsPaginas
|
||||
DdlProducto2.txtValue.Value = "";
|
||||
UpModalRecoleccion.Update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected void Tab_ActiveTabChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(Tab.ActiveTabIndex == 0)
|
||||
{
|
||||
SelecionEntrega = false;
|
||||
SeleccioanrGenrar();
|
||||
|
||||
SeleccionEntrega = false;
|
||||
SeleccionarGenerar(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2381,6 +2381,85 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Private Function GeneraPrePolizaMovimientoAlmacen(CveMovimientoEntrada As Integer, CveMovimientoSalida As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjContaContPAQ As ClsContPAQi, EsContabilizable As Boolean) As Boolean
|
||||
Dim Retorno As Boolean = True
|
||||
Try
|
||||
Dim DtCostos As DataTable = Nothing
|
||||
Dim ValorInventario As Decimal = 0
|
||||
Dim ValorInventarioME As Decimal = 0
|
||||
Dim CveConcepto As Integer = 3
|
||||
|
||||
ObjInventario.GetMovimientos(CveMovimientoEntrada, -1, -1, UsuarioActual.CveEmpresa)
|
||||
Dim CveVenta As Integer = ObjInventario.CveVenta
|
||||
Dim CveAlmacen As Integer = ObjInventario.CveAlmacen
|
||||
Dim SerieFolio As String = ObjInventario.DtResultados.Rows(0)("SerieFolioVenta").ToString
|
||||
Dim MovAlmacen As Boolean = True
|
||||
|
||||
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & CveConcepto).ToEntero
|
||||
If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True
|
||||
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
||||
DtCostos = ObjInventario.DtResultados
|
||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||
Dim IdCtaContable As Integer = 0
|
||||
Dim ConceptoPoliza As String = String.Format("{0}-{1}", "Salida de Almacen", SerieFolio)
|
||||
|
||||
If tmpCostos.Rows.Count > 0 Then
|
||||
Dim Concepto As String = ConceptoPoliza
|
||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("RA-01", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ValorInventario, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ValorInventario, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then
|
||||
Retorno = False
|
||||
End If
|
||||
|
||||
|
||||
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
|
||||
If ObjConta.ValorPolizaDescuadre > 0 Then
|
||||
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
|
||||
Retorno = False
|
||||
End If
|
||||
End If
|
||||
|
||||
'CONTABILIZAR - SIMPLIFICAR
|
||||
If Retorno Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
Retorno = False
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
If ObjContaContPAQ Is Nothing Then
|
||||
ObjContaContPAQ = New ClsContPAQi(UsuarioActual.Empresa)
|
||||
ObjContaContPAQ.IniciaTransacSQL()
|
||||
End If
|
||||
|
||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaContPAQ) Then
|
||||
Retorno = False
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
Else
|
||||
Retorno = False
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guadar la prepoliza", ex)
|
||||
Retorno = False
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Private Sub GuardaCompraOC()
|
||||
|
||||
Dim CveMovimiento As Integer
|
||||
@@ -2404,6 +2483,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim ObjVentas As New ClsVentas(ObjInventario.IniciaTransacSQL())
|
||||
Dim ObjContaAC As ClsContPAQi = Nothing
|
||||
Dim ObjContaContPAQ As ClsContPAQi = Nothing
|
||||
Dim MensajeOC As New StringBuilder
|
||||
|
||||
'ENTREGA DIRECTA
|
||||
|
||||
@@ -2603,6 +2683,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim SumaTotal As Decimal = 0.0D
|
||||
Dim Cont As Integer = 0
|
||||
|
||||
Dim ListaOC As New List(Of DetalleOC)
|
||||
|
||||
For Each gvr As GridViewRow In GvInv.Rows
|
||||
If gvr.FCCheckBox("cbInv").Checked AndAlso gvr.FCTextBox("TbCantidadF").Text.ToDecimal > 0 Then
|
||||
|
||||
@@ -2664,17 +2746,46 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
End If
|
||||
|
||||
End If
|
||||
'If ObjInventario.CveMovimientoDetalle > 0 AndAlso DtSeccionAlmacen.Rows.Count > 0 Then
|
||||
' For Each Dr As DataRow In DtSeccionAlmacen.FiltraParametros($"IndexSeccionAlmacen = {gvr.RowIndex}").Rows
|
||||
' If Not ObjInventario.AddMovimientosDetalleSeccionesAlmacen(ObjInventario.CveMovimientoDetalle, Dr("CveSeccionAlmacen").ToString.ToEntero, Dr("CantidadSeccionAlmacen").ToString.ToDecimal) Then
|
||||
' ErrorMovInv = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
'End If
|
||||
|
||||
Cont += 1
|
||||
End If
|
||||
If DdlTipo.SelectedValue = "2" Then
|
||||
ListaOC.Add(New DetalleOC With {.CveOCDetalle = gvr.DataKey("CveOrdenCompraDetalle").ToEntero,
|
||||
.Cantidad = gvr.FCTextBox("TbCantidadF").Text.ToDecimal,
|
||||
.CantidadOC = gvr.DataKey("CantidadF").ToDecimal,
|
||||
.PS = gvr.DataKey("PS")})
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
'' SI ES ENTRADA POR OC. VERIFICA QUE SE RECIBA LA TOTALIDAD POR PARTIDA. SINO SE DIVIDE
|
||||
|
||||
'si es entrada por oc, se verifican las cantidades, si la cantidad recibida es menor, se ajusta la cantidad en la OC. y se genera una nueva partida con la diferencia
|
||||
If DdlTipo.SelectedValue = "2" Then
|
||||
'se actualiza ListaOC
|
||||
Dim resultsOC = ListaOC.GroupBy(
|
||||
Function(row) row.CveOCDetalle) _
|
||||
.Select(Function(group) New With
|
||||
{
|
||||
.CveOCDetalle = group.Key,
|
||||
.CantidadOC = group.Sum(Function(row) row.CantidadOC),
|
||||
.Cantidad = group.Sum(Function(row) row.Cantidad),
|
||||
.PS = group.Max(Function(row) row.PS),
|
||||
.Data = group
|
||||
})
|
||||
|
||||
|
||||
For Each oc In resultsOC
|
||||
If oc.Cantidad < oc.CantidadOC Then
|
||||
MensajeOC.AppendFormat("- {0}</br>", oc.PS)
|
||||
If Not ObjOC.UpdateOrdenCompraDetalleDivideCantidad(CveOCSurtir, oc.CveOCDetalle, oc.Cantidad, UsuarioActual.CveUsuario) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
@@ -2849,6 +2960,13 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
Next
|
||||
|
||||
If Not ErrorMovInv Then
|
||||
'registra la prepóliza en el traspaso
|
||||
If Not GeneraPrePolizaMovimientoAlmacen(CveMovtoEntradaActual, CveMovtoSalidaActual, ObjInventario, ObjConta, ObjContaContPAQ, False) Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -2877,7 +2995,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
Dim CveTipoAlmacenFiltro As Integer = If(CveTipoCompra = 9, 25, 24)
|
||||
|
||||
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(TipoMovimiento > 1, 13, 2), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(TipoMovimiento > 1, 37, 36), 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCompraSurtir, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="RA/G4")
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
@@ -3589,6 +3707,9 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
If CveMovimiento > 0 AndAlso CveMovimientoSalidaTraspaso <= 0 Then
|
||||
Msg.AppendFormat("Movimiento Registrado: Folio: <b>{0}</b>", link)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
If MensajeOC.Length > 0 Then
|
||||
Msg.AppendFormat("<br/>La Orden de Compra se dividió en los siguientes productos:<br/>{0}", MensajeOC)
|
||||
End If
|
||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Individual</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Individual")))
|
||||
'Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Etiqueta Por Caja</a> ", Encripta(String.Format("OP=Etiqueta&CveMovimiento={0}&Modalidad={1}", CveMovimiento, "Caja")))
|
||||
@@ -4192,6 +4313,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
||||
|
||||
End Sub
|
||||
|
||||
Class DetalleOC
|
||||
Property CveOCDetalle As Integer
|
||||
Property CantidadOC As Decimal
|
||||
Property Cantidad As Decimal
|
||||
Property PS As String
|
||||
|
||||
End Class
|
||||
|
||||
#End Region
|
||||
|
||||
#Region " TIPO DE CAMBIO "
|
||||
|
||||
@@ -76,8 +76,7 @@
|
||||
<div class="col-md-8">
|
||||
|
||||
<asp:UpdatePanel ID="UpTraspaso" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="portlet light xspadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
@@ -114,22 +113,28 @@
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha3" runat="server" HighlightCssClass="vco" TargetControlID="RVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label class="col-md-2">Transitorio:</label>
|
||||
<div class="col-md-1" style="padding-left: 7px;">
|
||||
<asp:CheckBox ID="ChkTransitorio" AutoPostBack="true" OnCheckedChanged="ChkTransitorio_CheckedChanged" CssClass="md-checksd" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-2">Almacén Origen:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlAlmacenOrigen" Width="150px" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlAlmacenOrigen_SelectedIndexChanged" AutoPostBack="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlAlmacenOrigen" Width="100%" AppendDataBoundItems="true" OnSelectedIndexChanged="DdlAlmacenOrigen_SelectedIndexChanged" AutoPostBack="true" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacenOrigen" runat="server" ControlToValidate="DdlAlmacenOrigen" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Origen''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCEAlmacenOrigen" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenOrigen" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
<label class="col-md-3">Almacén Destino:</label>
|
||||
<label class="col-md-2">Almacén Destino:</label>
|
||||
<div class="col-md-3">
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" OnSelectedIndexChanged="DdlAlmacenDestino_SelectedIndexChanged" AutoPostBack="true" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me" Width="150px" runat="server"></asp:DropDownList>
|
||||
<asp:DropDownList ID="DdlAlmacenDestino" OnSelectedIndexChanged="DdlAlmacenDestino_SelectedIndexChanged" AutoPostBack="true" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm input-small select2me" Width="100%" runat="server"></asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVAlmacenDestino" runat="server" ControlToValidate="DdlAlmacenDestino" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Almacen Destino''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOAlmacenDestino" runat="server" HighlightCssClass="vco" TargetControlID="RFVAlmacenDestino" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row" style="padding-top: 8px;">
|
||||
<label class="col-md-2">Observaciones:</label>
|
||||
@@ -138,10 +143,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="padding-top: 8px;">
|
||||
<label class="col-md-2">Transitorio:</label>
|
||||
<div class="col-md-3" style="padding-left: 7px;">
|
||||
<asp:CheckBox ID="ChkTransitorio" AutoPostBack="true" OnCheckedChanged="ChkTransitorio_CheckedChanged" CssClass="md-checksd" runat="server" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="DivTransitorio" style="display: none;">
|
||||
@@ -152,25 +154,7 @@
|
||||
<asp:TextBox runat="server" Text="" CssClass="form-control input-sm" ID="TxtResponsable" />
|
||||
</asp:Panel>
|
||||
|
||||
<label class="col-md-2">Almacen Transitorio:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
<asp:Label AssociatedControlID="ChkEmitirTimbrado" runat="server" Text="Emitir Timbrado:" ID="LblEmitirTimbrado" CssClass="col-md-2 " Visible="false"></asp:Label>
|
||||
<asp:Panel ID="DivEmitirTimbrado" runat="server" Visible="false" class="col-md-1" >
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirTimbrado_CheckedChanged" AutoPostBack="true" /> </td>
|
||||
<td><asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" Text="Carta Porte" Visible="false" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -181,82 +165,29 @@
|
||||
<div class="col-md-2" id="divGastoIndirecto" visible="false" runat="server">
|
||||
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtGastoIndirecto" />
|
||||
</div>
|
||||
<label class="col-md-2">Chofer:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="Chofer" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" 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>
|
||||
<label class="col-md-2">F. Entrega:</label>
|
||||
<div class="col-md-2" style="padding-left: 5px; padding-top: 0px;">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
<label class="col-md-2">F. Envío:</label>
|
||||
<div class="col-md-2" style="padding-left: 5px; padding-top: 0px;" runat="server" id="divFechaEnvio" visible="false">
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 120px !important;">
|
||||
<asp:TextBox ID="TxtFechaEnvio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="75px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEnvio" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaEnvio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaEnvio" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaEnvio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-1">Unidad:</label>
|
||||
<div class="col-md-1 ">
|
||||
<asp:HyperLink runat="server" Visible="false" ID="HplNuevaUnidad" CssClass="btn btn-sm btn-primary" NavigateUrl="#" data-toggle="modal" data-target="#DivAgregarNuevoCamion"><i class='fa fa-plus'></i></asp:HyperLink>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="Placa"></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 id="divPlacaEspecificacion" runat="server">
|
||||
<label class="col-md-2">Placa:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtPlaca" CssClass="form-control input-sm" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtPlaca" runat="server" Enabled="false" ControlToValidate="TxtPlaca" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Placa''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceTxtPlaca" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtPlaca" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
<label class="col-md-2">Especificación de la Unidad:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtEspecifUnidad" CssClass="form-control input-sm" />
|
||||
<asp:RequiredFieldValidator ID="RfvTxtEspecifUnidad" runat="server" Enabled="false" ControlToValidate="TxtEspecifUnidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Especificación Unidad''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VceTxtEspecifUnidad" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtEspecifUnidad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="DivDocChofer" class="col-md-4" style="display: none;">
|
||||
|
||||
<div id="DivDocChofer" class="col-md-4 " style="display: none;" >
|
||||
|
||||
<asp:UpdatePanel ID="UpDocChofer" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
|
||||
<div class="portlet light xspadding traspasorow bordered">
|
||||
<div class="portlet-title">
|
||||
<div class="caption font-green">
|
||||
<i class="icon-pin font-green"></i>
|
||||
<span class="caption-subject bold uppercase">DOCUMENTACIÓN DEL CHOFER</span>
|
||||
<span class="caption-subject bold uppercase">EMISIÓN DE TRASLADO</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
@@ -269,49 +200,70 @@
|
||||
</div>
|
||||
<div class="portlet-body ">
|
||||
<div class="rowpadding">
|
||||
<div class="row">
|
||||
<label class="col-md-5">Responsable cargó:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtResponsableCarga" Width="150px" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-3">Transitorio:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" class="rowpadding">
|
||||
<label class="col-md-3">Emitir:</label>
|
||||
<div class="col-md-9">
|
||||
<table>
|
||||
<tr>
|
||||
<td><asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " OnCheckedChanged="ChkEmitirTimbrado_CheckedChanged" AutoPostBack="true" /> </td>
|
||||
<td><asp:CheckBox ID="ChkEmitirCartaPorte" runat="server" Text="Carta Porte" Visible="false" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-5">Responsable recibió:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtResponsableRecibio" Width="150px" />
|
||||
<div class="row" class="rowpadding">
|
||||
<label class="col-md-3">Chofer:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" 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>
|
||||
<div class="row" class="rowpadding">
|
||||
<label class="col-md-3">Unidad:</label>
|
||||
<div class="col-md-9">
|
||||
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca"></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>
|
||||
<div class="row rowpadding">
|
||||
<label class="col-md-3">F. Salida:</label>
|
||||
<div class="col-md-9" style="padding-top: 0px;">
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEntrega" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEntrega" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtFechaEntrega" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaEntrega" PopupButtonID="ImgFechaEntrega" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TxtFechaEntrega" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Entrega''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-5">Identificación:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtIdentificacion" Width="150px" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-5">Domicilio:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtDomicilio" Width="150px" />
|
||||
<div class="row rowpadding">
|
||||
<label class="col-md-3">F. Llegada:</label>
|
||||
<div class="col-md-9" style="padding-top: 0px;" runat="server" id="divFechaEnvio" visible="false">
|
||||
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 125px !important;">
|
||||
<asp:TextBox ID="TxtFechaEnvio" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" Width="80px" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton runat="server" ID="ImgFechaEnvio" class="btn default"> <i class="fa fa-calendar"></i> </asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="TxtFechaEnvio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CalendarExtender2" TargetControlID="TxtFechaEnvio" PopupButtonID="ImgFechaEnvio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CompareValidator2" runat="server" ControlToValidate="TxtFechaEnvio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Envío''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="CompareValidator2" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-5">Teléfono:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtTelefono" Width="150px" MaxLength="10" />
|
||||
<ajax:FilteredTextBoxExtender ID="FTETelefono" runat="server" TargetControlID="TxtTelefono" FilterType="Custom, Numbers" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-5">Ciudad:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtCiudad" Width="150px" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label class="col-md-5">Licencia:</label>
|
||||
<div class="col-md-4">
|
||||
<asp:TextBox runat="server" Text="" ID="TxtLicencia" Width="150px" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -365,46 +317,48 @@
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="DivCodigoSeriePS">
|
||||
<div class="col-md-4 pull-right">
|
||||
<table style="float: right;">
|
||||
<tr>
|
||||
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
|
||||
<td>
|
||||
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
|
||||
<asp:TextBox ID="TxtCodigoPS" CssClass="form-control input-sm" ClientIDMode="Static" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td runat="server" visible="false" id="TdSeriePS">
|
||||
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
|
||||
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row" runat="server" id="DivCodigoSeriePS">
|
||||
<div class="col-md-4 pull-right">
|
||||
<table style="float: right;">
|
||||
<tr>
|
||||
<td><i class="fa fa-barcode" style="font-size: 1.8em; margin-top: 8px;" aria-hidden="true" data-toggle="tooltip" title="Código Barras"></i></td>
|
||||
<td>
|
||||
<asp:Panel ID="PanelCodigo" runat="server" DefaultButton="BtnCodigoPS">
|
||||
<asp:TextBox ID="TxtCodigoPS" CssClass="form-control input-sm" ClientIDMode="Static" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnCodigoPS" OnClick="BtnCodigoPS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
<td runat="server" visible="false" id="TdSeriePS">
|
||||
<asp:Panel ID="PanelSerie" runat="server" DefaultButton="BtnSeriePS">
|
||||
<asp:TextBox ID="TxtSeriePS" Text="" runat="server" />
|
||||
<asp:Button Text="" ID="BtnSeriePS" OnClick="BtnSeriePS_Click" Style="display: none" runat="server" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
<table border="0" cellpadding="0" class="Widthall grides" cellspacing="0">
|
||||
<thead>
|
||||
<tr class="Titulos">
|
||||
<th width="25px">#</th>
|
||||
<th width="100px">Cantidad</th>
|
||||
<th width="90px">Unidad</th>
|
||||
<th width="500px">Clasificación
|
||||
|
||||
<br />
|
||||
<th width="500px">
|
||||
Producto
|
||||
</th>
|
||||
<th width="100px">Observaciones</th>
|
||||
@@ -436,10 +390,7 @@
|
||||
<ContentTemplate>
|
||||
<div class="psagregar">
|
||||
<div class="comboxes">
|
||||
<asp:DropDownList ID="DdlClasificacion" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione la Clasificación (Todas)" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<br />
|
||||
|
||||
<ADS:Dropdownlost runat="server" ID="DdlProducto2" CssStyle="width: 100%;" IncluyeTodos="false" CssClassDdl="select2me" TabIndex="2" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -475,8 +426,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<div style="max-height: 300px; overflow-y: auto;">
|
||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,CveSeccionAlmacen,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -821,7 +821,7 @@ Partial Class CatSubProyectos
|
||||
#Region "COMERCIO EXTERIOR"
|
||||
|
||||
Private Sub CargaPais()
|
||||
DdlPais.DataSource = GlobalDTPais()
|
||||
DdlPais.DataSource = GlobalDTGralPaises()
|
||||
DdlPais.DataBind()
|
||||
DdlPais.SelectedValueExist("151")
|
||||
End Sub
|
||||
@@ -829,7 +829,7 @@ Partial Class CatSubProyectos
|
||||
Private Sub CargaEstado()
|
||||
DdlEstado.Items.Clear()
|
||||
If DdlPais.SelectedValue.ToEntero > 0 Then
|
||||
DdlEstado.DataSource = GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString)
|
||||
DdlEstado.DataSource = GlobalDTEstado("-1", DdlPais.SelectedValue.ToEntero)
|
||||
End If
|
||||
DdlEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlEstado.DataBind()
|
||||
@@ -838,7 +838,7 @@ Partial Class CatSubProyectos
|
||||
Private Sub CargaMunicipio()
|
||||
DdlMunicipio.Items.Clear()
|
||||
If DdlEstado.SelectedValue.ToEntero > 0 Then
|
||||
DdlMunicipio.DataSource = GlobalDTMunicipio(GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString).FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString)
|
||||
DdlMunicipio.DataSource = GlobalDTMunicipio("-1", DdlEstado.SelectedValue.ToEntero)
|
||||
End If
|
||||
DdlMunicipio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlMunicipio.DataBind()
|
||||
@@ -848,7 +848,7 @@ Partial Class CatSubProyectos
|
||||
DdlColonia.Items.Clear()
|
||||
If DdlMunicipio.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
DdlColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString).FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString).FiltraParametros($"CveMunicipio = {DdlMunicipio.SelectedValue.ToEntero}")(0)("ClaveSATMunicipio").ToString).FiltraParametros(If(TxtCP.Text.Trim.Length > 0, $"CP = {TxtCP.Text}", ""))
|
||||
DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtCP.Text.Trim.Length > 0, TxtCP.Text.ToEntero, -1))
|
||||
|
||||
End If
|
||||
DdlColonia.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
@@ -917,9 +917,9 @@ Partial Class CatSubProyectos
|
||||
Dim CveColonia As Integer = DdlColonia.SelectedValue.ToEntero
|
||||
|
||||
If CPTxt > 0 And CveColonia > 0 Then
|
||||
Dim CP As Integer = GlobalDTColonia("-1").FiltroPrimeroValor("CP", $"CveColonia = {CveColonia}").ToEntero
|
||||
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
|
||||
If CPTxt <> CP Then
|
||||
Alert("El codigo postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -4380,7 +4380,7 @@ Partial Class Clientes
|
||||
|
||||
Private Sub CargaDirClientePais()
|
||||
|
||||
DdlDirClientePais.DataSource = GlobalDTPais()
|
||||
DdlDirClientePais.DataSource = GlobalDTGralPaises()
|
||||
DdlDirClientePais.DataBind()
|
||||
DdlDirClientePais.SelectedValueExist("151")
|
||||
End Sub
|
||||
@@ -4388,7 +4388,7 @@ Partial Class Clientes
|
||||
Private Sub CargaDirClienteEstado()
|
||||
DdlDirClienteEstado.Items.Clear()
|
||||
If DdlDirClientePais.SelectedValue.ToEntero > 0 Then
|
||||
DdlDirClienteEstado.DataSource = GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlDirClientePais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString)
|
||||
DdlDirClienteEstado.DataSource = GlobalDTEstado(GlobalDTGralPaises.FiltraParametros($"CvePais = {DdlDirClientePais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString)
|
||||
End If
|
||||
DdlDirClienteEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlDirClienteEstado.DataBind()
|
||||
@@ -4397,7 +4397,7 @@ Partial Class Clientes
|
||||
Private Sub CargaDirClienteMunicipio()
|
||||
DdlDirClienteMunicipio.Items.Clear()
|
||||
If DdlDirClienteEstado.SelectedValue.ToEntero > 0 Then
|
||||
DdlDirClienteMunicipio.DataSource = GlobalDTMunicipio(GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlDirClientePais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString).FiltraParametros($"CveEstado = {DdlDirClienteEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString)
|
||||
DdlDirClienteMunicipio.DataSource = GlobalDTMunicipio(GlobalDTEstado(GlobalDTGralPaises.FiltraParametros($"CvePais = {DdlDirClientePais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString).FiltraParametros($"CveEstado = {DdlDirClienteEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString)
|
||||
End If
|
||||
DdlDirClienteMunicipio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlDirClienteMunicipio.DataBind()
|
||||
@@ -4405,8 +4405,8 @@ Partial Class Clientes
|
||||
|
||||
Private Sub CargaDirClienteColonia()
|
||||
DdlDirClienteColonia.Items.Clear()
|
||||
If DdlDirClienteMunicipio.SelectedValue.ToEntero > 0 Then
|
||||
DdlDirClienteColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlDirClientePais.SelectedValue.ToEntero}")(0)("ClaveSATPais").ToString).FiltraParametros($"CveEstado = {DdlDirClienteEstado.SelectedValue.ToEntero}")(0)("ClaveSATEstado").ToString).FiltraParametros($"CveMunicipio = {DdlDirClienteMunicipio.SelectedValue.ToEntero}")(0)("ClaveSATMunicipio").ToString).FiltraParametros(If(TxtEnvioCP.Text.Trim.Length > 0, $"CP = {TxtEnvioCP.Text}", ""))
|
||||
If DdlDirClienteMunicipio.SelectedValue.ToEntero > 0 Then
|
||||
DdlDirClienteColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlDirClienteMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtEnvioCP.Text.Trim.Length > 0, TxtEnvioCP.Text.ToEntero, -1))
|
||||
End If
|
||||
DdlDirClienteColonia.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlDirClienteColonia.DataBind()
|
||||
@@ -4455,16 +4455,14 @@ Partial Class Clientes
|
||||
|
||||
Private Sub DirClientevalidaCodigoPostal()
|
||||
|
||||
|
||||
|
||||
Dim CPTxt As Integer = TxtEnvioCP.Text.ToEntero()
|
||||
|
||||
Dim CveColonia As Integer = DdlDirClienteColonia.SelectedValue.ToEntero
|
||||
|
||||
If CPTxt > 0 And CveColonia > 0 Then
|
||||
Dim CP As Integer = GlobalDTColonia("-1").FiltroPrimeroValor("CP", $"CveColonia = {CveColonia}").ToEntero
|
||||
Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
|
||||
If CPTxt <> CP Then
|
||||
Alert("El codigo postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -6930,7 +6928,7 @@ Partial Class Clientes
|
||||
|
||||
Private Sub CargaPais()
|
||||
DdlPais.Items.Clear()
|
||||
DdlPais.DataSource = GlobalDTPais()
|
||||
DdlPais.DataSource = GlobalDTGralPaises()
|
||||
DdlPais.DataBind()
|
||||
DdlPais.SelectedValueExist("151")
|
||||
End Sub
|
||||
@@ -6938,7 +6936,7 @@ Partial Class Clientes
|
||||
Private Sub CargaEstado()
|
||||
DdlEstado.Items.Clear()
|
||||
If DdlPais.SelectedValue.ToEntero() > 0 Then
|
||||
DdlEstado.DataSource = GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero()}")(0)("ClaveSATPais").ToString())
|
||||
DdlEstado.DataSource = GlobalDTEstado(GlobalDTGralPaises.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero()}")(0)("ClaveSATPais").ToString())
|
||||
End If
|
||||
DdlEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlEstado.DataBind()
|
||||
@@ -6947,7 +6945,7 @@ Partial Class Clientes
|
||||
Private Sub CargaMunicipio()
|
||||
DdlMunicipio.Items.Clear()
|
||||
If DdlEstado.SelectedValue.ToEntero() > 0 Then
|
||||
DdlMunicipio.DataSource = GlobalDTMunicipio(GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero()}")(0)("ClaveSATPais").ToString()).FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero()}")(0)("ClaveSATEstado").ToString())
|
||||
DdlMunicipio.DataSource = GlobalDTMunicipio(GlobalDTEstado(GlobalDTGralPaises.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero()}")(0)("ClaveSATPais").ToString()).FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero()}")(0)("ClaveSATEstado").ToString())
|
||||
End If
|
||||
DdlMunicipio.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlMunicipio.DataBind()
|
||||
@@ -6956,10 +6954,11 @@ Partial Class Clientes
|
||||
Private Sub CargaColonia()
|
||||
DdlColonia.Items.Clear()
|
||||
If DdlMunicipio.SelectedValue.ToEntero() > 0 Then
|
||||
DdlColonia.DataSource = GlobalDTColonia(GlobalDTMunicipio(GlobalDTEstado(GlobalDTPais.FiltraParametros($"CvePais = {DdlPais.SelectedValue.ToEntero()}")(0)("ClaveSATPais").ToString()).FiltraParametros($"CveEstado = {DdlEstado.SelectedValue.ToEntero()}")(0)("ClaveSATEstado").ToString()).FiltraParametros($"CveMunicipio = {DdlMunicipio.SelectedValue.ToEntero()}")(0)("ClaveSATMunicipio").ToString())
|
||||
DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero)
|
||||
End If
|
||||
DdlColonia.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
DdlColonia.DataBind()
|
||||
DdlColonia.DataBind()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlPais_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
@@ -9788,10 +9787,6 @@ Partial Class Clientes
|
||||
ObjFactura.Serie = Serie
|
||||
|
||||
ObjFactura.Fecha = Now
|
||||
ObjFactura.CvePrePoliza = -1
|
||||
'ObjFactura.CveMetodoPago = DdlMetodoPago.SelectedValue.Toentero()
|
||||
'ObjFactura.MetodoPago = DdlMetodoPago.SelectedItem.Text
|
||||
'ObjFactura.ClaveMetodoPagoSAT = GlobalDTMetodosPago.FiltroPrimeroValor("ClaveSAT", $"CveMetodoPago = {DdlMetodoPago.SelectedValue}")
|
||||
ObjFactura.FechaVencimiento = TxtFechaPago.Text.ToDate()
|
||||
|
||||
ObjFactura.CveMetodoPago33 = DdlMetodoPago33.SelectedValue.ToEntero()
|
||||
@@ -9811,24 +9806,16 @@ Partial Class Clientes
|
||||
ObjFactura.CondicionEntrega = ""
|
||||
|
||||
ObjFactura.CondicionesPago = 0 ' 0 - Contado, 1 - Credito, 2 - termianl
|
||||
ObjFactura.FormaPago = 0
|
||||
|
||||
ObjFactura.AtnA = ""
|
||||
ObjFactura.FordGSDB = ""
|
||||
|
||||
ObjFactura.NumeroContrato = ""
|
||||
ObjFactura.DescripcionContrato = ""
|
||||
ObjFactura.NumeroDescripcionContrato = ""
|
||||
ObjFactura.PedidoContrato = ""
|
||||
ObjFactura.OrdenCompra = ""
|
||||
|
||||
ObjFactura.FormaPago = 0
|
||||
|
||||
|
||||
Select Case ObjFactura.TipoDocto
|
||||
Case "Ing"
|
||||
ObjFactura.TipoDocumento = "Factura"
|
||||
Case "Rem"
|
||||
ObjFactura.TipoDocumento = "Remision"
|
||||
Case "Cot"
|
||||
ObjFactura.TipoDocumento = "Cotizacion"
|
||||
ObjFactura.TipoDocumento = "Cotización"
|
||||
Case "Egs"
|
||||
ObjFactura.TipoDocumento = "Nota de Crédito"
|
||||
Case "Dev"
|
||||
@@ -9843,30 +9830,18 @@ Partial Class Clientes
|
||||
|
||||
ObjFactura.Fech1 = Now
|
||||
ObjFactura.Fech2 = Now
|
||||
ObjFactura.Fech3 = Now
|
||||
|
||||
ObjFactura.Alfa1 = ""
|
||||
ObjFactura.Alfa2 = ""
|
||||
ObjFactura.Alfa3 = ""
|
||||
|
||||
'NUM 1- CARGO 2- BONIFICACION
|
||||
ObjFactura.Fech3 = Now
|
||||
|
||||
|
||||
'NUM 1- CARGO 2- BONIFICACION
|
||||
ObjFactura.Num1 = Tipo
|
||||
ObjFactura.Num2 = 0
|
||||
|
||||
ObjFactura.Num3 = 0
|
||||
ObjFactura.FechaPago = Now
|
||||
|
||||
ObjFactura.CveCorte = -1
|
||||
ObjFactura.CveMesa = -1
|
||||
ObjFactura.NumeroPersonas = 0
|
||||
ObjFactura.CveContrato = -1
|
||||
|
||||
ObjFactura.CveClienteSucursal = DdlSucursalCliente.SelectedValue.ToEntero()
|
||||
ObjFactura.Entrega = ""
|
||||
ObjFactura.Vigencia = Now
|
||||
|
||||
ObjFactura.CveVentaPadre = -1
|
||||
|
||||
ObjFactura.CveVendedor = DdlVendedor.SelectedValue.ToEntero()
|
||||
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
|
||||
DdlVendedor.Enabled = False
|
||||
@@ -9875,14 +9850,9 @@ Partial Class Clientes
|
||||
ObjFactura.FechaEjecucion = Now
|
||||
ObjFactura.CveSubProyecto = UsuarioActual.CveSubProyecto
|
||||
ObjFactura.CveSubProyectoCobranza = UsuarioActual.CveSubProyecto
|
||||
ObjFactura.CveSubProyectoEjecucion = UsuarioActual.CveSubProyecto
|
||||
ObjFactura.AtencionA = "-1"
|
||||
ObjFactura.MotivoDescuento = ""
|
||||
ObjFactura.Observaciones = ""
|
||||
ObjFactura.Det_OrdenCompra = ""
|
||||
ObjFactura.Det_FechaOrdenCompra = ""
|
||||
ObjFactura.MonedaAbreviatura = ""
|
||||
|
||||
ObjFactura.CveSubProyectoEjecucion = UsuarioActual.CveSubProyecto
|
||||
|
||||
|
||||
ObjFactura.SubTotal = SubTotalFactura
|
||||
ObjFactura.Descuento = 0
|
||||
ObjFactura.Amortizacion = 0
|
||||
@@ -9930,505 +9900,12 @@ Partial Class Clientes
|
||||
Next
|
||||
|
||||
ObjFactura.UsadosBonificacion = UsadosBonificacion
|
||||
ObjFactura.TipoBonificacion = Tipo
|
||||
|
||||
Dim FM As New Modelos.FemsaFactura
|
||||
Dim TmpDT7Eleven As New DataTable
|
||||
Dim TmpDTComplementosTimbrado As New DataTable
|
||||
|
||||
'PrepararTimbrado(FM, TmpDT7Eleven, TmpDTComplementosTimbrado)
|
||||
|
||||
ObjFactura.FemsaFactura = FM
|
||||
|
||||
' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
|
||||
ObjFactura.TipoBonificacion = Tipo
|
||||
|
||||
' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
|
||||
|
||||
End Sub
|
||||
|
||||
'Private Sub PrepararTimbrado(ByRef FM As Modelos.FemsaFactura, ByRef TmpDT7Eleven As DataTable, ByRef TmpDTComplementosTimbrado As DataTable)
|
||||
' FM.AplicaFEMSA = ChkAplicaFEMSA.Checked
|
||||
' FM.FEMSA_NumSociedad = ""
|
||||
' FM.FEMSA_NumProveedor = ""
|
||||
' FM.FEMSA_Mail = ""
|
||||
' FM.FEMSA_Version = "".Toentero()
|
||||
' FM.FEMSA_NumPedido = "".Toentero()
|
||||
' FM.FEMSA_NumEntrada = ""
|
||||
' FM.FEMSA_NumRemision = ""
|
||||
' FM.FEMSA_NumSocio = ""
|
||||
' FM.FEMSA_CentroCosto = ""
|
||||
' FM.FEMSA_IPeriodoLiquidacion = ""
|
||||
' FM.FEMSA_FPeriodoLiquidacion = ""
|
||||
' FM.FEMSA_CodRetencion1 = ""
|
||||
' FM.FEMSA_CodRetencion2 = ""
|
||||
|
||||
' TmpDT7Eleven.Columns.Add("sevenElevenNumProveedor")
|
||||
' TmpDT7Eleven.Columns.Add("sevenElevenFolio")
|
||||
' TmpDT7Eleven.Columns.Add("sevenElevenTienda")
|
||||
' TmpDT7Eleven.Columns.Add("sevenElevenFecha")
|
||||
|
||||
' Dim Row As DataRow = TmpDT7Eleven.NewRow
|
||||
' Row("sevenElevenNumProveedor") = ""
|
||||
' Row("sevenElevenFolio") = ""
|
||||
' Row("sevenElevenTienda") = ""
|
||||
' Row("sevenElevenFecha") = ""
|
||||
|
||||
' TmpDT7Eleven.Rows.Add(Row)
|
||||
|
||||
' TmpDTComplementosTimbrado.Columns.Add("CveComplemento")
|
||||
' TmpDTComplementosTimbrado.Columns.Add("IdContabilidad")
|
||||
' TmpDTComplementosTimbrado.Columns.Add("TipoProceso")
|
||||
' TmpDTComplementosTimbrado.Columns.Add("TipoAmbito")
|
||||
' TmpDTComplementosTimbrado.Columns.Add("Entidad")
|
||||
|
||||
' Dim Row2 As DataRow = TmpDTComplementosTimbrado.NewRow
|
||||
' Row2("CveComplemento") = -1
|
||||
' Row2("IdContabilidad") = -1
|
||||
' Row2("TipoProceso") = -1
|
||||
' Row2("TipoAmbito") = -1
|
||||
' Row2("Entidad") = -1
|
||||
|
||||
' TmpDTComplementosTimbrado.Rows.Add(Row2)
|
||||
'End Sub
|
||||
|
||||
'Private Function PreParaTimbre(Obj As Modelos.Factura) As CFDITimbre
|
||||
' Dim Timbre As New CFDITimbre
|
||||
' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
|
||||
' Timbre.Comprobante.Folio = Obj.Folio.ToString()
|
||||
' Timbre.Comprobante.Serie = Obj.Serie
|
||||
' Timbre.Comprobante.Fecha = Obj.FechaCP
|
||||
' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||
' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
' Timbre.Comprobante.Subtotal = Obj.SubTotal
|
||||
' Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
' Timbre.Comprobante.Moneda = Obj.MonedaSAT
|
||||
' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
|
||||
' Timbre.Comprobante.Total = Obj.Total
|
||||
|
||||
' Try
|
||||
' Obj.SetSubProyecto(Me)
|
||||
' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||
' Catch ex As Exception
|
||||
|
||||
' End Try
|
||||
|
||||
' Timbre.Comprobante.Confirmacion = ""
|
||||
|
||||
' Timbre.Receptor.RFC = Obj.Cliente.RFC
|
||||
' Timbre.Receptor.Nombre = Obj.Cliente.Nombre
|
||||
' Timbre.Receptor.ResidenciaFiscal = ""
|
||||
' Timbre.Receptor.NumeroRegistroTributario = ""
|
||||
' Timbre.Receptor.UsoCFDI = Obj.ClaveUsoCFDI
|
||||
|
||||
|
||||
' If Obj.CveTipoRelacion > 0 Then
|
||||
' Select Case Obj.CveTipoRelacion
|
||||
' Case 1
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "01"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "01-Nota de Crédito aplicada a Ingreso"
|
||||
' Case 2
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "02"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "02-Nota de débito de los documentos relacionados"
|
||||
' Case 3
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "03"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "03-Devolución aplicada a Ingreso"
|
||||
' Case 4
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "04"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "04-Refacturación de Ingreso"
|
||||
' Case 7
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "07"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "07-CFDI por aplicación de anticipo"
|
||||
' Case 8
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "08"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "08-Factura generada por pagos en parcialidades "
|
||||
' Case 9
|
||||
' Timbre.CFDIRelacionados.TipoRelacion = "09"
|
||||
' Timbre.CFDIRelacionados.TipoRelacionTexto = "09-Factura generada por pagos diferidos"
|
||||
|
||||
' End Select
|
||||
' End If
|
||||
|
||||
' Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
' Dim totIVA As Decimal = Obj.IVA
|
||||
' Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
' Dim totRetISR As Decimal = Obj.RetISR
|
||||
' Dim TasaRetIVA As Decimal = 0
|
||||
' Dim TasaRetISR As Decimal = 0
|
||||
' Dim i As Integer = 1
|
||||
|
||||
' 'detalles
|
||||
' Dim tPS As String = ""
|
||||
|
||||
' For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
' 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
|
||||
' 'condicionante, especial
|
||||
' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
||||
|
||||
' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal(),
|
||||
' .Descripcion = tPS,
|
||||
' .ValorUnitario = drr("PU").ToString().ToDecimal(),
|
||||
' .Importe = drr("TotalImporte").ToString().ToDecimal(),
|
||||
' .Descuento = drr("Descuento").ToString().ToDecimal(),
|
||||
' .Unidad = drr("UM").ToString(),
|
||||
' .ClaveUnidad = drr("SATClaveUM").ToString(),
|
||||
' .ClaveProdServ = drr("SATClaveProdServ").ToString(),
|
||||
' .Noidentificacion = drr("Noidentificacion").ToString(),
|
||||
' .CuentaPredial = drr("CuentaPredial").ToString()}
|
||||
' 'verifica suma subtotales
|
||||
' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
|
||||
' concepto.Importe = totSubTotal
|
||||
' End If
|
||||
' totSubTotal = totSubTotal - concepto.Importe
|
||||
|
||||
' 'siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
|
||||
' ' If drr("ImporteIVA").ToString().ToDouble > 0 Then
|
||||
|
||||
' 'si es ingreso amortizado por la totalidad, y arroja el valor total de cero, no debe de impuestos
|
||||
' If Timbre.Comprobante.Total > 0 Then
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal(), .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' If drr("ImporteIEPS").ToString().ToDouble > 0 Then
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal(), .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetIVA, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' Timbre.Conceptos.Add(concepto)
|
||||
' i += 1
|
||||
' Next
|
||||
|
||||
' Return Timbre
|
||||
'End Function
|
||||
|
||||
'Private Function GenerarNotaCredito(CvePS As Integer, Tipo As Integer, CveUnidadMedida As Integer, Importe As Decimal, Iva As Decimal, Descripcion As String, CveClasificacion As Integer) As Boolean
|
||||
|
||||
' Dim Respuesta As Boolean = False
|
||||
|
||||
' Dim ObjVentas As New ClsVentas
|
||||
' Dim ObjConta As New ClsContabilidad(ObjVentas.IniciaTransacSQL())
|
||||
' Dim ObjAcum As New ClsAcumuladores(ObjVentas.IniciaTransacSQL())
|
||||
|
||||
' Dim ErrorVentas As Boolean = False
|
||||
' Dim SubTotal As Decimal = Importe
|
||||
' Dim Total As Decimal = Importe + Iva
|
||||
|
||||
' Dim RetIVA As Decimal = 0
|
||||
' Dim RetISR As Decimal = 0
|
||||
' Dim TipoCambio As Decimal = 0
|
||||
' Dim FechaVencimiento As Date = Now
|
||||
' Dim fecha As Date = Now
|
||||
|
||||
' Dim Folio As Integer = 0
|
||||
' Dim Serie As String = ""
|
||||
|
||||
' If FolioNotaCredito() Then
|
||||
' Folio = FolioNotaAcumulador
|
||||
' Serie = SerieNotaAcumulador
|
||||
' End If
|
||||
|
||||
' Dim CveSubProyecto As Integer = DdlSubProyecto.SelectedValue.Toentero()
|
||||
|
||||
' Dim CveVenta As Integer
|
||||
|
||||
' If Folio > 0 Then
|
||||
|
||||
' Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas($"Clientes/{Descripcion}", 1, Total, Total, 1, fecha, "Nota de crédito por Cargo", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
' If ObjVentas.AddVenta("Egs", Folio, CveCliente.Toentero(), -1, SubTotal, 0, 0, Iva, RetIVA, RetISR, Total, 1, TipoCambio,
|
||||
' 0, 0, 0, FechaVencimiento, fecha, "", "", fecha, -1, "", "", "", 0, 0, 0, "-1".ToDate(), "-1".ToDate(), "-1".ToDate(), -1, -1, 0, CvePrePoliza,
|
||||
' UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Serie:=Serie, CveSubProyecto:=CveSubProyecto, CveSubProyectoEjecucion:=CveSubProyecto) Then
|
||||
|
||||
' CveVenta = ObjVentas.CveVenta
|
||||
|
||||
' If CveVenta > 0 Then
|
||||
' If ObjVentas.AddVentaDetalle(CveVenta, CvePS, 1, CveUnidadMedida, SubTotal, 0.16, SubTotal * 0.16, Descripcion, 0, 0, -1, 0) Then
|
||||
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, SubTotal, Folio.ToString(), 150, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveClasificacion:=CveClasificacion, ImporteMX:=SubTotal, CveSubProyecto:=CveSubProyecto) Then
|
||||
' ErrorVentas = True
|
||||
' End If
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Total, Folio.ToString(), 12, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Total) Then
|
||||
' ErrorVentas = True
|
||||
' End If
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Iva, Folio.ToString(), 13, String.Format("{0}-{1}", Serie, Folio), fecha, -1, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, ImporteMX:=Iva) Then
|
||||
' ErrorVentas = True
|
||||
' End If
|
||||
|
||||
' If Not ErrorVentas Then
|
||||
' For Each GvRow As GridViewRow In GvAcum.Rows
|
||||
' Dim CveMovto As Integer = GvRow.DataKey("CveMovto").Toentero()
|
||||
|
||||
' If (Tipo = 1 And GvRow.FCCheckBox("ChkCargo").Checked) Or (Tipo = 2 And GvRow.FCCheckBox("ChkBonificacion").Checked) Then
|
||||
|
||||
' If ObjAcum.DistribuidorActualizarFacturados(CveMovto, UsuarioActual.CveEmpresa, Tipo, CveVenta) Then
|
||||
' Respuesta = True
|
||||
' ErrorVentas = False
|
||||
' CveVentaNota = CveVenta
|
||||
' Else
|
||||
' Respuesta = False
|
||||
' ErrorVentas = True
|
||||
' CveVentaNota = 0
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
|
||||
|
||||
' If Not ErrorVentas Then
|
||||
' Alert($"Nota de crédito generada correctamente <a href='./Ventas.aspx?CveVenta={CveVenta}' >{Serie}-{Folio}</a>")
|
||||
' End If
|
||||
|
||||
|
||||
' Else
|
||||
' ErrorVentas = True
|
||||
' End If
|
||||
' Else
|
||||
' ErrorVentas = True
|
||||
' End If
|
||||
|
||||
' Else
|
||||
' ErrorVentas = True
|
||||
' End If
|
||||
' Else
|
||||
' Alert("No se pudo obtener el Folio.", TipoMensaje.MsgError)
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' If ErrorVentas Then
|
||||
' ObjVentas.RollBack()
|
||||
' Else
|
||||
|
||||
' ObjVentas.Commit()
|
||||
' CargaUsados()
|
||||
|
||||
' 'Dim DtDetallesVenta As New DataTable
|
||||
|
||||
' 'If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||
|
||||
' ' DtDetallesVenta = ObjVentas.DtResultados
|
||||
' ' 'CreaObjetosVenta(CveVenta, Serie, Folio, SubTotal, Iva, DtDetallesVenta)
|
||||
|
||||
' ' ObjFactura.Timbre = PreParaTimbre(ObjFactura, ObjFactura.CveSubProyecto)
|
||||
|
||||
' ' Dim ObjTimbrado As New Timbrado
|
||||
' ' Dim SeTimbro As Boolean = False
|
||||
|
||||
' ' SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
|
||||
|
||||
' ' If SeTimbro Then
|
||||
' ' Alert("Se timbro correctamente")
|
||||
' ' Else
|
||||
' ' Alert("No se pudo timbrar, intente mas tarde.", TipoMensaje.MsgError)
|
||||
' ' End If
|
||||
|
||||
' 'Else
|
||||
' ' Alert("No se pudo timbrar, no se pudieron obtener los detalles de la venta.", TipoMensaje.MsgError)
|
||||
' 'End If
|
||||
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' ObjVentas.Dispose()
|
||||
' Return Respuesta
|
||||
|
||||
'End Function
|
||||
'Private Function generaNC(CveVenta As Integer, ByRef ObjVentas As ClsVentas, ByVal factura As Modelos.Factura) As List(Of Object)
|
||||
|
||||
' Dim Obj As New List(Of Object)
|
||||
' Dim CveVentaNueva As Integer = ObjVentas.CveVenta
|
||||
' Dim BanderaGeneraNC As Boolean = False
|
||||
' If UsuarioActual.CveEmpresa.Contiene(1, 119) Then BanderaGeneraNC = True
|
||||
|
||||
' If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
' If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||
' Dim drv As DataRow = ObjVentas.DtResultados.Rows(0)
|
||||
' Dim TmpDTconceptos As DataTable = Nothing
|
||||
|
||||
' ''CargaCliente
|
||||
|
||||
' Dim CveCliente As Integer = drv("CveCliente").ToString().Toentero()
|
||||
' If UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 77 AndAlso Not CveCliente.Contiene(10450, 10460, 10458) Then
|
||||
' Return Nothing
|
||||
' ElseIf UsuarioActual.CveEmpresa = 2 AndAlso UsuarioActual.CveUsuario = 21 AndAlso Not CveCliente.Contiene(27448) Then
|
||||
' Return Nothing
|
||||
' End If
|
||||
' factura.TipoDocto = drv("TipoDocto").ToString()
|
||||
' factura.Serie = drv("Serie").ToString()
|
||||
' factura.FechaEjecucion = drv("FechaEjecucion").ToString().ToDate()Time
|
||||
' factura.Fecha = drv("Fecha").ToString().ToDate()Time
|
||||
' factura.CveSubProyectoEjecucion = drv("CveSubProyectoEjecucion").ToString().Toentero()
|
||||
' factura.CveSubProyectoCobranza = drv("CveSubProyectoCobranza").ToString().Toentero()
|
||||
' factura.CveClienteSucursal = drv("CveClienteSucursal").ToString().Toentero()
|
||||
' factura.CveSubProyecto = drv("CveSubProyecto").ToString().Toentero()
|
||||
|
||||
|
||||
' ''CargaDetalle
|
||||
' If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||
' TmpDTconceptos = ObjVentas.DtResultados
|
||||
' TmpDTconceptos.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
|
||||
' GvPS.DataSource = TmpDTconceptos
|
||||
' GvPS.DataBind()
|
||||
' End If
|
||||
|
||||
' '' Carga Totales
|
||||
' factura.SubTotal = drv("SubTotal").ToString().ToDecimal()
|
||||
' factura.Descuento = drv("Descuento").ToString().ToDecimal()
|
||||
' factura.Amortizacion = drv("Amortizacion").ToString().ToDecimal()
|
||||
' factura.IVA = drv("IVA").ToString().ToDecimal()
|
||||
' factura.RetIVA = drv("RetIVA").ToString().ToDecimal()
|
||||
' factura.RetISR = drv("RetISR").ToString().ToDecimal()
|
||||
' factura.Total = drv("Total").ToString().ToDecimal()
|
||||
' factura.MotivoDescuento = drv("MotivoDescuento").ToString()
|
||||
' factura.Observaciones = drv("Observaciones").ToString()
|
||||
' factura.CveMoneda = drv("CveMoneda").ToString().Toentero()
|
||||
' factura.TipoCambio = drv("TipoCambio").ToString().ToDecimal()
|
||||
' factura.CveVendedor = drv("CveVendedor").ToString().Toentero()
|
||||
' factura.RefDocto = drv("Ref").ToString()
|
||||
|
||||
' If factura.CveCliente > 0 Then
|
||||
' If Not IsNothing(TmpDTconceptos) AndAlso TmpDTconceptos.Rows.Count > 0 Then
|
||||
|
||||
' If Not drv("Total").ToString().ToDecimal() = factura.Total Then
|
||||
' Return Nothing
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' If Obj.Count > 0 Then
|
||||
' Return Obj
|
||||
' Else
|
||||
' Return Nothing
|
||||
' End If
|
||||
|
||||
'End Function
|
||||
|
||||
'Private Function PreParaTimbre(Obj As Modelos.Factura, CveSubProyecto As Integer) As CFDITimbre
|
||||
|
||||
' Dim Timbre As New CFDITimbre
|
||||
' Timbre.Comprobante.TipoComprobante = If(Obj.TipoDocto.Contiene("Ing", "Ant"), "I", If(Obj.TipoDocto.Contiene("Egs", "Dev"), "E", ""))
|
||||
' Timbre.Comprobante.Folio = Obj.Folio.ToString()
|
||||
' Timbre.Comprobante.Serie = Obj.Serie
|
||||
' Timbre.Comprobante.Fecha = Obj.Fecha
|
||||
' Timbre.Comprobante.FormadePago = Obj.FormaPagoSAT33
|
||||
' Timbre.Comprobante.CondicionesdePago = Obj.FormaPago33
|
||||
' Timbre.Comprobante.MetodoPago = Obj.ClaveMetodoPagoSAT
|
||||
' Timbre.Comprobante.Subtotal = Obj.SubTotal
|
||||
|
||||
' Timbre.Comprobante.Descuentos = Obj.Descuento
|
||||
' Timbre.Comprobante.Moneda = Obj.MonedaSAT
|
||||
' Timbre.Comprobante.TipoCambio = If(Obj.CveMoneda = 1, "1", Obj.TipoCambio.ToString())
|
||||
' Timbre.Comprobante.Total = Obj.Total
|
||||
|
||||
' Try
|
||||
' Obj.SetSubProyecto(Me)
|
||||
' Timbre.Comprobante.LugarExpedicion = Obj.SubProyecto.CP
|
||||
' Catch ex As Exception
|
||||
|
||||
' End Try
|
||||
|
||||
' Timbre.Comprobante.Confirmacion = ""
|
||||
|
||||
' Timbre.Receptor.RFC = TxtRFC.Text
|
||||
' Timbre.Receptor.Nombre = TxtNombre.Text
|
||||
' Timbre.Receptor.ResidenciaFiscal = ""
|
||||
' Timbre.Receptor.NumeroRegistroTributario = ""
|
||||
' Timbre.Receptor.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
|
||||
|
||||
' Dim totSubTotal As Decimal = Obj.SubTotal
|
||||
' Dim totIVA As Decimal = Obj.IVA
|
||||
' Dim totRetIVA As Decimal = Obj.RetIVA
|
||||
' Dim totRetISR As Decimal = Obj.RetISR
|
||||
' Dim TasaRetIVA As Decimal = 0
|
||||
' Dim TasaRetISR As Decimal = 0
|
||||
' Dim i As Integer = 1
|
||||
|
||||
' ''detalles
|
||||
' Dim tPS As String = ""
|
||||
|
||||
' For Each drr As DataRow In Obj.DtDetalle.Rows
|
||||
' 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
|
||||
' '' condicionante, especial
|
||||
' If UsuarioActual.CveEmpresa = 15 Then drr("UM") = "" ' les comentan que no debe de ir la etiqueta de "unidad" en el producto
|
||||
|
||||
' Dim concepto As New CFDIConceptos With {.Cantidad = drr("Cantidad").ToString().ToDecimal(),
|
||||
' .Descripcion = tPS,
|
||||
' .ValorUnitario = drr("PU").ToString().ToDecimal(),
|
||||
' .Importe = drr("TotalImporte").ToString().ToDecimal(),
|
||||
' .Descuento = drr("Descuento").ToString().ToDecimal(),
|
||||
' .Unidad = drr("UM").ToString(),
|
||||
' .ClaveUnidad = drr("SATClaveUM").ToString(),
|
||||
' .ClaveProdServ = drr("SATClaveProdServ").ToString(),
|
||||
' .Noidentificacion = drr("Noidentificacion").ToString(),
|
||||
' .CuentaPredial = drr("CuentaPredial").ToString()}
|
||||
' '' verifica suma subtotales
|
||||
' If i = Obj.DtDetalle.Rows.Count AndAlso totSubTotal <> concepto.Importe Then 'proceso de ajusta de decimales
|
||||
' concepto.Importe = totSubTotal
|
||||
' End If
|
||||
' totSubTotal = totSubTotal - concepto.Importe
|
||||
|
||||
' ''siempre estaremos agregando el iva, auqnue sea en importe cero o tasa cero, para que se emita la factura
|
||||
' If drr("ImporteIVA").ToString().ToDouble > 0 Then
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIVA").ToString().ToDecimal(), .Impuesto = "002", .Importe = drr("ImporteIVA").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' If drr("ImporteIEPS").ToString().ToDouble > 0 Then
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "T", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = drr("PorcentajeIEPS").ToString().ToDecimal(), .Impuesto = "003", .Importe = drr("ImporteIEPS").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' If drr("ImporteRetIVA").ToString().ToDouble > 0 Then 'si hay retenciones
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetIVA, .Impuesto = "002", .Importe = drr("ImporteRetIVA").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' If drr("ImporteRetISR").ToString().ToDouble > 0 Then 'retención de ISR
|
||||
' concepto.Impuestos.Add(New CFDIConceptosImpuestos With {.TrasladooRetencion = "R", .Base = concepto.Importe - concepto.Descuento, .TasaOCuota = TasaRetISR, .Impuesto = "001", .Importe = drr("ImporteRetISR").ToString().ToDecimal()})
|
||||
' End If
|
||||
|
||||
' Timbre.Conceptos.Add(concepto)
|
||||
' i += 1
|
||||
' Next
|
||||
|
||||
' Dim AplicaComercioExteriorSubProyecto As Boolean = If(GlobalDTSubProyectos(-1, Obj.CveSubProyecto)(0)("AplicaComercioExterior").ToString() = "True", True, False)
|
||||
' Timbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto = AplicaComercioExteriorSubProyecto
|
||||
|
||||
' If Obj.Cliente.AplicaComercioExterior And AplicaComercioExteriorSubProyecto Then
|
||||
|
||||
' Timbre.Receptor.ResidenciaFiscal = Obj.Cliente.ClaveSATPais
|
||||
' Timbre.Receptor.NumeroRegistroTributario = Obj.Cliente.NumRegIdTrib
|
||||
|
||||
' End If
|
||||
|
||||
' Return Timbre
|
||||
'End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Reference in New Issue
Block a user